From 42f4e863b7e4e141ce2a77c0a7a50e4742c957fa Mon Sep 17 00:00:00 2001 From: WILLIAM CHENG Date: Mon, 25 Oct 2021 12:13:33 +0800 Subject: [PATCH 001/117] prepare 5.4.0-SNAPSHOT --- modules/openapi-generator-cli/pom.xml | 2 +- modules/openapi-generator-core/pom.xml | 2 +- modules/openapi-generator-gradle-plugin/gradle.properties | 2 +- modules/openapi-generator-gradle-plugin/pom.xml | 2 +- modules/openapi-generator-maven-plugin/examples/java-client.xml | 2 +- modules/openapi-generator-maven-plugin/examples/kotlin.xml | 2 +- .../examples/multi-module/java-client/pom.xml | 2 +- .../examples/non-java-invalid-spec.xml | 2 +- modules/openapi-generator-maven-plugin/examples/non-java.xml | 2 +- modules/openapi-generator-maven-plugin/examples/spring.xml | 2 +- modules/openapi-generator-maven-plugin/pom.xml | 2 +- modules/openapi-generator-online/pom.xml | 2 +- modules/openapi-generator/pom.xml | 2 +- pom.xml | 2 +- .../java/okhttp-gson-streaming/.openapi-generator/VERSION | 2 +- samples/client/petstore/R/.openapi-generator/VERSION | 2 +- samples/client/petstore/apex/.openapi-generator/VERSION | 2 +- samples/client/petstore/bash/.openapi-generator/VERSION | 2 +- samples/client/petstore/c/.openapi-generator/VERSION | 2 +- samples/client/petstore/cpp-qt/.openapi-generator/VERSION | 2 +- .../petstore/cpp-restsdk/client/.openapi-generator/VERSION | 2 +- samples/client/petstore/cpp-restsdk/client/ApiClient.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/ApiClient.h | 2 +- samples/client/petstore/cpp-restsdk/client/ApiConfiguration.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/ApiConfiguration.h | 2 +- samples/client/petstore/cpp-restsdk/client/ApiException.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/ApiException.h | 2 +- samples/client/petstore/cpp-restsdk/client/HttpContent.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/HttpContent.h | 2 +- samples/client/petstore/cpp-restsdk/client/IHttpBody.h | 2 +- samples/client/petstore/cpp-restsdk/client/JsonBody.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/JsonBody.h | 2 +- samples/client/petstore/cpp-restsdk/client/ModelBase.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/ModelBase.h | 2 +- .../client/petstore/cpp-restsdk/client/MultipartFormData.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/MultipartFormData.h | 2 +- samples/client/petstore/cpp-restsdk/client/Object.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/Object.h | 2 +- samples/client/petstore/cpp-restsdk/client/api/PetApi.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/api/PetApi.h | 2 +- samples/client/petstore/cpp-restsdk/client/api/StoreApi.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/api/StoreApi.h | 2 +- samples/client/petstore/cpp-restsdk/client/api/UserApi.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/api/UserApi.h | 2 +- .../client/petstore/cpp-restsdk/client/model/ApiResponse.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/model/ApiResponse.h | 2 +- samples/client/petstore/cpp-restsdk/client/model/Category.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/model/Category.h | 2 +- samples/client/petstore/cpp-restsdk/client/model/Order.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/model/Order.h | 2 +- samples/client/petstore/cpp-restsdk/client/model/Pet.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/model/Pet.h | 2 +- samples/client/petstore/cpp-restsdk/client/model/Tag.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/model/Tag.h | 2 +- samples/client/petstore/cpp-restsdk/client/model/User.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/model/User.h | 2 +- samples/client/petstore/cpp-tiny/.openapi-generator/VERSION | 2 +- samples/client/petstore/cpp-ue4/.openapi-generator/VERSION | 2 +- samples/client/petstore/crystal/.openapi-generator/VERSION | 2 +- samples/client/petstore/crystal/.travis.yml | 2 +- samples/client/petstore/crystal/spec/spec_helper.cr | 2 +- samples/client/petstore/crystal/src/petstore.cr | 2 +- samples/client/petstore/crystal/src/petstore/api/pet_api.cr | 2 +- samples/client/petstore/crystal/src/petstore/api/store_api.cr | 2 +- samples/client/petstore/crystal/src/petstore/api/user_api.cr | 2 +- samples/client/petstore/crystal/src/petstore/api_client.cr | 2 +- samples/client/petstore/crystal/src/petstore/api_error.cr | 2 +- samples/client/petstore/crystal/src/petstore/configuration.cr | 2 +- .../client/petstore/crystal/src/petstore/models/api_response.cr | 2 +- samples/client/petstore/crystal/src/petstore/models/category.cr | 2 +- samples/client/petstore/crystal/src/petstore/models/order.cr | 2 +- samples/client/petstore/crystal/src/petstore/models/pet.cr | 2 +- samples/client/petstore/crystal/src/petstore/models/tag.cr | 2 +- samples/client/petstore/crystal/src/petstore/models/user.cr | 2 +- .../.openapi-generator/VERSION | 2 +- .../OpenAPIClient-httpclient/.openapi-generator/VERSION | 2 +- .../OpenAPIClient-net47/.openapi-generator/VERSION | 2 +- .../OpenAPIClient-net5.0/.openapi-generator/VERSION | 2 +- .../csharp-netcore/OpenAPIClient/.openapi-generator/VERSION | 2 +- .../csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION | 2 +- .../OpenAPIClientCoreAndNet47/.openapi-generator/VERSION | 2 +- .../petstore/csharp/OpenAPIClient/.openapi-generator/VERSION | 2 +- samples/client/petstore/elixir/.openapi-generator/VERSION | 2 +- .../client/petstore/go/go-petstore/.openapi-generator/VERSION | 2 +- samples/client/petstore/groovy/.openapi-generator/VERSION | 2 +- .../petstore/haskell-http-client/.openapi-generator/VERSION | 2 +- .../petstore/java-micronaut-client/.openapi-generator/VERSION | 2 +- .../petstore/java/apache-httpclient/.openapi-generator/VERSION | 2 +- .../petstore/java/feign-no-nullable/.openapi-generator/VERSION | 2 +- samples/client/petstore/java/feign/.openapi-generator/VERSION | 2 +- .../petstore/java/google-api-client/.openapi-generator/VERSION | 2 +- samples/client/petstore/java/jersey1/.openapi-generator/VERSION | 2 +- .../java/jersey2-java8-localdatetime/.openapi-generator/VERSION | 2 +- .../petstore/java/jersey2-java8/.openapi-generator/VERSION | 2 +- .../java/microprofile-rest-client/.openapi-generator/VERSION | 2 +- .../petstore/java/native-async/.openapi-generator/VERSION | 2 +- samples/client/petstore/java/native/.openapi-generator/VERSION | 2 +- .../okhttp-gson-dynamicOperations/.openapi-generator/VERSION | 2 +- .../java/okhttp-gson-parcelableModel/.openapi-generator/VERSION | 2 +- .../client/petstore/java/okhttp-gson/.openapi-generator/VERSION | 2 +- .../java/rest-assured-jackson/.openapi-generator/VERSION | 2 +- .../petstore/java/rest-assured/.openapi-generator/VERSION | 2 +- .../client/petstore/java/resteasy/.openapi-generator/VERSION | 2 +- .../java/resttemplate-withXml/.openapi-generator/VERSION | 2 +- .../petstore/java/resttemplate/.openapi-generator/VERSION | 2 +- .../petstore/java/retrofit2-play26/.openapi-generator/VERSION | 2 +- .../client/petstore/java/retrofit2/.openapi-generator/VERSION | 2 +- .../petstore/java/retrofit2rx2/.openapi-generator/VERSION | 2 +- .../petstore/java/retrofit2rx3/.openapi-generator/VERSION | 2 +- .../petstore/java/vertx-no-nullable/.openapi-generator/VERSION | 2 +- samples/client/petstore/java/vertx/.openapi-generator/VERSION | 2 +- .../java/webclient-nulable-arrays/.openapi-generator/VERSION | 2 +- .../client/petstore/java/webclient/.openapi-generator/VERSION | 2 +- .../client/petstore/javascript-es6/.openapi-generator/VERSION | 2 +- .../petstore/javascript-promise-es6/.openapi-generator/VERSION | 2 +- .../kotlin-enum-default-value/.openapi-generator/VERSION | 2 +- samples/client/petstore/kotlin-gson/.openapi-generator/VERSION | 2 +- .../client/petstore/kotlin-jackson/.openapi-generator/VERSION | 2 +- .../kotlin-json-request-string/.openapi-generator/VERSION | 2 +- .../kotlin-jvm-okhttp4-coroutines/.openapi-generator/VERSION | 2 +- .../petstore/kotlin-moshi-codegen/.openapi-generator/VERSION | 2 +- .../petstore/kotlin-multiplatform/.openapi-generator/VERSION | 2 +- .../client/petstore/kotlin-nonpublic/.openapi-generator/VERSION | 2 +- .../client/petstore/kotlin-nullable/.openapi-generator/VERSION | 2 +- .../client/petstore/kotlin-okhttp3/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../petstore/kotlin-retrofit2-rx3/.openapi-generator/VERSION | 2 +- .../client/petstore/kotlin-retrofit2/.openapi-generator/VERSION | 2 +- .../client/petstore/kotlin-string/.openapi-generator/VERSION | 2 +- .../petstore/kotlin-threetenbp/.openapi-generator/VERSION | 2 +- .../petstore/kotlin-uppercase-enum/.openapi-generator/VERSION | 2 +- samples/client/petstore/kotlin/.openapi-generator/VERSION | 2 +- samples/client/petstore/lua/.openapi-generator/VERSION | 2 +- samples/client/petstore/nim/.openapi-generator/VERSION | 2 +- .../client/petstore/objc/core-data/.openapi-generator/VERSION | 2 +- samples/client/petstore/objc/default/.openapi-generator/VERSION | 2 +- samples/client/petstore/perl/.openapi-generator/VERSION | 2 +- .../client/petstore/php-dt-modern/.openapi-generator/VERSION | 2 +- samples/client/petstore/php-dt/.openapi-generator/VERSION | 2 +- .../petstore/php/OpenAPIClient-php/.openapi-generator/VERSION | 2 +- .../petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php | 2 +- .../php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/ApiException.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Configuration.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/HeaderSelector.php | 2 +- .../OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php | 2 +- .../OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php | 2 +- .../php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php | 2 +- samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Category.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Client.php | 2 +- .../php/OpenAPIClient-php/lib/Model/DeprecatedObject.php | 2 +- samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/File.php | 2 +- .../php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php | 2 +- samples/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php | 2 +- .../php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php | 2 +- .../php/OpenAPIClient-php/lib/Model/HealthCheckResult.php | 2 +- .../php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php | 2 +- .../lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php | 2 +- .../php/OpenAPIClient-php/lib/Model/Model200Response.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ModelList.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Name.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php | 2 +- .../OpenAPIClient-php/lib/Model/ObjectWithDeprecatedFields.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Order.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php | 2 +- .../php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php | 2 +- .../php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php | 2 +- .../lib/Model/OuterEnumIntegerDefaultValue.php | 2 +- .../OpenAPIClient-php/lib/Model/OuterObjectWithEnumProperty.php | 2 +- samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php | 2 +- .../php/OpenAPIClient-php/lib/Model/SpecialModelName.php | 2 +- samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/User.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php | 2 +- samples/client/petstore/powershell/.openapi-generator/VERSION | 2 +- .../client/petstore/python-asyncio/.openapi-generator/VERSION | 2 +- .../client/petstore/python-legacy/.openapi-generator/VERSION | 2 +- .../client/petstore/python-tornado/.openapi-generator/VERSION | 2 +- samples/client/petstore/python/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- samples/client/petstore/ruby-faraday/.openapi-generator/VERSION | 2 +- samples/client/petstore/ruby-faraday/lib/petstore.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/api/default_api.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb | 2 +- .../ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/api/store_api.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/api/user_api.rb | 2 +- samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb | 2 +- samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/configuration.rb | 2 +- .../lib/petstore/models/additional_properties_class.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/animal.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/api_response.rb | 2 +- .../lib/petstore/models/array_of_array_of_number_only.rb | 2 +- .../ruby-faraday/lib/petstore/models/array_of_number_only.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/array_test.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/capitalization.rb | 2 +- samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/category.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/class_model.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/client.rb | 2 +- .../ruby-faraday/lib/petstore/models/deprecated_object.rb | 2 +- samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/enum_class.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/enum_test.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/file.rb | 2 +- .../ruby-faraday/lib/petstore/models/file_schema_test_class.rb | 2 +- samples/client/petstore/ruby-faraday/lib/petstore/models/foo.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/format_test.rb | 2 +- .../ruby-faraday/lib/petstore/models/has_only_read_only.rb | 2 +- .../ruby-faraday/lib/petstore/models/health_check_result.rb | 2 +- .../ruby-faraday/lib/petstore/models/inline_response_default.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/list.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/map_test.rb | 2 +- .../models/mixed_properties_and_additional_properties_class.rb | 2 +- .../ruby-faraday/lib/petstore/models/model200_response.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/model_return.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/name.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/nullable_class.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/number_only.rb | 2 +- .../lib/petstore/models/object_with_deprecated_fields.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/order.rb | 2 +- .../ruby-faraday/lib/petstore/models/outer_composite.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/outer_enum.rb | 2 +- .../lib/petstore/models/outer_enum_default_value.rb | 2 +- .../ruby-faraday/lib/petstore/models/outer_enum_integer.rb | 2 +- .../lib/petstore/models/outer_enum_integer_default_value.rb | 2 +- .../lib/petstore/models/outer_object_with_enum_property.rb | 2 +- samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb | 2 +- .../ruby-faraday/lib/petstore/models/read_only_first.rb | 2 +- .../ruby-faraday/lib/petstore/models/special_model_name.rb | 2 +- samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/user.rb | 2 +- samples/client/petstore/ruby-faraday/lib/petstore/version.rb | 2 +- samples/client/petstore/ruby-faraday/petstore.gemspec | 2 +- samples/client/petstore/ruby-faraday/spec/api_client_spec.rb | 2 +- samples/client/petstore/ruby-faraday/spec/configuration_spec.rb | 2 +- samples/client/petstore/ruby-faraday/spec/spec_helper.rb | 2 +- samples/client/petstore/ruby/.openapi-generator/VERSION | 2 +- samples/client/petstore/ruby/lib/petstore.rb | 2 +- .../client/petstore/ruby/lib/petstore/api/another_fake_api.rb | 2 +- samples/client/petstore/ruby/lib/petstore/api/default_api.rb | 2 +- samples/client/petstore/ruby/lib/petstore/api/fake_api.rb | 2 +- .../ruby/lib/petstore/api/fake_classname_tags123_api.rb | 2 +- samples/client/petstore/ruby/lib/petstore/api/pet_api.rb | 2 +- samples/client/petstore/ruby/lib/petstore/api/store_api.rb | 2 +- samples/client/petstore/ruby/lib/petstore/api/user_api.rb | 2 +- samples/client/petstore/ruby/lib/petstore/api_client.rb | 2 +- samples/client/petstore/ruby/lib/petstore/api_error.rb | 2 +- samples/client/petstore/ruby/lib/petstore/configuration.rb | 2 +- .../ruby/lib/petstore/models/additional_properties_class.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/animal.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/api_response.rb | 2 +- .../ruby/lib/petstore/models/array_of_array_of_number_only.rb | 2 +- .../petstore/ruby/lib/petstore/models/array_of_number_only.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/array_test.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/capitalization.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/cat.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/category.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/class_model.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/client.rb | 2 +- .../petstore/ruby/lib/petstore/models/deprecated_object.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/dog.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/enum_class.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/enum_test.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/file.rb | 2 +- .../petstore/ruby/lib/petstore/models/file_schema_test_class.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/foo.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/format_test.rb | 2 +- .../petstore/ruby/lib/petstore/models/has_only_read_only.rb | 2 +- .../petstore/ruby/lib/petstore/models/health_check_result.rb | 2 +- .../ruby/lib/petstore/models/inline_response_default.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/list.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/map_test.rb | 2 +- .../models/mixed_properties_and_additional_properties_class.rb | 2 +- .../petstore/ruby/lib/petstore/models/model200_response.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/model_return.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/name.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/nullable_class.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/number_only.rb | 2 +- .../ruby/lib/petstore/models/object_with_deprecated_fields.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/order.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/outer_composite.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb | 2 +- .../ruby/lib/petstore/models/outer_enum_default_value.rb | 2 +- .../petstore/ruby/lib/petstore/models/outer_enum_integer.rb | 2 +- .../lib/petstore/models/outer_enum_integer_default_value.rb | 2 +- .../ruby/lib/petstore/models/outer_object_with_enum_property.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/pet.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/read_only_first.rb | 2 +- .../petstore/ruby/lib/petstore/models/special_model_name.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/tag.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/user.rb | 2 +- samples/client/petstore/ruby/lib/petstore/version.rb | 2 +- samples/client/petstore/ruby/petstore.gemspec | 2 +- samples/client/petstore/ruby/spec/api_client_spec.rb | 2 +- samples/client/petstore/ruby/spec/configuration_spec.rb | 2 +- samples/client/petstore/ruby/spec/spec_helper.rb | 2 +- .../petstore/rust/hyper/petstore/.openapi-generator/VERSION | 2 +- .../rust/reqwest/petstore-async/.openapi-generator/VERSION | 2 +- .../petstore/rust/reqwest/petstore/.openapi-generator/VERSION | 2 +- samples/client/petstore/scala-akka/.openapi-generator/VERSION | 2 +- .../scala-httpclient-deprecated/.openapi-generator/VERSION | 2 +- samples/client/petstore/scala-sttp/.openapi-generator/VERSION | 2 +- .../petstore/spring-cloud-async/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../spring-cloud-spring-pageable/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- samples/client/petstore/spring-cloud/.openapi-generator/VERSION | 2 +- .../spring-cloud/src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- samples/client/petstore/spring-stubs/.openapi-generator/VERSION | 2 +- .../spring-stubs/src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/swift5/alamofireLibrary/.openapi-generator/VERSION | 2 +- .../swift5/asyncAwaitLibrary/.openapi-generator/VERSION | 2 +- .../petstore/swift5/combineLibrary/.openapi-generator/VERSION | 2 +- .../client/petstore/swift5/default/.openapi-generator/VERSION | 2 +- .../petstore/swift5/deprecated/.openapi-generator/VERSION | 2 +- .../petstore/swift5/nonPublicApi/.openapi-generator/VERSION | 2 +- .../petstore/swift5/objcCompatible/.openapi-generator/VERSION | 2 +- samples/client/petstore/swift5/oneOf/.openapi-generator/VERSION | 2 +- .../swift5/promisekitLibrary/.openapi-generator/VERSION | 2 +- .../swift5/readonlyProperties/.openapi-generator/VERSION | 2 +- .../petstore/swift5/resultLibrary/.openapi-generator/VERSION | 2 +- .../petstore/swift5/rxswiftLibrary/.openapi-generator/VERSION | 2 +- .../swift5/urlsessionLibrary/.openapi-generator/VERSION | 2 +- .../petstore/swift5/vaporLibrary/.openapi-generator/VERSION | 2 +- .../petstore/swift5/x-swift-hashable/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/single-request-parameter/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/with-prefixed-module-name/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../typescript-aurelia/default/.openapi-generator/VERSION | 2 +- .../builds/composed-schemas/.openapi-generator/VERSION | 2 +- .../typescript-axios/builds/default/.openapi-generator/VERSION | 2 +- .../builds/es6-target/.openapi-generator/VERSION | 2 +- .../builds/test-petstore/.openapi-generator/VERSION | 2 +- .../builds/with-complex-headers/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../builds/with-interfaces/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../builds/with-npm-version/.openapi-generator/VERSION | 2 +- .../with-single-request-parameters/.openapi-generator/VERSION | 2 +- .../builds/default-v3.0/.openapi-generator/VERSION | 2 +- .../typescript-fetch/builds/default/.openapi-generator/VERSION | 2 +- .../typescript-fetch/builds/enum/.openapi-generator/VERSION | 2 +- .../builds/es6-target/.openapi-generator/VERSION | 2 +- .../builds/multiple-parameters/.openapi-generator/VERSION | 2 +- .../prefix-parameter-interfaces/.openapi-generator/VERSION | 2 +- .../builds/sagas-and-records/.openapi-generator/VERSION | 2 +- .../builds/typescript-three-plus/.openapi-generator/VERSION | 2 +- .../builds/with-interfaces/.openapi-generator/VERSION | 2 +- .../builds/with-npm-version/.openapi-generator/VERSION | 2 +- .../builds/without-runtime-checks/.openapi-generator/VERSION | 2 +- .../petstore/typescript-inversify/.openapi-generator/VERSION | 2 +- .../typescript-jquery/default/.openapi-generator/VERSION | 2 +- .../petstore/typescript-jquery/npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../petstore/typescript-node/default/.openapi-generator/VERSION | 2 +- .../petstore/typescript-node/npm/.openapi-generator/VERSION | 2 +- .../builds/with-npm-version/.openapi-generator/VERSION | 2 +- .../typescript-rxjs/builds/default/.openapi-generator/VERSION | 2 +- .../builds/es6-target/.openapi-generator/VERSION | 2 +- .../builds/with-npm-version/.openapi-generator/VERSION | 2 +- .../builds/with-progress-subscriber/.openapi-generator/VERSION | 2 +- .../config/petstore/protobuf-schema/.openapi-generator/VERSION | 2 +- samples/openapi3/client/elm/.openapi-generator/VERSION | 2 +- .../x-auth-id-alias/go-experimental/.openapi-generator/VERSION | 2 +- .../java/jersey2-java8/.openapi-generator/VERSION | 2 +- .../x-auth-id-alias/python/.openapi-generator/VERSION | 2 +- .../x-auth-id-alias/ruby-client/.openapi-generator/VERSION | 2 +- .../x-auth-id-alias/ruby-client/lib/x_auth_id_alias.rb | 2 +- .../ruby-client/lib/x_auth_id_alias/api/usage_api.rb | 2 +- .../ruby-client/lib/x_auth_id_alias/api_client.rb | 2 +- .../ruby-client/lib/x_auth_id_alias/api_error.rb | 2 +- .../ruby-client/lib/x_auth_id_alias/configuration.rb | 2 +- .../x-auth-id-alias/ruby-client/lib/x_auth_id_alias/version.rb | 2 +- .../x-auth-id-alias/ruby-client/spec/api_client_spec.rb | 2 +- .../x-auth-id-alias/ruby-client/spec/configuration_spec.rb | 2 +- .../extensions/x-auth-id-alias/ruby-client/spec/spec_helper.rb | 2 +- .../x-auth-id-alias/ruby-client/x_auth_id_alias.gemspec | 2 +- .../features/dynamic-servers/python/.openapi-generator/VERSION | 2 +- .../features/dynamic-servers/ruby/.openapi-generator/VERSION | 2 +- .../features/dynamic-servers/ruby/dynamic_servers.gemspec | 2 +- .../client/features/dynamic-servers/ruby/lib/dynamic_servers.rb | 2 +- .../dynamic-servers/ruby/lib/dynamic_servers/api/usage_api.rb | 2 +- .../dynamic-servers/ruby/lib/dynamic_servers/api_client.rb | 2 +- .../dynamic-servers/ruby/lib/dynamic_servers/api_error.rb | 2 +- .../dynamic-servers/ruby/lib/dynamic_servers/configuration.rb | 2 +- .../dynamic-servers/ruby/lib/dynamic_servers/version.rb | 2 +- .../features/dynamic-servers/ruby/spec/api_client_spec.rb | 2 +- .../features/dynamic-servers/ruby/spec/configuration_spec.rb | 2 +- .../client/features/dynamic-servers/ruby/spec/spec_helper.rb | 2 +- .../ruby-client/.openapi-generator/VERSION | 2 +- .../generate-alias-as-model/ruby-client/lib/petstore.rb | 2 +- .../ruby-client/lib/petstore/api/usage_api.rb | 2 +- .../ruby-client/lib/petstore/api_client.rb | 2 +- .../ruby-client/lib/petstore/api_error.rb | 2 +- .../ruby-client/lib/petstore/configuration.rb | 2 +- .../ruby-client/lib/petstore/models/array_alias.rb | 2 +- .../ruby-client/lib/petstore/models/map_alias.rb | 2 +- .../generate-alias-as-model/ruby-client/lib/petstore/version.rb | 2 +- .../generate-alias-as-model/ruby-client/petstore.gemspec | 2 +- .../generate-alias-as-model/ruby-client/spec/api_client_spec.rb | 2 +- .../ruby-client/spec/configuration_spec.rb | 2 +- .../generate-alias-as-model/ruby-client/spec/spec_helper.rb | 2 +- .../.openapi-generator/VERSION | 2 +- .../petstore_client_lib_fake/.openapi-generator/VERSION | 2 +- .../dart-dio/petstore_client_lib/.openapi-generator/VERSION | 2 +- .../petstore_client_lib_fake/.openapi-generator/VERSION | 2 +- .../dart2/petstore_client_lib/.openapi-generator/VERSION | 2 +- .../dart2/petstore_client_lib_fake/.openapi-generator/VERSION | 2 +- .../client/petstore/go/go-petstore/.openapi-generator/VERSION | 2 +- .../jersey2-java8-special-characters/.openapi-generator/VERSION | 2 +- .../petstore/java/jersey2-java8/.openapi-generator/VERSION | 2 +- .../client/petstore/python-legacy/.openapi-generator/VERSION | 2 +- .../openapi3/client/petstore/python/.openapi-generator/VERSION | 2 +- .../builds/composed-schemas/.openapi-generator/VERSION | 2 +- .../typescript/builds/default/.openapi-generator/VERSION | 2 +- .../petstore/typescript/builds/deno/.openapi-generator/VERSION | 2 +- .../typescript/builds/inversify/.openapi-generator/VERSION | 2 +- .../typescript/builds/jquery/.openapi-generator/VERSION | 2 +- .../typescript/builds/object_params/.openapi-generator/VERSION | 2 +- samples/schema/petstore/ktorm/.openapi-generator/VERSION | 2 +- samples/schema/petstore/mysql/.openapi-generator/VERSION | 2 +- samples/schema/petstore/wsdl-schema/.openapi-generator/VERSION | 2 +- .../server/petstore/aspnetcore-3.0/.openapi-generator/VERSION | 2 +- .../server/petstore/aspnetcore-3.1/.openapi-generator/VERSION | 2 +- .../server/petstore/aspnetcore-5.0/.openapi-generator/VERSION | 2 +- samples/server/petstore/aspnetcore/.openapi-generator/VERSION | 2 +- samples/server/petstore/cpp-pistache/.openapi-generator/VERSION | 2 +- .../cpp-qt-qhttpengine-server/.openapi-generator/VERSION | 2 +- .../server/petstore/erlang-server/.openapi-generator/VERSION | 2 +- .../server/petstore/go-api-server/.openapi-generator/VERSION | 2 +- .../server/petstore/go-chi-server/.openapi-generator/VERSION | 2 +- .../server/petstore/go-echo-server/.openapi-generator/VERSION | 2 +- .../petstore/go-gin-api-server/.openapi-generator/VERSION | 2 +- .../petstore/go-server-required/.openapi-generator/VERSION | 2 +- .../server/petstore/haskell-servant/.openapi-generator/VERSION | 2 +- .../server/petstore/haskell-yesod/.openapi-generator/VERSION | 2 +- samples/server/petstore/java-msf4j/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../java-play-framework-async/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../java-play-framework-no-interface/.openapi-generator/VERSION | 2 +- .../java-play-framework-no-nullable/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../petstore/java-play-framework/.openapi-generator/VERSION | 2 +- .../server/petstore/java-undertow/.openapi-generator/VERSION | 2 +- .../server/petstore/java-vertx-web/.openapi-generator/VERSION | 2 +- .../jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION | 2 +- .../jaxrs-cxf-cdi-default-value/.openapi-generator/VERSION | 2 +- .../server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION | 2 +- .../jaxrs-cxf-non-spring-app/.openapi-generator/VERSION | 2 +- samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION | 2 +- .../server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION | 2 +- samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION | 2 +- .../jaxrs-resteasy/default-value/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-resteasy/default/.openapi-generator/VERSION | 2 +- .../jaxrs-resteasy/eap-java8/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-resteasy/java8/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-spec-interface/.openapi-generator/VERSION | 2 +- samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION | 2 +- .../server/petstore/jaxrs/jersey1/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION | 2 +- .../server/petstore/jaxrs/jersey2/.openapi-generator/VERSION | 2 +- .../petstore/kotlin-server/ktor/.openapi-generator/VERSION | 2 +- samples/server/petstore/kotlin-server/ktor/README.md | 2 +- .../kotlin-springboot-delegate/.openapi-generator/VERSION | 2 +- .../src/main/kotlin/org/openapitools/api/PetApi.kt | 2 +- .../src/main/kotlin/org/openapitools/api/StoreApi.kt | 2 +- .../src/main/kotlin/org/openapitools/api/UserApi.kt | 2 +- .../kotlin-springboot-reactive/.openapi-generator/VERSION | 2 +- .../petstore/kotlin-springboot/.openapi-generator/VERSION | 2 +- samples/server/petstore/php-laravel/.openapi-generator/VERSION | 2 +- samples/server/petstore/php-lumen/.openapi-generator/VERSION | 2 +- .../petstore/php-mezzio-ph-modern/.openapi-generator/VERSION | 2 +- .../server/petstore/php-mezzio-ph/.openapi-generator/VERSION | 2 +- samples/server/petstore/php-slim4/.openapi-generator/VERSION | 2 +- .../php-symfony/SymfonyBundle-php/.openapi-generator/VERSION | 2 +- .../python-aiohttp-srclayout/.openapi-generator/VERSION | 2 +- .../server/petstore/python-aiohttp/.openapi-generator/VERSION | 2 +- .../petstore/python-blueplanet/.openapi-generator/VERSION | 2 +- .../server/petstore/python-fastapi/.openapi-generator/VERSION | 2 +- samples/server/petstore/python-flask/.openapi-generator/VERSION | 2 +- .../rust-server/output/multipart-v3/.openapi-generator/VERSION | 2 +- .../rust-server/output/no-example-v3/.openapi-generator/VERSION | 2 +- .../rust-server/output/openapi-v3/.openapi-generator/VERSION | 2 +- .../rust-server/output/ops-v3/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../output/ping-bearer-auth/.openapi-generator/VERSION | 2 +- .../output/rust-server-test/.openapi-generator/VERSION | 2 +- .../spring-mvc-default-value/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/TestHeadersApi.java | 2 +- .../src/main/java/org/openapitools/api/TestQueryParamsApi.java | 2 +- .../petstore/spring-mvc-j8-async/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../spring-mvc-j8-localdatetime/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/spring-mvc-no-nullable/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../spring-mvc-spring-pageable/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- samples/server/petstore/spring-mvc/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../spring-mvc/src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../spring-mvc/src/main/java/org/openapitools/api/PetApi.java | 2 +- .../spring-mvc/src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../spring-mvc/src/main/java/org/openapitools/api/UserApi.java | 2 +- .../.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../springboot-beanvalidation/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/springboot-delegate-j8/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/springboot-delegate/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../springboot-implicitHeaders/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/springboot-reactive/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../springboot-spring-pageable/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/springboot-useoptional/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/springboot-virtualan/.openapi-generator/VERSION | 2 +- .../java/org/openapitools/virtualan/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/virtualan/api/FakeApi.java | 2 +- .../org/openapitools/virtualan/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/virtualan/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/virtualan/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/virtualan/api/UserApi.java | 2 +- samples/server/petstore/springboot/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../springboot/src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../springboot/src/main/java/org/openapitools/api/PetApi.java | 2 +- .../springboot/src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../springboot/src/main/java/org/openapitools/api/UserApi.java | 2 +- 685 files changed, 685 insertions(+), 685 deletions(-) diff --git a/modules/openapi-generator-cli/pom.xml b/modules/openapi-generator-cli/pom.xml index 6a7fbbda1b2f..88111767922f 100644 --- a/modules/openapi-generator-cli/pom.xml +++ b/modules/openapi-generator-cli/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 5.3.1-SNAPSHOT + 5.4.0-SNAPSHOT ../.. diff --git a/modules/openapi-generator-core/pom.xml b/modules/openapi-generator-core/pom.xml index 166ba14131b1..bfd0c5908319 100644 --- a/modules/openapi-generator-core/pom.xml +++ b/modules/openapi-generator-core/pom.xml @@ -6,7 +6,7 @@ openapi-generator-project org.openapitools - 5.3.1-SNAPSHOT + 5.4.0-SNAPSHOT ../.. diff --git a/modules/openapi-generator-gradle-plugin/gradle.properties b/modules/openapi-generator-gradle-plugin/gradle.properties index e623391d60c1..73b87d76810a 100644 --- a/modules/openapi-generator-gradle-plugin/gradle.properties +++ b/modules/openapi-generator-gradle-plugin/gradle.properties @@ -1,5 +1,5 @@ # RELEASE_VERSION -openApiGeneratorVersion=5.3.1-SNAPSHOT +openApiGeneratorVersion=5.4.0-SNAPSHOT # /RELEASE_VERSION # BEGIN placeholders diff --git a/modules/openapi-generator-gradle-plugin/pom.xml b/modules/openapi-generator-gradle-plugin/pom.xml index c1b8953d831b..fdc1d34c6c2c 100644 --- a/modules/openapi-generator-gradle-plugin/pom.xml +++ b/modules/openapi-generator-gradle-plugin/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 5.3.1-SNAPSHOT + 5.4.0-SNAPSHOT ../.. diff --git a/modules/openapi-generator-maven-plugin/examples/java-client.xml b/modules/openapi-generator-maven-plugin/examples/java-client.xml index 309594708bec..b59f96a7945b 100644 --- a/modules/openapi-generator-maven-plugin/examples/java-client.xml +++ b/modules/openapi-generator-maven-plugin/examples/java-client.xml @@ -13,7 +13,7 @@ org.openapitools openapi-generator-maven-plugin - 5.3.1-SNAPSHOT + 5.4.0-SNAPSHOT diff --git a/modules/openapi-generator-maven-plugin/examples/kotlin.xml b/modules/openapi-generator-maven-plugin/examples/kotlin.xml index e7ebc5a12458..c7681971d90d 100644 --- a/modules/openapi-generator-maven-plugin/examples/kotlin.xml +++ b/modules/openapi-generator-maven-plugin/examples/kotlin.xml @@ -15,7 +15,7 @@ org.openapitools openapi-generator-maven-plugin - 5.3.1-SNAPSHOT + 5.4.0-SNAPSHOT diff --git a/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml b/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml index be8c5cb67b4a..d0edba77ea50 100644 --- a/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml +++ b/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml @@ -19,7 +19,7 @@ org.openapitools openapi-generator-maven-plugin - 5.3.1-SNAPSHOT + 5.4.0-SNAPSHOT diff --git a/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml b/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml index cf242a94bad7..72559b55c7ab 100644 --- a/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml +++ b/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml @@ -13,7 +13,7 @@ org.openapitools openapi-generator-maven-plugin - 5.3.1-SNAPSHOT + 5.4.0-SNAPSHOT diff --git a/modules/openapi-generator-maven-plugin/examples/non-java.xml b/modules/openapi-generator-maven-plugin/examples/non-java.xml index 60018a26e646..842e549e797e 100644 --- a/modules/openapi-generator-maven-plugin/examples/non-java.xml +++ b/modules/openapi-generator-maven-plugin/examples/non-java.xml @@ -13,7 +13,7 @@ org.openapitools openapi-generator-maven-plugin - 5.3.1-SNAPSHOT + 5.4.0-SNAPSHOT diff --git a/modules/openapi-generator-maven-plugin/examples/spring.xml b/modules/openapi-generator-maven-plugin/examples/spring.xml index 967d49a16551..e1802203383a 100644 --- a/modules/openapi-generator-maven-plugin/examples/spring.xml +++ b/modules/openapi-generator-maven-plugin/examples/spring.xml @@ -20,7 +20,7 @@ org.openapitools openapi-generator-maven-plugin - 5.3.1-SNAPSHOT + 5.4.0-SNAPSHOT diff --git a/modules/openapi-generator-maven-plugin/pom.xml b/modules/openapi-generator-maven-plugin/pom.xml index 1726f2e9e813..2589de28155a 100644 --- a/modules/openapi-generator-maven-plugin/pom.xml +++ b/modules/openapi-generator-maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.openapitools openapi-generator-project - 5.3.1-SNAPSHOT + 5.4.0-SNAPSHOT ../.. diff --git a/modules/openapi-generator-online/pom.xml b/modules/openapi-generator-online/pom.xml index 031cadea6c22..be81d01ee265 100644 --- a/modules/openapi-generator-online/pom.xml +++ b/modules/openapi-generator-online/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 5.3.1-SNAPSHOT + 5.4.0-SNAPSHOT ../.. diff --git a/modules/openapi-generator/pom.xml b/modules/openapi-generator/pom.xml index ada2ac46d9e7..e57369d4d62b 100644 --- a/modules/openapi-generator/pom.xml +++ b/modules/openapi-generator/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 5.3.1-SNAPSHOT + 5.4.0-SNAPSHOT ../.. diff --git a/pom.xml b/pom.xml index 35974a9fdf09..62e74d86cb03 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ pom openapi-generator-project - 5.3.1-SNAPSHOT + 5.4.0-SNAPSHOT https://github.com/openapitools/openapi-generator diff --git a/samples/client/others/java/okhttp-gson-streaming/.openapi-generator/VERSION b/samples/client/others/java/okhttp-gson-streaming/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/others/java/okhttp-gson-streaming/.openapi-generator/VERSION +++ b/samples/client/others/java/okhttp-gson-streaming/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/R/.openapi-generator/VERSION b/samples/client/petstore/R/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/R/.openapi-generator/VERSION +++ b/samples/client/petstore/R/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/apex/.openapi-generator/VERSION b/samples/client/petstore/apex/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/apex/.openapi-generator/VERSION +++ b/samples/client/petstore/apex/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/bash/.openapi-generator/VERSION b/samples/client/petstore/bash/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/bash/.openapi-generator/VERSION +++ b/samples/client/petstore/bash/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/c/.openapi-generator/VERSION b/samples/client/petstore/c/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/c/.openapi-generator/VERSION +++ b/samples/client/petstore/c/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/cpp-qt/.openapi-generator/VERSION b/samples/client/petstore/cpp-qt/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/cpp-qt/.openapi-generator/VERSION +++ b/samples/client/petstore/cpp-qt/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/cpp-restsdk/client/.openapi-generator/VERSION b/samples/client/petstore/cpp-restsdk/client/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/cpp-restsdk/client/.openapi-generator/VERSION +++ b/samples/client/petstore/cpp-restsdk/client/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/cpp-restsdk/client/ApiClient.cpp b/samples/client/petstore/cpp-restsdk/client/ApiClient.cpp index 5d0f4a6475e7..b5c500a0fa14 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiClient.cpp +++ b/samples/client/petstore/cpp-restsdk/client/ApiClient.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiClient.h b/samples/client/petstore/cpp-restsdk/client/ApiClient.h index 0e05b25a7727..7a13f219f4eb 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiClient.h +++ b/samples/client/petstore/cpp-restsdk/client/ApiClient.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.cpp b/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.cpp index e691c52743d9..67e66b708cdf 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.cpp +++ b/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.h b/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.h index 9a254ad71ee6..046dfd9ea533 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.h +++ b/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiException.cpp b/samples/client/petstore/cpp-restsdk/client/ApiException.cpp index 82fc4f3c1193..8f981150270a 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiException.cpp +++ b/samples/client/petstore/cpp-restsdk/client/ApiException.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiException.h b/samples/client/petstore/cpp-restsdk/client/ApiException.h index 9916a29e2c51..5d1d82b9a8ed 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiException.h +++ b/samples/client/petstore/cpp-restsdk/client/ApiException.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/HttpContent.cpp b/samples/client/petstore/cpp-restsdk/client/HttpContent.cpp index 22dabc4beff3..be68ba1c7fad 100644 --- a/samples/client/petstore/cpp-restsdk/client/HttpContent.cpp +++ b/samples/client/petstore/cpp-restsdk/client/HttpContent.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/HttpContent.h b/samples/client/petstore/cpp-restsdk/client/HttpContent.h index 991e7a9f22d7..d8bd333dad15 100644 --- a/samples/client/petstore/cpp-restsdk/client/HttpContent.h +++ b/samples/client/petstore/cpp-restsdk/client/HttpContent.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/IHttpBody.h b/samples/client/petstore/cpp-restsdk/client/IHttpBody.h index 6655271d919d..7661536b930b 100644 --- a/samples/client/petstore/cpp-restsdk/client/IHttpBody.h +++ b/samples/client/petstore/cpp-restsdk/client/IHttpBody.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/JsonBody.cpp b/samples/client/petstore/cpp-restsdk/client/JsonBody.cpp index 780f48f91ea2..85dbe17686e7 100644 --- a/samples/client/petstore/cpp-restsdk/client/JsonBody.cpp +++ b/samples/client/petstore/cpp-restsdk/client/JsonBody.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/JsonBody.h b/samples/client/petstore/cpp-restsdk/client/JsonBody.h index 5774baebae21..99344661cb8c 100644 --- a/samples/client/petstore/cpp-restsdk/client/JsonBody.h +++ b/samples/client/petstore/cpp-restsdk/client/JsonBody.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ModelBase.cpp b/samples/client/petstore/cpp-restsdk/client/ModelBase.cpp index 4d75c83b3e13..752b93f70596 100644 --- a/samples/client/petstore/cpp-restsdk/client/ModelBase.cpp +++ b/samples/client/petstore/cpp-restsdk/client/ModelBase.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ModelBase.h b/samples/client/petstore/cpp-restsdk/client/ModelBase.h index 0e94211a66f6..c300ecb5af79 100644 --- a/samples/client/petstore/cpp-restsdk/client/ModelBase.h +++ b/samples/client/petstore/cpp-restsdk/client/ModelBase.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/MultipartFormData.cpp b/samples/client/petstore/cpp-restsdk/client/MultipartFormData.cpp index d3085c0a7ec2..075f7867be7b 100644 --- a/samples/client/petstore/cpp-restsdk/client/MultipartFormData.cpp +++ b/samples/client/petstore/cpp-restsdk/client/MultipartFormData.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/MultipartFormData.h b/samples/client/petstore/cpp-restsdk/client/MultipartFormData.h index 0d48bd7aa06d..a7e8a87f5ad5 100644 --- a/samples/client/petstore/cpp-restsdk/client/MultipartFormData.h +++ b/samples/client/petstore/cpp-restsdk/client/MultipartFormData.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/Object.cpp b/samples/client/petstore/cpp-restsdk/client/Object.cpp index a0ac8abe4f92..2c2f65d4ed85 100644 --- a/samples/client/petstore/cpp-restsdk/client/Object.cpp +++ b/samples/client/petstore/cpp-restsdk/client/Object.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/Object.h b/samples/client/petstore/cpp-restsdk/client/Object.h index 16b430c404d3..ba2a3bdb8c75 100644 --- a/samples/client/petstore/cpp-restsdk/client/Object.h +++ b/samples/client/petstore/cpp-restsdk/client/Object.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/PetApi.cpp b/samples/client/petstore/cpp-restsdk/client/api/PetApi.cpp index 08ff5e5772d4..5bf94b7ce257 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/PetApi.cpp +++ b/samples/client/petstore/cpp-restsdk/client/api/PetApi.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/PetApi.h b/samples/client/petstore/cpp-restsdk/client/api/PetApi.h index 5c861119be74..44868df043bf 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/PetApi.h +++ b/samples/client/petstore/cpp-restsdk/client/api/PetApi.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/StoreApi.cpp b/samples/client/petstore/cpp-restsdk/client/api/StoreApi.cpp index 11f4d22ff5d6..e415ebeffc53 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/StoreApi.cpp +++ b/samples/client/petstore/cpp-restsdk/client/api/StoreApi.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/StoreApi.h b/samples/client/petstore/cpp-restsdk/client/api/StoreApi.h index 3e60ecb4a81f..9cb9bb3b9399 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/StoreApi.h +++ b/samples/client/petstore/cpp-restsdk/client/api/StoreApi.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/UserApi.cpp b/samples/client/petstore/cpp-restsdk/client/api/UserApi.cpp index 0cc08823dc53..a291d4f0c4a2 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/UserApi.cpp +++ b/samples/client/petstore/cpp-restsdk/client/api/UserApi.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/UserApi.h b/samples/client/petstore/cpp-restsdk/client/api/UserApi.h index a416b21a1c69..41aaad210a3c 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/UserApi.h +++ b/samples/client/petstore/cpp-restsdk/client/api/UserApi.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.cpp b/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.cpp index 5473fd47040c..4157079156d6 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.h b/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.h index 167a3bbd28c1..ef7ab1aa32f3 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.h +++ b/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Category.cpp b/samples/client/petstore/cpp-restsdk/client/model/Category.cpp index 56ec361b78aa..2fcec2bcaab4 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Category.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/Category.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Category.h b/samples/client/petstore/cpp-restsdk/client/model/Category.h index 65518e3dbe0b..1694a939de7e 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Category.h +++ b/samples/client/petstore/cpp-restsdk/client/model/Category.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Order.cpp b/samples/client/petstore/cpp-restsdk/client/model/Order.cpp index 41a9930e468a..f8618ce03551 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Order.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/Order.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Order.h b/samples/client/petstore/cpp-restsdk/client/model/Order.h index 9206b97e20d5..dfa94793b644 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Order.h +++ b/samples/client/petstore/cpp-restsdk/client/model/Order.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Pet.cpp b/samples/client/petstore/cpp-restsdk/client/model/Pet.cpp index f43a844f892f..12c9dfa8b8ff 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Pet.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/Pet.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Pet.h b/samples/client/petstore/cpp-restsdk/client/model/Pet.h index a84abe5f17bd..48be1426d0fa 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Pet.h +++ b/samples/client/petstore/cpp-restsdk/client/model/Pet.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Tag.cpp b/samples/client/petstore/cpp-restsdk/client/model/Tag.cpp index 90e3aab5d6e1..14bce27318e4 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Tag.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/Tag.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Tag.h b/samples/client/petstore/cpp-restsdk/client/model/Tag.h index dbe9e0d63849..470dd597dfae 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Tag.h +++ b/samples/client/petstore/cpp-restsdk/client/model/Tag.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/User.cpp b/samples/client/petstore/cpp-restsdk/client/model/User.cpp index 2002040f1444..38aebe66ad09 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/User.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/User.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/User.h b/samples/client/petstore/cpp-restsdk/client/model/User.h index 477a78b82169..004038f8a116 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/User.h +++ b/samples/client/petstore/cpp-restsdk/client/model/User.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-tiny/.openapi-generator/VERSION b/samples/client/petstore/cpp-tiny/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/cpp-tiny/.openapi-generator/VERSION +++ b/samples/client/petstore/cpp-tiny/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/cpp-ue4/.openapi-generator/VERSION b/samples/client/petstore/cpp-ue4/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/cpp-ue4/.openapi-generator/VERSION +++ b/samples/client/petstore/cpp-ue4/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/crystal/.openapi-generator/VERSION b/samples/client/petstore/crystal/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/crystal/.openapi-generator/VERSION +++ b/samples/client/petstore/crystal/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/crystal/.travis.yml b/samples/client/petstore/crystal/.travis.yml index b0d669b09f6d..59de24cd459b 100644 --- a/samples/client/petstore/crystal/.travis.yml +++ b/samples/client/petstore/crystal/.travis.yml @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.4.0-SNAPSHOT # language: crystal diff --git a/samples/client/petstore/crystal/spec/spec_helper.cr b/samples/client/petstore/crystal/spec/spec_helper.cr index 6df055fdea53..c6eb4e7a6030 100644 --- a/samples/client/petstore/crystal/spec/spec_helper.cr +++ b/samples/client/petstore/crystal/spec/spec_helper.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.4.0-SNAPSHOT # # load modules diff --git a/samples/client/petstore/crystal/src/petstore.cr b/samples/client/petstore/crystal/src/petstore.cr index 585ca028c1ca..bfa9806eea98 100644 --- a/samples/client/petstore/crystal/src/petstore.cr +++ b/samples/client/petstore/crystal/src/petstore.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.4.0-SNAPSHOT # # Dependencies diff --git a/samples/client/petstore/crystal/src/petstore/api/pet_api.cr b/samples/client/petstore/crystal/src/petstore/api/pet_api.cr index 813ae328c65b..a808853db0c5 100644 --- a/samples/client/petstore/crystal/src/petstore/api/pet_api.cr +++ b/samples/client/petstore/crystal/src/petstore/api/pet_api.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.4.0-SNAPSHOT # require "uri" diff --git a/samples/client/petstore/crystal/src/petstore/api/store_api.cr b/samples/client/petstore/crystal/src/petstore/api/store_api.cr index 4d05bcef67e1..633b3ca71fd0 100644 --- a/samples/client/petstore/crystal/src/petstore/api/store_api.cr +++ b/samples/client/petstore/crystal/src/petstore/api/store_api.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.4.0-SNAPSHOT # require "uri" diff --git a/samples/client/petstore/crystal/src/petstore/api/user_api.cr b/samples/client/petstore/crystal/src/petstore/api/user_api.cr index c052abaa87c4..9809fc615e87 100644 --- a/samples/client/petstore/crystal/src/petstore/api/user_api.cr +++ b/samples/client/petstore/crystal/src/petstore/api/user_api.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.4.0-SNAPSHOT # require "uri" diff --git a/samples/client/petstore/crystal/src/petstore/api_client.cr b/samples/client/petstore/crystal/src/petstore/api_client.cr index a04d3b56a49b..5a15ff6f6f3b 100644 --- a/samples/client/petstore/crystal/src/petstore/api_client.cr +++ b/samples/client/petstore/crystal/src/petstore/api_client.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.4.0-SNAPSHOT # require "json" diff --git a/samples/client/petstore/crystal/src/petstore/api_error.cr b/samples/client/petstore/crystal/src/petstore/api_error.cr index a01117fbd536..c99be8e41f81 100644 --- a/samples/client/petstore/crystal/src/petstore/api_error.cr +++ b/samples/client/petstore/crystal/src/petstore/api_error.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.4.0-SNAPSHOT # module Petstore diff --git a/samples/client/petstore/crystal/src/petstore/configuration.cr b/samples/client/petstore/crystal/src/petstore/configuration.cr index dcf7bc0c9b70..cc46c380f1fa 100644 --- a/samples/client/petstore/crystal/src/petstore/configuration.cr +++ b/samples/client/petstore/crystal/src/petstore/configuration.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.4.0-SNAPSHOT # require "log" diff --git a/samples/client/petstore/crystal/src/petstore/models/api_response.cr b/samples/client/petstore/crystal/src/petstore/models/api_response.cr index b9f3034a1e72..be5511349070 100644 --- a/samples/client/petstore/crystal/src/petstore/models/api_response.cr +++ b/samples/client/petstore/crystal/src/petstore/models/api_response.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.4.0-SNAPSHOT # require "json" diff --git a/samples/client/petstore/crystal/src/petstore/models/category.cr b/samples/client/petstore/crystal/src/petstore/models/category.cr index 5e24f73d289e..55c64154d97c 100644 --- a/samples/client/petstore/crystal/src/petstore/models/category.cr +++ b/samples/client/petstore/crystal/src/petstore/models/category.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.4.0-SNAPSHOT # require "json" diff --git a/samples/client/petstore/crystal/src/petstore/models/order.cr b/samples/client/petstore/crystal/src/petstore/models/order.cr index 9f93b6ef453c..5d00ea6688ff 100644 --- a/samples/client/petstore/crystal/src/petstore/models/order.cr +++ b/samples/client/petstore/crystal/src/petstore/models/order.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.4.0-SNAPSHOT # require "json" diff --git a/samples/client/petstore/crystal/src/petstore/models/pet.cr b/samples/client/petstore/crystal/src/petstore/models/pet.cr index 39ef758adc09..cdac65776d76 100644 --- a/samples/client/petstore/crystal/src/petstore/models/pet.cr +++ b/samples/client/petstore/crystal/src/petstore/models/pet.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.4.0-SNAPSHOT # require "json" diff --git a/samples/client/petstore/crystal/src/petstore/models/tag.cr b/samples/client/petstore/crystal/src/petstore/models/tag.cr index 76c99c2e07d9..bd2933291853 100644 --- a/samples/client/petstore/crystal/src/petstore/models/tag.cr +++ b/samples/client/petstore/crystal/src/petstore/models/tag.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.4.0-SNAPSHOT # require "json" diff --git a/samples/client/petstore/crystal/src/petstore/models/user.cr b/samples/client/petstore/crystal/src/petstore/models/user.cr index bb541138fb39..47430b4452a9 100644 --- a/samples/client/petstore/crystal/src/petstore/models/user.cr +++ b/samples/client/petstore/crystal/src/petstore/models/user.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.4.0-SNAPSHOT # require "json" diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/elixir/.openapi-generator/VERSION b/samples/client/petstore/elixir/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/elixir/.openapi-generator/VERSION +++ b/samples/client/petstore/elixir/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION b/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION +++ b/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/groovy/.openapi-generator/VERSION b/samples/client/petstore/groovy/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/groovy/.openapi-generator/VERSION +++ b/samples/client/petstore/groovy/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/.openapi-generator/VERSION b/samples/client/petstore/haskell-http-client/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/haskell-http-client/.openapi-generator/VERSION +++ b/samples/client/petstore/haskell-http-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java-micronaut-client/.openapi-generator/VERSION b/samples/client/petstore/java-micronaut-client/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/java-micronaut-client/.openapi-generator/VERSION +++ b/samples/client/petstore/java-micronaut-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/apache-httpclient/.openapi-generator/VERSION b/samples/client/petstore/java/apache-httpclient/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/java/apache-httpclient/.openapi-generator/VERSION +++ b/samples/client/petstore/java/apache-httpclient/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/feign-no-nullable/.openapi-generator/VERSION b/samples/client/petstore/java/feign-no-nullable/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/java/feign-no-nullable/.openapi-generator/VERSION +++ b/samples/client/petstore/java/feign-no-nullable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/feign/.openapi-generator/VERSION b/samples/client/petstore/java/feign/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/java/feign/.openapi-generator/VERSION +++ b/samples/client/petstore/java/feign/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION b/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION +++ b/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/jersey1/.openapi-generator/VERSION b/samples/client/petstore/java/jersey1/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/java/jersey1/.openapi-generator/VERSION +++ b/samples/client/petstore/java/jersey1/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/.openapi-generator/VERSION b/samples/client/petstore/java/jersey2-java8-localdatetime/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/.openapi-generator/VERSION +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION b/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION +++ b/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/microprofile-rest-client/.openapi-generator/VERSION b/samples/client/petstore/java/microprofile-rest-client/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/java/microprofile-rest-client/.openapi-generator/VERSION +++ b/samples/client/petstore/java/microprofile-rest-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/native-async/.openapi-generator/VERSION b/samples/client/petstore/java/native-async/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/java/native-async/.openapi-generator/VERSION +++ b/samples/client/petstore/java/native-async/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/native/.openapi-generator/VERSION b/samples/client/petstore/java/native/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/java/native/.openapi-generator/VERSION +++ b/samples/client/petstore/java/native/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator/VERSION b/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator/VERSION +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION b/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION b/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION +++ b/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/rest-assured-jackson/.openapi-generator/VERSION b/samples/client/petstore/java/rest-assured-jackson/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/java/rest-assured-jackson/.openapi-generator/VERSION +++ b/samples/client/petstore/java/rest-assured-jackson/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION b/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION +++ b/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/resteasy/.openapi-generator/VERSION b/samples/client/petstore/java/resteasy/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/java/resteasy/.openapi-generator/VERSION +++ b/samples/client/petstore/java/resteasy/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION b/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION +++ b/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION b/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION +++ b/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2-play26/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2-play26/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/java/retrofit2-play26/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2-play26/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2rx3/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2rx3/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/java/retrofit2rx3/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2rx3/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/vertx-no-nullable/.openapi-generator/VERSION b/samples/client/petstore/java/vertx-no-nullable/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/java/vertx-no-nullable/.openapi-generator/VERSION +++ b/samples/client/petstore/java/vertx-no-nullable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/vertx/.openapi-generator/VERSION b/samples/client/petstore/java/vertx/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/java/vertx/.openapi-generator/VERSION +++ b/samples/client/petstore/java/vertx/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/webclient-nulable-arrays/.openapi-generator/VERSION b/samples/client/petstore/java/webclient-nulable-arrays/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/java/webclient-nulable-arrays/.openapi-generator/VERSION +++ b/samples/client/petstore/java/webclient-nulable-arrays/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/webclient/.openapi-generator/VERSION b/samples/client/petstore/java/webclient/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/java/webclient/.openapi-generator/VERSION +++ b/samples/client/petstore/java/webclient/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/javascript-es6/.openapi-generator/VERSION b/samples/client/petstore/javascript-es6/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/javascript-es6/.openapi-generator/VERSION +++ b/samples/client/petstore/javascript-es6/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION b/samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION +++ b/samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-enum-default-value/.openapi-generator/VERSION b/samples/client/petstore/kotlin-enum-default-value/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/kotlin-enum-default-value/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-enum-default-value/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-gson/.openapi-generator/VERSION b/samples/client/petstore/kotlin-gson/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/kotlin-gson/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-gson/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jackson/.openapi-generator/VERSION b/samples/client/petstore/kotlin-jackson/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/kotlin-jackson/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-jackson/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-json-request-string/.openapi-generator/VERSION b/samples/client/petstore/kotlin-json-request-string/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/kotlin-json-request-string/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-json-request-string/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/VERSION b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/VERSION b/samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION b/samples/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nonpublic/.openapi-generator/VERSION b/samples/client/petstore/kotlin-nonpublic/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/kotlin-nonpublic/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-nonpublic/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nullable/.openapi-generator/VERSION b/samples/client/petstore/kotlin-nullable/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/kotlin-nullable/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-nullable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-okhttp3/.openapi-generator/VERSION b/samples/client/petstore/kotlin-okhttp3/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/kotlin-okhttp3/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-okhttp3/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/VERSION b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/.openapi-generator/VERSION b/samples/client/petstore/kotlin-retrofit2-rx3/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-retrofit2-rx3/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-retrofit2/.openapi-generator/VERSION b/samples/client/petstore/kotlin-retrofit2/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/kotlin-retrofit2/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-retrofit2/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-string/.openapi-generator/VERSION b/samples/client/petstore/kotlin-string/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/kotlin-string/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-string/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION b/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ 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 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin/.openapi-generator/VERSION b/samples/client/petstore/kotlin/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/kotlin/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/lua/.openapi-generator/VERSION b/samples/client/petstore/lua/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/lua/.openapi-generator/VERSION +++ b/samples/client/petstore/lua/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/nim/.openapi-generator/VERSION b/samples/client/petstore/nim/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/nim/.openapi-generator/VERSION +++ b/samples/client/petstore/nim/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/objc/core-data/.openapi-generator/VERSION b/samples/client/petstore/objc/core-data/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/objc/core-data/.openapi-generator/VERSION +++ b/samples/client/petstore/objc/core-data/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/objc/default/.openapi-generator/VERSION b/samples/client/petstore/objc/default/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/objc/default/.openapi-generator/VERSION +++ b/samples/client/petstore/objc/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/perl/.openapi-generator/VERSION b/samples/client/petstore/perl/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/perl/.openapi-generator/VERSION +++ b/samples/client/petstore/perl/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/php-dt-modern/.openapi-generator/VERSION b/samples/client/petstore/php-dt-modern/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/php-dt-modern/.openapi-generator/VERSION +++ b/samples/client/petstore/php-dt-modern/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/php-dt/.openapi-generator/VERSION b/samples/client/petstore/php-dt/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/php-dt/.openapi-generator/VERSION +++ b/samples/client/petstore/php-dt/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION b/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION +++ b/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php index 1848ea60872b..b069070fd138 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php index 98450dfdce6e..def9fc158005 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php index b284bfc1da2f..6feaff883342 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php index 5b01b4788695..cf271105c8bb 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php index 0ce7655f68f6..399cec4b7744 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php index b4084ea0f811..7fb733e79536 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php index f4137f4061ea..d54e6cfaef49 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php index 9793625ce059..01f8b03d59a8 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php index 15c87c883382..cd182e99fcb1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php b/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php index 65c30b801462..c44fe4784d23 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php index cf51246752f6..813a7583db51 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php index 4730a780c9ef..3f8820c97896 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php index 94cd6c008106..b64c2a8772a6 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php index 9ac0724679fc..af16be5b4a09 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php index b6a77632ddd2..c932439bb400 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php index 98656789cc6e..341366e541c0 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php index 80457e8befd8..b1a0bd652c69 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php index 1ab9ae895219..75bc5fe9da99 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php index 1f5442b74647..ef088f7fd99b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php index 675ec09537f5..f61f944a48d1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php index 061c4bbf2dce..26293327c28c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php index 5a12e03f5370..fabf7edb56cc 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DeprecatedObject.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DeprecatedObject.php index ce4a50797b07..3d2727154a25 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DeprecatedObject.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DeprecatedObject.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php index a8913e4d4667..9f2f6b76f101 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php index 31c569fbffc9..8dc34950ced9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php index b075f037ce29..20bdbe900e06 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php index ca5795be26e4..61c123dfe406 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php index bd4ba37593dd..61663693efa3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php index 18598a117d26..2fbc4e79331b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php index 84ac5deed603..7f6d4895ae5f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php index cc6eec6f37fe..5f3dd7183232 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php index 229691e3f9c1..65a211e15813 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php index de6d9b2a1b72..3aaae75260f3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php index 91effaad0c5c..71f11616f9ec 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php index d9c20bad20c8..1b70b356259c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php index d74dbb7187e4..7359bf0da86c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php index 2c74ff0afd0d..546996e9c752 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php index b5d6024b0ddd..e6db4af8c7d2 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php index 50af9985b46e..26d5c4988fdc 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php index c0148a3c9508..13195d272566 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php index f70e22035767..4fb179c4de98 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php index 2c6dd888ee42..d576c3d69fc8 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php index ef6e0c99af1e..1cc4acb16168 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php index 4038d4bdd8d7..82f4e7c5c733 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ObjectWithDeprecatedFields.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ObjectWithDeprecatedFields.php index a9ee861174a8..aaff2f3c3c6a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ObjectWithDeprecatedFields.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ObjectWithDeprecatedFields.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php index 8e0bfd035fa4..36e32464b249 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php index 0161dcb53591..73660c6e4634 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php index 848fe8c710f9..1b5bdf7693c4 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php index 38cc912fa773..8bcebde39893 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php index acdb884a648e..7575c418afb2 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php index bec3672715ec..65234ea6e1db 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterObjectWithEnumProperty.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterObjectWithEnumProperty.php index 1f18ed694a5c..d370aadf39b9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterObjectWithEnumProperty.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterObjectWithEnumProperty.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php index 5ed7cf384834..e22f00ae162c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php index 0b9f551c97ef..cedd0e73d971 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php index 027cefe7b336..d77bea39df27 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php index 0d66323a9b96..d4284492ed9d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php index ae5d4c147c42..262613842907 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php index cf8277464437..017633db769f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/powershell/.openapi-generator/VERSION b/samples/client/petstore/powershell/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/powershell/.openapi-generator/VERSION +++ b/samples/client/petstore/powershell/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/python-asyncio/.openapi-generator/VERSION b/samples/client/petstore/python-asyncio/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/python-asyncio/.openapi-generator/VERSION +++ b/samples/client/petstore/python-asyncio/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/python-legacy/.openapi-generator/VERSION b/samples/client/petstore/python-legacy/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/python-legacy/.openapi-generator/VERSION +++ b/samples/client/petstore/python-legacy/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/python-tornado/.openapi-generator/VERSION b/samples/client/petstore/python-tornado/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/python-tornado/.openapi-generator/VERSION +++ b/samples/client/petstore/python-tornado/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/python/.openapi-generator/VERSION b/samples/client/petstore/python/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/python/.openapi-generator/VERSION +++ b/samples/client/petstore/python/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/VERSION b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/VERSION +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION b/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION +++ b/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/ruby-faraday/lib/petstore.rb b/samples/client/petstore/ruby-faraday/lib/petstore.rb index 52888e58a27c..d9d54916247a 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb index 4bf4193b4eae..9535fd15de5a 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb index e3a7cd310337..84d666312ebc 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end 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 ee52929a2479..d7acddef01e2 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 @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb index 65485cff858b..9eb20c278b93 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb index e0793d51f0fe..fd4d73299e13 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb index deac217effc7..9ebd82ddc89f 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb index e78912f6ec6f..9f6cd55be746 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb index f6ad5e2c7a31..f14d04a5b741 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb index becfa19ff983..ebf166152c76 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb index d7b5555cf838..09143381bc03 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb index 7531ca63698c..6137b4905f42 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb index aa12eb3d75d7..c1d80a23d3ff 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb index 696db1a23df2..0b9e281f3313 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb index 638f600b4184..0987e392a59c 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb index b317724cf128..6e40954d60cf 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb index 882a63aba31f..eba93689e7bd 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb index 438e60cb08dc..a04322c900d3 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb index 23ffc61d744b..7107968d387d 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb index 6edbd10d0d59..7a2a2ad5f777 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb index 74b270bb2fb8..cf5d1e36c33a 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb index f86d40e3a30c..546e54a41fa7 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb index 6ec58e16cee5..792ea88c609f 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/deprecated_object.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/deprecated_object.rb index a03e3768569f..7304906159f1 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/deprecated_object.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/deprecated_object.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb index f0e5b085052a..7db02e1cab4f 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb index 4c6bf35e7f75..1fb42b5a03d6 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb index 5ef024fa4a2e..0ffa7fb0f80b 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb index 597f28b713ad..2afb2753c4f2 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb index abbbd53eb472..bd1304ccf378 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb index 87a2e68dac9d..2d0680fa72ce 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb index 7a8b6dbbac33..1a2146a9c692 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/foo.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/foo.rb index 4b78a1a4e0b5..3ab566051390 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/foo.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/foo.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb index 150c9c5fd4ea..6a658e35bf0a 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb index b45c4c559f93..54d25a6f5b7c 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb index f571546880ae..cd53646b938c 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb index 81cd539687c0..ccd578a95210 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb index 7f7b06af8107..f2c5ec1619d8 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb index 81d45842d317..ffa79e40fea2 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb index f4f82d05a24f..543cc1ce5bd4 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb index 250270b108d0..83b38460ee64 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb index c6415f59a10e..4ad971483d43 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb index f30bc7d491d4..c313f795169a 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb index ceaba02c50f4..b8a5a96fad67 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb index 90ec47bc8d7e..dba180351b68 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/object_with_deprecated_fields.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/object_with_deprecated_fields.rb index 685e67faf247..da6017f8e464 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/object_with_deprecated_fields.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/object_with_deprecated_fields.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb index 3302c7a6ae74..e305739da95a 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb index 7fbf354561e1..059f08912424 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb index 22fb7e25e290..d3ae94e1d5cf 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb index 7c6e440a2a4d..003c7217c31b 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb index ac32309217e1..d4a4fed26d5e 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb index 88edbfe29494..d6079135cfdd 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_object_with_enum_property.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_object_with_enum_property.rb index e4c1bf4cace4..6f4aec9f4a60 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_object_with_enum_property.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_object_with_enum_property.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb index 35d3a97a5306..e73b65c3c517 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb index 8c67c2007cbb..4197a2ec616b 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb index f839bdefc132..001d3b3a0b1d 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb index 70f887236d1f..cba58e1df627 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb index 6d96a7f032a6..167953675a36 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/version.rb b/samples/client/petstore/ruby-faraday/lib/petstore/version.rb index 536c6915652e..fe6cd38e7ccf 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/version.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/petstore.gemspec b/samples/client/petstore/ruby-faraday/petstore.gemspec index 6afb0812dbba..eb8fa27ef089 100644 --- a/samples/client/petstore/ruby-faraday/petstore.gemspec +++ b/samples/client/petstore/ruby-faraday/petstore.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/api_client_spec.rb b/samples/client/petstore/ruby-faraday/spec/api_client_spec.rb index ab6921a450cf..d47987c12a6b 100644 --- a/samples/client/petstore/ruby-faraday/spec/api_client_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/api_client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/configuration_spec.rb b/samples/client/petstore/ruby-faraday/spec/configuration_spec.rb index 449c41414396..f7eceea4ec30 100644 --- a/samples/client/petstore/ruby-faraday/spec/configuration_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/spec_helper.rb b/samples/client/petstore/ruby-faraday/spec/spec_helper.rb index 223647452af5..d90940c63b52 100644 --- a/samples/client/petstore/ruby-faraday/spec/spec_helper.rb +++ b/samples/client/petstore/ruby-faraday/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/.openapi-generator/VERSION b/samples/client/petstore/ruby/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/ruby/.openapi-generator/VERSION +++ b/samples/client/petstore/ruby/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/ruby/lib/petstore.rb b/samples/client/petstore/ruby/lib/petstore.rb index 52888e58a27c..d9d54916247a 100644 --- a/samples/client/petstore/ruby/lib/petstore.rb +++ b/samples/client/petstore/ruby/lib/petstore.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb b/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb index 4bf4193b4eae..9535fd15de5a 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/default_api.rb b/samples/client/petstore/ruby/lib/petstore/api/default_api.rb index e3a7cd310337..84d666312ebc 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/default_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/default_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end 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 ee52929a2479..d7acddef01e2 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb b/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb index 65485cff858b..9eb20c278b93 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb index 0fd7e3cf7f93..0014c5b78a0d 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb index 74b571373fd3..becfae6e1b7c 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/user_api.rb b/samples/client/petstore/ruby/lib/petstore/api/user_api.rb index b2acdb131860..5a550ce47ee3 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/user_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/user_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api_client.rb b/samples/client/petstore/ruby/lib/petstore/api_client.rb index 7e6dff7d6b9c..7cf4a5d85ebb 100644 --- a/samples/client/petstore/ruby/lib/petstore/api_client.rb +++ b/samples/client/petstore/ruby/lib/petstore/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api_error.rb b/samples/client/petstore/ruby/lib/petstore/api_error.rb index becfa19ff983..ebf166152c76 100644 --- a/samples/client/petstore/ruby/lib/petstore/api_error.rb +++ b/samples/client/petstore/ruby/lib/petstore/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/configuration.rb b/samples/client/petstore/ruby/lib/petstore/configuration.rb index a0453d029264..6c934e35bff3 100644 --- a/samples/client/petstore/ruby/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby/lib/petstore/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb index 7531ca63698c..6137b4905f42 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/animal.rb b/samples/client/petstore/ruby/lib/petstore/models/animal.rb index aa12eb3d75d7..c1d80a23d3ff 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/animal.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/animal.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/api_response.rb b/samples/client/petstore/ruby/lib/petstore/models/api_response.rb index 696db1a23df2..0b9e281f3313 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/api_response.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/api_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb index 638f600b4184..0987e392a59c 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb index b317724cf128..6e40954d60cf 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_test.rb b/samples/client/petstore/ruby/lib/petstore/models/array_test.rb index 882a63aba31f..eba93689e7bd 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb b/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb index 438e60cb08dc..a04322c900d3 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/cat.rb b/samples/client/petstore/ruby/lib/petstore/models/cat.rb index 23ffc61d744b..7107968d387d 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/cat.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/cat.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb b/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb index 6edbd10d0d59..7a2a2ad5f777 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/category.rb b/samples/client/petstore/ruby/lib/petstore/models/category.rb index 74b270bb2fb8..cf5d1e36c33a 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/category.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/category.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/class_model.rb b/samples/client/petstore/ruby/lib/petstore/models/class_model.rb index f86d40e3a30c..546e54a41fa7 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/class_model.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/class_model.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/client.rb b/samples/client/petstore/ruby/lib/petstore/models/client.rb index 6ec58e16cee5..792ea88c609f 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/client.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/deprecated_object.rb b/samples/client/petstore/ruby/lib/petstore/models/deprecated_object.rb index a03e3768569f..7304906159f1 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/deprecated_object.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/deprecated_object.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/dog.rb b/samples/client/petstore/ruby/lib/petstore/models/dog.rb index f0e5b085052a..7db02e1cab4f 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/dog.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/dog.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb b/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb index 4c6bf35e7f75..1fb42b5a03d6 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb index 5ef024fa4a2e..0ffa7fb0f80b 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb index 597f28b713ad..2afb2753c4f2 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb index abbbd53eb472..bd1304ccf378 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/file.rb b/samples/client/petstore/ruby/lib/petstore/models/file.rb index 87a2e68dac9d..2d0680fa72ce 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/file.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/file.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb b/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb index 7a8b6dbbac33..1a2146a9c692 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/foo.rb b/samples/client/petstore/ruby/lib/petstore/models/foo.rb index 4b78a1a4e0b5..3ab566051390 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/foo.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/foo.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb index 150c9c5fd4ea..6a658e35bf0a 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb b/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb index b45c4c559f93..54d25a6f5b7c 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/health_check_result.rb b/samples/client/petstore/ruby/lib/petstore/models/health_check_result.rb index f571546880ae..cd53646b938c 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/health_check_result.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/health_check_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/inline_response_default.rb b/samples/client/petstore/ruby/lib/petstore/models/inline_response_default.rb index 81cd539687c0..ccd578a95210 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/inline_response_default.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/inline_response_default.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/list.rb b/samples/client/petstore/ruby/lib/petstore/models/list.rb index 7f7b06af8107..f2c5ec1619d8 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/list.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/map_test.rb b/samples/client/petstore/ruby/lib/petstore/models/map_test.rb index 81d45842d317..ffa79e40fea2 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/map_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/map_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb index f4f82d05a24f..543cc1ce5bd4 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb b/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb index 250270b108d0..83b38460ee64 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/model_return.rb b/samples/client/petstore/ruby/lib/petstore/models/model_return.rb index c6415f59a10e..4ad971483d43 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/model_return.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/model_return.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/name.rb b/samples/client/petstore/ruby/lib/petstore/models/name.rb index f30bc7d491d4..c313f795169a 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/name.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/name.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/nullable_class.rb b/samples/client/petstore/ruby/lib/petstore/models/nullable_class.rb index ceaba02c50f4..b8a5a96fad67 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/nullable_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/nullable_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/number_only.rb index 90ec47bc8d7e..dba180351b68 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/object_with_deprecated_fields.rb b/samples/client/petstore/ruby/lib/petstore/models/object_with_deprecated_fields.rb index 685e67faf247..da6017f8e464 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/object_with_deprecated_fields.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/object_with_deprecated_fields.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/order.rb b/samples/client/petstore/ruby/lib/petstore/models/order.rb index 3302c7a6ae74..e305739da95a 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/order.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/order.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb index 7fbf354561e1..059f08912424 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb index 22fb7e25e290..d3ae94e1d5cf 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb index 7c6e440a2a4d..003c7217c31b 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb index ac32309217e1..d4a4fed26d5e 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb index 88edbfe29494..d6079135cfdd 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_object_with_enum_property.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_object_with_enum_property.rb index e4c1bf4cace4..6f4aec9f4a60 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_object_with_enum_property.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_object_with_enum_property.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/pet.rb b/samples/client/petstore/ruby/lib/petstore/models/pet.rb index 35d3a97a5306..e73b65c3c517 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/pet.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/pet.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb b/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb index 8c67c2007cbb..4197a2ec616b 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb b/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb index f839bdefc132..001d3b3a0b1d 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/tag.rb b/samples/client/petstore/ruby/lib/petstore/models/tag.rb index 70f887236d1f..cba58e1df627 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/tag.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/tag.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/user.rb b/samples/client/petstore/ruby/lib/petstore/models/user.rb index 6d96a7f032a6..167953675a36 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/user.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/user.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/version.rb b/samples/client/petstore/ruby/lib/petstore/version.rb index 536c6915652e..fe6cd38e7ccf 100644 --- a/samples/client/petstore/ruby/lib/petstore/version.rb +++ b/samples/client/petstore/ruby/lib/petstore/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/petstore.gemspec b/samples/client/petstore/ruby/petstore.gemspec index fb9853b2f605..869a27cff67a 100644 --- a/samples/client/petstore/ruby/petstore.gemspec +++ b/samples/client/petstore/ruby/petstore.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/spec/api_client_spec.rb b/samples/client/petstore/ruby/spec/api_client_spec.rb index 8f608b72b491..48ef4c890a00 100644 --- a/samples/client/petstore/ruby/spec/api_client_spec.rb +++ b/samples/client/petstore/ruby/spec/api_client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/spec/configuration_spec.rb b/samples/client/petstore/ruby/spec/configuration_spec.rb index 449c41414396..f7eceea4ec30 100644 --- a/samples/client/petstore/ruby/spec/configuration_spec.rb +++ b/samples/client/petstore/ruby/spec/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/spec/spec_helper.rb b/samples/client/petstore/ruby/spec/spec_helper.rb index 223647452af5..d90940c63b52 100644 --- a/samples/client/petstore/ruby/spec/spec_helper.rb +++ b/samples/client/petstore/ruby/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/rust/hyper/petstore/.openapi-generator/VERSION b/samples/client/petstore/rust/hyper/petstore/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/rust/hyper/petstore/.openapi-generator/VERSION +++ b/samples/client/petstore/rust/hyper/petstore/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/VERSION b/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/VERSION +++ b/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.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 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/VERSION +++ b/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/scala-akka/.openapi-generator/VERSION b/samples/client/petstore/scala-akka/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/scala-akka/.openapi-generator/VERSION +++ b/samples/client/petstore/scala-akka/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/scala-httpclient-deprecated/.openapi-generator/VERSION b/samples/client/petstore/scala-httpclient-deprecated/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/scala-httpclient-deprecated/.openapi-generator/VERSION +++ b/samples/client/petstore/scala-httpclient-deprecated/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/scala-sttp/.openapi-generator/VERSION b/samples/client/petstore/scala-sttp/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/scala-sttp/.openapi-generator/VERSION +++ b/samples/client/petstore/scala-sttp/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION b/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java index 201390db01a1..990b0eec1cfc 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java index 4884db415ac5..7f3661002f64 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java index 32bba7195eec..c981ba142e04 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud-spring-pageable/.openapi-generator/VERSION b/samples/client/petstore/spring-cloud-spring-pageable/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-cloud-spring-pageable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java index ef3a506138c7..ac1611220636 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java index 3c23ac563a3f..6e7e5be954ff 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index e572a2aa6987..c9ca353c8d8a 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud/.openapi-generator/VERSION b/samples/client/petstore/spring-cloud/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/spring-cloud/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-cloud/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java index 2936b1bc0c89..5631204b336f 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java index cfb78b620762..08223c4449ed 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java index a96a9901fbee..7bb285737800 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-stubs/.openapi-generator/VERSION b/samples/client/petstore/spring-stubs/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/spring-stubs/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-stubs/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java index b3bfb2d25f6b..be3ac9d5d7a3 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java index fee94a945c1a..b11987cc7378 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java index d178aafd1fbd..7bb296e335a0 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/swift5/alamofireLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/alamofireLibrary/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/alamofireLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/asyncAwaitLibrary/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/combineLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/combineLibrary/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/swift5/combineLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/combineLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/default/.openapi-generator/VERSION b/samples/client/petstore/swift5/default/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/swift5/default/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/deprecated/.openapi-generator/VERSION b/samples/client/petstore/swift5/deprecated/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/swift5/deprecated/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/deprecated/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/nonPublicApi/.openapi-generator/VERSION b/samples/client/petstore/swift5/nonPublicApi/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/swift5/nonPublicApi/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/nonPublicApi/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/objcCompatible/.openapi-generator/VERSION b/samples/client/petstore/swift5/objcCompatible/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/swift5/objcCompatible/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/objcCompatible/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/oneOf/.openapi-generator/VERSION b/samples/client/petstore/swift5/oneOf/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/swift5/oneOf/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/oneOf/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/promisekitLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/promisekitLibrary/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/promisekitLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/readonlyProperties/.openapi-generator/VERSION b/samples/client/petstore/swift5/readonlyProperties/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/swift5/readonlyProperties/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/readonlyProperties/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/resultLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/resultLibrary/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/swift5/resultLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/resultLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/rxswiftLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/rxswiftLibrary/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/rxswiftLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/urlsessionLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/urlsessionLibrary/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/urlsessionLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/vaporLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/vaporLibrary/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/swift5/vaporLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/vaporLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/x-swift-hashable/.openapi-generator/VERSION b/samples/client/petstore/swift5/x-swift-hashable/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/x-swift-hashable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/composed-schemas/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/composed-schemas/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-axios/builds/composed-schemas/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/composed-schemas/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/test-petstore/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/test-petstore/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-axios/builds/test-petstore/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/test-petstore/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/enum/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/enum/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-fetch/builds/enum/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/enum/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION b/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-node/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-node/default/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-node/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-node/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-node/npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-node/npm/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-node/npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-node/npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-redux-query/builds/with-npm-version/.openapi-generator/VERSION b/samples/client/petstore/typescript-redux-query/builds/with-npm-version/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-redux-query/builds/with-npm-version/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-redux-query/builds/with-npm-version/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/VERSION b/samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/VERSION b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/.openapi-generator/VERSION b/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION b/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION +++ b/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/elm/.openapi-generator/VERSION b/samples/openapi3/client/elm/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/openapi3/client/elm/.openapi-generator/VERSION +++ b/samples/openapi3/client/elm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/.openapi-generator/VERSION b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/.openapi-generator/VERSION +++ b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.openapi-generator/VERSION b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.openapi-generator/VERSION +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/.openapi-generator/VERSION b/samples/openapi3/client/extensions/x-auth-id-alias/python/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python/.openapi-generator/VERSION +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/.openapi-generator/VERSION b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/.openapi-generator/VERSION +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias.rb index 38bf40026771..2b3dbe10fe7d 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api/usage_api.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api/usage_api.rb index 84e3bdc6885f..3ca038ad1133 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api/usage_api.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api/usage_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_client.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_client.rb index f7fda51a469f..abc3d3c2674f 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_client.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_error.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_error.rb index 43558c0a8d1b..7b029fc31b73 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_error.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/configuration.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/configuration.rb index dbf8adc10ef7..03a6b4505c3b 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/configuration.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/version.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/version.rb index be49fe115f5d..0af9e59105aa 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/version.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/api_client_spec.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/api_client_spec.rb index 97f9b2e8329d..24fc7dbeb5fe 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/api_client_spec.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/api_client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/configuration_spec.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/configuration_spec.rb index 2f9a61462725..9ed65352f5b1 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/configuration_spec.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/spec_helper.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/spec_helper.rb index 8704daa39c3d..cd0ab1c5441d 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/spec_helper.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/x_auth_id_alias.gemspec b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/x_auth_id_alias.gemspec index 429b960dcfb9..7405c95a614b 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/x_auth_id_alias.gemspec +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/x_auth_id_alias.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/dynamic-servers/python/.openapi-generator/VERSION b/samples/openapi3/client/features/dynamic-servers/python/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/.openapi-generator/VERSION +++ b/samples/openapi3/client/features/dynamic-servers/python/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/.openapi-generator/VERSION b/samples/openapi3/client/features/dynamic-servers/ruby/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/.openapi-generator/VERSION +++ b/samples/openapi3/client/features/dynamic-servers/ruby/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/dynamic_servers.gemspec b/samples/openapi3/client/features/dynamic-servers/ruby/dynamic_servers.gemspec index ec29bbb2de3b..386e9241fe10 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/dynamic_servers.gemspec +++ b/samples/openapi3/client/features/dynamic-servers/ruby/dynamic_servers.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers.rb b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers.rb index dd38bdd94123..6e40dcf063f8 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api/usage_api.rb b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api/usage_api.rb index 000b259b380e..daba92a4fa57 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api/usage_api.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api/usage_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_client.rb b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_client.rb index 6b94cfc24e18..60e56673b997 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_client.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_error.rb b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_error.rb index ed00fd5969b0..17ff6f501b18 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_error.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/configuration.rb b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/configuration.rb index e90670e8320f..533f65efb56a 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/configuration.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/version.rb b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/version.rb index 654718614808..fdae30f5c103 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/version.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/spec/api_client_spec.rb b/samples/openapi3/client/features/dynamic-servers/ruby/spec/api_client_spec.rb index 77a88330a2a0..11c36c4a2923 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/spec/api_client_spec.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/spec/api_client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/spec/configuration_spec.rb b/samples/openapi3/client/features/dynamic-servers/ruby/spec/configuration_spec.rb index 549db52d5c74..7e20d8a8e045 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/spec/configuration_spec.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/spec/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/spec/spec_helper.rb b/samples/openapi3/client/features/dynamic-servers/ruby/spec/spec_helper.rb index f8ebbcdb98da..c408531cca12 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/spec/spec_helper.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/.openapi-generator/VERSION b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/.openapi-generator/VERSION +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore.rb index 40a130506ad5..dfeb3986439e 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api/usage_api.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api/usage_api.rb index a126916ccbb0..6b74413ec0f8 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api/usage_api.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api/usage_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_client.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_client.rb index 92fe897c6968..650088fca01c 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_client.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_error.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_error.rb index 7e837120aaa4..7464a5ae6ca1 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_error.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/configuration.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/configuration.rb index 5090bcfcb924..9a122b5a22b4 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/configuration.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/array_alias.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/array_alias.rb index 580b8c5bd2ab..ba89078942eb 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/array_alias.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/array_alias.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/map_alias.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/map_alias.rb index 446dd162dde3..26dd99dc1aa0 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/map_alias.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/map_alias.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/version.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/version.rb index f570789af128..b2685e70c63c 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/version.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/petstore.gemspec b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/petstore.gemspec index 93f6b8bcd434..44f179dbf3c5 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/petstore.gemspec +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/petstore.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/api_client_spec.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/api_client_spec.rb index f03fbe5455e3..e8c82e7bcc2b 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/api_client_spec.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/api_client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/configuration_spec.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/configuration_spec.rb index a56c37c158ee..97934083eeb1 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/configuration_spec.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/spec_helper.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/spec_helper.rb index 2af20efde2f0..5face65cf285 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/spec_helper.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart2/petstore_client_lib/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/VERSION b/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator/VERSION b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/VERSION b/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-legacy/.openapi-generator/VERSION b/samples/openapi3/client/petstore/python-legacy/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100755 --- a/samples/openapi3/client/petstore/python-legacy/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/python-legacy/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/.openapi-generator/VERSION b/samples/openapi3/client/petstore/python/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/openapi3/client/petstore/python/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/python/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/.openapi-generator/VERSION b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/typescript/builds/default/.openapi-generator/VERSION b/samples/openapi3/client/petstore/typescript/builds/default/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/typescript/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/.openapi-generator/VERSION b/samples/openapi3/client/petstore/typescript/builds/deno/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/typescript/builds/deno/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/.openapi-generator/VERSION b/samples/openapi3/client/petstore/typescript/builds/inversify/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/.openapi-generator/VERSION b/samples/openapi3/client/petstore/typescript/builds/jquery/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/.openapi-generator/VERSION b/samples/openapi3/client/petstore/typescript/builds/object_params/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/schema/petstore/ktorm/.openapi-generator/VERSION b/samples/schema/petstore/ktorm/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/schema/petstore/ktorm/.openapi-generator/VERSION +++ b/samples/schema/petstore/ktorm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/schema/petstore/mysql/.openapi-generator/VERSION b/samples/schema/petstore/mysql/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/schema/petstore/mysql/.openapi-generator/VERSION +++ b/samples/schema/petstore/mysql/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/schema/petstore/wsdl-schema/.openapi-generator/VERSION b/samples/schema/petstore/wsdl-schema/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/schema/petstore/wsdl-schema/.openapi-generator/VERSION +++ b/samples/schema/petstore/wsdl-schema/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-3.0/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore-3.0/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/aspnetcore-3.0/.openapi-generator/VERSION +++ b/samples/server/petstore/aspnetcore-3.0/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-3.1/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore-3.1/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/aspnetcore-3.1/.openapi-generator/VERSION +++ b/samples/server/petstore/aspnetcore-3.1/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-5.0/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore-5.0/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/aspnetcore-5.0/.openapi-generator/VERSION +++ b/samples/server/petstore/aspnetcore-5.0/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/aspnetcore/.openapi-generator/VERSION +++ b/samples/server/petstore/aspnetcore/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION b/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION +++ b/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/cpp-qt-qhttpengine-server/.openapi-generator/VERSION b/samples/server/petstore/cpp-qt-qhttpengine-server/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/cpp-qt-qhttpengine-server/.openapi-generator/VERSION +++ b/samples/server/petstore/cpp-qt-qhttpengine-server/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/erlang-server/.openapi-generator/VERSION b/samples/server/petstore/erlang-server/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/erlang-server/.openapi-generator/VERSION +++ b/samples/server/petstore/erlang-server/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/go-api-server/.openapi-generator/VERSION b/samples/server/petstore/go-api-server/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/go-api-server/.openapi-generator/VERSION +++ b/samples/server/petstore/go-api-server/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/go-chi-server/.openapi-generator/VERSION b/samples/server/petstore/go-chi-server/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/go-chi-server/.openapi-generator/VERSION +++ b/samples/server/petstore/go-chi-server/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/go-echo-server/.openapi-generator/VERSION b/samples/server/petstore/go-echo-server/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/go-echo-server/.openapi-generator/VERSION +++ b/samples/server/petstore/go-echo-server/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/go-gin-api-server/.openapi-generator/VERSION b/samples/server/petstore/go-gin-api-server/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/go-gin-api-server/.openapi-generator/VERSION +++ b/samples/server/petstore/go-gin-api-server/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/go-server-required/.openapi-generator/VERSION b/samples/server/petstore/go-server-required/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/go-server-required/.openapi-generator/VERSION +++ b/samples/server/petstore/go-server-required/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.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 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/haskell-servant/.openapi-generator/VERSION +++ b/samples/server/petstore/haskell-servant/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/haskell-yesod/.openapi-generator/VERSION b/samples/server/petstore/haskell-yesod/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/haskell-yesod/.openapi-generator/VERSION +++ b/samples/server/petstore/haskell-yesod/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-msf4j/.openapi-generator/VERSION b/samples/server/petstore/java-msf4j/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/java-msf4j/.openapi-generator/VERSION +++ b/samples/server/petstore/java-msf4j/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-nullable/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-nullable/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/java-play-framework-no-nullable/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-nullable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/java-play-framework/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-undertow/.openapi-generator/VERSION b/samples/server/petstore/java-undertow/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/java-undertow/.openapi-generator/VERSION +++ b/samples/server/petstore/java-undertow/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-vertx-web/.openapi-generator/VERSION b/samples/server/petstore/java-vertx-web/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/java-vertx-web/.openapi-generator/VERSION +++ b/samples/server/petstore/java-vertx-web/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-cdi-default-value/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-cdi-default-value/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi-default-value/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-cdi-default-value/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/default-value/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/default-value/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/jaxrs-resteasy/default-value/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/default-value/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/java8/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/java8/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/jaxrs-resteasy/java8/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/java8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION b/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/kotlin-server/ktor/README.md b/samples/server/petstore/kotlin-server/ktor/README.md index d78e27dd2ea5..0fc7a3bf2911 100644 --- a/samples/server/petstore/kotlin-server/ktor/README.md +++ b/samples/server/petstore/kotlin-server/ktor/README.md @@ -2,7 +2,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -Generated by OpenAPI Generator 5.3.1-SNAPSHOT. +Generated by OpenAPI Generator 5.4.0-SNAPSHOT. ## Requires diff --git a/samples/server/petstore/kotlin-springboot-delegate/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot-delegate/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-springboot-delegate/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt index fd4f3edbda71..6ddbe5583e49 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt index 238dc18931b2..8bb9e405c31f 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt index 54a68054495e..d1be9a9efed7 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/kotlin-springboot/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/kotlin-springboot/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-springboot/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-laravel/.openapi-generator/VERSION b/samples/server/petstore/php-laravel/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/php-laravel/.openapi-generator/VERSION +++ b/samples/server/petstore/php-laravel/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-lumen/.openapi-generator/VERSION b/samples/server/petstore/php-lumen/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/php-lumen/.openapi-generator/VERSION +++ b/samples/server/petstore/php-lumen/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-mezzio-ph-modern/.openapi-generator/VERSION b/samples/server/petstore/php-mezzio-ph-modern/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/php-mezzio-ph-modern/.openapi-generator/VERSION +++ b/samples/server/petstore/php-mezzio-ph-modern/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-mezzio-ph/.openapi-generator/VERSION b/samples/server/petstore/php-mezzio-ph/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/php-mezzio-ph/.openapi-generator/VERSION +++ b/samples/server/petstore/php-mezzio-ph/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-slim4/.openapi-generator/VERSION b/samples/server/petstore/php-slim4/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/php-slim4/.openapi-generator/VERSION +++ b/samples/server/petstore/php-slim4/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION b/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/python-aiohttp-srclayout/.openapi-generator/VERSION b/samples/server/petstore/python-aiohttp-srclayout/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/python-aiohttp-srclayout/.openapi-generator/VERSION +++ b/samples/server/petstore/python-aiohttp-srclayout/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/python-aiohttp/.openapi-generator/VERSION b/samples/server/petstore/python-aiohttp/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/python-aiohttp/.openapi-generator/VERSION +++ b/samples/server/petstore/python-aiohttp/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/python-blueplanet/.openapi-generator/VERSION b/samples/server/petstore/python-blueplanet/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/python-blueplanet/.openapi-generator/VERSION +++ b/samples/server/petstore/python-blueplanet/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/python-fastapi/.openapi-generator/VERSION b/samples/server/petstore/python-fastapi/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/python-fastapi/.openapi-generator/VERSION +++ b/samples/server/petstore/python-fastapi/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/python-flask/.openapi-generator/VERSION b/samples/server/petstore/python-flask/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/python-flask/.openapi-generator/VERSION +++ b/samples/server/petstore/python-flask/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/no-example-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/no-example-v3/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/rust-server/output/no-example-v3/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/no-example-v3/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/ping-bearer-auth/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/ping-bearer-auth/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/rust-server/output/ping-bearer-auth/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/ping-bearer-auth/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-default-value/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-default-value/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/spring-mvc-default-value/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc-default-value/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java index 9a39105da900..57eeab68579c 100644 --- a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java +++ b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApi.java b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApi.java index 14cdb9ccb6a6..f722e3907edc 100644 --- a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApi.java +++ b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java index 62afbd7d4b5a..7bfeb18e4070 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java index a8c79e245c8d..bcfb69e6e420 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index bf2b4ea0a5bf..8e8a95a4a35d 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java index 415b3f89c0ed..008d22776541 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java index a34599e4b14b..2c9d877db8cf 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java index 44f237700bc0..085258b44f1e 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java index c39c4d2227eb..78af7f1960f8 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java index 25b3feeb7987..2aeb64f71f21 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 081a205e9125..c5f9f4b1000f 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java index b48e45b6068b..5edf19309364 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java index 65d771ce01bb..2a0adcdf4d41 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java index 69205eeeb18f..62e1bfa86d50 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-no-nullable/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc-no-nullable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java index c39c4d2227eb..78af7f1960f8 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java index 07302b4c7d8c..5e2cfca1ed17 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 081a205e9125..c5f9f4b1000f 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApi.java index b48e45b6068b..5edf19309364 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApi.java index 65d771ce01bb..2a0adcdf4d41 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java index 69205eeeb18f..62e1bfa86d50 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java index c39c4d2227eb..78af7f1960f8 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java index 2a84a4ab5c69..6559197d2d28 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 081a205e9125..c5f9f4b1000f 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApi.java index 62ac8b226cc6..5c8251cd80e8 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java index 65d771ce01bb..2a0adcdf4d41 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index 69205eeeb18f..62e1bfa86d50 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/spring-mvc/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java index c39c4d2227eb..78af7f1960f8 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java index 07302b4c7d8c..5e2cfca1ed17 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 081a205e9125..c5f9f4b1000f 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java index b48e45b6068b..5edf19309364 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java index 65d771ce01bb..2a0adcdf4d41 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java index 69205eeeb18f..62e1bfa86d50 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/VERSION b/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java index a84f97e7071b..deee690e51eb 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java index c8bbc2eca2dc..496720406a57 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index e0555ba889ea..7e5ee3ec69d4 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java index 8a1e70ad495b..0220f86fc4be 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java index f31855d1318e..c905a265a54c 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java index 510d11d8e9e0..d956508c479c 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java index c39c4d2227eb..78af7f1960f8 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java index 07302b4c7d8c..5e2cfca1ed17 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 081a205e9125..c5f9f4b1000f 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java index b48e45b6068b..5edf19309364 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java index 65d771ce01bb..2a0adcdf4d41 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java index 69205eeeb18f..62e1bfa86d50 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index 8a2205e990fe..ad1cdd44e49f 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java index b72e307f9750..3a1dbcdf0d18 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 7b84b8cd51ae..1d3ed2c09edd 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java index dccec075e5aa..dd7bf24b0e95 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java index 2a0cfabab4b8..9b22b674ce8d 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java index 59615e8d21c1..2865cfa269c8 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION b/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java index 8a2205e990fe..ad1cdd44e49f 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java index b72e307f9750..3a1dbcdf0d18 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 7b84b8cd51ae..1d3ed2c09edd 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java index dccec075e5aa..dd7bf24b0e95 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java index 2a0cfabab4b8..9b22b674ce8d 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java index 59615e8d21c1..2865cfa269c8 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java index 3b1e30dd3852..b6205ac9a4ff 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java index d8835b1f794f..94931c1b29bb 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index ea96bda489ce..e7ac69b818f1 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java index db5edb9933af..491ec6135ed8 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java index af72984a1320..11515193864b 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java index 9236407c3a7c..7f300c5944cf 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION b/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java index cc36aa71d7aa..eac8acc70c64 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java index fbc80bf9a77d..33806c07f998 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 0cc1498fa757..9c32999e4197 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java index 3babe1c40a41..7dd9974e6cdd 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java index 20713d38c146..7ab1bc2282f2 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java index e95954ffb963..e1f856d4a3f1 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/VERSION b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index a84f97e7071b..deee690e51eb 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java index d84e0f2663de..ceeca9b3f1bf 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index e0555ba889ea..7e5ee3ec69d4 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java index 37449224cb77..86de7b07c561 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java index f31855d1318e..c905a265a54c 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java index 510d11d8e9e0..d956508c479c 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/VERSION b/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java index 8a2205e990fe..ad1cdd44e49f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java index 9c9ba633da75..a41ac72dafd0 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 7b84b8cd51ae..1d3ed2c09edd 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java index d966a69941c8..09d3446244a2 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java index 2a0cfabab4b8..9b22b674ce8d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java index 59615e8d21c1..2865cfa269c8 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/VERSION b/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index a84f97e7071b..deee690e51eb 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java index d84e0f2663de..ceeca9b3f1bf 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index e0555ba889ea..7e5ee3ec69d4 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java index 37449224cb77..86de7b07c561 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java index f31855d1318e..c905a265a54c 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java index 510d11d8e9e0..d956508c479c 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable/.openapi-generator/VERSION b/samples/server/petstore/springboot-spring-pageable/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/springboot-spring-pageable/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-spring-pageable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java index c39c4d2227eb..78af7f1960f8 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java index 2a84a4ab5c69..6559197d2d28 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 081a205e9125..c5f9f4b1000f 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java index 62ac8b226cc6..5c8251cd80e8 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java index 65d771ce01bb..2a0adcdf4d41 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index 69205eeeb18f..62e1bfa86d50 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION b/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java index c39c4d2227eb..78af7f1960f8 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java index 03bab0f6dcc8..d343a51b4906 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 081a205e9125..c5f9f4b1000f 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java index b65e9c01bf7c..b6957a5d0ef1 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java index 65d771ce01bb..2a0adcdf4d41 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java index 69205eeeb18f..62e1bfa86d50 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION b/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java index 42b1510a64d4..55a154596ca8 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java index 700d3b47d22f..7531c82d60c9 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java index 733c4b7532d2..8171516cf829 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java index 9e3e39339af5..2a0981b466f2 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java index f31840b4f143..40218ddac64b 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java index 9e2c99591309..e05930eb96c3 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/.openapi-generator/VERSION b/samples/server/petstore/springboot/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/server/petstore/springboot/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java index c39c4d2227eb..78af7f1960f8 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java index 07302b4c7d8c..5e2cfca1ed17 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 081a205e9125..c5f9f4b1000f 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java index b48e45b6068b..5edf19309364 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java index 65d771ce01bb..2a0adcdf4d41 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java index 69205eeeb18f..62e1bfa86d50 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ From eeb00e27d13fb0c578c1c4159c0c7bddfcb21082 Mon Sep 17 00:00:00 2001 From: Tal Kirshboim Date: Sat, 20 Nov 2021 02:30:26 +0100 Subject: [PATCH 002/117] [Kotlin][Multiplatform] Fix Kotlin Multiplatform Test (#10900) * Fix Kotlin Multiplatform Test - Remove obsolete 'GRADLE_METADATA' Gradle preview flag from Kotlin Multiplatform settings.gradle template file. - Update Kotlin Version to 1.5.31 - Update coroutines, serialization and Ktor versions to the versions recommended for usage with Kotlin 1.5.31 see https://kotlinlang.org/docs/releases.html#release-details . Fixes https://github.com/OpenAPITools/openapi-generator/issues/10898 * Add 'clean' task to pom.mustache and reformat sample pom.xml * Use stable 1.3.0 version of Kotlin serialization --- .../multiplatform/build.gradle.kts.mustache | 12 ++++++------ .../libraries/multiplatform/pom.mustache | 14 ++++++++++++++ .../multiplatform/settings.gradle.kts.mustache | 1 - .../petstore/kotlin-multiplatform/build.gradle.kts | 12 ++++++------ .../client/petstore/kotlin-multiplatform/pom.xml | 14 ++++++++++++++ .../kotlin-multiplatform/settings.gradle.kts | 1 - 6 files changed, 40 insertions(+), 14 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/build.gradle.kts.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/build.gradle.kts.mustache index e0a08492c53a..ac4f19048a15 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/build.gradle.kts.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/build.gradle.kts.mustache @@ -1,17 +1,17 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget plugins { - kotlin("multiplatform") version "1.5.10" // kotlin_version - kotlin("plugin.serialization") version "1.5.10" // kotlin_version + kotlin("multiplatform") version "1.5.31" // kotlin_version + kotlin("plugin.serialization") version "1.5.31" // kotlin_version } group = "{{groupId}}" version = "{{artifactVersion}}" -val kotlin_version = "1.5.10" -val coroutines_version = "1.5.0" -val serialization_version = "1.2.1" -val ktor_version = "1.6.0" +val kotlin_version = "1.5.31" +val coroutines_version = "1.5.2" +val serialization_version = "1.3.0" +val ktor_version = "1.6.3" repositories { mavenCentral() diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/pom.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/pom.mustache index be6fb120855c..215539ec151f 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/pom.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/pom.mustache @@ -26,6 +26,20 @@ exec-maven-plugin 1.2.1 + + bundle-clean + clean + + exec + + + /bin/bash + + gradlew + clean + + + bundle-test integration-test diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/settings.gradle.kts.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/settings.gradle.kts.mustache index bf286c5e8c29..b8fd6c4c41f9 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/settings.gradle.kts.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/settings.gradle.kts.mustache @@ -1,2 +1 @@ -enableFeaturePreview("GRADLE_METADATA") rootProject.name = "{{artifactId}}" \ No newline at end of file diff --git a/samples/client/petstore/kotlin-multiplatform/build.gradle.kts b/samples/client/petstore/kotlin-multiplatform/build.gradle.kts index 42324041d66f..2c891e8fa4fd 100644 --- a/samples/client/petstore/kotlin-multiplatform/build.gradle.kts +++ b/samples/client/petstore/kotlin-multiplatform/build.gradle.kts @@ -1,17 +1,17 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget plugins { - kotlin("multiplatform") version "1.5.10" // kotlin_version - kotlin("plugin.serialization") version "1.5.10" // kotlin_version + kotlin("multiplatform") version "1.5.31" // kotlin_version + kotlin("plugin.serialization") version "1.5.31" // kotlin_version } group = "org.openapitools" version = "1.0.0" -val kotlin_version = "1.5.10" -val coroutines_version = "1.5.0" -val serialization_version = "1.2.1" -val ktor_version = "1.6.0" +val kotlin_version = "1.5.31" +val coroutines_version = "1.5.2" +val serialization_version = "1.3.0" +val ktor_version = "1.6.3" repositories { mavenCentral() diff --git a/samples/client/petstore/kotlin-multiplatform/pom.xml b/samples/client/petstore/kotlin-multiplatform/pom.xml index 6397a0668d0b..f4ff095e65ac 100644 --- a/samples/client/petstore/kotlin-multiplatform/pom.xml +++ b/samples/client/petstore/kotlin-multiplatform/pom.xml @@ -26,6 +26,20 @@ exec-maven-plugin 1.2.1 + + bundle-clean + clean + + exec + + + /bin/bash + + gradlew + clean + + + bundle-test integration-test diff --git a/samples/client/petstore/kotlin-multiplatform/settings.gradle.kts b/samples/client/petstore/kotlin-multiplatform/settings.gradle.kts index 15cae2a9fd06..e471be1cddcc 100644 --- a/samples/client/petstore/kotlin-multiplatform/settings.gradle.kts +++ b/samples/client/petstore/kotlin-multiplatform/settings.gradle.kts @@ -1,2 +1 @@ -enableFeaturePreview("GRADLE_METADATA") rootProject.name = "kotlin-client-petstore-multiplatform" \ No newline at end of file From 6702785cae5906cd980718d859f5395d5f742ba8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 21 Nov 2021 01:03:17 +0800 Subject: [PATCH 003/117] Bump ssri from 6.0.1 to 6.0.2 in /website (#10909) Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2. - [Release notes](https://github.com/npm/ssri/releases) - [Changelog](https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md) - [Commits](https://github.com/npm/ssri/compare/v6.0.1...v6.0.2) --- updated-dependencies: - dependency-name: ssri dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- website/yarn.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/website/yarn.lock b/website/yarn.lock index 1dd6b0b5bd40..4363ee89f2b5 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -3708,9 +3708,9 @@ feed@^4.0.0: xml-js "^1.6.11" figgy-pudding@^3.5.1: - version "3.5.1" - resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.1.tgz#862470112901c727a0e495a80744bd5baa1d6790" - integrity sha512-vNKxJHTEKNThjfrdJwHc7brvM6eVevuO5nTj6ez8ZQ1qbXTvGthucRF7S4vf2cr71QVnT70V34v0S1DyQsti0w== + version "3.5.2" + resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.2.tgz#b4eee8148abb01dcf1d1ac34367d59e12fa61d6e" + integrity sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw== figures@^2.0.0: version "2.0.0" @@ -8488,9 +8488,9 @@ sshpk@^1.7.0: tweetnacl "~0.14.0" ssri@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/ssri/-/ssri-6.0.1.tgz#2a3c41b28dd45b62b63676ecb74001265ae9edd8" - integrity sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA== + version "6.0.2" + resolved "https://registry.yarnpkg.com/ssri/-/ssri-6.0.2.tgz#157939134f20464e7301ddba3e90ffa8f7728ac5" + integrity sha512-cepbSq/neFK7xB6A50KHN0xHDotYzq58wWCa5LeWqnPrHG8GzfEjO/4O8kpmcGW+oaxkvhEJCWgbgNk4/ZV93Q== dependencies: figgy-pudding "^3.5.1" From 18d8843cf94b8720a2b6d5db44f3093b07d08be3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 21 Nov 2021 01:15:29 +0800 Subject: [PATCH 004/117] Bump dns-packet from 1.3.1 to 1.3.4 in /website (#10908) Bumps [dns-packet](https://github.com/mafintosh/dns-packet) from 1.3.1 to 1.3.4. - [Release notes](https://github.com/mafintosh/dns-packet/releases) - [Changelog](https://github.com/mafintosh/dns-packet/blob/master/CHANGELOG.md) - [Commits](https://github.com/mafintosh/dns-packet/compare/v1.3.1...v1.3.4) --- updated-dependencies: - dependency-name: dns-packet dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- website/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/yarn.lock b/website/yarn.lock index 4363ee89f2b5..23846922dea9 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -3151,9 +3151,9 @@ dns-equal@^1.0.0: integrity sha1-s55/HabrCnW6nBcySzR1PEfgZU0= dns-packet@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/dns-packet/-/dns-packet-1.3.1.tgz#12aa426981075be500b910eedcd0b47dd7deda5a" - integrity sha512-0UxfQkMhYAUaZI+xrNZOz/as5KgDU0M/fQ9b6SpkyLbk3GEswDi6PADJVaYJradtRVsRIlF1zLyOodbcTCDzUg== + version "1.3.4" + resolved "https://registry.yarnpkg.com/dns-packet/-/dns-packet-1.3.4.tgz#e3455065824a2507ba886c55a89963bb107dec6f" + integrity sha512-BQ6F4vycLXBvdrJZ6S3gZewt6rcrks9KBgM9vrhW+knGRqc8uEdT7fuCwloc7nny5xNoMJ17HGH0R/6fpo8ECA== dependencies: ip "^1.1.0" safe-buffer "^5.0.1" From 637fa430d514ec275cdf5b324a87f40a1fcf3b4e Mon Sep 17 00:00:00 2001 From: Kevin Chen Date: Sat, 20 Nov 2021 11:25:45 -0600 Subject: [PATCH 005/117] [kotlin-spring] add comment to api method (#10857) * fix: add api comment * update sample * update sample --- .../resources/kotlin-spring/service.mustache | 20 ++++++ .../org/openapitools/api/PetApiService.kt | 71 +++++++++++++++++++ .../org/openapitools/api/StoreApiService.kt | 34 +++++++++ .../org/openapitools/api/UserApiService.kt | 65 +++++++++++++++++ .../org/openapitools/api/PetApiService.kt | 71 +++++++++++++++++++ .../org/openapitools/api/StoreApiService.kt | 34 +++++++++ .../org/openapitools/api/UserApiService.kt | 65 +++++++++++++++++ 7 files changed, 360 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/service.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/service.mustache index becec2257ef6..c823d7a32ac8 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/service.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/service.mustache @@ -10,6 +10,26 @@ import kotlinx.coroutines.flow.Flow; interface {{classname}}Service { {{#operation}} + /** + * {{httpMethod}} {{{path}}}{{#summary}} : {{.}}{{/summary}} + {{#notes}} + * {{.}} + {{/notes}} + * + {{#allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + * @return {{#responses}}{{message}} (status code {{code}}){{^-last}} + * or {{/-last}}{{/responses}} + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} + {{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation + {{/externalDocs}} + * @see {{classname}}#{{operationId}} + */ {{#reactive}}{{^isArray}}suspend {{/isArray}}{{/reactive}}fun {{operationId}}({{#allParams}}{{paramName}}: {{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{>optionalDataType}}{{/reactive}}{{#reactive}}{{^isArray}}{{>optionalDataType}}{{/isArray}}{{#isArray}}Flow<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{^-last}}, {{/-last}}{{/allParams}}): {{>returnTypes}} {{/operation}} } diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiService.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiService.kt index 082f75c0fe35..fa6c0b67ce5d 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiService.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiService.kt @@ -6,19 +6,90 @@ import kotlinx.coroutines.flow.Flow; interface PetApiService { + /** + * POST /pet : Add a new pet to the store + * + * @param body Pet object that needs to be added to the store (required) + * @return Invalid input (status code 405) + * @see PetApi#addPet + */ suspend fun addPet(body: Pet): Unit + /** + * DELETE /pet/{petId} : Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return Invalid pet value (status code 400) + * @see PetApi#deletePet + */ suspend fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?): Unit + /** + * GET /pet/findByStatus : Finds Pets by status + * Multiple status values can be provided with comma separated strings + * + * @param status Status values that need to be considered for filter (required) + * @return successful operation (status code 200) + * or Invalid status value (status code 400) + * @see PetApi#findPetsByStatus + */ fun findPetsByStatus(status: kotlin.collections.List): Flow + /** + * GET /pet/findByTags : Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @param tags Tags to filter by (required) + * @return successful operation (status code 200) + * or Invalid tag value (status code 400) + * @deprecated + * @see PetApi#findPetsByTags + */ fun findPetsByTags(tags: kotlin.collections.List): Flow + /** + * GET /pet/{petId} : Find pet by ID + * Returns a single pet + * + * @param petId ID of pet to return (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * @see PetApi#getPetById + */ suspend fun getPetById(petId: kotlin.Long): Pet + /** + * PUT /pet : Update an existing pet + * + * @param body Pet object that needs to be added to the store (required) + * @return Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * or Validation exception (status code 405) + * @see PetApi#updatePet + */ suspend fun updatePet(body: Pet): Unit + /** + * POST /pet/{petId} : Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return Invalid input (status code 405) + * @see PetApi#updatePetWithForm + */ suspend fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): Unit + /** + * POST /pet/{petId}/uploadImage : uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return successful operation (status code 200) + * @see PetApi#uploadFile + */ suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse } diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiService.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiService.kt index 5dbae34663cc..1bc1ce9dc712 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiService.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiService.kt @@ -5,11 +5,45 @@ import kotlinx.coroutines.flow.Flow; interface StoreApiService { + /** + * DELETE /store/order/{orderId} : Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @param orderId ID of the order that needs to be deleted (required) + * @return Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#deleteOrder + */ suspend fun deleteOrder(orderId: kotlin.String): Unit + /** + * GET /store/inventory : Returns pet inventories by status + * Returns a map of status codes to quantities + * + * @return successful operation (status code 200) + * @see StoreApi#getInventory + */ suspend fun getInventory(): Map + /** + * GET /store/order/{orderId} : Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @param orderId ID of pet that needs to be fetched (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#getOrderById + */ suspend fun getOrderById(orderId: kotlin.Long): Order + /** + * POST /store/order : Place an order for a pet + * + * @param body order placed for purchasing the pet (required) + * @return successful operation (status code 200) + * or Invalid Order (status code 400) + * @see StoreApi#placeOrder + */ suspend fun placeOrder(body: Order): Order } diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiService.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiService.kt index 475862547b58..90703434b3b1 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiService.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiService.kt @@ -5,19 +5,84 @@ import kotlinx.coroutines.flow.Flow; interface UserApiService { + /** + * POST /user : Create user + * This can only be done by the logged in user. + * + * @param body Created user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUser + */ suspend fun createUser(body: User): Unit + /** + * POST /user/createWithArray : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithArrayInput + */ suspend fun createUsersWithArrayInput(body: Flow): Unit + /** + * POST /user/createWithList : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithListInput + */ suspend fun createUsersWithListInput(body: Flow): Unit + /** + * DELETE /user/{username} : Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#deleteUser + */ suspend fun deleteUser(username: kotlin.String): Unit + /** + * GET /user/{username} : Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return successful operation (status code 200) + * or Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#getUserByName + */ suspend fun getUserByName(username: kotlin.String): User + /** + * GET /user/login : Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return successful operation (status code 200) + * or Invalid username/password supplied (status code 400) + * @see UserApi#loginUser + */ suspend fun loginUser(username: kotlin.String, password: kotlin.String): kotlin.String + /** + * GET /user/logout : Logs out current logged in user session + * + * @return successful operation (status code 200) + * @see UserApi#logoutUser + */ suspend fun logoutUser(): Unit + /** + * PUT /user/{username} : Updated user + * This can only be done by the logged in user. + * + * @param username name that need to be deleted (required) + * @param body Updated user object (required) + * @return Invalid user supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#updateUser + */ suspend fun updateUser(username: kotlin.String, body: User): Unit } diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt index b96e86aff1bb..ee0e3bef83cc 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt @@ -5,19 +5,90 @@ import org.openapitools.model.Pet interface PetApiService { + /** + * POST /pet : Add a new pet to the store + * + * @param body Pet object that needs to be added to the store (required) + * @return Invalid input (status code 405) + * @see PetApi#addPet + */ fun addPet(body: Pet): Unit + /** + * DELETE /pet/{petId} : Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return Invalid pet value (status code 400) + * @see PetApi#deletePet + */ fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?): Unit + /** + * GET /pet/findByStatus : Finds Pets by status + * Multiple status values can be provided with comma separated strings + * + * @param status Status values that need to be considered for filter (required) + * @return successful operation (status code 200) + * or Invalid status value (status code 400) + * @see PetApi#findPetsByStatus + */ fun findPetsByStatus(status: kotlin.collections.List): List + /** + * GET /pet/findByTags : Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @param tags Tags to filter by (required) + * @return successful operation (status code 200) + * or Invalid tag value (status code 400) + * @deprecated + * @see PetApi#findPetsByTags + */ fun findPetsByTags(tags: kotlin.collections.List): List + /** + * GET /pet/{petId} : Find pet by ID + * Returns a single pet + * + * @param petId ID of pet to return (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * @see PetApi#getPetById + */ fun getPetById(petId: kotlin.Long): Pet + /** + * PUT /pet : Update an existing pet + * + * @param body Pet object that needs to be added to the store (required) + * @return Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * or Validation exception (status code 405) + * @see PetApi#updatePet + */ fun updatePet(body: Pet): Unit + /** + * POST /pet/{petId} : Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return Invalid input (status code 405) + * @see PetApi#updatePetWithForm + */ fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): Unit + /** + * POST /pet/{petId}/uploadImage : uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return successful operation (status code 200) + * @see PetApi#uploadFile + */ fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse } diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiService.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiService.kt index e67a66c4f7e5..6de3e6cc1def 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiService.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiService.kt @@ -4,11 +4,45 @@ import org.openapitools.model.Order interface StoreApiService { + /** + * DELETE /store/order/{orderId} : Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @param orderId ID of the order that needs to be deleted (required) + * @return Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#deleteOrder + */ fun deleteOrder(orderId: kotlin.String): Unit + /** + * GET /store/inventory : Returns pet inventories by status + * Returns a map of status codes to quantities + * + * @return successful operation (status code 200) + * @see StoreApi#getInventory + */ fun getInventory(): Map + /** + * GET /store/order/{orderId} : Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @param orderId ID of pet that needs to be fetched (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#getOrderById + */ fun getOrderById(orderId: kotlin.Long): Order + /** + * POST /store/order : Place an order for a pet + * + * @param body order placed for purchasing the pet (required) + * @return successful operation (status code 200) + * or Invalid Order (status code 400) + * @see StoreApi#placeOrder + */ fun placeOrder(body: Order): Order } diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiService.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiService.kt index 40148efeb72c..a1bcf6be237c 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiService.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiService.kt @@ -4,19 +4,84 @@ import org.openapitools.model.User interface UserApiService { + /** + * POST /user : Create user + * This can only be done by the logged in user. + * + * @param body Created user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUser + */ fun createUser(body: User): Unit + /** + * POST /user/createWithArray : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithArrayInput + */ fun createUsersWithArrayInput(body: kotlin.collections.List): Unit + /** + * POST /user/createWithList : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithListInput + */ fun createUsersWithListInput(body: kotlin.collections.List): Unit + /** + * DELETE /user/{username} : Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#deleteUser + */ fun deleteUser(username: kotlin.String): Unit + /** + * GET /user/{username} : Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return successful operation (status code 200) + * or Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#getUserByName + */ fun getUserByName(username: kotlin.String): User + /** + * GET /user/login : Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return successful operation (status code 200) + * or Invalid username/password supplied (status code 400) + * @see UserApi#loginUser + */ fun loginUser(username: kotlin.String, password: kotlin.String): kotlin.String + /** + * GET /user/logout : Logs out current logged in user session + * + * @return successful operation (status code 200) + * @see UserApi#logoutUser + */ fun logoutUser(): Unit + /** + * PUT /user/{username} : Updated user + * This can only be done by the logged in user. + * + * @param username name that need to be deleted (required) + * @param body Updated user object (required) + * @return Invalid user supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#updateUser + */ fun updateUser(username: kotlin.String, body: User): Unit } From 6848c229f73be3032bf3938e6f23183d11002d8e Mon Sep 17 00:00:00 2001 From: S2021Git <91172466+S2021Git@users.noreply.github.com> Date: Sat, 20 Nov 2021 12:35:32 -0500 Subject: [PATCH 006/117] [JAVA]Add additional check for openapiDocketConfig in SpringCodegan.java (#10853) * updated SpringCodegan * added test case for SpringCodegen change * update samples * updated test Javadoc --- .../codegen/languages/SpringCodegen.java | 2 +- .../java/spring/SpringCodegenTest.java | 41 + .../.openapi-generator/FILES | 2 +- .../src/main/resources/openapi.yaml | 170 ++ .../.openapi-generator/FILES | 2 +- .../src/main/resources/openapi.yaml | 2264 +++++++++++++++++ .../.openapi-generator/FILES | 2 +- .../src/main/resources/openapi.yaml | 2264 +++++++++++++++++ .../.openapi-generator/FILES | 2 +- .../src/main/resources/openapi.yaml | 2264 +++++++++++++++++ .../.openapi-generator/FILES | 2 +- .../src/main/resources/openapi.yaml | 2248 ++++++++++++++++ .../spring-mvc/.openapi-generator/FILES | 2 +- .../src/main/resources/openapi.yaml | 2264 +++++++++++++++++ .../.openapi-generator/FILES | 2 +- .../src/main/resources/openapi.yaml | 2264 +++++++++++++++++ .../.openapi-generator/FILES | 2 +- .../src/main/resources/openapi.yaml | 2264 +++++++++++++++++ .../.openapi-generator/FILES | 2 +- .../src/main/resources/openapi.yaml | 2264 +++++++++++++++++ .../.openapi-generator/FILES | 2 +- .../src/main/resources/openapi.yaml | 2264 +++++++++++++++++ .../.openapi-generator/FILES | 2 +- .../src/main/resources/openapi.yaml | 2264 +++++++++++++++++ .../.openapi-generator/FILES | 2 +- .../src/main/resources/openapi.yaml | 2248 ++++++++++++++++ .../.openapi-generator/FILES | 2 +- .../src/main/resources/openapi.yaml | 2248 ++++++++++++++++ .../.openapi-generator/FILES | 2 +- .../src/main/resources/openapi.yaml | 2248 ++++++++++++++++ .../.openapi-generator/FILES | 2 +- .../src/main/resources/openapi.yaml | 2248 ++++++++++++++++ .../.openapi-generator/FILES | 2 +- .../src/main/resources/openapi.yaml | 2264 +++++++++++++++++ .../.openapi-generator/FILES | 2 +- .../src/main/resources/openapi.yaml | 2264 +++++++++++++++++ .../springboot/.openapi-generator/FILES | 2 +- .../src/main/resources/openapi.yaml | 2264 +++++++++++++++++ 38 files changed, 38638 insertions(+), 19 deletions(-) create mode 100644 samples/server/petstore/spring-mvc-default-value/src/main/resources/openapi.yaml create mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/resources/openapi.yaml create mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/resources/openapi.yaml create mode 100644 samples/server/petstore/spring-mvc-no-nullable/src/main/resources/openapi.yaml create mode 100644 samples/server/petstore/spring-mvc-spring-pageable/src/main/resources/openapi.yaml create mode 100644 samples/server/petstore/spring-mvc/src/main/resources/openapi.yaml create mode 100644 samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml create mode 100644 samples/server/petstore/springboot-beanvalidation/src/main/resources/openapi.yaml create mode 100644 samples/server/petstore/springboot-delegate-j8/src/main/resources/openapi.yaml create mode 100644 samples/server/petstore/springboot-delegate/src/main/resources/openapi.yaml create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml create mode 100644 samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/resources/openapi.yaml create mode 100644 samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/resources/openapi.yaml create mode 100644 samples/server/petstore/springboot-spring-pageable-without-j8/src/main/resources/openapi.yaml create mode 100644 samples/server/petstore/springboot-spring-pageable/src/main/resources/openapi.yaml create mode 100644 samples/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml create mode 100644 samples/server/petstore/springboot-virtualan/src/main/resources/openapi.yaml create mode 100644 samples/server/petstore/springboot/src/main/resources/openapi.yaml diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java index a1e73c16e47d..297c458e3c23 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java @@ -449,7 +449,7 @@ public void processOpts() { supportingFiles.add(new SupportingFile("homeController.mustache", (sourceFolder + File.separator + configPackage).replace(".", java.io.File.separator), "HomeController.java")); - if (!reactive && !apiFirst) { + if (!reactive && !apiFirst && this.openapiDocketConfig) { supportingFiles.add(new SupportingFile("openapiDocumentationConfig.mustache", (sourceFolder + File.separator + configPackage).replace(".", java.io.File.separator), "OpenAPIDocumentationConfig.java")); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java index 66817e5dbc77..8ba2950c2d3e 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java @@ -43,6 +43,7 @@ import static org.openapitools.codegen.TestUtils.assertFileNotContains; import static org.openapitools.codegen.languages.SpringCodegen.RESPONSE_WRAPPER; import static org.testng.Assert.assertEquals; +import static org.testng.Assert.fail; public class SpringCodegenTest { @@ -722,5 +723,45 @@ public void shouldGenerateDefaultValueForEnumRequestParameter() throws IOExcepti assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/GetApi.java"), "@RequestParam(value = \"testParameter1\", required = false, defaultValue = \"BAR\")", "@RequestParam(value = \"TestParameter2\", required = false, defaultValue = \"BAR\")"); + + } + + /**define the destinationFilename*/ + private final static String DESTINATIONFILE = "OpenAPIDocumentationConfig.java"; + /**define the templateFile*/ + private final static String TEMPLATEFILE = "openapiDocumentationConfig.mustache"; + + /** + * test whether OpenAPIDocumentationConfig.java is generated + * fix issue #10287 + */ + @Test + public void testConfigFileGeneration() { + + final SpringCodegen codegen = new SpringCodegen(); + + codegen.additionalProperties().put(SpringCodegen.INTERFACE_ONLY, false); + codegen.additionalProperties().put(SpringCodegen.SPRING_CLOUD_LIBRARY, "spring-cloud"); + codegen.additionalProperties().put(SpringCodegen.OPENAPI_DOCKET_CONFIG, true); + codegen.additionalProperties().put(SpringCodegen.REACTIVE, false); + codegen.additionalProperties().put(SpringCodegen.API_FIRST, false); + + codegen.processOpts(); + final List supList = codegen.supportingFiles(); + String tmpFile; + String desFile; + boolean flag = false; + for (final SupportingFile s : supList) { + tmpFile = s.getTemplateFile(); + desFile = s.getDestinationFilename(); + + if (TEMPLATEFILE.equals(tmpFile)) { + flag = true; + assertEquals(desFile, DESTINATIONFILE); + } + } + if(!flag){ + fail("OpenAPIDocumentationConfig.java not generated"); + } } } diff --git a/samples/server/petstore/spring-mvc-default-value/.openapi-generator/FILES b/samples/server/petstore/spring-mvc-default-value/.openapi-generator/FILES index e9684d579483..3522987f15f9 100644 --- a/samples/server/petstore/spring-mvc-default-value/.openapi-generator/FILES +++ b/samples/server/petstore/spring-mvc-default-value/.openapi-generator/FILES @@ -8,6 +8,6 @@ src/main/java/org/openapitools/api/TestHeadersApiController.java src/main/java/org/openapitools/api/TestQueryParamsApi.java src/main/java/org/openapitools/api/TestQueryParamsApiController.java src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/model/TestResponse.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/resources/openapi.yaml b/samples/server/petstore/spring-mvc-default-value/src/main/resources/openapi.yaml new file mode 100644 index 000000000000..bd7100d9b552 --- /dev/null +++ b/samples/server/petstore/spring-mvc-default-value/src/main/resources/openapi.yaml @@ -0,0 +1,170 @@ +openapi: 3.0.1 +info: + description: desc + title: toto + version: 1.0.0 +servers: +- description: / + url: / +tags: +- description: verify-default-value + name: verify-default-value +paths: + /test-headers: + get: + description: desc + operationId: headersTest + parameters: + - explode: false + in: header + name: headerNumber + required: false + schema: + default: 11.2 + type: number + style: simple + - explode: false + in: header + name: headerString + required: false + schema: + default: qwerty + type: string + style: simple + - explode: false + in: header + name: headerStringWrapped + required: false + schema: + default: qwerty + type: string + style: simple + - explode: false + in: header + name: headerStringQuotes + required: false + schema: + default: qwerty"with quotes" test + type: string + style: simple + - explode: false + in: header + name: headerStringQuotesWrapped + required: false + schema: + default: qwerty"with quotes" test + type: string + style: simple + - explode: false + in: header + name: headerBoolean + required: false + schema: + default: true + type: boolean + style: simple + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/TestResponse' + description: default response + summary: test headers + tags: + - verify-default-value + x-accepts: application/json + x-tags: + - tag: verify-default-value + /test-query-params: + get: + description: desc + operationId: queryParamsTest + parameters: + - explode: true + in: query + name: queryNumber + required: false + schema: + default: 11.2 + type: number + style: form + - explode: true + in: query + name: queryString + required: false + schema: + default: qwerty + type: string + style: form + - explode: true + in: query + name: queryStringWrapped + required: false + schema: + default: qwerty + type: string + style: form + - explode: true + in: query + name: queryStringQuotes + required: false + schema: + default: qwerty"with quotes" test + type: string + style: form + - explode: true + in: query + name: queryStringQuotesWrapped + required: false + schema: + default: qwerty"with quotes" test + type: string + style: form + - explode: true + in: query + name: queryBoolean + required: false + schema: + default: true + type: boolean + style: form + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/TestResponse' + description: default response + summary: test query params + tags: + - verify-default-value + x-accepts: application/json + x-tags: + - tag: verify-default-value +components: + schemas: + TestResponse: + example: + numberField: 6.027456183070403 + booleanField: true + id: 0 + stringField: asd + properties: + id: + type: integer + stringField: + default: asd + type: string + numberField: + default: 11 + type: number + booleanField: + default: true + type: boolean + required: + - booleanField + - id + - numberField + - stringField + type: object diff --git a/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/FILES b/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/FILES index 4b0ad04efe42..830caed1ff1e 100644 --- a/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/FILES +++ b/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/FILES @@ -14,7 +14,6 @@ src/main/java/org/openapitools/api/StoreApiController.java src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java src/main/java/org/openapitools/configuration/RFC3339DateFormat.java src/main/java/org/openapitools/configuration/WebApplication.java @@ -66,3 +65,4 @@ src/main/java/org/openapitools/model/TypeHolderExample.java src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/resources/openapi.yaml b/samples/server/petstore/spring-mvc-j8-async/src/main/resources/openapi.yaml new file mode 100644 index 000000000000..d6386dc39bf4 --- /dev/null +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/resources/openapi.yaml @@ -0,0 +1,2264 @@ +openapi: 3.0.1 +info: + description: 'This spec is mainly for testing Petstore server and contains fake + endpoints, models. Please do not use this for any other purpose. Special characters: + " \' + 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:80/v2 +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /pet: + post: + operationId: addPet + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + responses: + "200": + content: {} + description: successful operation + "405": + content: {} + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: pet + 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 + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + "405": + content: {} + description: Validation exception + security: + - petstore_auth: + - 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 + x-tags: + - tag: pet + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + content: {} + description: Invalid status value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + description: successful operation + "400": + content: {} + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + /pet/{petId}: + delete: + operationId: deletePet + parameters: + - in: header + name: api_key + schema: + type: string + - description: Pet id to delete + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + post: + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + responses: + "405": + content: {} + description: Invalid input + 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 + x-tags: + - tag: pet + /pet/{petId}/uploadImage: + post: + operationId: uploadFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + x-contentType: multipart/form-data + x-accepts: application/json + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + 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 + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + in: path + name: order_id + required: true + schema: + type: string + responses: + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Delete purchase order by ID + 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 + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Create user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithArray: + post: + operationId: createUsersWithArrayInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithList: + post: + operationId: createUsersWithListInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/login: + get: + operationId: loginUser + parameters: + - description: The user name for login + in: query + name: username + required: true + schema: + type: string + - description: The password for login in clear text + in: query + name: password + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + format: int32 + type: integer + X-Expires-After: + description: date in UTC when token expires + schema: + format: date-time + type: string + "400": + content: {} + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/logout: + get: + operationId: logoutUser + responses: + default: + content: {} + description: successful operation + summary: Logs out current logged in user session + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + 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 + x-tags: + - tag: user + get: + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + in: path + name: username + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + summary: Get user by user name + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + in: path + name: username + required: true + schema: + type: string + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + content: {} + description: Invalid user supplied + "404": + content: {} + description: User not found + summary: Updated user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + 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 + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + in: header + name: enum_header_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (string array) + explode: false + in: query + name: enum_query_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + in: query + name: enum_query_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (double) + in: query + name: enum_query_integer + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + - description: Query parameter enum test (double) + in: query + name: enum_query_double + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + responses: + "400": + content: {} + description: Invalid request + "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: + description: To test "client" model + operationId: testClientModel + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: fake + post: + description: |- + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + required: true + responses: + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + security: + - http_basic_test: [] + 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: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/jsonFormData: + get: + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + required: true + responses: + "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: + post: + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "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: + put: + operationId: testBodyWithQueryParams + parameters: + - in: query + name: query + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + 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/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: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + x-codegen-request-body-name: body + x-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`. + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $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-parameters: + 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: + post: + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + 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 + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + uniqueItems: true + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + $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: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + type: object + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + 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 + 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: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_string: + 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: + 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: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + type: string + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + TypeHolderDefault: + properties: + string_item: + default: what + type: string + number_item: + type: number + integer_item: + type: integer + bool_item: + default: true + type: boolean + array_item: + items: + type: integer + type: array + required: + - array_item + - bool_item + - integer_item + - number_item + - string_item + type: object + TypeHolderExample: + 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 + type: object + XmlItem: + properties: + attribute_string: + example: string + type: string + xml: + attribute: true + attribute_number: + example: 1.234 + type: number + xml: + attribute: true + attribute_integer: + example: -2 + type: integer + xml: + attribute: true + attribute_boolean: + example: true + type: boolean + xml: + attribute: true + wrapped_array: + items: + type: integer + type: array + xml: + wrapped: true + name_string: + example: string + type: string + xml: + name: xml_name_string + name_number: + example: 1.234 + type: number + xml: + name: xml_name_number + name_integer: + example: -2 + type: integer + xml: + name: xml_name_integer + name_boolean: + example: true + type: boolean + xml: + name: xml_name_boolean + name_array: + items: + type: integer + xml: + name: xml_name_array_item + type: array + name_wrapped_array: + items: + type: integer + xml: + name: xml_name_wrapped_array_item + type: array + xml: + name: xml_name_wrapped_array + wrapped: true + prefix_string: + example: string + type: string + xml: + prefix: ab + prefix_number: + example: 1.234 + type: number + xml: + prefix: cd + prefix_integer: + example: -2 + type: integer + xml: + prefix: ef + prefix_boolean: + example: true + type: boolean + xml: + prefix: gh + prefix_array: + items: + type: integer + xml: + prefix: ij + type: array + prefix_wrapped_array: + items: + type: integer + xml: + prefix: mn + type: array + xml: + prefix: kl + wrapped: true + namespace_string: + example: string + type: string + xml: + namespace: http://a.com/schema + namespace_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + namespace_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + namespace_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + namespace_array: + items: + type: integer + xml: + namespace: http://e.com/schema + type: array + namespace_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + type: array + xml: + namespace: http://f.com/schema + wrapped: true + prefix_ns_string: + example: string + type: string + xml: + namespace: http://a.com/schema + prefix: a + prefix_ns_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + prefix: b + prefix_ns_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + prefix: c + prefix_ns_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + prefix: d + prefix_ns_array: + items: + type: integer + xml: + namespace: http://e.com/schema + prefix: e + type: array + prefix_ns_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + prefix: g + type: array + xml: + namespace: http://f.com/schema + prefix: f + wrapped: true + type: object + xml: + namespace: http://a.com/schema + prefix: pre + Dog_allOf: + properties: + breed: + type: string + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http +x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/FILES b/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/FILES index 4b0ad04efe42..830caed1ff1e 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/FILES +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/FILES @@ -14,7 +14,6 @@ src/main/java/org/openapitools/api/StoreApiController.java src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java src/main/java/org/openapitools/configuration/RFC3339DateFormat.java src/main/java/org/openapitools/configuration/WebApplication.java @@ -66,3 +65,4 @@ src/main/java/org/openapitools/model/TypeHolderExample.java src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/resources/openapi.yaml b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/resources/openapi.yaml new file mode 100644 index 000000000000..d6386dc39bf4 --- /dev/null +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/resources/openapi.yaml @@ -0,0 +1,2264 @@ +openapi: 3.0.1 +info: + description: 'This spec is mainly for testing Petstore server and contains fake + endpoints, models. Please do not use this for any other purpose. Special characters: + " \' + 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:80/v2 +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /pet: + post: + operationId: addPet + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + responses: + "200": + content: {} + description: successful operation + "405": + content: {} + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: pet + 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 + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + "405": + content: {} + description: Validation exception + security: + - petstore_auth: + - 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 + x-tags: + - tag: pet + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + content: {} + description: Invalid status value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + description: successful operation + "400": + content: {} + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + /pet/{petId}: + delete: + operationId: deletePet + parameters: + - in: header + name: api_key + schema: + type: string + - description: Pet id to delete + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + post: + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + responses: + "405": + content: {} + description: Invalid input + 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 + x-tags: + - tag: pet + /pet/{petId}/uploadImage: + post: + operationId: uploadFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + x-contentType: multipart/form-data + x-accepts: application/json + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + 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 + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + in: path + name: order_id + required: true + schema: + type: string + responses: + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Delete purchase order by ID + 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 + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Create user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithArray: + post: + operationId: createUsersWithArrayInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithList: + post: + operationId: createUsersWithListInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/login: + get: + operationId: loginUser + parameters: + - description: The user name for login + in: query + name: username + required: true + schema: + type: string + - description: The password for login in clear text + in: query + name: password + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + format: int32 + type: integer + X-Expires-After: + description: date in UTC when token expires + schema: + format: date-time + type: string + "400": + content: {} + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/logout: + get: + operationId: logoutUser + responses: + default: + content: {} + description: successful operation + summary: Logs out current logged in user session + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + 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 + x-tags: + - tag: user + get: + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + in: path + name: username + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + summary: Get user by user name + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + in: path + name: username + required: true + schema: + type: string + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + content: {} + description: Invalid user supplied + "404": + content: {} + description: User not found + summary: Updated user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + 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 + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + in: header + name: enum_header_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (string array) + explode: false + in: query + name: enum_query_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + in: query + name: enum_query_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (double) + in: query + name: enum_query_integer + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + - description: Query parameter enum test (double) + in: query + name: enum_query_double + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + responses: + "400": + content: {} + description: Invalid request + "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: + description: To test "client" model + operationId: testClientModel + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: fake + post: + description: |- + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + required: true + responses: + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + security: + - http_basic_test: [] + 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: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/jsonFormData: + get: + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + required: true + responses: + "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: + post: + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "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: + put: + operationId: testBodyWithQueryParams + parameters: + - in: query + name: query + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + 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/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: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + x-codegen-request-body-name: body + x-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`. + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $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-parameters: + 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: + post: + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + 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 + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + uniqueItems: true + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + $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: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + type: object + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + 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 + 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: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_string: + 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: + 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: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + type: string + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + TypeHolderDefault: + properties: + string_item: + default: what + type: string + number_item: + type: number + integer_item: + type: integer + bool_item: + default: true + type: boolean + array_item: + items: + type: integer + type: array + required: + - array_item + - bool_item + - integer_item + - number_item + - string_item + type: object + TypeHolderExample: + 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 + type: object + XmlItem: + properties: + attribute_string: + example: string + type: string + xml: + attribute: true + attribute_number: + example: 1.234 + type: number + xml: + attribute: true + attribute_integer: + example: -2 + type: integer + xml: + attribute: true + attribute_boolean: + example: true + type: boolean + xml: + attribute: true + wrapped_array: + items: + type: integer + type: array + xml: + wrapped: true + name_string: + example: string + type: string + xml: + name: xml_name_string + name_number: + example: 1.234 + type: number + xml: + name: xml_name_number + name_integer: + example: -2 + type: integer + xml: + name: xml_name_integer + name_boolean: + example: true + type: boolean + xml: + name: xml_name_boolean + name_array: + items: + type: integer + xml: + name: xml_name_array_item + type: array + name_wrapped_array: + items: + type: integer + xml: + name: xml_name_wrapped_array_item + type: array + xml: + name: xml_name_wrapped_array + wrapped: true + prefix_string: + example: string + type: string + xml: + prefix: ab + prefix_number: + example: 1.234 + type: number + xml: + prefix: cd + prefix_integer: + example: -2 + type: integer + xml: + prefix: ef + prefix_boolean: + example: true + type: boolean + xml: + prefix: gh + prefix_array: + items: + type: integer + xml: + prefix: ij + type: array + prefix_wrapped_array: + items: + type: integer + xml: + prefix: mn + type: array + xml: + prefix: kl + wrapped: true + namespace_string: + example: string + type: string + xml: + namespace: http://a.com/schema + namespace_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + namespace_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + namespace_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + namespace_array: + items: + type: integer + xml: + namespace: http://e.com/schema + type: array + namespace_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + type: array + xml: + namespace: http://f.com/schema + wrapped: true + prefix_ns_string: + example: string + type: string + xml: + namespace: http://a.com/schema + prefix: a + prefix_ns_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + prefix: b + prefix_ns_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + prefix: c + prefix_ns_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + prefix: d + prefix_ns_array: + items: + type: integer + xml: + namespace: http://e.com/schema + prefix: e + type: array + prefix_ns_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + prefix: g + type: array + xml: + namespace: http://f.com/schema + prefix: f + wrapped: true + type: object + xml: + namespace: http://a.com/schema + prefix: pre + Dog_allOf: + properties: + breed: + type: string + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http +x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/spring-mvc-no-nullable/.openapi-generator/FILES b/samples/server/petstore/spring-mvc-no-nullable/.openapi-generator/FILES index 4b0ad04efe42..830caed1ff1e 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/.openapi-generator/FILES +++ b/samples/server/petstore/spring-mvc-no-nullable/.openapi-generator/FILES @@ -14,7 +14,6 @@ src/main/java/org/openapitools/api/StoreApiController.java src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java src/main/java/org/openapitools/configuration/RFC3339DateFormat.java src/main/java/org/openapitools/configuration/WebApplication.java @@ -66,3 +65,4 @@ src/main/java/org/openapitools/model/TypeHolderExample.java src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/resources/openapi.yaml b/samples/server/petstore/spring-mvc-no-nullable/src/main/resources/openapi.yaml new file mode 100644 index 000000000000..d6386dc39bf4 --- /dev/null +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/resources/openapi.yaml @@ -0,0 +1,2264 @@ +openapi: 3.0.1 +info: + description: 'This spec is mainly for testing Petstore server and contains fake + endpoints, models. Please do not use this for any other purpose. Special characters: + " \' + 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:80/v2 +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /pet: + post: + operationId: addPet + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + responses: + "200": + content: {} + description: successful operation + "405": + content: {} + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: pet + 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 + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + "405": + content: {} + description: Validation exception + security: + - petstore_auth: + - 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 + x-tags: + - tag: pet + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + content: {} + description: Invalid status value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + description: successful operation + "400": + content: {} + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + /pet/{petId}: + delete: + operationId: deletePet + parameters: + - in: header + name: api_key + schema: + type: string + - description: Pet id to delete + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + post: + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + responses: + "405": + content: {} + description: Invalid input + 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 + x-tags: + - tag: pet + /pet/{petId}/uploadImage: + post: + operationId: uploadFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + x-contentType: multipart/form-data + x-accepts: application/json + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + 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 + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + in: path + name: order_id + required: true + schema: + type: string + responses: + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Delete purchase order by ID + 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 + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Create user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithArray: + post: + operationId: createUsersWithArrayInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithList: + post: + operationId: createUsersWithListInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/login: + get: + operationId: loginUser + parameters: + - description: The user name for login + in: query + name: username + required: true + schema: + type: string + - description: The password for login in clear text + in: query + name: password + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + format: int32 + type: integer + X-Expires-After: + description: date in UTC when token expires + schema: + format: date-time + type: string + "400": + content: {} + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/logout: + get: + operationId: logoutUser + responses: + default: + content: {} + description: successful operation + summary: Logs out current logged in user session + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + 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 + x-tags: + - tag: user + get: + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + in: path + name: username + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + summary: Get user by user name + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + in: path + name: username + required: true + schema: + type: string + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + content: {} + description: Invalid user supplied + "404": + content: {} + description: User not found + summary: Updated user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + 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 + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + in: header + name: enum_header_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (string array) + explode: false + in: query + name: enum_query_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + in: query + name: enum_query_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (double) + in: query + name: enum_query_integer + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + - description: Query parameter enum test (double) + in: query + name: enum_query_double + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + responses: + "400": + content: {} + description: Invalid request + "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: + description: To test "client" model + operationId: testClientModel + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: fake + post: + description: |- + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + required: true + responses: + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + security: + - http_basic_test: [] + 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: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/jsonFormData: + get: + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + required: true + responses: + "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: + post: + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "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: + put: + operationId: testBodyWithQueryParams + parameters: + - in: query + name: query + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + 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/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: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + x-codegen-request-body-name: body + x-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`. + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $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-parameters: + 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: + post: + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + 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 + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + uniqueItems: true + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + $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: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + type: object + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + 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 + 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: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_string: + 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: + 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: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + type: string + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + TypeHolderDefault: + properties: + string_item: + default: what + type: string + number_item: + type: number + integer_item: + type: integer + bool_item: + default: true + type: boolean + array_item: + items: + type: integer + type: array + required: + - array_item + - bool_item + - integer_item + - number_item + - string_item + type: object + TypeHolderExample: + 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 + type: object + XmlItem: + properties: + attribute_string: + example: string + type: string + xml: + attribute: true + attribute_number: + example: 1.234 + type: number + xml: + attribute: true + attribute_integer: + example: -2 + type: integer + xml: + attribute: true + attribute_boolean: + example: true + type: boolean + xml: + attribute: true + wrapped_array: + items: + type: integer + type: array + xml: + wrapped: true + name_string: + example: string + type: string + xml: + name: xml_name_string + name_number: + example: 1.234 + type: number + xml: + name: xml_name_number + name_integer: + example: -2 + type: integer + xml: + name: xml_name_integer + name_boolean: + example: true + type: boolean + xml: + name: xml_name_boolean + name_array: + items: + type: integer + xml: + name: xml_name_array_item + type: array + name_wrapped_array: + items: + type: integer + xml: + name: xml_name_wrapped_array_item + type: array + xml: + name: xml_name_wrapped_array + wrapped: true + prefix_string: + example: string + type: string + xml: + prefix: ab + prefix_number: + example: 1.234 + type: number + xml: + prefix: cd + prefix_integer: + example: -2 + type: integer + xml: + prefix: ef + prefix_boolean: + example: true + type: boolean + xml: + prefix: gh + prefix_array: + items: + type: integer + xml: + prefix: ij + type: array + prefix_wrapped_array: + items: + type: integer + xml: + prefix: mn + type: array + xml: + prefix: kl + wrapped: true + namespace_string: + example: string + type: string + xml: + namespace: http://a.com/schema + namespace_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + namespace_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + namespace_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + namespace_array: + items: + type: integer + xml: + namespace: http://e.com/schema + type: array + namespace_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + type: array + xml: + namespace: http://f.com/schema + wrapped: true + prefix_ns_string: + example: string + type: string + xml: + namespace: http://a.com/schema + prefix: a + prefix_ns_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + prefix: b + prefix_ns_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + prefix: c + prefix_ns_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + prefix: d + prefix_ns_array: + items: + type: integer + xml: + namespace: http://e.com/schema + prefix: e + type: array + prefix_ns_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + prefix: g + type: array + xml: + namespace: http://f.com/schema + prefix: f + wrapped: true + type: object + xml: + namespace: http://a.com/schema + prefix: pre + Dog_allOf: + properties: + breed: + type: string + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http +x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator/FILES b/samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator/FILES index a6fa9fcb33b6..42cbca1ab186 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator/FILES +++ b/samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator/FILES @@ -14,7 +14,6 @@ src/main/java/org/openapitools/api/StoreApiController.java src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java src/main/java/org/openapitools/configuration/RFC3339DateFormat.java src/main/java/org/openapitools/configuration/WebApplication.java @@ -64,3 +63,4 @@ src/main/java/org/openapitools/model/TypeHolderExample.java src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/resources/openapi.yaml b/samples/server/petstore/spring-mvc-spring-pageable/src/main/resources/openapi.yaml new file mode 100644 index 000000000000..1cd65b8e95d4 --- /dev/null +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/resources/openapi.yaml @@ -0,0 +1,2248 @@ +openapi: 3.0.1 +info: + description: 'This spec is mainly for testing Petstore server and contains fake + endpoints, models. Please do not use this for any other purpose. Special characters: + " \' + license: + name: Apache-2.0 + url: http://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +servers: +- url: http://petstore.swagger.io:80/v2 +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /pet: + post: + operationId: addPet + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + responses: + "200": + content: {} + description: successful operation + "405": + content: {} + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: pet + 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 + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + "405": + content: {} + description: Validation exception + security: + - petstore_auth: + - 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 + x-tags: + - tag: pet + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + content: {} + description: Invalid status value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + x-spring-paginated: true + x-accepts: application/json + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + content: {} + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-spring-paginated: true + x-accepts: application/json + x-tags: + - tag: pet + /pet/{petId}: + delete: + operationId: deletePet + parameters: + - in: header + name: api_key + schema: + type: string + - description: Pet id to delete + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + post: + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + responses: + "405": + content: {} + description: Invalid input + 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 + x-tags: + - tag: pet + /pet/{petId}/uploadImage: + post: + operationId: uploadFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + x-contentType: multipart/form-data + x-accepts: application/json + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + 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 + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + in: path + name: order_id + required: true + schema: + type: string + responses: + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Delete purchase order by ID + 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 + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Create user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithArray: + post: + operationId: createUsersWithArrayInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithList: + post: + operationId: createUsersWithListInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/login: + get: + operationId: loginUser + parameters: + - description: The user name for login + in: query + name: username + required: true + schema: + type: string + - description: The password for login in clear text + in: query + name: password + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + format: int32 + type: integer + X-Expires-After: + description: date in UTC when token expires + schema: + format: date-time + type: string + "400": + content: {} + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/logout: + get: + operationId: logoutUser + responses: + default: + content: {} + description: successful operation + summary: Logs out current logged in user session + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + 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 + x-tags: + - tag: user + get: + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + in: path + name: username + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + summary: Get user by user name + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + in: path + name: username + required: true + schema: + type: string + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + content: {} + description: Invalid user supplied + "404": + content: {} + description: User not found + summary: Updated user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + 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 + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + in: header + name: enum_header_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (string array) + explode: false + in: query + name: enum_query_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + in: query + name: enum_query_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (double) + in: query + name: enum_query_integer + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + - description: Query parameter enum test (double) + in: query + name: enum_query_double + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + responses: + "400": + content: {} + description: Invalid request + "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: + description: To test "client" model + operationId: testClientModel + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: fake + post: + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + required: true + responses: + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + security: + - http_basic_test: [] + 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: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/jsonFormData: + get: + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + required: true + responses: + "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: + post: + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "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: + put: + operationId: testBodyWithQueryParams + parameters: + - in: query + name: query + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + 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/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: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + x-codegen-request-body-name: body + x-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`. + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $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-parameters: + 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: + post: + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + 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 + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + $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: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + type: object + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + 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' + 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: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_string: + 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: + 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: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + type: string + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + TypeHolderDefault: + properties: + string_item: + default: what + type: string + number_item: + type: number + integer_item: + type: integer + bool_item: + default: true + type: boolean + array_item: + items: + type: integer + type: array + required: + - array_item + - bool_item + - integer_item + - number_item + - string_item + type: object + TypeHolderExample: + 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 + type: object + XmlItem: + properties: + attribute_string: + example: string + type: string + xml: + attribute: true + attribute_number: + example: 1.234 + type: number + xml: + attribute: true + attribute_integer: + example: -2 + type: integer + xml: + attribute: true + attribute_boolean: + example: true + type: boolean + xml: + attribute: true + wrapped_array: + items: + type: integer + type: array + xml: + wrapped: true + name_string: + example: string + type: string + xml: + name: xml_name_string + name_number: + example: 1.234 + type: number + xml: + name: xml_name_number + name_integer: + example: -2 + type: integer + xml: + name: xml_name_integer + name_boolean: + example: true + type: boolean + xml: + name: xml_name_boolean + name_array: + items: + type: integer + xml: + name: xml_name_array_item + type: array + name_wrapped_array: + items: + type: integer + xml: + name: xml_name_wrapped_array_item + type: array + xml: + name: xml_name_wrapped_array + wrapped: true + prefix_string: + example: string + type: string + xml: + prefix: ab + prefix_number: + example: 1.234 + type: number + xml: + prefix: cd + prefix_integer: + example: -2 + type: integer + xml: + prefix: ef + prefix_boolean: + example: true + type: boolean + xml: + prefix: gh + prefix_array: + items: + type: integer + xml: + prefix: ij + type: array + prefix_wrapped_array: + items: + type: integer + xml: + prefix: mn + type: array + xml: + prefix: kl + wrapped: true + namespace_string: + example: string + type: string + xml: + namespace: http://a.com/schema + namespace_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + namespace_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + namespace_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + namespace_array: + items: + type: integer + xml: + namespace: http://e.com/schema + type: array + namespace_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + type: array + xml: + namespace: http://f.com/schema + wrapped: true + prefix_ns_string: + example: string + type: string + xml: + namespace: http://a.com/schema + prefix: a + prefix_ns_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + prefix: b + prefix_ns_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + prefix: c + prefix_ns_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + prefix: d + prefix_ns_array: + items: + type: integer + xml: + namespace: http://e.com/schema + prefix: e + type: array + prefix_ns_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + prefix: g + type: array + xml: + namespace: http://f.com/schema + prefix: f + wrapped: true + type: object + xml: + namespace: http://a.com/schema + prefix: pre + Dog_allOf: + properties: + breed: + type: string + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http +x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/spring-mvc/.openapi-generator/FILES b/samples/server/petstore/spring-mvc/.openapi-generator/FILES index 4b0ad04efe42..830caed1ff1e 100644 --- a/samples/server/petstore/spring-mvc/.openapi-generator/FILES +++ b/samples/server/petstore/spring-mvc/.openapi-generator/FILES @@ -14,7 +14,6 @@ src/main/java/org/openapitools/api/StoreApiController.java src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java src/main/java/org/openapitools/configuration/RFC3339DateFormat.java src/main/java/org/openapitools/configuration/WebApplication.java @@ -66,3 +65,4 @@ src/main/java/org/openapitools/model/TypeHolderExample.java src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/spring-mvc/src/main/resources/openapi.yaml b/samples/server/petstore/spring-mvc/src/main/resources/openapi.yaml new file mode 100644 index 000000000000..d6386dc39bf4 --- /dev/null +++ b/samples/server/petstore/spring-mvc/src/main/resources/openapi.yaml @@ -0,0 +1,2264 @@ +openapi: 3.0.1 +info: + description: 'This spec is mainly for testing Petstore server and contains fake + endpoints, models. Please do not use this for any other purpose. Special characters: + " \' + 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:80/v2 +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /pet: + post: + operationId: addPet + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + responses: + "200": + content: {} + description: successful operation + "405": + content: {} + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: pet + 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 + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + "405": + content: {} + description: Validation exception + security: + - petstore_auth: + - 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 + x-tags: + - tag: pet + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + content: {} + description: Invalid status value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + description: successful operation + "400": + content: {} + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + /pet/{petId}: + delete: + operationId: deletePet + parameters: + - in: header + name: api_key + schema: + type: string + - description: Pet id to delete + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + post: + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + responses: + "405": + content: {} + description: Invalid input + 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 + x-tags: + - tag: pet + /pet/{petId}/uploadImage: + post: + operationId: uploadFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + x-contentType: multipart/form-data + x-accepts: application/json + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + 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 + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + in: path + name: order_id + required: true + schema: + type: string + responses: + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Delete purchase order by ID + 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 + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Create user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithArray: + post: + operationId: createUsersWithArrayInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithList: + post: + operationId: createUsersWithListInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/login: + get: + operationId: loginUser + parameters: + - description: The user name for login + in: query + name: username + required: true + schema: + type: string + - description: The password for login in clear text + in: query + name: password + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + format: int32 + type: integer + X-Expires-After: + description: date in UTC when token expires + schema: + format: date-time + type: string + "400": + content: {} + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/logout: + get: + operationId: logoutUser + responses: + default: + content: {} + description: successful operation + summary: Logs out current logged in user session + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + 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 + x-tags: + - tag: user + get: + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + in: path + name: username + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + summary: Get user by user name + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + in: path + name: username + required: true + schema: + type: string + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + content: {} + description: Invalid user supplied + "404": + content: {} + description: User not found + summary: Updated user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + 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 + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + in: header + name: enum_header_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (string array) + explode: false + in: query + name: enum_query_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + in: query + name: enum_query_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (double) + in: query + name: enum_query_integer + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + - description: Query parameter enum test (double) + in: query + name: enum_query_double + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + responses: + "400": + content: {} + description: Invalid request + "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: + description: To test "client" model + operationId: testClientModel + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: fake + post: + description: |- + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + required: true + responses: + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + security: + - http_basic_test: [] + 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: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/jsonFormData: + get: + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + required: true + responses: + "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: + post: + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "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: + put: + operationId: testBodyWithQueryParams + parameters: + - in: query + name: query + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + 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/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: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + x-codegen-request-body-name: body + x-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`. + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $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-parameters: + 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: + post: + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + 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 + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + uniqueItems: true + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + $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: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + type: object + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + 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 + 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: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_string: + 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: + 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: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + type: string + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + TypeHolderDefault: + properties: + string_item: + default: what + type: string + number_item: + type: number + integer_item: + type: integer + bool_item: + default: true + type: boolean + array_item: + items: + type: integer + type: array + required: + - array_item + - bool_item + - integer_item + - number_item + - string_item + type: object + TypeHolderExample: + 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 + type: object + XmlItem: + properties: + attribute_string: + example: string + type: string + xml: + attribute: true + attribute_number: + example: 1.234 + type: number + xml: + attribute: true + attribute_integer: + example: -2 + type: integer + xml: + attribute: true + attribute_boolean: + example: true + type: boolean + xml: + attribute: true + wrapped_array: + items: + type: integer + type: array + xml: + wrapped: true + name_string: + example: string + type: string + xml: + name: xml_name_string + name_number: + example: 1.234 + type: number + xml: + name: xml_name_number + name_integer: + example: -2 + type: integer + xml: + name: xml_name_integer + name_boolean: + example: true + type: boolean + xml: + name: xml_name_boolean + name_array: + items: + type: integer + xml: + name: xml_name_array_item + type: array + name_wrapped_array: + items: + type: integer + xml: + name: xml_name_wrapped_array_item + type: array + xml: + name: xml_name_wrapped_array + wrapped: true + prefix_string: + example: string + type: string + xml: + prefix: ab + prefix_number: + example: 1.234 + type: number + xml: + prefix: cd + prefix_integer: + example: -2 + type: integer + xml: + prefix: ef + prefix_boolean: + example: true + type: boolean + xml: + prefix: gh + prefix_array: + items: + type: integer + xml: + prefix: ij + type: array + prefix_wrapped_array: + items: + type: integer + xml: + prefix: mn + type: array + xml: + prefix: kl + wrapped: true + namespace_string: + example: string + type: string + xml: + namespace: http://a.com/schema + namespace_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + namespace_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + namespace_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + namespace_array: + items: + type: integer + xml: + namespace: http://e.com/schema + type: array + namespace_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + type: array + xml: + namespace: http://f.com/schema + wrapped: true + prefix_ns_string: + example: string + type: string + xml: + namespace: http://a.com/schema + prefix: a + prefix_ns_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + prefix: b + prefix_ns_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + prefix: c + prefix_ns_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + prefix: d + prefix_ns_array: + items: + type: integer + xml: + namespace: http://e.com/schema + prefix: e + type: array + prefix_ns_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + prefix: g + type: array + xml: + namespace: http://f.com/schema + prefix: f + wrapped: true + type: object + xml: + namespace: http://a.com/schema + prefix: pre + Dog_allOf: + properties: + breed: + type: string + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http +x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES b/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES index 4bb76c23b2a2..0616dc9030d3 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES @@ -18,7 +18,6 @@ src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/configuration/CustomInstantDeserializer.java src/main/java/org/openapitools/configuration/HomeController.java src/main/java/org/openapitools/configuration/JacksonConfiguration.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -66,3 +65,4 @@ src/main/java/org/openapitools/model/TypeHolderExample.java src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml new file mode 100644 index 000000000000..d6386dc39bf4 --- /dev/null +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml @@ -0,0 +1,2264 @@ +openapi: 3.0.1 +info: + description: 'This spec is mainly for testing Petstore server and contains fake + endpoints, models. Please do not use this for any other purpose. Special characters: + " \' + 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:80/v2 +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /pet: + post: + operationId: addPet + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + responses: + "200": + content: {} + description: successful operation + "405": + content: {} + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: pet + 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 + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + "405": + content: {} + description: Validation exception + security: + - petstore_auth: + - 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 + x-tags: + - tag: pet + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + content: {} + description: Invalid status value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + description: successful operation + "400": + content: {} + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + /pet/{petId}: + delete: + operationId: deletePet + parameters: + - in: header + name: api_key + schema: + type: string + - description: Pet id to delete + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + post: + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + responses: + "405": + content: {} + description: Invalid input + 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 + x-tags: + - tag: pet + /pet/{petId}/uploadImage: + post: + operationId: uploadFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + x-contentType: multipart/form-data + x-accepts: application/json + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + 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 + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + in: path + name: order_id + required: true + schema: + type: string + responses: + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Delete purchase order by ID + 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 + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Create user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithArray: + post: + operationId: createUsersWithArrayInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithList: + post: + operationId: createUsersWithListInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/login: + get: + operationId: loginUser + parameters: + - description: The user name for login + in: query + name: username + required: true + schema: + type: string + - description: The password for login in clear text + in: query + name: password + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + format: int32 + type: integer + X-Expires-After: + description: date in UTC when token expires + schema: + format: date-time + type: string + "400": + content: {} + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/logout: + get: + operationId: logoutUser + responses: + default: + content: {} + description: successful operation + summary: Logs out current logged in user session + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + 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 + x-tags: + - tag: user + get: + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + in: path + name: username + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + summary: Get user by user name + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + in: path + name: username + required: true + schema: + type: string + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + content: {} + description: Invalid user supplied + "404": + content: {} + description: User not found + summary: Updated user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + 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 + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + in: header + name: enum_header_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (string array) + explode: false + in: query + name: enum_query_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + in: query + name: enum_query_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (double) + in: query + name: enum_query_integer + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + - description: Query parameter enum test (double) + in: query + name: enum_query_double + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + responses: + "400": + content: {} + description: Invalid request + "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: + description: To test "client" model + operationId: testClientModel + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: fake + post: + description: |- + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + required: true + responses: + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + security: + - http_basic_test: [] + 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: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/jsonFormData: + get: + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + required: true + responses: + "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: + post: + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "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: + put: + operationId: testBodyWithQueryParams + parameters: + - in: query + name: query + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + 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/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: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + x-codegen-request-body-name: body + x-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`. + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $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-parameters: + 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: + post: + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + 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 + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + uniqueItems: true + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + $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: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + type: object + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + 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 + 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: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_string: + 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: + 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: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + type: string + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + TypeHolderDefault: + properties: + string_item: + default: what + type: string + number_item: + type: number + integer_item: + type: integer + bool_item: + default: true + type: boolean + array_item: + items: + type: integer + type: array + required: + - array_item + - bool_item + - integer_item + - number_item + - string_item + type: object + TypeHolderExample: + 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 + type: object + XmlItem: + properties: + attribute_string: + example: string + type: string + xml: + attribute: true + attribute_number: + example: 1.234 + type: number + xml: + attribute: true + attribute_integer: + example: -2 + type: integer + xml: + attribute: true + attribute_boolean: + example: true + type: boolean + xml: + attribute: true + wrapped_array: + items: + type: integer + type: array + xml: + wrapped: true + name_string: + example: string + type: string + xml: + name: xml_name_string + name_number: + example: 1.234 + type: number + xml: + name: xml_name_number + name_integer: + example: -2 + type: integer + xml: + name: xml_name_integer + name_boolean: + example: true + type: boolean + xml: + name: xml_name_boolean + name_array: + items: + type: integer + xml: + name: xml_name_array_item + type: array + name_wrapped_array: + items: + type: integer + xml: + name: xml_name_wrapped_array_item + type: array + xml: + name: xml_name_wrapped_array + wrapped: true + prefix_string: + example: string + type: string + xml: + prefix: ab + prefix_number: + example: 1.234 + type: number + xml: + prefix: cd + prefix_integer: + example: -2 + type: integer + xml: + prefix: ef + prefix_boolean: + example: true + type: boolean + xml: + prefix: gh + prefix_array: + items: + type: integer + xml: + prefix: ij + type: array + prefix_wrapped_array: + items: + type: integer + xml: + prefix: mn + type: array + xml: + prefix: kl + wrapped: true + namespace_string: + example: string + type: string + xml: + namespace: http://a.com/schema + namespace_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + namespace_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + namespace_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + namespace_array: + items: + type: integer + xml: + namespace: http://e.com/schema + type: array + namespace_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + type: array + xml: + namespace: http://f.com/schema + wrapped: true + prefix_ns_string: + example: string + type: string + xml: + namespace: http://a.com/schema + prefix: a + prefix_ns_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + prefix: b + prefix_ns_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + prefix: c + prefix_ns_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + prefix: d + prefix_ns_array: + items: + type: integer + xml: + namespace: http://e.com/schema + prefix: e + type: array + prefix_ns_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + prefix: g + type: array + xml: + namespace: http://f.com/schema + prefix: f + wrapped: true + type: object + xml: + namespace: http://a.com/schema + prefix: pre + Dog_allOf: + properties: + breed: + type: string + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http +x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/FILES b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/FILES index 61420a325e38..e4c32719b541 100644 --- a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/FILES @@ -16,7 +16,6 @@ src/main/java/org/openapitools/api/StoreApiController.java src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -64,3 +63,4 @@ src/main/java/org/openapitools/model/TypeHolderExample.java src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-beanvalidation/src/main/resources/openapi.yaml new file mode 100644 index 000000000000..d6386dc39bf4 --- /dev/null +++ b/samples/server/petstore/springboot-beanvalidation/src/main/resources/openapi.yaml @@ -0,0 +1,2264 @@ +openapi: 3.0.1 +info: + description: 'This spec is mainly for testing Petstore server and contains fake + endpoints, models. Please do not use this for any other purpose. Special characters: + " \' + 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:80/v2 +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /pet: + post: + operationId: addPet + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + responses: + "200": + content: {} + description: successful operation + "405": + content: {} + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: pet + 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 + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + "405": + content: {} + description: Validation exception + security: + - petstore_auth: + - 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 + x-tags: + - tag: pet + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + content: {} + description: Invalid status value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + description: successful operation + "400": + content: {} + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + /pet/{petId}: + delete: + operationId: deletePet + parameters: + - in: header + name: api_key + schema: + type: string + - description: Pet id to delete + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + post: + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + responses: + "405": + content: {} + description: Invalid input + 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 + x-tags: + - tag: pet + /pet/{petId}/uploadImage: + post: + operationId: uploadFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + x-contentType: multipart/form-data + x-accepts: application/json + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + 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 + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + in: path + name: order_id + required: true + schema: + type: string + responses: + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Delete purchase order by ID + 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 + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Create user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithArray: + post: + operationId: createUsersWithArrayInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithList: + post: + operationId: createUsersWithListInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/login: + get: + operationId: loginUser + parameters: + - description: The user name for login + in: query + name: username + required: true + schema: + type: string + - description: The password for login in clear text + in: query + name: password + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + format: int32 + type: integer + X-Expires-After: + description: date in UTC when token expires + schema: + format: date-time + type: string + "400": + content: {} + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/logout: + get: + operationId: logoutUser + responses: + default: + content: {} + description: successful operation + summary: Logs out current logged in user session + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + 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 + x-tags: + - tag: user + get: + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + in: path + name: username + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + summary: Get user by user name + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + in: path + name: username + required: true + schema: + type: string + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + content: {} + description: Invalid user supplied + "404": + content: {} + description: User not found + summary: Updated user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + 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 + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + in: header + name: enum_header_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (string array) + explode: false + in: query + name: enum_query_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + in: query + name: enum_query_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (double) + in: query + name: enum_query_integer + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + - description: Query parameter enum test (double) + in: query + name: enum_query_double + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + responses: + "400": + content: {} + description: Invalid request + "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: + description: To test "client" model + operationId: testClientModel + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: fake + post: + description: |- + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + required: true + responses: + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + security: + - http_basic_test: [] + 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: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/jsonFormData: + get: + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + required: true + responses: + "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: + post: + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "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: + put: + operationId: testBodyWithQueryParams + parameters: + - in: query + name: query + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + 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/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: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + x-codegen-request-body-name: body + x-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`. + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $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-parameters: + 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: + post: + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + 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 + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + uniqueItems: true + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + $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: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + type: object + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + 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 + 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: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_string: + 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: + 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: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + type: string + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + TypeHolderDefault: + properties: + string_item: + default: what + type: string + number_item: + type: number + integer_item: + type: integer + bool_item: + default: true + type: boolean + array_item: + items: + type: integer + type: array + required: + - array_item + - bool_item + - integer_item + - number_item + - string_item + type: object + TypeHolderExample: + 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 + type: object + XmlItem: + properties: + attribute_string: + example: string + type: string + xml: + attribute: true + attribute_number: + example: 1.234 + type: number + xml: + attribute: true + attribute_integer: + example: -2 + type: integer + xml: + attribute: true + attribute_boolean: + example: true + type: boolean + xml: + attribute: true + wrapped_array: + items: + type: integer + type: array + xml: + wrapped: true + name_string: + example: string + type: string + xml: + name: xml_name_string + name_number: + example: 1.234 + type: number + xml: + name: xml_name_number + name_integer: + example: -2 + type: integer + xml: + name: xml_name_integer + name_boolean: + example: true + type: boolean + xml: + name: xml_name_boolean + name_array: + items: + type: integer + xml: + name: xml_name_array_item + type: array + name_wrapped_array: + items: + type: integer + xml: + name: xml_name_wrapped_array_item + type: array + xml: + name: xml_name_wrapped_array + wrapped: true + prefix_string: + example: string + type: string + xml: + prefix: ab + prefix_number: + example: 1.234 + type: number + xml: + prefix: cd + prefix_integer: + example: -2 + type: integer + xml: + prefix: ef + prefix_boolean: + example: true + type: boolean + xml: + prefix: gh + prefix_array: + items: + type: integer + xml: + prefix: ij + type: array + prefix_wrapped_array: + items: + type: integer + xml: + prefix: mn + type: array + xml: + prefix: kl + wrapped: true + namespace_string: + example: string + type: string + xml: + namespace: http://a.com/schema + namespace_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + namespace_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + namespace_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + namespace_array: + items: + type: integer + xml: + namespace: http://e.com/schema + type: array + namespace_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + type: array + xml: + namespace: http://f.com/schema + wrapped: true + prefix_ns_string: + example: string + type: string + xml: + namespace: http://a.com/schema + prefix: a + prefix_ns_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + prefix: b + prefix_ns_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + prefix: c + prefix_ns_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + prefix: d + prefix_ns_array: + items: + type: integer + xml: + namespace: http://e.com/schema + prefix: e + type: array + prefix_ns_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + prefix: g + type: array + xml: + namespace: http://f.com/schema + prefix: f + wrapped: true + type: object + xml: + namespace: http://a.com/schema + prefix: pre + Dog_allOf: + properties: + breed: + type: string + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http +x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES index 8c36406da484..9df6c44a3213 100644 --- a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES @@ -22,7 +22,6 @@ src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/api/UserApiDelegate.java src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -70,3 +69,4 @@ src/main/java/org/openapitools/model/TypeHolderExample.java src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-delegate-j8/src/main/resources/openapi.yaml new file mode 100644 index 000000000000..d6386dc39bf4 --- /dev/null +++ b/samples/server/petstore/springboot-delegate-j8/src/main/resources/openapi.yaml @@ -0,0 +1,2264 @@ +openapi: 3.0.1 +info: + description: 'This spec is mainly for testing Petstore server and contains fake + endpoints, models. Please do not use this for any other purpose. Special characters: + " \' + 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:80/v2 +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /pet: + post: + operationId: addPet + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + responses: + "200": + content: {} + description: successful operation + "405": + content: {} + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: pet + 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 + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + "405": + content: {} + description: Validation exception + security: + - petstore_auth: + - 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 + x-tags: + - tag: pet + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + content: {} + description: Invalid status value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + description: successful operation + "400": + content: {} + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + /pet/{petId}: + delete: + operationId: deletePet + parameters: + - in: header + name: api_key + schema: + type: string + - description: Pet id to delete + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + post: + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + responses: + "405": + content: {} + description: Invalid input + 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 + x-tags: + - tag: pet + /pet/{petId}/uploadImage: + post: + operationId: uploadFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + x-contentType: multipart/form-data + x-accepts: application/json + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + 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 + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + in: path + name: order_id + required: true + schema: + type: string + responses: + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Delete purchase order by ID + 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 + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Create user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithArray: + post: + operationId: createUsersWithArrayInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithList: + post: + operationId: createUsersWithListInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/login: + get: + operationId: loginUser + parameters: + - description: The user name for login + in: query + name: username + required: true + schema: + type: string + - description: The password for login in clear text + in: query + name: password + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + format: int32 + type: integer + X-Expires-After: + description: date in UTC when token expires + schema: + format: date-time + type: string + "400": + content: {} + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/logout: + get: + operationId: logoutUser + responses: + default: + content: {} + description: successful operation + summary: Logs out current logged in user session + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + 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 + x-tags: + - tag: user + get: + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + in: path + name: username + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + summary: Get user by user name + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + in: path + name: username + required: true + schema: + type: string + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + content: {} + description: Invalid user supplied + "404": + content: {} + description: User not found + summary: Updated user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + 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 + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + in: header + name: enum_header_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (string array) + explode: false + in: query + name: enum_query_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + in: query + name: enum_query_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (double) + in: query + name: enum_query_integer + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + - description: Query parameter enum test (double) + in: query + name: enum_query_double + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + responses: + "400": + content: {} + description: Invalid request + "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: + description: To test "client" model + operationId: testClientModel + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: fake + post: + description: |- + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + required: true + responses: + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + security: + - http_basic_test: [] + 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: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/jsonFormData: + get: + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + required: true + responses: + "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: + post: + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "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: + put: + operationId: testBodyWithQueryParams + parameters: + - in: query + name: query + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + 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/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: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + x-codegen-request-body-name: body + x-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`. + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $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-parameters: + 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: + post: + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + 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 + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + uniqueItems: true + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + $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: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + type: object + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + 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 + 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: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_string: + 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: + 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: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + type: string + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + TypeHolderDefault: + properties: + string_item: + default: what + type: string + number_item: + type: number + integer_item: + type: integer + bool_item: + default: true + type: boolean + array_item: + items: + type: integer + type: array + required: + - array_item + - bool_item + - integer_item + - number_item + - string_item + type: object + TypeHolderExample: + 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 + type: object + XmlItem: + properties: + attribute_string: + example: string + type: string + xml: + attribute: true + attribute_number: + example: 1.234 + type: number + xml: + attribute: true + attribute_integer: + example: -2 + type: integer + xml: + attribute: true + attribute_boolean: + example: true + type: boolean + xml: + attribute: true + wrapped_array: + items: + type: integer + type: array + xml: + wrapped: true + name_string: + example: string + type: string + xml: + name: xml_name_string + name_number: + example: 1.234 + type: number + xml: + name: xml_name_number + name_integer: + example: -2 + type: integer + xml: + name: xml_name_integer + name_boolean: + example: true + type: boolean + xml: + name: xml_name_boolean + name_array: + items: + type: integer + xml: + name: xml_name_array_item + type: array + name_wrapped_array: + items: + type: integer + xml: + name: xml_name_wrapped_array_item + type: array + xml: + name: xml_name_wrapped_array + wrapped: true + prefix_string: + example: string + type: string + xml: + prefix: ab + prefix_number: + example: 1.234 + type: number + xml: + prefix: cd + prefix_integer: + example: -2 + type: integer + xml: + prefix: ef + prefix_boolean: + example: true + type: boolean + xml: + prefix: gh + prefix_array: + items: + type: integer + xml: + prefix: ij + type: array + prefix_wrapped_array: + items: + type: integer + xml: + prefix: mn + type: array + xml: + prefix: kl + wrapped: true + namespace_string: + example: string + type: string + xml: + namespace: http://a.com/schema + namespace_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + namespace_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + namespace_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + namespace_array: + items: + type: integer + xml: + namespace: http://e.com/schema + type: array + namespace_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + type: array + xml: + namespace: http://f.com/schema + wrapped: true + prefix_ns_string: + example: string + type: string + xml: + namespace: http://a.com/schema + prefix: a + prefix_ns_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + prefix: b + prefix_ns_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + prefix: c + prefix_ns_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + prefix: d + prefix_ns_array: + items: + type: integer + xml: + namespace: http://e.com/schema + prefix: e + type: array + prefix_ns_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + prefix: g + type: array + xml: + namespace: http://f.com/schema + prefix: f + wrapped: true + type: object + xml: + namespace: http://a.com/schema + prefix: pre + Dog_allOf: + properties: + breed: + type: string + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http +x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-delegate/.openapi-generator/FILES b/samples/server/petstore/springboot-delegate/.openapi-generator/FILES index 8c36406da484..9df6c44a3213 100644 --- a/samples/server/petstore/springboot-delegate/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-delegate/.openapi-generator/FILES @@ -22,7 +22,6 @@ src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/api/UserApiDelegate.java src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -70,3 +69,4 @@ src/main/java/org/openapitools/model/TypeHolderExample.java src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/springboot-delegate/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-delegate/src/main/resources/openapi.yaml new file mode 100644 index 000000000000..d6386dc39bf4 --- /dev/null +++ b/samples/server/petstore/springboot-delegate/src/main/resources/openapi.yaml @@ -0,0 +1,2264 @@ +openapi: 3.0.1 +info: + description: 'This spec is mainly for testing Petstore server and contains fake + endpoints, models. Please do not use this for any other purpose. Special characters: + " \' + 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:80/v2 +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /pet: + post: + operationId: addPet + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + responses: + "200": + content: {} + description: successful operation + "405": + content: {} + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: pet + 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 + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + "405": + content: {} + description: Validation exception + security: + - petstore_auth: + - 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 + x-tags: + - tag: pet + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + content: {} + description: Invalid status value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + description: successful operation + "400": + content: {} + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + /pet/{petId}: + delete: + operationId: deletePet + parameters: + - in: header + name: api_key + schema: + type: string + - description: Pet id to delete + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + post: + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + responses: + "405": + content: {} + description: Invalid input + 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 + x-tags: + - tag: pet + /pet/{petId}/uploadImage: + post: + operationId: uploadFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + x-contentType: multipart/form-data + x-accepts: application/json + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + 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 + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + in: path + name: order_id + required: true + schema: + type: string + responses: + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Delete purchase order by ID + 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 + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Create user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithArray: + post: + operationId: createUsersWithArrayInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithList: + post: + operationId: createUsersWithListInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/login: + get: + operationId: loginUser + parameters: + - description: The user name for login + in: query + name: username + required: true + schema: + type: string + - description: The password for login in clear text + in: query + name: password + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + format: int32 + type: integer + X-Expires-After: + description: date in UTC when token expires + schema: + format: date-time + type: string + "400": + content: {} + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/logout: + get: + operationId: logoutUser + responses: + default: + content: {} + description: successful operation + summary: Logs out current logged in user session + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + 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 + x-tags: + - tag: user + get: + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + in: path + name: username + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + summary: Get user by user name + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + in: path + name: username + required: true + schema: + type: string + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + content: {} + description: Invalid user supplied + "404": + content: {} + description: User not found + summary: Updated user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + 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 + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + in: header + name: enum_header_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (string array) + explode: false + in: query + name: enum_query_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + in: query + name: enum_query_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (double) + in: query + name: enum_query_integer + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + - description: Query parameter enum test (double) + in: query + name: enum_query_double + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + responses: + "400": + content: {} + description: Invalid request + "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: + description: To test "client" model + operationId: testClientModel + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: fake + post: + description: |- + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + required: true + responses: + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + security: + - http_basic_test: [] + 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: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/jsonFormData: + get: + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + required: true + responses: + "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: + post: + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "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: + put: + operationId: testBodyWithQueryParams + parameters: + - in: query + name: query + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + 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/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: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + x-codegen-request-body-name: body + x-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`. + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $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-parameters: + 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: + post: + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + 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 + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + uniqueItems: true + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + $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: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + type: object + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + 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 + 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: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_string: + 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: + 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: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + type: string + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + TypeHolderDefault: + properties: + string_item: + default: what + type: string + number_item: + type: number + integer_item: + type: integer + bool_item: + default: true + type: boolean + array_item: + items: + type: integer + type: array + required: + - array_item + - bool_item + - integer_item + - number_item + - string_item + type: object + TypeHolderExample: + 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 + type: object + XmlItem: + properties: + attribute_string: + example: string + type: string + xml: + attribute: true + attribute_number: + example: 1.234 + type: number + xml: + attribute: true + attribute_integer: + example: -2 + type: integer + xml: + attribute: true + attribute_boolean: + example: true + type: boolean + xml: + attribute: true + wrapped_array: + items: + type: integer + type: array + xml: + wrapped: true + name_string: + example: string + type: string + xml: + name: xml_name_string + name_number: + example: 1.234 + type: number + xml: + name: xml_name_number + name_integer: + example: -2 + type: integer + xml: + name: xml_name_integer + name_boolean: + example: true + type: boolean + xml: + name: xml_name_boolean + name_array: + items: + type: integer + xml: + name: xml_name_array_item + type: array + name_wrapped_array: + items: + type: integer + xml: + name: xml_name_wrapped_array_item + type: array + xml: + name: xml_name_wrapped_array + wrapped: true + prefix_string: + example: string + type: string + xml: + prefix: ab + prefix_number: + example: 1.234 + type: number + xml: + prefix: cd + prefix_integer: + example: -2 + type: integer + xml: + prefix: ef + prefix_boolean: + example: true + type: boolean + xml: + prefix: gh + prefix_array: + items: + type: integer + xml: + prefix: ij + type: array + prefix_wrapped_array: + items: + type: integer + xml: + prefix: mn + type: array + xml: + prefix: kl + wrapped: true + namespace_string: + example: string + type: string + xml: + namespace: http://a.com/schema + namespace_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + namespace_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + namespace_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + namespace_array: + items: + type: integer + xml: + namespace: http://e.com/schema + type: array + namespace_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + type: array + xml: + namespace: http://f.com/schema + wrapped: true + prefix_ns_string: + example: string + type: string + xml: + namespace: http://a.com/schema + prefix: a + prefix_ns_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + prefix: b + prefix_ns_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + prefix: c + prefix_ns_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + prefix: d + prefix_ns_array: + items: + type: integer + xml: + namespace: http://e.com/schema + prefix: e + type: array + prefix_ns_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + prefix: g + type: array + xml: + namespace: http://f.com/schema + prefix: f + wrapped: true + type: object + xml: + namespace: http://a.com/schema + prefix: pre + Dog_allOf: + properties: + breed: + type: string + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http +x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES index 61420a325e38..e4c32719b541 100644 --- a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES @@ -16,7 +16,6 @@ src/main/java/org/openapitools/api/StoreApiController.java src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -64,3 +63,4 @@ src/main/java/org/openapitools/model/TypeHolderExample.java src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml new file mode 100644 index 000000000000..d6386dc39bf4 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml @@ -0,0 +1,2264 @@ +openapi: 3.0.1 +info: + description: 'This spec is mainly for testing Petstore server and contains fake + endpoints, models. Please do not use this for any other purpose. Special characters: + " \' + 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:80/v2 +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /pet: + post: + operationId: addPet + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + responses: + "200": + content: {} + description: successful operation + "405": + content: {} + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: pet + 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 + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + "405": + content: {} + description: Validation exception + security: + - petstore_auth: + - 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 + x-tags: + - tag: pet + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + content: {} + description: Invalid status value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + description: successful operation + "400": + content: {} + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + /pet/{petId}: + delete: + operationId: deletePet + parameters: + - in: header + name: api_key + schema: + type: string + - description: Pet id to delete + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + post: + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + responses: + "405": + content: {} + description: Invalid input + 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 + x-tags: + - tag: pet + /pet/{petId}/uploadImage: + post: + operationId: uploadFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + x-contentType: multipart/form-data + x-accepts: application/json + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + 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 + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + in: path + name: order_id + required: true + schema: + type: string + responses: + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Delete purchase order by ID + 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 + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Create user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithArray: + post: + operationId: createUsersWithArrayInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithList: + post: + operationId: createUsersWithListInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/login: + get: + operationId: loginUser + parameters: + - description: The user name for login + in: query + name: username + required: true + schema: + type: string + - description: The password for login in clear text + in: query + name: password + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + format: int32 + type: integer + X-Expires-After: + description: date in UTC when token expires + schema: + format: date-time + type: string + "400": + content: {} + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/logout: + get: + operationId: logoutUser + responses: + default: + content: {} + description: successful operation + summary: Logs out current logged in user session + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + 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 + x-tags: + - tag: user + get: + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + in: path + name: username + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + summary: Get user by user name + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + in: path + name: username + required: true + schema: + type: string + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + content: {} + description: Invalid user supplied + "404": + content: {} + description: User not found + summary: Updated user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + 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 + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + in: header + name: enum_header_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (string array) + explode: false + in: query + name: enum_query_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + in: query + name: enum_query_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (double) + in: query + name: enum_query_integer + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + - description: Query parameter enum test (double) + in: query + name: enum_query_double + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + responses: + "400": + content: {} + description: Invalid request + "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: + description: To test "client" model + operationId: testClientModel + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: fake + post: + description: |- + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + required: true + responses: + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + security: + - http_basic_test: [] + 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: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/jsonFormData: + get: + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + required: true + responses: + "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: + post: + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "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: + put: + operationId: testBodyWithQueryParams + parameters: + - in: query + name: query + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + 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/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: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + x-codegen-request-body-name: body + x-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`. + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $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-parameters: + 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: + post: + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + 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 + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + uniqueItems: true + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + $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: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + type: object + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + 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 + 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: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_string: + 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: + 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: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + type: string + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + TypeHolderDefault: + properties: + string_item: + default: what + type: string + number_item: + type: number + integer_item: + type: integer + bool_item: + default: true + type: boolean + array_item: + items: + type: integer + type: array + required: + - array_item + - bool_item + - integer_item + - number_item + - string_item + type: object + TypeHolderExample: + 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 + type: object + XmlItem: + properties: + attribute_string: + example: string + type: string + xml: + attribute: true + attribute_number: + example: 1.234 + type: number + xml: + attribute: true + attribute_integer: + example: -2 + type: integer + xml: + attribute: true + attribute_boolean: + example: true + type: boolean + xml: + attribute: true + wrapped_array: + items: + type: integer + type: array + xml: + wrapped: true + name_string: + example: string + type: string + xml: + name: xml_name_string + name_number: + example: 1.234 + type: number + xml: + name: xml_name_number + name_integer: + example: -2 + type: integer + xml: + name: xml_name_integer + name_boolean: + example: true + type: boolean + xml: + name: xml_name_boolean + name_array: + items: + type: integer + xml: + name: xml_name_array_item + type: array + name_wrapped_array: + items: + type: integer + xml: + name: xml_name_wrapped_array_item + type: array + xml: + name: xml_name_wrapped_array + wrapped: true + prefix_string: + example: string + type: string + xml: + prefix: ab + prefix_number: + example: 1.234 + type: number + xml: + prefix: cd + prefix_integer: + example: -2 + type: integer + xml: + prefix: ef + prefix_boolean: + example: true + type: boolean + xml: + prefix: gh + prefix_array: + items: + type: integer + xml: + prefix: ij + type: array + prefix_wrapped_array: + items: + type: integer + xml: + prefix: mn + type: array + xml: + prefix: kl + wrapped: true + namespace_string: + example: string + type: string + xml: + namespace: http://a.com/schema + namespace_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + namespace_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + namespace_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + namespace_array: + items: + type: integer + xml: + namespace: http://e.com/schema + type: array + namespace_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + type: array + xml: + namespace: http://f.com/schema + wrapped: true + prefix_ns_string: + example: string + type: string + xml: + namespace: http://a.com/schema + prefix: a + prefix_ns_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + prefix: b + prefix_ns_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + prefix: c + prefix_ns_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + prefix: d + prefix_ns_array: + items: + type: integer + xml: + namespace: http://e.com/schema + prefix: e + type: array + prefix_ns_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + prefix: g + type: array + xml: + namespace: http://f.com/schema + prefix: f + wrapped: true + type: object + xml: + namespace: http://a.com/schema + prefix: pre + Dog_allOf: + properties: + breed: + type: string + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http +x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/FILES b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/FILES index 5ed7c1bf68dc..521670b5356f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/FILES @@ -24,7 +24,6 @@ src/main/java/org/openapitools/api/UserApiDelegate.java src/main/java/org/openapitools/configuration/CustomInstantDeserializer.java src/main/java/org/openapitools/configuration/HomeController.java src/main/java/org/openapitools/configuration/JacksonConfiguration.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -70,3 +69,4 @@ src/main/java/org/openapitools/model/TypeHolderExample.java src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/resources/openapi.yaml new file mode 100644 index 000000000000..1cd65b8e95d4 --- /dev/null +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/resources/openapi.yaml @@ -0,0 +1,2248 @@ +openapi: 3.0.1 +info: + description: 'This spec is mainly for testing Petstore server and contains fake + endpoints, models. Please do not use this for any other purpose. Special characters: + " \' + license: + name: Apache-2.0 + url: http://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +servers: +- url: http://petstore.swagger.io:80/v2 +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /pet: + post: + operationId: addPet + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + responses: + "200": + content: {} + description: successful operation + "405": + content: {} + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: pet + 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 + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + "405": + content: {} + description: Validation exception + security: + - petstore_auth: + - 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 + x-tags: + - tag: pet + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + content: {} + description: Invalid status value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + x-spring-paginated: true + x-accepts: application/json + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + content: {} + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-spring-paginated: true + x-accepts: application/json + x-tags: + - tag: pet + /pet/{petId}: + delete: + operationId: deletePet + parameters: + - in: header + name: api_key + schema: + type: string + - description: Pet id to delete + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + post: + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + responses: + "405": + content: {} + description: Invalid input + 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 + x-tags: + - tag: pet + /pet/{petId}/uploadImage: + post: + operationId: uploadFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + x-contentType: multipart/form-data + x-accepts: application/json + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + 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 + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + in: path + name: order_id + required: true + schema: + type: string + responses: + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Delete purchase order by ID + 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 + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Create user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithArray: + post: + operationId: createUsersWithArrayInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithList: + post: + operationId: createUsersWithListInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/login: + get: + operationId: loginUser + parameters: + - description: The user name for login + in: query + name: username + required: true + schema: + type: string + - description: The password for login in clear text + in: query + name: password + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + format: int32 + type: integer + X-Expires-After: + description: date in UTC when token expires + schema: + format: date-time + type: string + "400": + content: {} + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/logout: + get: + operationId: logoutUser + responses: + default: + content: {} + description: successful operation + summary: Logs out current logged in user session + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + 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 + x-tags: + - tag: user + get: + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + in: path + name: username + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + summary: Get user by user name + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + in: path + name: username + required: true + schema: + type: string + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + content: {} + description: Invalid user supplied + "404": + content: {} + description: User not found + summary: Updated user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + 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 + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + in: header + name: enum_header_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (string array) + explode: false + in: query + name: enum_query_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + in: query + name: enum_query_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (double) + in: query + name: enum_query_integer + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + - description: Query parameter enum test (double) + in: query + name: enum_query_double + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + responses: + "400": + content: {} + description: Invalid request + "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: + description: To test "client" model + operationId: testClientModel + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: fake + post: + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + required: true + responses: + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + security: + - http_basic_test: [] + 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: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/jsonFormData: + get: + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + required: true + responses: + "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: + post: + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "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: + put: + operationId: testBodyWithQueryParams + parameters: + - in: query + name: query + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + 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/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: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + x-codegen-request-body-name: body + x-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`. + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $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-parameters: + 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: + post: + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + 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 + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + $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: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + type: object + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + 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' + 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: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_string: + 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: + 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: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + type: string + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + TypeHolderDefault: + properties: + string_item: + default: what + type: string + number_item: + type: number + integer_item: + type: integer + bool_item: + default: true + type: boolean + array_item: + items: + type: integer + type: array + required: + - array_item + - bool_item + - integer_item + - number_item + - string_item + type: object + TypeHolderExample: + 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 + type: object + XmlItem: + properties: + attribute_string: + example: string + type: string + xml: + attribute: true + attribute_number: + example: 1.234 + type: number + xml: + attribute: true + attribute_integer: + example: -2 + type: integer + xml: + attribute: true + attribute_boolean: + example: true + type: boolean + xml: + attribute: true + wrapped_array: + items: + type: integer + type: array + xml: + wrapped: true + name_string: + example: string + type: string + xml: + name: xml_name_string + name_number: + example: 1.234 + type: number + xml: + name: xml_name_number + name_integer: + example: -2 + type: integer + xml: + name: xml_name_integer + name_boolean: + example: true + type: boolean + xml: + name: xml_name_boolean + name_array: + items: + type: integer + xml: + name: xml_name_array_item + type: array + name_wrapped_array: + items: + type: integer + xml: + name: xml_name_wrapped_array_item + type: array + xml: + name: xml_name_wrapped_array + wrapped: true + prefix_string: + example: string + type: string + xml: + prefix: ab + prefix_number: + example: 1.234 + type: number + xml: + prefix: cd + prefix_integer: + example: -2 + type: integer + xml: + prefix: ef + prefix_boolean: + example: true + type: boolean + xml: + prefix: gh + prefix_array: + items: + type: integer + xml: + prefix: ij + type: array + prefix_wrapped_array: + items: + type: integer + xml: + prefix: mn + type: array + xml: + prefix: kl + wrapped: true + namespace_string: + example: string + type: string + xml: + namespace: http://a.com/schema + namespace_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + namespace_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + namespace_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + namespace_array: + items: + type: integer + xml: + namespace: http://e.com/schema + type: array + namespace_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + type: array + xml: + namespace: http://f.com/schema + wrapped: true + prefix_ns_string: + example: string + type: string + xml: + namespace: http://a.com/schema + prefix: a + prefix_ns_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + prefix: b + prefix_ns_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + prefix: c + prefix_ns_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + prefix: d + prefix_ns_array: + items: + type: integer + xml: + namespace: http://e.com/schema + prefix: e + type: array + prefix_ns_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + prefix: g + type: array + xml: + namespace: http://f.com/schema + prefix: f + wrapped: true + type: object + xml: + namespace: http://a.com/schema + prefix: pre + Dog_allOf: + properties: + breed: + type: string + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http +x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/FILES b/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/FILES index 2bcd994d13a2..31af355960d5 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/FILES @@ -22,7 +22,6 @@ src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/api/UserApiDelegate.java src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -68,3 +67,4 @@ src/main/java/org/openapitools/model/TypeHolderExample.java src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/resources/openapi.yaml new file mode 100644 index 000000000000..1cd65b8e95d4 --- /dev/null +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/resources/openapi.yaml @@ -0,0 +1,2248 @@ +openapi: 3.0.1 +info: + description: 'This spec is mainly for testing Petstore server and contains fake + endpoints, models. Please do not use this for any other purpose. Special characters: + " \' + license: + name: Apache-2.0 + url: http://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +servers: +- url: http://petstore.swagger.io:80/v2 +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /pet: + post: + operationId: addPet + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + responses: + "200": + content: {} + description: successful operation + "405": + content: {} + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: pet + 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 + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + "405": + content: {} + description: Validation exception + security: + - petstore_auth: + - 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 + x-tags: + - tag: pet + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + content: {} + description: Invalid status value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + x-spring-paginated: true + x-accepts: application/json + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + content: {} + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-spring-paginated: true + x-accepts: application/json + x-tags: + - tag: pet + /pet/{petId}: + delete: + operationId: deletePet + parameters: + - in: header + name: api_key + schema: + type: string + - description: Pet id to delete + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + post: + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + responses: + "405": + content: {} + description: Invalid input + 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 + x-tags: + - tag: pet + /pet/{petId}/uploadImage: + post: + operationId: uploadFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + x-contentType: multipart/form-data + x-accepts: application/json + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + 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 + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + in: path + name: order_id + required: true + schema: + type: string + responses: + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Delete purchase order by ID + 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 + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Create user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithArray: + post: + operationId: createUsersWithArrayInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithList: + post: + operationId: createUsersWithListInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/login: + get: + operationId: loginUser + parameters: + - description: The user name for login + in: query + name: username + required: true + schema: + type: string + - description: The password for login in clear text + in: query + name: password + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + format: int32 + type: integer + X-Expires-After: + description: date in UTC when token expires + schema: + format: date-time + type: string + "400": + content: {} + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/logout: + get: + operationId: logoutUser + responses: + default: + content: {} + description: successful operation + summary: Logs out current logged in user session + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + 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 + x-tags: + - tag: user + get: + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + in: path + name: username + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + summary: Get user by user name + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + in: path + name: username + required: true + schema: + type: string + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + content: {} + description: Invalid user supplied + "404": + content: {} + description: User not found + summary: Updated user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + 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 + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + in: header + name: enum_header_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (string array) + explode: false + in: query + name: enum_query_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + in: query + name: enum_query_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (double) + in: query + name: enum_query_integer + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + - description: Query parameter enum test (double) + in: query + name: enum_query_double + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + responses: + "400": + content: {} + description: Invalid request + "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: + description: To test "client" model + operationId: testClientModel + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: fake + post: + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + required: true + responses: + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + security: + - http_basic_test: [] + 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: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/jsonFormData: + get: + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + required: true + responses: + "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: + post: + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "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: + put: + operationId: testBodyWithQueryParams + parameters: + - in: query + name: query + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + 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/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: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + x-codegen-request-body-name: body + x-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`. + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $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-parameters: + 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: + post: + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + 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 + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + $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: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + type: object + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + 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' + 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: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_string: + 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: + 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: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + type: string + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + TypeHolderDefault: + properties: + string_item: + default: what + type: string + number_item: + type: number + integer_item: + type: integer + bool_item: + default: true + type: boolean + array_item: + items: + type: integer + type: array + required: + - array_item + - bool_item + - integer_item + - number_item + - string_item + type: object + TypeHolderExample: + 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 + type: object + XmlItem: + properties: + attribute_string: + example: string + type: string + xml: + attribute: true + attribute_number: + example: 1.234 + type: number + xml: + attribute: true + attribute_integer: + example: -2 + type: integer + xml: + attribute: true + attribute_boolean: + example: true + type: boolean + xml: + attribute: true + wrapped_array: + items: + type: integer + type: array + xml: + wrapped: true + name_string: + example: string + type: string + xml: + name: xml_name_string + name_number: + example: 1.234 + type: number + xml: + name: xml_name_number + name_integer: + example: -2 + type: integer + xml: + name: xml_name_integer + name_boolean: + example: true + type: boolean + xml: + name: xml_name_boolean + name_array: + items: + type: integer + xml: + name: xml_name_array_item + type: array + name_wrapped_array: + items: + type: integer + xml: + name: xml_name_wrapped_array_item + type: array + xml: + name: xml_name_wrapped_array + wrapped: true + prefix_string: + example: string + type: string + xml: + prefix: ab + prefix_number: + example: 1.234 + type: number + xml: + prefix: cd + prefix_integer: + example: -2 + type: integer + xml: + prefix: ef + prefix_boolean: + example: true + type: boolean + xml: + prefix: gh + prefix_array: + items: + type: integer + xml: + prefix: ij + type: array + prefix_wrapped_array: + items: + type: integer + xml: + prefix: mn + type: array + xml: + prefix: kl + wrapped: true + namespace_string: + example: string + type: string + xml: + namespace: http://a.com/schema + namespace_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + namespace_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + namespace_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + namespace_array: + items: + type: integer + xml: + namespace: http://e.com/schema + type: array + namespace_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + type: array + xml: + namespace: http://f.com/schema + wrapped: true + prefix_ns_string: + example: string + type: string + xml: + namespace: http://a.com/schema + prefix: a + prefix_ns_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + prefix: b + prefix_ns_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + prefix: c + prefix_ns_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + prefix: d + prefix_ns_array: + items: + type: integer + xml: + namespace: http://e.com/schema + prefix: e + type: array + prefix_ns_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + prefix: g + type: array + xml: + namespace: http://f.com/schema + prefix: f + wrapped: true + type: object + xml: + namespace: http://a.com/schema + prefix: pre + Dog_allOf: + properties: + breed: + type: string + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http +x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/FILES b/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/FILES index fce68c4e6a74..c314c6a9a0f6 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/FILES @@ -18,7 +18,6 @@ src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/configuration/CustomInstantDeserializer.java src/main/java/org/openapitools/configuration/HomeController.java src/main/java/org/openapitools/configuration/JacksonConfiguration.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -64,3 +63,4 @@ src/main/java/org/openapitools/model/TypeHolderExample.java src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/resources/openapi.yaml new file mode 100644 index 000000000000..1cd65b8e95d4 --- /dev/null +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/resources/openapi.yaml @@ -0,0 +1,2248 @@ +openapi: 3.0.1 +info: + description: 'This spec is mainly for testing Petstore server and contains fake + endpoints, models. Please do not use this for any other purpose. Special characters: + " \' + license: + name: Apache-2.0 + url: http://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +servers: +- url: http://petstore.swagger.io:80/v2 +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /pet: + post: + operationId: addPet + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + responses: + "200": + content: {} + description: successful operation + "405": + content: {} + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: pet + 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 + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + "405": + content: {} + description: Validation exception + security: + - petstore_auth: + - 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 + x-tags: + - tag: pet + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + content: {} + description: Invalid status value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + x-spring-paginated: true + x-accepts: application/json + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + content: {} + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-spring-paginated: true + x-accepts: application/json + x-tags: + - tag: pet + /pet/{petId}: + delete: + operationId: deletePet + parameters: + - in: header + name: api_key + schema: + type: string + - description: Pet id to delete + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + post: + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + responses: + "405": + content: {} + description: Invalid input + 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 + x-tags: + - tag: pet + /pet/{petId}/uploadImage: + post: + operationId: uploadFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + x-contentType: multipart/form-data + x-accepts: application/json + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + 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 + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + in: path + name: order_id + required: true + schema: + type: string + responses: + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Delete purchase order by ID + 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 + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Create user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithArray: + post: + operationId: createUsersWithArrayInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithList: + post: + operationId: createUsersWithListInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/login: + get: + operationId: loginUser + parameters: + - description: The user name for login + in: query + name: username + required: true + schema: + type: string + - description: The password for login in clear text + in: query + name: password + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + format: int32 + type: integer + X-Expires-After: + description: date in UTC when token expires + schema: + format: date-time + type: string + "400": + content: {} + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/logout: + get: + operationId: logoutUser + responses: + default: + content: {} + description: successful operation + summary: Logs out current logged in user session + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + 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 + x-tags: + - tag: user + get: + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + in: path + name: username + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + summary: Get user by user name + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + in: path + name: username + required: true + schema: + type: string + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + content: {} + description: Invalid user supplied + "404": + content: {} + description: User not found + summary: Updated user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + 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 + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + in: header + name: enum_header_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (string array) + explode: false + in: query + name: enum_query_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + in: query + name: enum_query_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (double) + in: query + name: enum_query_integer + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + - description: Query parameter enum test (double) + in: query + name: enum_query_double + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + responses: + "400": + content: {} + description: Invalid request + "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: + description: To test "client" model + operationId: testClientModel + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: fake + post: + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + required: true + responses: + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + security: + - http_basic_test: [] + 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: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/jsonFormData: + get: + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + required: true + responses: + "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: + post: + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "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: + put: + operationId: testBodyWithQueryParams + parameters: + - in: query + name: query + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + 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/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: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + x-codegen-request-body-name: body + x-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`. + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $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-parameters: + 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: + post: + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + 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 + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + $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: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + type: object + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + 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' + 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: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_string: + 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: + 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: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + type: string + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + TypeHolderDefault: + properties: + string_item: + default: what + type: string + number_item: + type: number + integer_item: + type: integer + bool_item: + default: true + type: boolean + array_item: + items: + type: integer + type: array + required: + - array_item + - bool_item + - integer_item + - number_item + - string_item + type: object + TypeHolderExample: + 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 + type: object + XmlItem: + properties: + attribute_string: + example: string + type: string + xml: + attribute: true + attribute_number: + example: 1.234 + type: number + xml: + attribute: true + attribute_integer: + example: -2 + type: integer + xml: + attribute: true + attribute_boolean: + example: true + type: boolean + xml: + attribute: true + wrapped_array: + items: + type: integer + type: array + xml: + wrapped: true + name_string: + example: string + type: string + xml: + name: xml_name_string + name_number: + example: 1.234 + type: number + xml: + name: xml_name_number + name_integer: + example: -2 + type: integer + xml: + name: xml_name_integer + name_boolean: + example: true + type: boolean + xml: + name: xml_name_boolean + name_array: + items: + type: integer + xml: + name: xml_name_array_item + type: array + name_wrapped_array: + items: + type: integer + xml: + name: xml_name_wrapped_array_item + type: array + xml: + name: xml_name_wrapped_array + wrapped: true + prefix_string: + example: string + type: string + xml: + prefix: ab + prefix_number: + example: 1.234 + type: number + xml: + prefix: cd + prefix_integer: + example: -2 + type: integer + xml: + prefix: ef + prefix_boolean: + example: true + type: boolean + xml: + prefix: gh + prefix_array: + items: + type: integer + xml: + prefix: ij + type: array + prefix_wrapped_array: + items: + type: integer + xml: + prefix: mn + type: array + xml: + prefix: kl + wrapped: true + namespace_string: + example: string + type: string + xml: + namespace: http://a.com/schema + namespace_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + namespace_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + namespace_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + namespace_array: + items: + type: integer + xml: + namespace: http://e.com/schema + type: array + namespace_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + type: array + xml: + namespace: http://f.com/schema + wrapped: true + prefix_ns_string: + example: string + type: string + xml: + namespace: http://a.com/schema + prefix: a + prefix_ns_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + prefix: b + prefix_ns_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + prefix: c + prefix_ns_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + prefix: d + prefix_ns_array: + items: + type: integer + xml: + namespace: http://e.com/schema + prefix: e + type: array + prefix_ns_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + prefix: g + type: array + xml: + namespace: http://f.com/schema + prefix: f + wrapped: true + type: object + xml: + namespace: http://a.com/schema + prefix: pre + Dog_allOf: + properties: + breed: + type: string + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http +x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-spring-pageable/.openapi-generator/FILES b/samples/server/petstore/springboot-spring-pageable/.openapi-generator/FILES index 0827a14791f4..cc5174f019bd 100644 --- a/samples/server/petstore/springboot-spring-pageable/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-spring-pageable/.openapi-generator/FILES @@ -16,7 +16,6 @@ src/main/java/org/openapitools/api/StoreApiController.java src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -62,3 +61,4 @@ src/main/java/org/openapitools/model/TypeHolderExample.java src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-spring-pageable/src/main/resources/openapi.yaml new file mode 100644 index 000000000000..1cd65b8e95d4 --- /dev/null +++ b/samples/server/petstore/springboot-spring-pageable/src/main/resources/openapi.yaml @@ -0,0 +1,2248 @@ +openapi: 3.0.1 +info: + description: 'This spec is mainly for testing Petstore server and contains fake + endpoints, models. Please do not use this for any other purpose. Special characters: + " \' + license: + name: Apache-2.0 + url: http://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +servers: +- url: http://petstore.swagger.io:80/v2 +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /pet: + post: + operationId: addPet + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + responses: + "200": + content: {} + description: successful operation + "405": + content: {} + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: pet + 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 + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + "405": + content: {} + description: Validation exception + security: + - petstore_auth: + - 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 + x-tags: + - tag: pet + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + content: {} + description: Invalid status value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + x-spring-paginated: true + x-accepts: application/json + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + content: {} + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-spring-paginated: true + x-accepts: application/json + x-tags: + - tag: pet + /pet/{petId}: + delete: + operationId: deletePet + parameters: + - in: header + name: api_key + schema: + type: string + - description: Pet id to delete + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + post: + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + responses: + "405": + content: {} + description: Invalid input + 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 + x-tags: + - tag: pet + /pet/{petId}/uploadImage: + post: + operationId: uploadFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + x-contentType: multipart/form-data + x-accepts: application/json + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + 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 + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + in: path + name: order_id + required: true + schema: + type: string + responses: + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Delete purchase order by ID + 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 + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Create user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithArray: + post: + operationId: createUsersWithArrayInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithList: + post: + operationId: createUsersWithListInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/login: + get: + operationId: loginUser + parameters: + - description: The user name for login + in: query + name: username + required: true + schema: + type: string + - description: The password for login in clear text + in: query + name: password + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + format: int32 + type: integer + X-Expires-After: + description: date in UTC when token expires + schema: + format: date-time + type: string + "400": + content: {} + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/logout: + get: + operationId: logoutUser + responses: + default: + content: {} + description: successful operation + summary: Logs out current logged in user session + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + 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 + x-tags: + - tag: user + get: + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + in: path + name: username + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + summary: Get user by user name + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + in: path + name: username + required: true + schema: + type: string + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + content: {} + description: Invalid user supplied + "404": + content: {} + description: User not found + summary: Updated user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + 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 + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + in: header + name: enum_header_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (string array) + explode: false + in: query + name: enum_query_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + in: query + name: enum_query_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (double) + in: query + name: enum_query_integer + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + - description: Query parameter enum test (double) + in: query + name: enum_query_double + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + responses: + "400": + content: {} + description: Invalid request + "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: + description: To test "client" model + operationId: testClientModel + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: fake + post: + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + required: true + responses: + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + security: + - http_basic_test: [] + 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: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/jsonFormData: + get: + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + required: true + responses: + "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: + post: + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "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: + put: + operationId: testBodyWithQueryParams + parameters: + - in: query + name: query + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + 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/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: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + x-codegen-request-body-name: body + x-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`. + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $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-parameters: + 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: + post: + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + 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 + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + $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: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + type: object + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + 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' + 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: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_string: + 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: + 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: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + type: string + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + TypeHolderDefault: + properties: + string_item: + default: what + type: string + number_item: + type: number + integer_item: + type: integer + bool_item: + default: true + type: boolean + array_item: + items: + type: integer + type: array + required: + - array_item + - bool_item + - integer_item + - number_item + - string_item + type: object + TypeHolderExample: + 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 + type: object + XmlItem: + properties: + attribute_string: + example: string + type: string + xml: + attribute: true + attribute_number: + example: 1.234 + type: number + xml: + attribute: true + attribute_integer: + example: -2 + type: integer + xml: + attribute: true + attribute_boolean: + example: true + type: boolean + xml: + attribute: true + wrapped_array: + items: + type: integer + type: array + xml: + wrapped: true + name_string: + example: string + type: string + xml: + name: xml_name_string + name_number: + example: 1.234 + type: number + xml: + name: xml_name_number + name_integer: + example: -2 + type: integer + xml: + name: xml_name_integer + name_boolean: + example: true + type: boolean + xml: + name: xml_name_boolean + name_array: + items: + type: integer + xml: + name: xml_name_array_item + type: array + name_wrapped_array: + items: + type: integer + xml: + name: xml_name_wrapped_array_item + type: array + xml: + name: xml_name_wrapped_array + wrapped: true + prefix_string: + example: string + type: string + xml: + prefix: ab + prefix_number: + example: 1.234 + type: number + xml: + prefix: cd + prefix_integer: + example: -2 + type: integer + xml: + prefix: ef + prefix_boolean: + example: true + type: boolean + xml: + prefix: gh + prefix_array: + items: + type: integer + xml: + prefix: ij + type: array + prefix_wrapped_array: + items: + type: integer + xml: + prefix: mn + type: array + xml: + prefix: kl + wrapped: true + namespace_string: + example: string + type: string + xml: + namespace: http://a.com/schema + namespace_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + namespace_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + namespace_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + namespace_array: + items: + type: integer + xml: + namespace: http://e.com/schema + type: array + namespace_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + type: array + xml: + namespace: http://f.com/schema + wrapped: true + prefix_ns_string: + example: string + type: string + xml: + namespace: http://a.com/schema + prefix: a + prefix_ns_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + prefix: b + prefix_ns_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + prefix: c + prefix_ns_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + prefix: d + prefix_ns_array: + items: + type: integer + xml: + namespace: http://e.com/schema + prefix: e + type: array + prefix_ns_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + prefix: g + type: array + xml: + namespace: http://f.com/schema + prefix: f + wrapped: true + type: object + xml: + namespace: http://a.com/schema + prefix: pre + Dog_allOf: + properties: + breed: + type: string + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http +x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-useoptional/.openapi-generator/FILES b/samples/server/petstore/springboot-useoptional/.openapi-generator/FILES index 61420a325e38..e4c32719b541 100644 --- a/samples/server/petstore/springboot-useoptional/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-useoptional/.openapi-generator/FILES @@ -16,7 +16,6 @@ src/main/java/org/openapitools/api/StoreApiController.java src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -64,3 +63,4 @@ src/main/java/org/openapitools/model/TypeHolderExample.java src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml new file mode 100644 index 000000000000..d6386dc39bf4 --- /dev/null +++ b/samples/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml @@ -0,0 +1,2264 @@ +openapi: 3.0.1 +info: + description: 'This spec is mainly for testing Petstore server and contains fake + endpoints, models. Please do not use this for any other purpose. Special characters: + " \' + 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:80/v2 +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /pet: + post: + operationId: addPet + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + responses: + "200": + content: {} + description: successful operation + "405": + content: {} + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: pet + 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 + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + "405": + content: {} + description: Validation exception + security: + - petstore_auth: + - 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 + x-tags: + - tag: pet + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + content: {} + description: Invalid status value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + description: successful operation + "400": + content: {} + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + /pet/{petId}: + delete: + operationId: deletePet + parameters: + - in: header + name: api_key + schema: + type: string + - description: Pet id to delete + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + post: + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + responses: + "405": + content: {} + description: Invalid input + 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 + x-tags: + - tag: pet + /pet/{petId}/uploadImage: + post: + operationId: uploadFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + x-contentType: multipart/form-data + x-accepts: application/json + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + 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 + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + in: path + name: order_id + required: true + schema: + type: string + responses: + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Delete purchase order by ID + 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 + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Create user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithArray: + post: + operationId: createUsersWithArrayInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithList: + post: + operationId: createUsersWithListInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/login: + get: + operationId: loginUser + parameters: + - description: The user name for login + in: query + name: username + required: true + schema: + type: string + - description: The password for login in clear text + in: query + name: password + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + format: int32 + type: integer + X-Expires-After: + description: date in UTC when token expires + schema: + format: date-time + type: string + "400": + content: {} + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/logout: + get: + operationId: logoutUser + responses: + default: + content: {} + description: successful operation + summary: Logs out current logged in user session + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + 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 + x-tags: + - tag: user + get: + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + in: path + name: username + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + summary: Get user by user name + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + in: path + name: username + required: true + schema: + type: string + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + content: {} + description: Invalid user supplied + "404": + content: {} + description: User not found + summary: Updated user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + 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 + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + in: header + name: enum_header_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (string array) + explode: false + in: query + name: enum_query_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + in: query + name: enum_query_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (double) + in: query + name: enum_query_integer + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + - description: Query parameter enum test (double) + in: query + name: enum_query_double + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + responses: + "400": + content: {} + description: Invalid request + "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: + description: To test "client" model + operationId: testClientModel + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: fake + post: + description: |- + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + required: true + responses: + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + security: + - http_basic_test: [] + 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: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/jsonFormData: + get: + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + required: true + responses: + "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: + post: + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "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: + put: + operationId: testBodyWithQueryParams + parameters: + - in: query + name: query + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + 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/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: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + x-codegen-request-body-name: body + x-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`. + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $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-parameters: + 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: + post: + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + 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 + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + uniqueItems: true + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + $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: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + type: object + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + 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 + 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: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_string: + 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: + 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: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + type: string + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + TypeHolderDefault: + properties: + string_item: + default: what + type: string + number_item: + type: number + integer_item: + type: integer + bool_item: + default: true + type: boolean + array_item: + items: + type: integer + type: array + required: + - array_item + - bool_item + - integer_item + - number_item + - string_item + type: object + TypeHolderExample: + 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 + type: object + XmlItem: + properties: + attribute_string: + example: string + type: string + xml: + attribute: true + attribute_number: + example: 1.234 + type: number + xml: + attribute: true + attribute_integer: + example: -2 + type: integer + xml: + attribute: true + attribute_boolean: + example: true + type: boolean + xml: + attribute: true + wrapped_array: + items: + type: integer + type: array + xml: + wrapped: true + name_string: + example: string + type: string + xml: + name: xml_name_string + name_number: + example: 1.234 + type: number + xml: + name: xml_name_number + name_integer: + example: -2 + type: integer + xml: + name: xml_name_integer + name_boolean: + example: true + type: boolean + xml: + name: xml_name_boolean + name_array: + items: + type: integer + xml: + name: xml_name_array_item + type: array + name_wrapped_array: + items: + type: integer + xml: + name: xml_name_wrapped_array_item + type: array + xml: + name: xml_name_wrapped_array + wrapped: true + prefix_string: + example: string + type: string + xml: + prefix: ab + prefix_number: + example: 1.234 + type: number + xml: + prefix: cd + prefix_integer: + example: -2 + type: integer + xml: + prefix: ef + prefix_boolean: + example: true + type: boolean + xml: + prefix: gh + prefix_array: + items: + type: integer + xml: + prefix: ij + type: array + prefix_wrapped_array: + items: + type: integer + xml: + prefix: mn + type: array + xml: + prefix: kl + wrapped: true + namespace_string: + example: string + type: string + xml: + namespace: http://a.com/schema + namespace_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + namespace_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + namespace_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + namespace_array: + items: + type: integer + xml: + namespace: http://e.com/schema + type: array + namespace_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + type: array + xml: + namespace: http://f.com/schema + wrapped: true + prefix_ns_string: + example: string + type: string + xml: + namespace: http://a.com/schema + prefix: a + prefix_ns_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + prefix: b + prefix_ns_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + prefix: c + prefix_ns_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + prefix: d + prefix_ns_array: + items: + type: integer + xml: + namespace: http://e.com/schema + prefix: e + type: array + prefix_ns_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + prefix: g + type: array + xml: + namespace: http://f.com/schema + prefix: f + wrapped: true + type: object + xml: + namespace: http://a.com/schema + prefix: pre + Dog_allOf: + properties: + breed: + type: string + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http +x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-virtualan/.openapi-generator/FILES b/samples/server/petstore/springboot-virtualan/.openapi-generator/FILES index 3a2d6eacf9db..0d1c364ddf28 100644 --- a/samples/server/petstore/springboot-virtualan/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-virtualan/.openapi-generator/FILES @@ -3,7 +3,6 @@ pom.xml src/main/java/org/openapitools/OpenAPI2SpringBoot.java src/main/java/org/openapitools/RFC3339DateFormat.java src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java src/main/java/org/openapitools/virtualan/api/AnotherFakeApiController.java src/main/java/org/openapitools/virtualan/api/ApiUtil.java @@ -64,3 +63,4 @@ src/main/java/org/openapitools/virtualan/model/TypeHolderExample.java src/main/java/org/openapitools/virtualan/model/User.java src/main/java/org/openapitools/virtualan/model/XmlItem.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/springboot-virtualan/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-virtualan/src/main/resources/openapi.yaml new file mode 100644 index 000000000000..d6386dc39bf4 --- /dev/null +++ b/samples/server/petstore/springboot-virtualan/src/main/resources/openapi.yaml @@ -0,0 +1,2264 @@ +openapi: 3.0.1 +info: + description: 'This spec is mainly for testing Petstore server and contains fake + endpoints, models. Please do not use this for any other purpose. Special characters: + " \' + 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:80/v2 +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /pet: + post: + operationId: addPet + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + responses: + "200": + content: {} + description: successful operation + "405": + content: {} + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: pet + 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 + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + "405": + content: {} + description: Validation exception + security: + - petstore_auth: + - 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 + x-tags: + - tag: pet + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + content: {} + description: Invalid status value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + description: successful operation + "400": + content: {} + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + /pet/{petId}: + delete: + operationId: deletePet + parameters: + - in: header + name: api_key + schema: + type: string + - description: Pet id to delete + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + post: + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + responses: + "405": + content: {} + description: Invalid input + 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 + x-tags: + - tag: pet + /pet/{petId}/uploadImage: + post: + operationId: uploadFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + x-contentType: multipart/form-data + x-accepts: application/json + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + 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 + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + in: path + name: order_id + required: true + schema: + type: string + responses: + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Delete purchase order by ID + 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 + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Create user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithArray: + post: + operationId: createUsersWithArrayInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithList: + post: + operationId: createUsersWithListInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/login: + get: + operationId: loginUser + parameters: + - description: The user name for login + in: query + name: username + required: true + schema: + type: string + - description: The password for login in clear text + in: query + name: password + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + format: int32 + type: integer + X-Expires-After: + description: date in UTC when token expires + schema: + format: date-time + type: string + "400": + content: {} + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/logout: + get: + operationId: logoutUser + responses: + default: + content: {} + description: successful operation + summary: Logs out current logged in user session + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + 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 + x-tags: + - tag: user + get: + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + in: path + name: username + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + summary: Get user by user name + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + in: path + name: username + required: true + schema: + type: string + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + content: {} + description: Invalid user supplied + "404": + content: {} + description: User not found + summary: Updated user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + 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 + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + in: header + name: enum_header_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (string array) + explode: false + in: query + name: enum_query_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + in: query + name: enum_query_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (double) + in: query + name: enum_query_integer + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + - description: Query parameter enum test (double) + in: query + name: enum_query_double + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + responses: + "400": + content: {} + description: Invalid request + "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: + description: To test "client" model + operationId: testClientModel + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: fake + post: + description: |- + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + required: true + responses: + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + security: + - http_basic_test: [] + 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: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/jsonFormData: + get: + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + required: true + responses: + "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: + post: + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "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: + put: + operationId: testBodyWithQueryParams + parameters: + - in: query + name: query + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + 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/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: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + x-codegen-request-body-name: body + x-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`. + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $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-parameters: + 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: + post: + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + 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 + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + uniqueItems: true + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + $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: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + type: object + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + 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 + 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: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_string: + 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: + 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: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + type: string + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + TypeHolderDefault: + properties: + string_item: + default: what + type: string + number_item: + type: number + integer_item: + type: integer + bool_item: + default: true + type: boolean + array_item: + items: + type: integer + type: array + required: + - array_item + - bool_item + - integer_item + - number_item + - string_item + type: object + TypeHolderExample: + 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 + type: object + XmlItem: + properties: + attribute_string: + example: string + type: string + xml: + attribute: true + attribute_number: + example: 1.234 + type: number + xml: + attribute: true + attribute_integer: + example: -2 + type: integer + xml: + attribute: true + attribute_boolean: + example: true + type: boolean + xml: + attribute: true + wrapped_array: + items: + type: integer + type: array + xml: + wrapped: true + name_string: + example: string + type: string + xml: + name: xml_name_string + name_number: + example: 1.234 + type: number + xml: + name: xml_name_number + name_integer: + example: -2 + type: integer + xml: + name: xml_name_integer + name_boolean: + example: true + type: boolean + xml: + name: xml_name_boolean + name_array: + items: + type: integer + xml: + name: xml_name_array_item + type: array + name_wrapped_array: + items: + type: integer + xml: + name: xml_name_wrapped_array_item + type: array + xml: + name: xml_name_wrapped_array + wrapped: true + prefix_string: + example: string + type: string + xml: + prefix: ab + prefix_number: + example: 1.234 + type: number + xml: + prefix: cd + prefix_integer: + example: -2 + type: integer + xml: + prefix: ef + prefix_boolean: + example: true + type: boolean + xml: + prefix: gh + prefix_array: + items: + type: integer + xml: + prefix: ij + type: array + prefix_wrapped_array: + items: + type: integer + xml: + prefix: mn + type: array + xml: + prefix: kl + wrapped: true + namespace_string: + example: string + type: string + xml: + namespace: http://a.com/schema + namespace_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + namespace_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + namespace_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + namespace_array: + items: + type: integer + xml: + namespace: http://e.com/schema + type: array + namespace_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + type: array + xml: + namespace: http://f.com/schema + wrapped: true + prefix_ns_string: + example: string + type: string + xml: + namespace: http://a.com/schema + prefix: a + prefix_ns_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + prefix: b + prefix_ns_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + prefix: c + prefix_ns_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + prefix: d + prefix_ns_array: + items: + type: integer + xml: + namespace: http://e.com/schema + prefix: e + type: array + prefix_ns_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + prefix: g + type: array + xml: + namespace: http://f.com/schema + prefix: f + wrapped: true + type: object + xml: + namespace: http://a.com/schema + prefix: pre + Dog_allOf: + properties: + breed: + type: string + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http +x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot/.openapi-generator/FILES b/samples/server/petstore/springboot/.openapi-generator/FILES index 61420a325e38..e4c32719b541 100644 --- a/samples/server/petstore/springboot/.openapi-generator/FILES +++ b/samples/server/petstore/springboot/.openapi-generator/FILES @@ -16,7 +16,6 @@ src/main/java/org/openapitools/api/StoreApiController.java src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiController.java src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -64,3 +63,4 @@ src/main/java/org/openapitools/model/TypeHolderExample.java src/main/java/org/openapitools/model/User.java src/main/java/org/openapitools/model/XmlItem.java src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/springboot/src/main/resources/openapi.yaml b/samples/server/petstore/springboot/src/main/resources/openapi.yaml new file mode 100644 index 000000000000..d6386dc39bf4 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/resources/openapi.yaml @@ -0,0 +1,2264 @@ +openapi: 3.0.1 +info: + description: 'This spec is mainly for testing Petstore server and contains fake + endpoints, models. Please do not use this for any other purpose. Special characters: + " \' + 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:80/v2 +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /pet: + post: + operationId: addPet + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + responses: + "200": + content: {} + description: successful operation + "405": + content: {} + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: pet + 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 + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + "405": + content: {} + description: Validation exception + security: + - petstore_auth: + - 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 + x-tags: + - tag: pet + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + content: {} + description: Invalid status value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + description: successful operation + "400": + content: {} + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + /pet/{petId}: + delete: + operationId: deletePet + parameters: + - in: header + name: api_key + schema: + type: string + - description: Pet id to delete + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + post: + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + responses: + "405": + content: {} + description: Invalid input + 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 + x-tags: + - tag: pet + /pet/{petId}/uploadImage: + post: + operationId: uploadFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + x-contentType: multipart/form-data + x-accepts: application/json + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + 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 + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + in: path + name: order_id + required: true + schema: + type: string + responses: + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Delete purchase order by ID + 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 + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Create user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithArray: + post: + operationId: createUsersWithArrayInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithList: + post: + operationId: createUsersWithListInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/login: + get: + operationId: loginUser + parameters: + - description: The user name for login + in: query + name: username + required: true + schema: + type: string + - description: The password for login in clear text + in: query + name: password + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + format: int32 + type: integer + X-Expires-After: + description: date in UTC when token expires + schema: + format: date-time + type: string + "400": + content: {} + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/logout: + get: + operationId: logoutUser + responses: + default: + content: {} + description: successful operation + summary: Logs out current logged in user session + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + 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 + x-tags: + - tag: user + get: + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + in: path + name: username + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + summary: Get user by user name + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + in: path + name: username + required: true + schema: + type: string + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + content: {} + description: Invalid user supplied + "404": + content: {} + description: User not found + summary: Updated user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + 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 + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + in: header + name: enum_header_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (string array) + explode: false + in: query + name: enum_query_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + in: query + name: enum_query_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (double) + in: query + name: enum_query_integer + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + - description: Query parameter enum test (double) + in: query + name: enum_query_double + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + responses: + "400": + content: {} + description: Invalid request + "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: + description: To test "client" model + operationId: testClientModel + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: fake + post: + description: |- + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + required: true + responses: + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + security: + - http_basic_test: [] + 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: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/jsonFormData: + get: + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + required: true + responses: + "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: + post: + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "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: + put: + operationId: testBodyWithQueryParams + parameters: + - in: query + name: query + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + 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/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: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + x-codegen-request-body-name: body + x-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`. + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $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-parameters: + 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: + post: + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + 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 + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + uniqueItems: true + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + $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: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + type: object + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + 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 + 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: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_string: + 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: + 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: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + type: string + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + TypeHolderDefault: + properties: + string_item: + default: what + type: string + number_item: + type: number + integer_item: + type: integer + bool_item: + default: true + type: boolean + array_item: + items: + type: integer + type: array + required: + - array_item + - bool_item + - integer_item + - number_item + - string_item + type: object + TypeHolderExample: + 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 + type: object + XmlItem: + properties: + attribute_string: + example: string + type: string + xml: + attribute: true + attribute_number: + example: 1.234 + type: number + xml: + attribute: true + attribute_integer: + example: -2 + type: integer + xml: + attribute: true + attribute_boolean: + example: true + type: boolean + xml: + attribute: true + wrapped_array: + items: + type: integer + type: array + xml: + wrapped: true + name_string: + example: string + type: string + xml: + name: xml_name_string + name_number: + example: 1.234 + type: number + xml: + name: xml_name_number + name_integer: + example: -2 + type: integer + xml: + name: xml_name_integer + name_boolean: + example: true + type: boolean + xml: + name: xml_name_boolean + name_array: + items: + type: integer + xml: + name: xml_name_array_item + type: array + name_wrapped_array: + items: + type: integer + xml: + name: xml_name_wrapped_array_item + type: array + xml: + name: xml_name_wrapped_array + wrapped: true + prefix_string: + example: string + type: string + xml: + prefix: ab + prefix_number: + example: 1.234 + type: number + xml: + prefix: cd + prefix_integer: + example: -2 + type: integer + xml: + prefix: ef + prefix_boolean: + example: true + type: boolean + xml: + prefix: gh + prefix_array: + items: + type: integer + xml: + prefix: ij + type: array + prefix_wrapped_array: + items: + type: integer + xml: + prefix: mn + type: array + xml: + prefix: kl + wrapped: true + namespace_string: + example: string + type: string + xml: + namespace: http://a.com/schema + namespace_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + namespace_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + namespace_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + namespace_array: + items: + type: integer + xml: + namespace: http://e.com/schema + type: array + namespace_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + type: array + xml: + namespace: http://f.com/schema + wrapped: true + prefix_ns_string: + example: string + type: string + xml: + namespace: http://a.com/schema + prefix: a + prefix_ns_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + prefix: b + prefix_ns_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + prefix: c + prefix_ns_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + prefix: d + prefix_ns_array: + items: + type: integer + xml: + namespace: http://e.com/schema + prefix: e + type: array + prefix_ns_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + prefix: g + type: array + xml: + namespace: http://f.com/schema + prefix: f + wrapped: true + type: object + xml: + namespace: http://a.com/schema + prefix: pre + Dog_allOf: + properties: + breed: + type: string + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http +x-original-swagger-version: "2.0" From c69bff28717cb777d2461a7edac13576c7376f0a Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 21 Nov 2021 09:04:57 +0800 Subject: [PATCH 007/117] update meta codegen junit to latest version (#10911) --- .../openapi-generator/src/main/resources/codegen/pom.mustache | 2 +- samples/meta-codegen/lib/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/codegen/pom.mustache b/modules/openapi-generator/src/main/resources/codegen/pom.mustache index a4f01d1cbbd8..1815c0115a79 100644 --- a/modules/openapi-generator/src/main/resources/codegen/pom.mustache +++ b/modules/openapi-generator/src/main/resources/codegen/pom.mustache @@ -123,6 +123,6 @@ UTF-8 {{openapiGeneratorVersion}} 1.0.0 - 4.8.1 + 4.13.2 diff --git a/samples/meta-codegen/lib/pom.xml b/samples/meta-codegen/lib/pom.xml index f3beaa1e9762..b58e80a5b28f 100644 --- a/samples/meta-codegen/lib/pom.xml +++ b/samples/meta-codegen/lib/pom.xml @@ -123,6 +123,6 @@ UTF-8 5.3.1-SNAPSHOT 1.0.0 - 4.8.1 + 4.13.2 From 606db36c77153498c9c4fd435aeeb4a7b85c2128 Mon Sep 17 00:00:00 2001 From: Hong Zhuang Date: Sat, 20 Nov 2021 19:31:11 -0600 Subject: [PATCH 008/117] Better handling of NPE in parser when referencing invalid schema (#10882) * try to catch NullPointerException and print error message * handles invalid specifications when the spec file is invalid * added comment * added null pointer exception test --- .../org/openapitools/codegen/cmd/GenerateTest.java | 10 ++++++++++ .../src/test/resources/npe-test-spec-file.yaml | 14 ++++++++++++++ .../src/test/resources/npe-test.yaml | 8 ++++++++ .../codegen/config/CodegenConfigurator.java | 14 ++++++++++++-- 4 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 modules/openapi-generator-cli/src/test/resources/npe-test-spec-file.yaml create mode 100644 modules/openapi-generator-cli/src/test/resources/npe-test.yaml diff --git a/modules/openapi-generator-cli/src/test/java/org/openapitools/codegen/cmd/GenerateTest.java b/modules/openapi-generator-cli/src/test/java/org/openapitools/codegen/cmd/GenerateTest.java index 496e078a15d6..5b0130067398 100644 --- a/modules/openapi-generator-cli/src/test/java/org/openapitools/codegen/cmd/GenerateTest.java +++ b/modules/openapi-generator-cli/src/test/java/org/openapitools/codegen/cmd/GenerateTest.java @@ -22,7 +22,9 @@ import org.mockito.MockSettings; import org.openapitools.codegen.DefaultGenerator; import org.openapitools.codegen.Generator; +import org.openapitools.codegen.SpecValidationException; import org.openapitools.codegen.config.CodegenConfigurator; +import org.testng.TestException; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; @@ -430,4 +432,12 @@ public void testVerboseShort() { verify(configurator).toContext(); verifyNoMoreInteractions(configurator); } + + /** + * This test ensures that when the + */ + @Test(expectedExceptions = SpecValidationException.class) + public void testNPEWithInvalidSpecFile() { + setupAndRunTest("-i", "src/test/resources/npe-test.yaml", "-g", "java", "-o", "src/main/java", false, null); + } } diff --git a/modules/openapi-generator-cli/src/test/resources/npe-test-spec-file.yaml b/modules/openapi-generator-cli/src/test/resources/npe-test-spec-file.yaml new file mode 100644 index 000000000000..3e2a60862c98 --- /dev/null +++ b/modules/openapi-generator-cli/src/test/resources/npe-test-spec-file.yaml @@ -0,0 +1,14 @@ +test: + get: + responses: + '200': + description: test + content: + application/json: + schema: + type: object + properties: + prop1: + type: array + prop2: + type: date \ No newline at end of file diff --git a/modules/openapi-generator-cli/src/test/resources/npe-test.yaml b/modules/openapi-generator-cli/src/test/resources/npe-test.yaml new file mode 100644 index 000000000000..11fc1eff666a --- /dev/null +++ b/modules/openapi-generator-cli/src/test/resources/npe-test.yaml @@ -0,0 +1,8 @@ +openapi: 3.0.0 +info: + description: test + version: test + title: test +paths: + /test: + $ref: 'npe-test-spec-file.yaml#/test' \ No newline at end of file diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java index a2a88860f5b9..b5bd0b23c332 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java @@ -534,8 +534,18 @@ public Context toContext() { if (validationMessages.size() > 0) { Set warnings = new HashSet<>(); if (specification != null) { - List unusedModels = ModelUtils.getUnusedSchemas(specification); - unusedModels.forEach(name -> warnings.add("Unused model: " + name)); + + // Wrap the getUnusedSchemas() in try catch block so it catches the NPE + // when the input spec file is not correct + try{ + List unusedModels = ModelUtils.getUnusedSchemas(specification); + if (unusedModels != null) { + unusedModels.forEach(name -> warnings.add("Unused model: " + name)); + } + } catch (Exception e){ + System.err.println("[error] There is an error with OpenAPI specification parsed from the input spec file: " + inputSpec); + System.err.println("[error] Please make sure the spec file has correct format and all required fields are populated with valid value."); + } } if (workflowSettings.isValidateSpec()) { From f6001c2768191d3ae2d5984968e9d65461a184bf Mon Sep 17 00:00:00 2001 From: WILLIAM CHENG Date: Sun, 21 Nov 2021 09:50:10 +0800 Subject: [PATCH 009/117] update samples --- .../csharp-netcore-complex-files/.openapi-generator/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/client/others/csharp-netcore-complex-files/.openapi-generator/VERSION b/samples/client/others/csharp-netcore-complex-files/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/others/csharp-netcore-complex-files/.openapi-generator/VERSION +++ b/samples/client/others/csharp-netcore-complex-files/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file From 37a442902487f510810a64caad4e8b202993a6c6 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 21 Nov 2021 14:28:37 +0800 Subject: [PATCH 010/117] various enhancements to PSRSAEncryptionProvider (#10914) --- .../powershell/rsa_provider.mustache | 135 ++++++++++++++---- .../Private/PSRSAEncryptionProvider.cs | 126 ++++++++++++---- 2 files changed, 209 insertions(+), 52 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/powershell/rsa_provider.mustache b/modules/openapi-generator/src/main/resources/powershell/rsa_provider.mustache index ab9be24df972..c684ce6c3fe5 100644 --- a/modules/openapi-generator/src/main/resources/powershell/rsa_provider.mustache +++ b/modules/openapi-generator/src/main/resources/powershell/rsa_provider.mustache @@ -1,3 +1,20 @@ +/* + {{#appName}} + * {{{.}}} + * + {{/appName}} + {{#appDescription}} + * {{{.}}} + * + {{/appDescription}} + {{#version}} + * The version of the OpenAPI document: {{{.}}} + {{/version}} + {{#infoEmail}} + * Contact: {{{.}}} + {{/infoEmail}} + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections.Generic; using System.IO; @@ -9,8 +26,17 @@ using System.Text; namespace RSAEncryption { + /// + /// A RSA enccryption provider. + /// public class RSAEncryptionProvider { + /// + /// Get the RSA provider from the PEM file. + /// + /// PEM file. + /// Key pass phrase. + /// Get an instance of RSACryptoServiceProvider. public static RSACryptoServiceProvider GetRSAProviderFromPemFile(String pemfile,SecureString keyPassPhrase = null) { const String pempubheader = "-----BEGIN PUBLIC KEY-----"; @@ -41,6 +67,12 @@ namespace RSAEncryption return null ; } + /// + /// Convert the private key to bytes. + /// + /// Private key. + /// Key pass phrase. + /// The private key in the form of bytes. static byte[] ConvertPrivateKeyToBytes(String instr, SecureString keyPassPhrase = null) { const String pemprivheader = "-----BEGIN RSA PRIVATE KEY-----"; @@ -69,16 +101,24 @@ namespace RSAEncryption //-------- read PEM encryption info. lines and extract salt ----- if (!str.ReadLine().StartsWith("Proc-Type: 4,ENCRYPTED")) + { return null; + } String saltline = str.ReadLine(); if (!saltline.StartsWith("DEK-Info: DES-EDE3-CBC,")) + { return null; + } String saltstr = saltline.Substring(saltline.IndexOf(",") + 1).Trim(); byte[] salt = new byte[saltstr.Length / 2]; for (int i = 0; i < salt.Length; i++) + { salt[i] = Convert.ToByte(saltstr.Substring(i * 2, 2), 16); - if (!(str.ReadLine() == "")) + } + if (str.ReadLine() != "") + { return null; + } //------ remaining b64 data is encrypted RSA key ---- String encryptedstr = str.ReadToEnd(); @@ -94,7 +134,9 @@ namespace RSAEncryption byte[] deskey = GetEncryptedKey(salt, keyPassPhrase, 1, 2); // count=1 (for OpenSSL implementation); 2 iterations to get at least 24 bytes if (deskey == null) + { return null; + } //------ Decrypt the encrypted 3des-encrypted RSA private key ------ byte[] rsakey = DecryptKey(binkey, deskey, salt); //OpenSSL uses salt value in PEM header also as 3DES IV @@ -102,9 +144,14 @@ namespace RSAEncryption } } + /// + /// Decode the RSA private key. + /// + /// Private key. + /// An instance of RSACryptoServiceProvider. public static RSACryptoServiceProvider DecodeRSAPrivateKey(byte[] privkey) { - byte[] MODULUS, E, D, P, Q, DP, DQ, IQ; + byte[] bytesModules, bytesE, bytesD, bytesP, bytesQ, bytesDp, bytesDq, bytesIq; // --------- Set up stream to decode the asn.1 encoded RSA private key ------ MemoryStream mem = new MemoryStream(privkey); @@ -116,63 +163,76 @@ namespace RSAEncryption { twobytes = binr.ReadUInt16(); if (twobytes == 0x8130) //data read as little endian order (actual data order for Sequence is 30 81) + { binr.ReadByte(); //advance 1 byte + } else if (twobytes == 0x8230) + { binr.ReadInt16(); //advance 2 bytes + } else + { return null; + } twobytes = binr.ReadUInt16(); if (twobytes != 0x0102) //version number + { return null; + } bt = binr.ReadByte(); if (bt != 0x00) + { return null; + } //------ all private key components are Integer sequences ---- elems = GetIntegerSize(binr); - MODULUS = binr.ReadBytes(elems); + bytesModules = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - E = binr.ReadBytes(elems); + bytesE = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - D = binr.ReadBytes(elems); + bytesD = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - P = binr.ReadBytes(elems); + bytesP = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - Q = binr.ReadBytes(elems); + bytesQ = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - DP = binr.ReadBytes(elems); + bytesDp = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - DQ = binr.ReadBytes(elems); + bytesDq = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - IQ = binr.ReadBytes(elems); + bytesIq = binr.ReadBytes(elems); // ------- create RSACryptoServiceProvider instance and initialize with public key ----- - RSACryptoServiceProvider RSA = new RSACryptoServiceProvider(); + RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(); RSAParameters RSAparams = new RSAParameters(); - RSAparams.Modulus = MODULUS; - RSAparams.Exponent = E; - RSAparams.D = D; - RSAparams.P = P; - RSAparams.Q = Q; - RSAparams.DP = DP; - RSAparams.DQ = DQ; - RSAparams.InverseQ = IQ; - RSA.ImportParameters(RSAparams); - return RSA; + RSAparams.Modulus = bytesModules; + RSAparams.Exponent = bytesE; + RSAparams.D = bytesD; + RSAparams.P = bytesP; + RSAparams.Q = bytesQ; + RSAparams.DP = bytesDp; + RSAparams.DQ = bytesDq; + RSAparams.InverseQ = bytesIq; + rsa.ImportParameters(RSAparams); + return rsa; } catch (Exception) { return null; } - finally { binr.Close(); } + finally + { + binr.Close(); + } } private static int GetIntegerSize(BinaryReader binr) @@ -183,13 +243,16 @@ namespace RSAEncryption int count = 0; bt = binr.ReadByte(); if (bt != 0x02) //expect integer + { return 0; + } bt = binr.ReadByte(); if (bt == 0x81) + { count = binr.ReadByte(); // data size in next byte - else - if (bt == 0x82) + } + else if (bt == 0x82) { highbyte = binr.ReadByte(); // data size in next 2 bytes lowbyte = binr.ReadByte(); @@ -209,10 +272,18 @@ namespace RSAEncryption return count; } + /// + /// Get the encrypted key. + /// + /// Random bytes to be added. + /// Password. + /// Count. + /// Miter. + /// Decrypted key. static byte[] GetEncryptedKey(byte[] salt, SecureString secpswd, int count, int miter) { IntPtr unmanagedPswd = IntPtr.Zero; - int HASHLENGTH = 16; //MD5 bytes + const int HASHLENGTH = 16; //MD5 bytes byte[] keymaterial = new byte[HASHLENGTH * miter]; //to store concatenated Mi hashed results byte[] psbytes = new byte[secpswd.Length]; @@ -234,7 +305,9 @@ namespace RSAEncryption { // ---- Now hash consecutively for count times ------ if (j == 0) + { result = data00; //initialize + } else { Array.Copy(result, hashtarget, result.Length); @@ -243,7 +316,9 @@ namespace RSAEncryption } for (int i = 0; i < count; i++) + { result = md5.ComputeHash(result); + } Array.Copy(result, 0, keymaterial, j * HASHLENGTH, result.Length); //concatenate to keymaterial } byte[] deskey = new byte[24]; @@ -257,6 +332,13 @@ namespace RSAEncryption return deskey; } + /// + /// Decrypt the key. + /// + /// Cipher data. + /// Key to decrypt. + /// Initialization vector. + /// Decrypted key. static byte[] DecryptKey(byte[] cipherData, byte[] desKey, byte[] IV) { MemoryStream memst = new MemoryStream(); @@ -269,7 +351,8 @@ namespace RSAEncryption cs.Write(cipherData, 0, cipherData.Length); cs.Close(); } - catch (Exception){ + catch (Exception) + { return null; } byte[] decryptedData = memst.ToArray(); diff --git a/samples/client/petstore/powershell/src/PSPetstore/Private/PSRSAEncryptionProvider.cs b/samples/client/petstore/powershell/src/PSPetstore/Private/PSRSAEncryptionProvider.cs index ab9be24df972..27f40d771724 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Private/PSRSAEncryptionProvider.cs +++ b/samples/client/petstore/powershell/src/PSPetstore/Private/PSRSAEncryptionProvider.cs @@ -1,3 +1,11 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ using System; using System.Collections.Generic; using System.IO; @@ -9,8 +17,17 @@ namespace RSAEncryption { + /// + /// A RSA enccryption provider. + /// public class RSAEncryptionProvider { + /// + /// Get the RSA provider from the PEM file. + /// + /// PEM file. + /// Key pass phrase. + /// Get an instance of RSACryptoServiceProvider. public static RSACryptoServiceProvider GetRSAProviderFromPemFile(String pemfile,SecureString keyPassPhrase = null) { const String pempubheader = "-----BEGIN PUBLIC KEY-----"; @@ -41,6 +58,12 @@ public static RSACryptoServiceProvider GetRSAProviderFromPemFile(String pemfile, return null ; } + /// + /// Convert the private key to bytes. + /// + /// Private key. + /// Key pass phrase. + /// The private key in the form of bytes. static byte[] ConvertPrivateKeyToBytes(String instr, SecureString keyPassPhrase = null) { const String pemprivheader = "-----BEGIN RSA PRIVATE KEY-----"; @@ -69,16 +92,24 @@ static byte[] ConvertPrivateKeyToBytes(String instr, SecureString keyPassPhrase //-------- read PEM encryption info. lines and extract salt ----- if (!str.ReadLine().StartsWith("Proc-Type: 4,ENCRYPTED")) + { return null; + } String saltline = str.ReadLine(); if (!saltline.StartsWith("DEK-Info: DES-EDE3-CBC,")) + { return null; + } String saltstr = saltline.Substring(saltline.IndexOf(",") + 1).Trim(); byte[] salt = new byte[saltstr.Length / 2]; for (int i = 0; i < salt.Length; i++) + { salt[i] = Convert.ToByte(saltstr.Substring(i * 2, 2), 16); - if (!(str.ReadLine() == "")) + } + if (str.ReadLine() != "") + { return null; + } //------ remaining b64 data is encrypted RSA key ---- String encryptedstr = str.ReadToEnd(); @@ -94,7 +125,9 @@ static byte[] ConvertPrivateKeyToBytes(String instr, SecureString keyPassPhrase byte[] deskey = GetEncryptedKey(salt, keyPassPhrase, 1, 2); // count=1 (for OpenSSL implementation); 2 iterations to get at least 24 bytes if (deskey == null) + { return null; + } //------ Decrypt the encrypted 3des-encrypted RSA private key ------ byte[] rsakey = DecryptKey(binkey, deskey, salt); //OpenSSL uses salt value in PEM header also as 3DES IV @@ -102,9 +135,14 @@ static byte[] ConvertPrivateKeyToBytes(String instr, SecureString keyPassPhrase } } + /// + /// Decode the RSA private key. + /// + /// Private key. + /// An instance of RSACryptoServiceProvider. public static RSACryptoServiceProvider DecodeRSAPrivateKey(byte[] privkey) { - byte[] MODULUS, E, D, P, Q, DP, DQ, IQ; + byte[] bytesModules, bytesE, bytesD, bytesP, bytesQ, bytesDp, bytesDq, bytesIq; // --------- Set up stream to decode the asn.1 encoded RSA private key ------ MemoryStream mem = new MemoryStream(privkey); @@ -116,63 +154,76 @@ public static RSACryptoServiceProvider DecodeRSAPrivateKey(byte[] privkey) { twobytes = binr.ReadUInt16(); if (twobytes == 0x8130) //data read as little endian order (actual data order for Sequence is 30 81) + { binr.ReadByte(); //advance 1 byte + } else if (twobytes == 0x8230) + { binr.ReadInt16(); //advance 2 bytes + } else + { return null; + } twobytes = binr.ReadUInt16(); if (twobytes != 0x0102) //version number + { return null; + } bt = binr.ReadByte(); if (bt != 0x00) + { return null; + } //------ all private key components are Integer sequences ---- elems = GetIntegerSize(binr); - MODULUS = binr.ReadBytes(elems); + bytesModules = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - E = binr.ReadBytes(elems); + bytesE = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - D = binr.ReadBytes(elems); + bytesD = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - P = binr.ReadBytes(elems); + bytesP = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - Q = binr.ReadBytes(elems); + bytesQ = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - DP = binr.ReadBytes(elems); + bytesDp = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - DQ = binr.ReadBytes(elems); + bytesDq = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - IQ = binr.ReadBytes(elems); + bytesIq = binr.ReadBytes(elems); // ------- create RSACryptoServiceProvider instance and initialize with public key ----- - RSACryptoServiceProvider RSA = new RSACryptoServiceProvider(); + RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(); RSAParameters RSAparams = new RSAParameters(); - RSAparams.Modulus = MODULUS; - RSAparams.Exponent = E; - RSAparams.D = D; - RSAparams.P = P; - RSAparams.Q = Q; - RSAparams.DP = DP; - RSAparams.DQ = DQ; - RSAparams.InverseQ = IQ; - RSA.ImportParameters(RSAparams); - return RSA; + RSAparams.Modulus = bytesModules; + RSAparams.Exponent = bytesE; + RSAparams.D = bytesD; + RSAparams.P = bytesP; + RSAparams.Q = bytesQ; + RSAparams.DP = bytesDp; + RSAparams.DQ = bytesDq; + RSAparams.InverseQ = bytesIq; + rsa.ImportParameters(RSAparams); + return rsa; } catch (Exception) { return null; } - finally { binr.Close(); } + finally + { + binr.Close(); + } } private static int GetIntegerSize(BinaryReader binr) @@ -183,13 +234,16 @@ private static int GetIntegerSize(BinaryReader binr) int count = 0; bt = binr.ReadByte(); if (bt != 0x02) //expect integer + { return 0; + } bt = binr.ReadByte(); if (bt == 0x81) + { count = binr.ReadByte(); // data size in next byte - else - if (bt == 0x82) + } + else if (bt == 0x82) { highbyte = binr.ReadByte(); // data size in next 2 bytes lowbyte = binr.ReadByte(); @@ -209,10 +263,18 @@ private static int GetIntegerSize(BinaryReader binr) return count; } + /// + /// Get the encrypted key. + /// + /// Random bytes to be added. + /// Password. + /// Count. + /// Miter. + /// Decrypted key. static byte[] GetEncryptedKey(byte[] salt, SecureString secpswd, int count, int miter) { IntPtr unmanagedPswd = IntPtr.Zero; - int HASHLENGTH = 16; //MD5 bytes + const int HASHLENGTH = 16; //MD5 bytes byte[] keymaterial = new byte[HASHLENGTH * miter]; //to store concatenated Mi hashed results byte[] psbytes = new byte[secpswd.Length]; @@ -234,7 +296,9 @@ static byte[] GetEncryptedKey(byte[] salt, SecureString secpswd, int count, int { // ---- Now hash consecutively for count times ------ if (j == 0) + { result = data00; //initialize + } else { Array.Copy(result, hashtarget, result.Length); @@ -243,7 +307,9 @@ static byte[] GetEncryptedKey(byte[] salt, SecureString secpswd, int count, int } for (int i = 0; i < count; i++) + { result = md5.ComputeHash(result); + } Array.Copy(result, 0, keymaterial, j * HASHLENGTH, result.Length); //concatenate to keymaterial } byte[] deskey = new byte[24]; @@ -257,6 +323,13 @@ static byte[] GetEncryptedKey(byte[] salt, SecureString secpswd, int count, int return deskey; } + /// + /// Decrypt the key. + /// + /// Cipher data. + /// Key to decrypt. + /// Initialization vector. + /// Decrypted key. static byte[] DecryptKey(byte[] cipherData, byte[] desKey, byte[] IV) { MemoryStream memst = new MemoryStream(); @@ -269,7 +342,8 @@ static byte[] DecryptKey(byte[] cipherData, byte[] desKey, byte[] IV) cs.Write(cipherData, 0, cipherData.Length); cs.Close(); } - catch (Exception){ + catch (Exception) + { return null; } byte[] decryptedData = memst.ToArray(); From c244c230531d97ee1fadeabf37ac5ce56c532bb5 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 21 Nov 2021 23:03:25 +0800 Subject: [PATCH 011/117] better null comparison (#10915) --- .../src/main/resources/powershell/api_client.mustache | 6 +++--- .../src/main/resources/powershell/appveyor.mustache | 2 +- .../src/main/resources/powershell/configuration.mustache | 2 +- .../src/main/resources/powershell/model_simple.mustache | 2 +- samples/client/petstore/powershell/appveyor.yml | 2 +- .../powershell/src/PSPetstore/Client/PSConfiguration.ps1 | 2 +- .../client/petstore/powershell/src/PSPetstore/Model/Pet.ps1 | 4 ++-- .../powershell/src/PSPetstore/Private/PSApiClient.ps1 | 6 +++--- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/powershell/api_client.mustache b/modules/openapi-generator/src/main/resources/powershell/api_client.mustache index 2435b7b0ced1..f7769247fc49 100644 --- a/modules/openapi-generator/src/main/resources/powershell/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/powershell/api_client.mustache @@ -144,7 +144,7 @@ function Invoke-{{{apiNamePrefix}}}ApiClient { {{/hasHttpSignatureMethods}} if ($SkipCertificateCheck -eq $true) { - if ($Configuration["Proxy"] -eq $null) { + if ($null -eq $Configuration["Proxy"]) { # skip certification check, no proxy $Response = Invoke-WebRequest -Uri $UriBuilder.Uri ` -Method $Method ` @@ -166,7 +166,7 @@ function Invoke-{{{apiNamePrefix}}}ApiClient { -ProxyUseDefaultCredentials } } else { - if ($Configuration["Proxy"] -eq $null) { + if ($null -eq $Configuration["Proxy"]) { # perform certification check, no proxy $Response = Invoke-WebRequest -Uri $UriBuilder.Uri ` -Method $Method ` @@ -241,7 +241,7 @@ function DeserializeResponse { [string[]]$ContentTypes ) - If ($ContentTypes -eq $null) { + If ($null -eq $ContentTypes) { $ContentTypes = [string[]]@() } diff --git a/modules/openapi-generator/src/main/resources/powershell/appveyor.mustache b/modules/openapi-generator/src/main/resources/powershell/appveyor.mustache index d1047879e53b..1127a6fc20c4 100644 --- a/modules/openapi-generator/src/main/resources/powershell/appveyor.mustache +++ b/modules/openapi-generator/src/main/resources/powershell/appveyor.mustache @@ -20,7 +20,7 @@ test_script: } deploy_script: - pwsh: | - if ($env:APPVEYOR_REPO_TAG -eq $true -and $env:NuGetApiKey -ne $null) { + if ($env:APPVEYOR_REPO_TAG -eq $true -and $null -ne $env:NuGetApiKey) { .\Build.ps1 try { Publish-Module -NuGetApiKey $env:NuGetApiKey -Path .\src\{{{packageName}}}\ -Confirm:$False -Verbose diff --git a/modules/openapi-generator/src/main/resources/powershell/configuration.mustache b/modules/openapi-generator/src/main/resources/powershell/configuration.mustache index 21762dbf5c4c..0e674f1f560c 100644 --- a/modules/openapi-generator/src/main/resources/powershell/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/powershell/configuration.mustache @@ -172,7 +172,7 @@ function Set-{{{apiNamePrefix}}}Configuration { $Script:Configuration['DefaultHeaders'] = $DefaultHeaders } - If ($Proxy -ne $null) { + If ($null -ne $Proxy) { If ($Proxy.GetType().FullName -ne "System.Net.SystemWebProxy" -and $Proxy.GetType().FullName -ne "System.Net.WebRequest+WebProxyWrapperOpaque") { throw "Incorrect Proxy type '$($Proxy.GetType().FullName)'. Must be System.Net.SystemWebProxy or System.Net.WebRequest+WebProxyWrapperOpaque." } diff --git a/modules/openapi-generator/src/main/resources/powershell/model_simple.mustache b/modules/openapi-generator/src/main/resources/powershell/model_simple.mustache index 94f92c3dd033..f7954411df89 100644 --- a/modules/openapi-generator/src/main/resources/powershell/model_simple.mustache +++ b/modules/openapi-generator/src/main/resources/powershell/model_simple.mustache @@ -73,7 +73,7 @@ function Initialize-{{{apiNamePrefix}}}{{{classname}}} { {{#vars}} {{^isNullable}} {{#required}} - if (${{{name}}} -eq $null) { + if ($null -eq ${{{name}}}) { throw "invalid value for '{{{name}}}', '{{{name}}}' cannot be null." } diff --git a/samples/client/petstore/powershell/appveyor.yml b/samples/client/petstore/powershell/appveyor.yml index b6967a7c7b6f..86b98d394b5c 100644 --- a/samples/client/petstore/powershell/appveyor.yml +++ b/samples/client/petstore/powershell/appveyor.yml @@ -26,7 +26,7 @@ test_script: } deploy_script: - pwsh: | - if ($env:APPVEYOR_REPO_TAG -eq $true -and $env:NuGetApiKey -ne $null) { + if ($env:APPVEYOR_REPO_TAG -eq $true -and $null -ne $env:NuGetApiKey) { .\Build.ps1 try { Publish-Module -NuGetApiKey $env:NuGetApiKey -Path .\src\PSPetstore\ -Confirm:$False -Verbose diff --git a/samples/client/petstore/powershell/src/PSPetstore/Client/PSConfiguration.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Client/PSConfiguration.ps1 index 67e428658317..d24a405660da 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Client/PSConfiguration.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Client/PSConfiguration.ps1 @@ -178,7 +178,7 @@ function Set-PSConfiguration { $Script:Configuration['DefaultHeaders'] = $DefaultHeaders } - If ($Proxy -ne $null) { + If ($null -ne $Proxy) { If ($Proxy.GetType().FullName -ne "System.Net.SystemWebProxy" -and $Proxy.GetType().FullName -ne "System.Net.WebRequest+WebProxyWrapperOpaque") { throw "Incorrect Proxy type '$($Proxy.GetType().FullName)'. Must be System.Net.SystemWebProxy or System.Net.WebRequest+WebProxyWrapperOpaque." } diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/Pet.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/Pet.ps1 index eebc0a222606..5207e6986f6e 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Model/Pet.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/Pet.ps1 @@ -59,11 +59,11 @@ function Initialize-PSPet { 'Creating PSCustomObject: PSPetstore => PSPet' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug - if ($Name -eq $null) { + if ($null -eq $Name) { throw "invalid value for 'Name', 'Name' cannot be null." } - if ($PhotoUrls -eq $null) { + if ($null -eq $PhotoUrls) { throw "invalid value for 'PhotoUrls', 'PhotoUrls' cannot be null." } diff --git a/samples/client/petstore/powershell/src/PSPetstore/Private/PSApiClient.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Private/PSApiClient.ps1 index 11745f186146..be338cd33eb4 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Private/PSApiClient.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Private/PSApiClient.ps1 @@ -131,7 +131,7 @@ function Invoke-PSApiClient { } if ($SkipCertificateCheck -eq $true) { - if ($Configuration["Proxy"] -eq $null) { + if ($null -eq $Configuration["Proxy"]) { # skip certification check, no proxy $Response = Invoke-WebRequest -Uri $UriBuilder.Uri ` -Method $Method ` @@ -153,7 +153,7 @@ function Invoke-PSApiClient { -ProxyUseDefaultCredentials } } else { - if ($Configuration["Proxy"] -eq $null) { + if ($null -eq $Configuration["Proxy"]) { # perform certification check, no proxy $Response = Invoke-WebRequest -Uri $UriBuilder.Uri ` -Method $Method ` @@ -228,7 +228,7 @@ function DeserializeResponse { [string[]]$ContentTypes ) - If ($ContentTypes -eq $null) { + If ($null -eq $ContentTypes) { $ContentTypes = [string[]]@() } From 6779c33b9de63ae9c7cf0725761e7b0359c9ffb4 Mon Sep 17 00:00:00 2001 From: Ian Cubbon Date: Mon, 22 Nov 2021 01:27:43 -0700 Subject: [PATCH 012/117] [GO][Client] Multipart/form-data Request Support More Than One File (#10843) * Instead of limiting a request to a single file when performing an upload, use a slice of files so an arbitrary number of files can be used in the form. * Remove commented out line of code * Update examples for multi-form file fix for multiple files * Convert spaces to tabs for indentation * Updated examples to have tabs instead of spaces * Add an example of a multipart/form-data OA3 schema that contains two files to be uploaded --- .../src/main/resources/go/api.mustache | 30 +- .../src/main/resources/go/client.mustache | 33 +- .../go/go-petstore/api_another_fake.go | 6 +- .../petstore/go/go-petstore/api_fake.go | 106 ++-- .../go-petstore/api_fake_classname_tags123.go | 6 +- .../client/petstore/go/go-petstore/api_pet.go | 96 ++- .../petstore/go/go-petstore/api_store.go | 24 +- .../petstore/go/go-petstore/api_user.go | 48 +- .../client/petstore/go/go-petstore/client.go | 33 +- .../go-experimental/api_usage.go | 24 +- .../x-auth-id-alias/go-experimental/client.go | 33 +- .../mulitple-data-in-forms/.gitignore | 24 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 16 + .../.openapi-generator/VERSION | 1 + .../mulitple-data-in-forms/.travis.yml | 8 + .../features/mulitple-data-in-forms/README.md | 113 ++++ .../mulitple-data-in-forms/api/openapi.yaml | 73 +++ .../mulitple-data-in-forms/api_default.go | 172 ++++++ .../features/mulitple-data-in-forms/client.go | 553 ++++++++++++++++++ .../mulitple-data-in-forms/configuration.go | 230 ++++++++ .../docs/ApiResponse.md | 108 ++++ .../mulitple-data-in-forms/docs/DefaultApi.md | 75 +++ .../mulitple-data-in-forms/git_push.sh | 57 ++ .../features/mulitple-data-in-forms/go.mod | 7 + .../features/mulitple-data-in-forms/go.sum | 13 + .../model_api_response.go | 187 ++++++ .../multiple-files-forms.yaml | 52 ++ .../mulitple-data-in-forms/response.go | 47 ++ .../features/mulitple-data-in-forms/utils.go | 328 +++++++++++ .../go/go-petstore/api_another_fake.go | 6 +- .../petstore/go/go-petstore/api_default.go | 6 +- .../petstore/go/go-petstore/api_fake.go | 112 ++-- .../go-petstore/api_fake_classname_tags123.go | 6 +- .../client/petstore/go/go-petstore/api_pet.go | 96 ++- .../petstore/go/go-petstore/api_store.go | 24 +- .../petstore/go/go-petstore/api_user.go | 48 +- .../client/petstore/go/go-petstore/client.go | 33 +- 38 files changed, 2422 insertions(+), 435 deletions(-) create mode 100644 samples/openapi3/client/features/mulitple-data-in-forms/.gitignore create mode 100644 samples/openapi3/client/features/mulitple-data-in-forms/.openapi-generator-ignore create mode 100644 samples/openapi3/client/features/mulitple-data-in-forms/.openapi-generator/FILES create mode 100644 samples/openapi3/client/features/mulitple-data-in-forms/.openapi-generator/VERSION create mode 100644 samples/openapi3/client/features/mulitple-data-in-forms/.travis.yml create mode 100644 samples/openapi3/client/features/mulitple-data-in-forms/README.md create mode 100644 samples/openapi3/client/features/mulitple-data-in-forms/api/openapi.yaml create mode 100644 samples/openapi3/client/features/mulitple-data-in-forms/api_default.go create mode 100644 samples/openapi3/client/features/mulitple-data-in-forms/client.go create mode 100644 samples/openapi3/client/features/mulitple-data-in-forms/configuration.go create mode 100644 samples/openapi3/client/features/mulitple-data-in-forms/docs/ApiResponse.md create mode 100644 samples/openapi3/client/features/mulitple-data-in-forms/docs/DefaultApi.md create mode 100644 samples/openapi3/client/features/mulitple-data-in-forms/git_push.sh create mode 100644 samples/openapi3/client/features/mulitple-data-in-forms/go.mod create mode 100644 samples/openapi3/client/features/mulitple-data-in-forms/go.sum create mode 100644 samples/openapi3/client/features/mulitple-data-in-forms/model_api_response.go create mode 100644 samples/openapi3/client/features/mulitple-data-in-forms/multiple-files-forms.yaml create mode 100644 samples/openapi3/client/features/mulitple-data-in-forms/response.go create mode 100644 samples/openapi3/client/features/mulitple-data-in-forms/utils.go diff --git a/modules/openapi-generator/src/main/resources/go/api.mustache b/modules/openapi-generator/src/main/resources/go/api.mustache index cabab9ca8fa6..4a94d6aaf598 100644 --- a/modules/openapi-generator/src/main/resources/go/api.mustache +++ b/modules/openapi-generator/src/main/resources/go/api.mustache @@ -109,9 +109,7 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class var ( localVarHTTPMethod = _nethttp.Method{{httpMethod}} localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile {{#returnType}} localVarReturnValue {{{.}}} {{/returnType}} @@ -251,22 +249,28 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class {{/headerParams}} {{#formParams}} {{#isFile}} - localVarFormFileName = "{{baseName}}" + var {{paramName}}LocalVarFormFileName string + var {{paramName}}LocalVarFileName string + var {{paramName}}LocalVarFileBytes []byte + + {{paramName}}LocalVarFormFileName = "{{baseName}}" + {{#required}} - localVarFile := *r.{{paramName}} + {{paramName}}LocalVarFile := *r.{{paramName}} {{/required}} {{^required}} - var localVarFile {{dataType}} + var {{paramName}}LocalVarFile {{dataType}} if r.{{paramName}} != nil { - localVarFile = *r.{{paramName}} + {{paramName}}LocalVarFile = *r.{{paramName}} } {{/required}} - if localVarFile != nil { - fbs, _ := _ioutil.ReadAll(localVarFile) - localVarFileBytes = fbs - localVarFileName = localVarFile.Name() - localVarFile.Close() + if {{paramName}}LocalVarFile != nil { + fbs, _ := _ioutil.ReadAll({{paramName}}LocalVarFile) + {{paramName}}LocalVarFileBytes = fbs + {{paramName}}LocalVarFileName = {{paramName}}LocalVarFile.Name() + {{paramName}}LocalVarFile.Close() } + formFiles = append(formFiles, formFile{fileBytes: {{paramName}}LocalVarFileBytes, fileName: {{paramName}}LocalVarFileName, formFileName: {{paramName}}LocalVarFormFileName}) {{/isFile}} {{^isFile}} {{#required}} @@ -330,7 +334,7 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class {{/isKeyInCookie}} {{/isApiKey}} {{/authMethods}} - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return {{#returnType}}localVarReturnValue, {{/returnType}}nil, err } diff --git a/modules/openapi-generator/src/main/resources/go/client.mustache b/modules/openapi-generator/src/main/resources/go/client.mustache index ace6231a44fa..609b362a8629 100644 --- a/modules/openapi-generator/src/main/resources/go/client.mustache +++ b/modules/openapi-generator/src/main/resources/go/client.mustache @@ -196,6 +196,12 @@ func (c *APIClient) GetConfig() *Configuration { return c.cfg } +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + // prepareRequest build the request func (c *APIClient) prepareRequest( ctx context.Context, @@ -204,9 +210,7 @@ func (c *APIClient) prepareRequest( headerParams map[string]string, queryParams url.Values, formParams url.Values, - formFileName string, - fileName string, - fileBytes []byte) (localVarRequest *http.Request, err error) { + formFiles []formFile) (localVarRequest *http.Request, err error) { var body *bytes.Buffer @@ -225,7 +229,7 @@ func (c *APIClient) prepareRequest( } // add form parameters and file if available. - if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { if body != nil { return nil, errors.New("Cannot specify postBody and multipart form at the same time.") } @@ -244,16 +248,17 @@ func (c *APIClient) prepareRequest( } } } - if len(fileBytes) > 0 && fileName != "" { - w.Boundary() - //_, fileNm := filepath.Split(fileName) - part, err := w.CreateFormFile(formFileName, filepath.Base(fileName)) - if err != nil { - return nil, err - } - _, err = part.Write(fileBytes) - if err != nil { - return nil, err + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } } } diff --git a/samples/client/petstore/go/go-petstore/api_another_fake.go b/samples/client/petstore/go/go-petstore/api_another_fake.go index c460926ef23b..bb5add0ca9fe 100644 --- a/samples/client/petstore/go/go-petstore/api_another_fake.go +++ b/samples/client/petstore/go/go-petstore/api_another_fake.go @@ -80,9 +80,7 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp var ( localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue Client ) @@ -119,7 +117,7 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp } // body params localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } diff --git a/samples/client/petstore/go/go-petstore/api_fake.go b/samples/client/petstore/go/go-petstore/api_fake.go index 92bd64eaa92e..40252ad41b5a 100644 --- a/samples/client/petstore/go/go-petstore/api_fake.go +++ b/samples/client/petstore/go/go-petstore/api_fake.go @@ -252,9 +252,7 @@ func (a *FakeApiService) CreateXmlItemExecute(r ApiCreateXmlItemRequest) (*_neth var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.CreateXmlItem") @@ -290,7 +288,7 @@ func (a *FakeApiService) CreateXmlItemExecute(r ApiCreateXmlItemRequest) (*_neth } // body params localVarPostBody = r.xmlItem - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -355,9 +353,7 @@ func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanS var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue bool ) @@ -391,7 +387,7 @@ func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanS } // body params localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -465,9 +461,7 @@ func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompos var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue OuterComposite ) @@ -501,7 +495,7 @@ func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompos } // body params localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -575,9 +569,7 @@ func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSer var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue float32 ) @@ -611,7 +603,7 @@ func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSer } // body params localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -685,9 +677,7 @@ func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSer var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue string ) @@ -721,7 +711,7 @@ func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSer } // body params localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -793,9 +783,7 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithFileSchema") @@ -831,7 +819,7 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche } // body params localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -897,9 +885,7 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithQueryParams") @@ -939,7 +925,7 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa } // body params localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1004,9 +990,7 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl var ( localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue Client ) @@ -1043,7 +1027,7 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl } // body params localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1197,9 +1181,7 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEndpointParameters") @@ -1273,17 +1255,23 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete } localVarFormParams.Add("pattern_without_delimiter", parameterToString(*r.patternWithoutDelimiter, "")) localVarFormParams.Add("byte", parameterToString(*r.byte_, "")) - localVarFormFileName = "binary" - var localVarFile *os.File + var binaryLocalVarFormFileName string + var binaryLocalVarFileName string + var binaryLocalVarFileBytes []byte + + binaryLocalVarFormFileName = "binary" + + var binaryLocalVarFile *os.File if r.binary != nil { - localVarFile = *r.binary + binaryLocalVarFile = *r.binary } - if localVarFile != nil { - fbs, _ := _ioutil.ReadAll(localVarFile) - localVarFileBytes = fbs - localVarFileName = localVarFile.Name() - localVarFile.Close() + if binaryLocalVarFile != nil { + fbs, _ := _ioutil.ReadAll(binaryLocalVarFile) + binaryLocalVarFileBytes = fbs + binaryLocalVarFileName = binaryLocalVarFile.Name() + binaryLocalVarFile.Close() } + formFiles = append(formFiles, formFile{fileBytes: binaryLocalVarFileBytes, fileName: binaryLocalVarFileName, formFileName: binaryLocalVarFormFileName}) if r.date != nil { localVarFormParams.Add("date", parameterToString(*r.date, "")) } @@ -1296,7 +1284,7 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete if r.callback != nil { localVarFormParams.Add("callback", parameterToString(*r.callback, "")) } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1402,9 +1390,7 @@ func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersReques var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEnumParameters") @@ -1459,7 +1445,7 @@ func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersReques if r.enumFormString != nil { localVarFormParams.Add("enum_form_string", parameterToString(*r.enumFormString, "")) } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1553,9 +1539,7 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestGroupParameters") @@ -1607,7 +1591,7 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ if r.booleanGroup != nil { localVarHeaderParams["boolean_group"] = parameterToString(*r.booleanGroup, "") } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1669,9 +1653,7 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestInlineAdditionalProperties") @@ -1707,7 +1689,7 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd } // body params localVarPostBody = r.param - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1775,9 +1757,7 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestJsonFormData") @@ -1816,7 +1796,7 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( } localVarFormParams.Add("param", parameterToString(*r.param, "")) localVarFormParams.Add("param2", parameterToString(*r.param2, "")) - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1899,9 +1879,7 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestQueryParameterCollectionFormat") @@ -1962,7 +1940,7 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } diff --git a/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go b/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go index cc8592a1a785..67f9f95661a7 100644 --- a/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go +++ b/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go @@ -80,9 +80,7 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname var ( localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue Client ) @@ -133,7 +131,7 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } diff --git a/samples/client/petstore/go/go-petstore/api_pet.go b/samples/client/petstore/go/go-petstore/api_pet.go index 9e806f501e58..dc8fe0167356 100644 --- a/samples/client/petstore/go/go-petstore/api_pet.go +++ b/samples/client/petstore/go/go-petstore/api_pet.go @@ -183,9 +183,7 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, e var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.AddPet") @@ -221,7 +219,7 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, e } // body params localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -285,9 +283,7 @@ func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Respo var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.DeletePet") @@ -322,7 +318,7 @@ func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Respo if r.apiKey != nil { localVarHeaderParams["api_key"] = parameterToString(*r.apiKey, "") } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -387,9 +383,7 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []Pet ) @@ -425,7 +419,7 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -502,9 +496,7 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []Pet ) @@ -540,7 +532,7 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -611,9 +603,7 @@ func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethtt var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue Pet ) @@ -660,7 +650,7 @@ func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethtt } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -731,9 +721,7 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePet") @@ -769,7 +757,7 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo } // body params localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -840,9 +828,7 @@ func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePetWithForm") @@ -880,7 +866,7 @@ func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) if r.status != nil { localVarFormParams.Add("status", parameterToString(*r.status, "")) } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -952,9 +938,7 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue ApiResponse ) @@ -990,18 +974,24 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, if r.additionalMetadata != nil { localVarFormParams.Add("additionalMetadata", parameterToString(*r.additionalMetadata, "")) } - localVarFormFileName = "file" - var localVarFile *os.File + var fileLocalVarFormFileName string + var fileLocalVarFileName string + var fileLocalVarFileBytes []byte + + fileLocalVarFormFileName = "file" + + var fileLocalVarFile *os.File if r.file != nil { - localVarFile = *r.file + fileLocalVarFile = *r.file } - if localVarFile != nil { - fbs, _ := _ioutil.ReadAll(localVarFile) - localVarFileBytes = fbs - localVarFileName = localVarFile.Name() - localVarFile.Close() + if fileLocalVarFile != nil { + fbs, _ := _ioutil.ReadAll(fileLocalVarFile) + fileLocalVarFileBytes = fbs + fileLocalVarFileName = fileLocalVarFile.Name() + fileLocalVarFile.Close() } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + formFiles = append(formFiles, formFile{fileBytes: fileLocalVarFileBytes, fileName: fileLocalVarFileName, formFileName: fileLocalVarFormFileName}) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1082,9 +1072,7 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue ApiResponse ) @@ -1123,15 +1111,21 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq if r.additionalMetadata != nil { localVarFormParams.Add("additionalMetadata", parameterToString(*r.additionalMetadata, "")) } - localVarFormFileName = "requiredFile" - localVarFile := *r.requiredFile - if localVarFile != nil { - fbs, _ := _ioutil.ReadAll(localVarFile) - localVarFileBytes = fbs - localVarFileName = localVarFile.Name() - localVarFile.Close() + var requiredFileLocalVarFormFileName string + var requiredFileLocalVarFileName string + var requiredFileLocalVarFileBytes []byte + + requiredFileLocalVarFormFileName = "requiredFile" + + requiredFileLocalVarFile := *r.requiredFile + if requiredFileLocalVarFile != nil { + fbs, _ := _ioutil.ReadAll(requiredFileLocalVarFile) + requiredFileLocalVarFileBytes = fbs + requiredFileLocalVarFileName = requiredFileLocalVarFile.Name() + requiredFileLocalVarFile.Close() } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + formFiles = append(formFiles, formFile{fileBytes: requiredFileLocalVarFileBytes, fileName: requiredFileLocalVarFileName, formFileName: requiredFileLocalVarFormFileName}) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } diff --git a/samples/client/petstore/go/go-petstore/api_store.go b/samples/client/petstore/go/go-petstore/api_store.go index 0d31a9d574a5..be6336216da6 100644 --- a/samples/client/petstore/go/go-petstore/api_store.go +++ b/samples/client/petstore/go/go-petstore/api_store.go @@ -118,9 +118,7 @@ func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.DeleteOrder") @@ -152,7 +150,7 @@ func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -211,9 +209,7 @@ func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[str var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue map[string]int32 ) @@ -259,7 +255,7 @@ func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[str } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -330,9 +326,7 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue Order ) @@ -371,7 +365,7 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -443,9 +437,7 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue Order ) @@ -482,7 +474,7 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne } // body params localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } diff --git a/samples/client/petstore/go/go-petstore/api_user.go b/samples/client/petstore/go/go-petstore/api_user.go index b1f6a57f9c4e..d6f2c7f710bd 100644 --- a/samples/client/petstore/go/go-petstore/api_user.go +++ b/samples/client/petstore/go/go-petstore/api_user.go @@ -165,9 +165,7 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUser") @@ -203,7 +201,7 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re } // body params localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -265,9 +263,7 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithArrayInput") @@ -303,7 +299,7 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr } // body params localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -365,9 +361,7 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithListInput") @@ -403,7 +397,7 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis } // body params localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -464,9 +458,7 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Re var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.DeleteUser") @@ -498,7 +490,7 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Re if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -558,9 +550,7 @@ func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue User ) @@ -593,7 +583,7 @@ func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -671,9 +661,7 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue string ) @@ -713,7 +701,7 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -778,9 +766,7 @@ func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Re var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LogoutUser") @@ -811,7 +797,7 @@ func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Re if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -878,9 +864,7 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Re var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.UpdateUser") @@ -917,7 +901,7 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Re } // body params localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } diff --git a/samples/client/petstore/go/go-petstore/client.go b/samples/client/petstore/go/go-petstore/client.go index efd991f27007..8fbafd329352 100644 --- a/samples/client/petstore/go/go-petstore/client.go +++ b/samples/client/petstore/go/go-petstore/client.go @@ -204,6 +204,12 @@ func (c *APIClient) GetConfig() *Configuration { return c.cfg } +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + // prepareRequest build the request func (c *APIClient) prepareRequest( ctx context.Context, @@ -212,9 +218,7 @@ func (c *APIClient) prepareRequest( headerParams map[string]string, queryParams url.Values, formParams url.Values, - formFileName string, - fileName string, - fileBytes []byte) (localVarRequest *http.Request, err error) { + formFiles []formFile) (localVarRequest *http.Request, err error) { var body *bytes.Buffer @@ -233,7 +237,7 @@ func (c *APIClient) prepareRequest( } // add form parameters and file if available. - if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { if body != nil { return nil, errors.New("Cannot specify postBody and multipart form at the same time.") } @@ -252,16 +256,17 @@ func (c *APIClient) prepareRequest( } } } - if len(fileBytes) > 0 && fileName != "" { - w.Boundary() - //_, fileNm := filepath.Split(fileName) - part, err := w.CreateFormFile(formFileName, filepath.Base(fileName)) - if err != nil { - return nil, err - } - _, err = part.Write(fileBytes) - if err != nil { - return nil, err + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } } } diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go index d98b721c83d9..6e891fbe6faa 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go +++ b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/api_usage.go @@ -57,9 +57,7 @@ func (a *UsageApiService) AnyKeyExecute(r ApiAnyKeyRequest) (map[string]interfac var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue map[string]interface{} ) @@ -119,7 +117,7 @@ func (a *UsageApiService) AnyKeyExecute(r ApiAnyKeyRequest) (map[string]interfac } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -187,9 +185,7 @@ func (a *UsageApiService) BothKeysExecute(r ApiBothKeysRequest) (map[string]inte var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue map[string]interface{} ) @@ -249,7 +245,7 @@ func (a *UsageApiService) BothKeysExecute(r ApiBothKeysRequest) (map[string]inte } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -317,9 +313,7 @@ func (a *UsageApiService) KeyInHeaderExecute(r ApiKeyInHeaderRequest) (map[strin var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue map[string]interface{} ) @@ -365,7 +359,7 @@ func (a *UsageApiService) KeyInHeaderExecute(r ApiKeyInHeaderRequest) (map[strin } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -433,9 +427,7 @@ func (a *UsageApiService) KeyInQueryExecute(r ApiKeyInQueryRequest) (map[string] var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue map[string]interface{} ) @@ -481,7 +473,7 @@ func (a *UsageApiService) KeyInQueryExecute(r ApiKeyInQueryRequest) (map[string] } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/client.go b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/client.go index cdec38218593..f7a7c368cbf3 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/client.go +++ b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/client.go @@ -189,6 +189,12 @@ func (c *APIClient) GetConfig() *Configuration { return c.cfg } +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + // prepareRequest build the request func (c *APIClient) prepareRequest( ctx context.Context, @@ -197,9 +203,7 @@ func (c *APIClient) prepareRequest( headerParams map[string]string, queryParams url.Values, formParams url.Values, - formFileName string, - fileName string, - fileBytes []byte) (localVarRequest *http.Request, err error) { + formFiles []formFile) (localVarRequest *http.Request, err error) { var body *bytes.Buffer @@ -218,7 +222,7 @@ func (c *APIClient) prepareRequest( } // add form parameters and file if available. - if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { if body != nil { return nil, errors.New("Cannot specify postBody and multipart form at the same time.") } @@ -237,16 +241,17 @@ func (c *APIClient) prepareRequest( } } } - if len(fileBytes) > 0 && fileName != "" { - w.Boundary() - //_, fileNm := filepath.Split(fileName) - part, err := w.CreateFormFile(formFileName, filepath.Base(fileName)) - if err != nil { - return nil, err - } - _, err = part.Write(fileBytes) - if err != nil { - return nil, err + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } } } diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/.gitignore b/samples/openapi3/client/features/mulitple-data-in-forms/.gitignore new file mode 100644 index 000000000000..daf913b1b347 --- /dev/null +++ b/samples/openapi3/client/features/mulitple-data-in-forms/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/.openapi-generator-ignore b/samples/openapi3/client/features/mulitple-data-in-forms/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/openapi3/client/features/mulitple-data-in-forms/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/.openapi-generator/FILES b/samples/openapi3/client/features/mulitple-data-in-forms/.openapi-generator/FILES new file mode 100644 index 000000000000..c55836136d01 --- /dev/null +++ b/samples/openapi3/client/features/mulitple-data-in-forms/.openapi-generator/FILES @@ -0,0 +1,16 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +docs/ApiResponse.md +docs/DefaultApi.md +git_push.sh +go.mod +go.sum +model_api_response.go +response.go +utils.go diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/.openapi-generator/VERSION b/samples/openapi3/client/features/mulitple-data-in-forms/.openapi-generator/VERSION new file mode 100644 index 000000000000..4077803655c0 --- /dev/null +++ b/samples/openapi3/client/features/mulitple-data-in-forms/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/.travis.yml b/samples/openapi3/client/features/mulitple-data-in-forms/.travis.yml new file mode 100644 index 000000000000..f5cb2ce9a5aa --- /dev/null +++ b/samples/openapi3/client/features/mulitple-data-in-forms/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/README.md b/samples/openapi3/client/features/mulitple-data-in-forms/README.md new file mode 100644 index 000000000000..76cfee5b4043 --- /dev/null +++ b/samples/openapi3/client/features/mulitple-data-in-forms/README.md @@ -0,0 +1,113 @@ +# Go API client for openapi + +This is a sample server with a single endpoint that accepts two files via a multipart/form-data POST request. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/oauth2 +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import sw "./openapi" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), sw.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +``` +ctx := context.WithValue(context.Background(), sw.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), sw.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://example.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**UploadFiles**](docs/DefaultApi.md#uploadfiles) | **Post** /uploadFiles | uploads two files + + +## Documentation For Models + + - [ApiResponse](docs/ApiResponse.md) + + +## Documentation For Authorization + + Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/api/openapi.yaml b/samples/openapi3/client/features/mulitple-data-in-forms/api/openapi.yaml new file mode 100644 index 000000000000..b849a15b6585 --- /dev/null +++ b/samples/openapi3/client/features/mulitple-data-in-forms/api/openapi.yaml @@ -0,0 +1,73 @@ +openapi: 3.0.0 +info: + description: This is a sample server with a single endpoint that accepts two files + via a multipart/form-data POST request. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Multiple Files via form-data + version: 1.0.0 +servers: +- url: http://example.com +paths: + /uploadFiles: + post: + operationId: uploadFiles + requestBody: + $ref: '#/components/requestBodies/inline_object' + content: + multipart/form-data: + schema: + properties: + file: + description: file to upload + format: binary + type: string + secondFile: + description: another file to upload + format: binary + type: string + type: object + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + summary: uploads two files +components: + requestBodies: + inline_object: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/inline_object' + schemas: + ApiResponse: + description: Describes the result of uploading files + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + title: An uploaded response + type: object + inline_object: + properties: + file: + description: file to upload + format: binary + type: string + secondFile: + description: another file to upload + format: binary + type: string + type: object diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/api_default.go b/samples/openapi3/client/features/mulitple-data-in-forms/api_default.go new file mode 100644 index 000000000000..81c36eb8bb9a --- /dev/null +++ b/samples/openapi3/client/features/mulitple-data-in-forms/api_default.go @@ -0,0 +1,172 @@ +/* +Multiple Files via form-data + +This is a sample server with a single endpoint that accepts two files via a multipart/form-data POST request. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "bytes" + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "os" +) + +// Linger please +var ( + _ _context.Context +) + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiUploadFilesRequest struct { + ctx _context.Context + ApiService *DefaultApiService + file **os.File + secondFile **os.File +} + +// file to upload +func (r ApiUploadFilesRequest) File(file *os.File) ApiUploadFilesRequest { + r.file = &file + return r +} +// another file to upload +func (r ApiUploadFilesRequest) SecondFile(secondFile *os.File) ApiUploadFilesRequest { + r.secondFile = &secondFile + return r +} + +func (r ApiUploadFilesRequest) Execute() (ApiResponse, *_nethttp.Response, error) { + return r.ApiService.UploadFilesExecute(r) +} + +/* +UploadFiles uploads two files + + @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUploadFilesRequest +*/ +func (a *DefaultApiService) UploadFiles(ctx _context.Context) ApiUploadFilesRequest { + return ApiUploadFilesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return ApiResponse +func (a *DefaultApiService) UploadFilesExecute(r ApiUploadFilesRequest) (ApiResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue ApiResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UploadFiles") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/uploadFiles" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + var fileLocalVarFormFileName string + var fileLocalVarFileName string + var fileLocalVarFileBytes []byte + + fileLocalVarFormFileName = "file" + + var fileLocalVarFile *os.File + if r.file != nil { + fileLocalVarFile = *r.file + } + if fileLocalVarFile != nil { + fbs, _ := _ioutil.ReadAll(fileLocalVarFile) + fileLocalVarFileBytes = fbs + fileLocalVarFileName = fileLocalVarFile.Name() + fileLocalVarFile.Close() + } + formFiles = append(formFiles, formFile{fileBytes: fileLocalVarFileBytes, fileName: fileLocalVarFileName, formFileName: fileLocalVarFormFileName}) + var secondFileLocalVarFormFileName string + var secondFileLocalVarFileName string + var secondFileLocalVarFileBytes []byte + + secondFileLocalVarFormFileName = "secondFile" + + var secondFileLocalVarFile *os.File + if r.secondFile != nil { + secondFileLocalVarFile = *r.secondFile + } + if secondFileLocalVarFile != nil { + fbs, _ := _ioutil.ReadAll(secondFileLocalVarFile) + secondFileLocalVarFileBytes = fbs + secondFileLocalVarFileName = secondFileLocalVarFile.Name() + secondFileLocalVarFile.Close() + } + formFiles = append(formFiles, formFile{fileBytes: secondFileLocalVarFileBytes, fileName: secondFileLocalVarFileName, formFileName: secondFileLocalVarFormFileName}) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/client.go b/samples/openapi3/client/features/mulitple-data-in-forms/client.go new file mode 100644 index 000000000000..3d2f9db38b62 --- /dev/null +++ b/samples/openapi3/client/features/mulitple-data-in-forms/client.go @@ -0,0 +1,553 @@ +/* +Multiple Files via form-data + +This is a sample server with a single endpoint that accepts two files via a multipart/form-data POST request. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "io/ioutil" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "golang.org/x/oauth2" +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) +) + +// APIClient manages communication with the Multiple Files via form-data API v1.0.0 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.ToLower(a) == strings.ToLower(needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +// parameterToString convert interface{} parameters to string, using a delimiter if format is provided. +func parameterToString(obj interface{}, collectionFormat string) string { + var delimiter string + + switch collectionFormat { + case "pipes": + delimiter = "|" + case "ssv": + delimiter = " " + case "tsv": + delimiter = "\t" + case "csv": + delimiter = "," + } + + if reflect.TypeOf(obj).Kind() == reflect.Slice { + return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]") + } else if t, ok := obj.(time.Time); ok { + return t.Format(time.RFC3339) + } + + return fmt.Sprintf("%v", obj) +} + +// helper for converting interface{} parameters to json strings +func parameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + if c.cfg.Debug { + dump, err := httputil.DumpRequestOut(request, true) + if err != nil { + return nil, err + } + log.Printf("\n%s\n", string(dump)) + } + + resp, err := c.cfg.HTTPClient.Do(request) + if err != nil { + return resp, err + } + + if c.cfg.Debug { + dump, err := httputil.DumpResponse(resp, true) + if err != nil { + return resp, err + } + log.Printf("\n%s\n", string(dump)) + } + return resp, err +} + +// Allow modification of underlying config for alternate implementations and testing +// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +func (c *APIClient) GetConfig() *Configuration { + return c.cfg +} + +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFiles []formFile) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = query.Encode() + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers.Set(h, v) + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + // OAuth2 authentication + if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok { + // We were able to grab an oauth2 token from the context + var latestToken *oauth2.Token + if latestToken, err = tok.Token(); err != nil { + return nil, err + } + + latestToken.SetAuthHeader(localVarRequest) + } + + // Basic HTTP Authentication + if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok { + localVarRequest.SetBasicAuth(auth.UserName, auth.Password) + } + + // AccessToken Authentication + if auth, ok := ctx.Value(ContextAccessToken).(string); ok { + localVarRequest.Header.Add("Authorization", "Bearer "+auth) + } + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(**os.File); ok { + *f, err = ioutil.TempFile("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(path) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(**os.File); ok { + _, err = bodyBuf.ReadFrom(*fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("Invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/configuration.go b/samples/openapi3/client/features/mulitple-data-in-forms/configuration.go new file mode 100644 index 000000000000..b37e37f59eb3 --- /dev/null +++ b/samples/openapi3/client/features/mulitple-data-in-forms/configuration.go @@ -0,0 +1,230 @@ +/* +Multiple Files via form-data + +This is a sample server with a single endpoint that accepts two files via a multipart/form-data POST request. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextOAuth2 takes an oauth2.TokenSource as authentication for the request. + ContextOAuth2 = contextKey("token") + + // ContextBasicAuth takes BasicAuth as authentication for the request. + ContextBasicAuth = contextKey("basic") + + // ContextAccessToken takes a string oauth2 access token as authentication for the request. + ContextAccessToken = contextKey("accesstoken") + + // ContextAPIKeys takes a string apikey as authentication for the request + ContextAPIKeys = contextKey("apiKeys") + + // ContextHttpSignatureAuth takes HttpSignatureAuth as authentication for the request. + ContextHttpSignatureAuth = contextKey("httpsignature") + + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "http://example.com", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("Index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("The variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/docs/ApiResponse.md b/samples/openapi3/client/features/mulitple-data-in-forms/docs/ApiResponse.md new file mode 100644 index 000000000000..877dacb4293c --- /dev/null +++ b/samples/openapi3/client/features/mulitple-data-in-forms/docs/ApiResponse.md @@ -0,0 +1,108 @@ +# ApiResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | Pointer to **int32** | | [optional] +**Type** | Pointer to **string** | | [optional] +**Message** | Pointer to **string** | | [optional] + +## Methods + +### NewApiResponse + +`func NewApiResponse() *ApiResponse` + +NewApiResponse instantiates a new ApiResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewApiResponseWithDefaults + +`func NewApiResponseWithDefaults() *ApiResponse` + +NewApiResponseWithDefaults instantiates a new ApiResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCode + +`func (o *ApiResponse) GetCode() int32` + +GetCode returns the Code field if non-nil, zero value otherwise. + +### GetCodeOk + +`func (o *ApiResponse) GetCodeOk() (*int32, bool)` + +GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCode + +`func (o *ApiResponse) SetCode(v int32)` + +SetCode sets Code field to given value. + +### HasCode + +`func (o *ApiResponse) HasCode() bool` + +HasCode returns a boolean if a field has been set. + +### GetType + +`func (o *ApiResponse) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *ApiResponse) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *ApiResponse) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *ApiResponse) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetMessage + +`func (o *ApiResponse) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *ApiResponse) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *ApiResponse) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *ApiResponse) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/docs/DefaultApi.md b/samples/openapi3/client/features/mulitple-data-in-forms/docs/DefaultApi.md new file mode 100644 index 000000000000..fc5678d93458 --- /dev/null +++ b/samples/openapi3/client/features/mulitple-data-in-forms/docs/DefaultApi.md @@ -0,0 +1,75 @@ +# \DefaultApi + +All URIs are relative to *http://example.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UploadFiles**](DefaultApi.md#UploadFiles) | **Post** /uploadFiles | uploads two files + + + +## UploadFiles + +> ApiResponse UploadFiles(ctx).File(file).SecondFile(secondFile).Execute() + +uploads two files + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + file := os.NewFile(1234, "some_file") // *os.File | file to upload (optional) + secondFile := os.NewFile(1234, "some_file") // *os.File | another file to upload (optional) + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.DefaultApi.UploadFiles(context.Background()).File(file).SecondFile(secondFile).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.UploadFiles``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UploadFiles`: ApiResponse + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.UploadFiles`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiUploadFilesRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **file** | ***os.File** | file to upload | + **secondFile** | ***os.File** | another file to upload | + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +No authorization required + +### 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/openapi3/client/features/mulitple-data-in-forms/git_push.sh b/samples/openapi3/client/features/mulitple-data-in-forms/git_push.sh new file mode 100644 index 000000000000..f53a75d4fabe --- /dev/null +++ b/samples/openapi3/client/features/mulitple-data-in-forms/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/go.mod b/samples/openapi3/client/features/mulitple-data-in-forms/go.mod new file mode 100644 index 000000000000..0f43de9ebb2c --- /dev/null +++ b/samples/openapi3/client/features/mulitple-data-in-forms/go.mod @@ -0,0 +1,7 @@ +module github.com/GIT_USER_ID/GIT_REPO_ID + +go 1.13 + +require ( + golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99 +) diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/go.sum b/samples/openapi3/client/features/mulitple-data-in-forms/go.sum new file mode 100644 index 000000000000..734252e68153 --- /dev/null +++ b/samples/openapi3/client/features/mulitple-data-in-forms/go.sum @@ -0,0 +1,13 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/model_api_response.go b/samples/openapi3/client/features/mulitple-data-in-forms/model_api_response.go new file mode 100644 index 000000000000..d1fee6092d1e --- /dev/null +++ b/samples/openapi3/client/features/mulitple-data-in-forms/model_api_response.go @@ -0,0 +1,187 @@ +/* +Multiple Files via form-data + +This is a sample server with a single endpoint that accepts two files via a multipart/form-data POST request. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// ApiResponse Describes the result of uploading files +type ApiResponse struct { + Code *int32 `json:"code,omitempty"` + Type *string `json:"type,omitempty"` + Message *string `json:"message,omitempty"` +} + +// NewApiResponse instantiates a new ApiResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewApiResponse() *ApiResponse { + this := ApiResponse{} + return &this +} + +// NewApiResponseWithDefaults instantiates a new ApiResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewApiResponseWithDefaults() *ApiResponse { + this := ApiResponse{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *ApiResponse) GetCode() int32 { + if o == nil || o.Code == nil { + var ret int32 + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApiResponse) GetCodeOk() (*int32, bool) { + if o == nil || o.Code == nil { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *ApiResponse) HasCode() bool { + if o != nil && o.Code != nil { + return true + } + + return false +} + +// SetCode gets a reference to the given int32 and assigns it to the Code field. +func (o *ApiResponse) SetCode(v int32) { + o.Code = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *ApiResponse) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApiResponse) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *ApiResponse) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *ApiResponse) SetType(v string) { + o.Type = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *ApiResponse) GetMessage() string { + if o == nil || o.Message == nil { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApiResponse) GetMessageOk() (*string, bool) { + if o == nil || o.Message == nil { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *ApiResponse) HasMessage() bool { + if o != nil && o.Message != nil { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *ApiResponse) SetMessage(v string) { + o.Message = &v +} + +func (o ApiResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Code != nil { + toSerialize["code"] = o.Code + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Message != nil { + toSerialize["message"] = o.Message + } + return json.Marshal(toSerialize) +} + +type NullableApiResponse struct { + value *ApiResponse + isSet bool +} + +func (v NullableApiResponse) Get() *ApiResponse { + return v.value +} + +func (v *NullableApiResponse) Set(val *ApiResponse) { + v.value = val + v.isSet = true +} + +func (v NullableApiResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableApiResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApiResponse(val *ApiResponse) *NullableApiResponse { + return &NullableApiResponse{value: val, isSet: true} +} + +func (v NullableApiResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApiResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/multiple-files-forms.yaml b/samples/openapi3/client/features/mulitple-data-in-forms/multiple-files-forms.yaml new file mode 100644 index 000000000000..fd522ba72c4f --- /dev/null +++ b/samples/openapi3/client/features/mulitple-data-in-forms/multiple-files-forms.yaml @@ -0,0 +1,52 @@ +openapi: 3.0.0 +servers: + - url: "http://example.com" +info: + description: >- + This is a sample server with a single endpoint that accepts two files via a multipart/form-data POST request. + version: 1.0.0 + title: Multiple Files via form-data + license: + name: Apache-2.0 + url: "https://www.apache.org/licenses/LICENSE-2.0.html" +paths: + "/uploadFiles": + post: + summary: uploads two files + description: "" + operationId: uploadFiles + responses: + "200": + description: successful operation + content: + application/json: + schema: + $ref: "#/components/schemas/ApiResponse" + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + file: + description: file to upload + type: string + format: binary + secondFile: + description: another file to upload + type: string + format: binary +components: + schemas: + ApiResponse: + title: An uploaded response + description: Describes the result of uploading files + type: object + properties: + code: + type: integer + format: int32 + type: + type: string + message: + type: string diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/response.go b/samples/openapi3/client/features/mulitple-data-in-forms/response.go new file mode 100644 index 000000000000..f6fa23e6e013 --- /dev/null +++ b/samples/openapi3/client/features/mulitple-data-in-forms/response.go @@ -0,0 +1,47 @@ +/* +Multiple Files via form-data + +This is a sample server with a single endpoint that accepts two files via a multipart/form-data POST request. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/utils.go b/samples/openapi3/client/features/mulitple-data-in-forms/utils.go new file mode 100644 index 000000000000..b687a2ee01c4 --- /dev/null +++ b/samples/openapi3/client/features/mulitple-data-in-forms/utils.go @@ -0,0 +1,328 @@ +/* +Multiple Files via form-data + +This is a sample server with a single endpoint that accepts two files via a multipart/form-data POST request. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go b/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go index 7fd48ba7647b..640c21d7250f 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go @@ -80,9 +80,7 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp var ( localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue Client ) @@ -119,7 +117,7 @@ func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSp } // body params localVarPostBody = r.client - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_default.go b/samples/openapi3/client/petstore/go/go-petstore/api_default.go index 1b75b59c713a..be637eceddf9 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_default.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_default.go @@ -70,9 +70,7 @@ func (a *DefaultApiService) FooGetExecute(r ApiFooGetRequest) (InlineResponseDef var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue InlineResponseDefault ) @@ -104,7 +102,7 @@ func (a *DefaultApiService) FooGetExecute(r ApiFooGetRequest) (InlineResponseDef if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_fake.go b/samples/openapi3/client/petstore/go/go-petstore/api_fake.go index bcdf35e0231b..a2cb81b7fea9 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_fake.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_fake.go @@ -259,9 +259,7 @@ func (a *FakeApiService) FakeHealthGetExecute(r ApiFakeHealthGetRequest) (Health var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue HealthCheckResult ) @@ -293,7 +291,7 @@ func (a *FakeApiService) FakeHealthGetExecute(r ApiFakeHealthGetRequest) (Health if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -367,9 +365,7 @@ func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanS var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue bool ) @@ -403,7 +399,7 @@ func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanS } // body params localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -477,9 +473,7 @@ func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompos var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue OuterComposite ) @@ -513,7 +507,7 @@ func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompos } // body params localVarPostBody = r.outerComposite - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -587,9 +581,7 @@ func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSer var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue float32 ) @@ -623,7 +615,7 @@ func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSer } // body params localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -697,9 +689,7 @@ func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSer var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue string ) @@ -733,7 +723,7 @@ func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSer } // body params localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -805,9 +795,7 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithFileSchema") @@ -843,7 +831,7 @@ func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSche } // body params localVarPostBody = r.fileSchemaTestClass - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -909,9 +897,7 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithQueryParams") @@ -951,7 +937,7 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa } // body params localVarPostBody = r.user - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1016,9 +1002,7 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl var ( localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue Client ) @@ -1055,7 +1039,7 @@ func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Cl } // body params localVarPostBody = r.client - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1210,9 +1194,7 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEndpointParameters") @@ -1286,17 +1268,23 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete } localVarFormParams.Add("pattern_without_delimiter", parameterToString(*r.patternWithoutDelimiter, "")) localVarFormParams.Add("byte", parameterToString(*r.byte_, "")) - localVarFormFileName = "binary" - var localVarFile *os.File + var binaryLocalVarFormFileName string + var binaryLocalVarFileName string + var binaryLocalVarFileBytes []byte + + binaryLocalVarFormFileName = "binary" + + var binaryLocalVarFile *os.File if r.binary != nil { - localVarFile = *r.binary + binaryLocalVarFile = *r.binary } - if localVarFile != nil { - fbs, _ := _ioutil.ReadAll(localVarFile) - localVarFileBytes = fbs - localVarFileName = localVarFile.Name() - localVarFile.Close() + if binaryLocalVarFile != nil { + fbs, _ := _ioutil.ReadAll(binaryLocalVarFile) + binaryLocalVarFileBytes = fbs + binaryLocalVarFileName = binaryLocalVarFile.Name() + binaryLocalVarFile.Close() } + formFiles = append(formFiles, formFile{fileBytes: binaryLocalVarFileBytes, fileName: binaryLocalVarFileName, formFileName: binaryLocalVarFormFileName}) if r.date != nil { localVarFormParams.Add("date", parameterToString(*r.date, "")) } @@ -1309,7 +1297,7 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete if r.callback != nil { localVarFormParams.Add("callback", parameterToString(*r.callback, "")) } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1415,9 +1403,7 @@ func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersReques var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEnumParameters") @@ -1480,7 +1466,7 @@ func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersReques if r.enumFormString != nil { localVarFormParams.Add("enum_form_string", parameterToString(*r.enumFormString, "")) } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1574,9 +1560,7 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestGroupParameters") @@ -1628,7 +1612,7 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ if r.booleanGroup != nil { localVarHeaderParams["boolean_group"] = parameterToString(*r.booleanGroup, "") } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1690,9 +1674,7 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestInlineAdditionalProperties") @@ -1728,7 +1710,7 @@ func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAd } // body params localVarPostBody = r.requestBody - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1796,9 +1778,7 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestJsonFormData") @@ -1837,7 +1817,7 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) ( } localVarFormParams.Add("param", parameterToString(*r.param, "")) localVarFormParams.Add("param2", parameterToString(*r.param2, "")) - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -1920,9 +1900,7 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestQueryParameterCollectionFormat") @@ -1993,7 +1971,7 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -2062,9 +2040,7 @@ func (a *FakeApiService) TestUniqueItemsHeaderAndQueryParameterCollectionFormatE var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []Pet ) @@ -2114,7 +2090,7 @@ func (a *FakeApiService) TestUniqueItemsHeaderAndQueryParameterCollectionFormatE localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } localVarHeaderParams["headerUnique"] = parameterToString(*r.headerUnique, "csv") - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go b/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go index 2ddc5ebf7da7..a9e7b6279f3e 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go @@ -80,9 +80,7 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname var ( localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue Client ) @@ -133,7 +131,7 @@ func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassname } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_pet.go b/samples/openapi3/client/petstore/go/go-petstore/api_pet.go index 9f172c3cd304..0b50bc15c5ec 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_pet.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_pet.go @@ -183,9 +183,7 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, e var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.AddPet") @@ -221,7 +219,7 @@ func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, e } // body params localVarPostBody = r.pet - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -285,9 +283,7 @@ func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Respo var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.DeletePet") @@ -322,7 +318,7 @@ func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Respo if r.apiKey != nil { localVarHeaderParams["api_key"] = parameterToString(*r.apiKey, "") } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -388,9 +384,7 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []Pet ) @@ -426,7 +420,7 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([ if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -503,9 +497,7 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue []Pet ) @@ -541,7 +533,7 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -612,9 +604,7 @@ func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethtt var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue Pet ) @@ -661,7 +651,7 @@ func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethtt } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -732,9 +722,7 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePet") @@ -770,7 +758,7 @@ func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Respo } // body params localVarPostBody = r.pet - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -841,9 +829,7 @@ func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePetWithForm") @@ -881,7 +867,7 @@ func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) if r.status != nil { localVarFormParams.Add("status", parameterToString(*r.status, "")) } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -953,9 +939,7 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue ApiResponse ) @@ -991,18 +975,24 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, if r.additionalMetadata != nil { localVarFormParams.Add("additionalMetadata", parameterToString(*r.additionalMetadata, "")) } - localVarFormFileName = "file" - var localVarFile *os.File + var fileLocalVarFormFileName string + var fileLocalVarFileName string + var fileLocalVarFileBytes []byte + + fileLocalVarFormFileName = "file" + + var fileLocalVarFile *os.File if r.file != nil { - localVarFile = *r.file + fileLocalVarFile = *r.file } - if localVarFile != nil { - fbs, _ := _ioutil.ReadAll(localVarFile) - localVarFileBytes = fbs - localVarFileName = localVarFile.Name() - localVarFile.Close() + if fileLocalVarFile != nil { + fbs, _ := _ioutil.ReadAll(fileLocalVarFile) + fileLocalVarFileBytes = fbs + fileLocalVarFileName = fileLocalVarFile.Name() + fileLocalVarFile.Close() } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + formFiles = append(formFiles, formFile{fileBytes: fileLocalVarFileBytes, fileName: fileLocalVarFileName, formFileName: fileLocalVarFormFileName}) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1083,9 +1073,7 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue ApiResponse ) @@ -1124,15 +1112,21 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq if r.additionalMetadata != nil { localVarFormParams.Add("additionalMetadata", parameterToString(*r.additionalMetadata, "")) } - localVarFormFileName = "requiredFile" - localVarFile := *r.requiredFile - if localVarFile != nil { - fbs, _ := _ioutil.ReadAll(localVarFile) - localVarFileBytes = fbs - localVarFileName = localVarFile.Name() - localVarFile.Close() + var requiredFileLocalVarFormFileName string + var requiredFileLocalVarFileName string + var requiredFileLocalVarFileBytes []byte + + requiredFileLocalVarFormFileName = "requiredFile" + + requiredFileLocalVarFile := *r.requiredFile + if requiredFileLocalVarFile != nil { + fbs, _ := _ioutil.ReadAll(requiredFileLocalVarFile) + requiredFileLocalVarFileBytes = fbs + requiredFileLocalVarFileName = requiredFileLocalVarFile.Name() + requiredFileLocalVarFile.Close() } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + formFiles = append(formFiles, formFile{fileBytes: requiredFileLocalVarFileBytes, fileName: requiredFileLocalVarFileName, formFileName: requiredFileLocalVarFormFileName}) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_store.go b/samples/openapi3/client/petstore/go/go-petstore/api_store.go index 1fb82f576fad..41c9e8fda94f 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_store.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_store.go @@ -118,9 +118,7 @@ func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.DeleteOrder") @@ -152,7 +150,7 @@ func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -211,9 +209,7 @@ func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[str var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue map[string]int32 ) @@ -259,7 +255,7 @@ func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[str } } } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -330,9 +326,7 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue Order ) @@ -371,7 +365,7 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -443,9 +437,7 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue Order ) @@ -482,7 +474,7 @@ func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_ne } // body params localVarPostBody = r.order - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_user.go b/samples/openapi3/client/petstore/go/go-petstore/api_user.go index 0c259b33c4f9..d67bb32a7e03 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_user.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_user.go @@ -165,9 +165,7 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUser") @@ -203,7 +201,7 @@ func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Re } // body params localVarPostBody = r.user - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -265,9 +263,7 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithArrayInput") @@ -303,7 +299,7 @@ func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithAr } // body params localVarPostBody = r.user - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -365,9 +361,7 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithListInput") @@ -403,7 +397,7 @@ func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithLis } // body params localVarPostBody = r.user - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -464,9 +458,7 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Re var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.DeleteUser") @@ -498,7 +490,7 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Re if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -558,9 +550,7 @@ func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue User ) @@ -593,7 +583,7 @@ func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -671,9 +661,7 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile localVarReturnValue string ) @@ -713,7 +701,7 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_neth if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -778,9 +766,7 @@ func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Re var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LogoutUser") @@ -811,7 +797,7 @@ func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Re if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -878,9 +864,7 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Re var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.UpdateUser") @@ -917,7 +901,7 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Re } // body params localVarPostBody = r.user - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } diff --git a/samples/openapi3/client/petstore/go/go-petstore/client.go b/samples/openapi3/client/petstore/go/go-petstore/client.go index 99cd5b9ef28b..99eed71f66fd 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/client.go +++ b/samples/openapi3/client/petstore/go/go-petstore/client.go @@ -207,6 +207,12 @@ func (c *APIClient) GetConfig() *Configuration { return c.cfg } +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + // prepareRequest build the request func (c *APIClient) prepareRequest( ctx context.Context, @@ -215,9 +221,7 @@ func (c *APIClient) prepareRequest( headerParams map[string]string, queryParams url.Values, formParams url.Values, - formFileName string, - fileName string, - fileBytes []byte) (localVarRequest *http.Request, err error) { + formFiles []formFile) (localVarRequest *http.Request, err error) { var body *bytes.Buffer @@ -236,7 +240,7 @@ func (c *APIClient) prepareRequest( } // add form parameters and file if available. - if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { if body != nil { return nil, errors.New("Cannot specify postBody and multipart form at the same time.") } @@ -255,16 +259,17 @@ func (c *APIClient) prepareRequest( } } } - if len(fileBytes) > 0 && fileName != "" { - w.Boundary() - //_, fileNm := filepath.Split(fileName) - part, err := w.CreateFormFile(formFileName, filepath.Base(fileName)) - if err != nil { - return nil, err - } - _, err = part.Write(fileBytes) - if err != nil { - return nil, err + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } } } From fdea71b26eb0bfcc4ff7e48b15463e63c5a1a6ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20=C4=8Cerm=C3=A1k?= <64807060+Yurzel@users.noreply.github.com> Date: Mon, 22 Nov 2021 09:29:09 +0100 Subject: [PATCH 013/117] [Protobuf-Schema] Add enum as model support (#10868) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [Protobuf-Schema] Add enum as model support * [Protobuf-Schema] Bugfix: Reverted classname modification * [Protobuf-Scheme] Mustache newlines update * [Protobuf-Schema] Renamed addModelEnumIndexes to addEnumIndexes * [Protobuf-Schema] Add enum as model support * [Protobuf-Schema] Bugfix: Reverted classname modification * [Protobuf-Scheme] Mustache newlines update * [Protobuf-Schema] Renamed addModelEnumIndexes to addEnumIndexes Co-authored-by: Tomáš Čermák --- .../languages/ProtobufSchemaCodegen.java | 24 ++++++++++++++----- .../resources/protobuf-schema/enum.mustache | 7 ++++++ .../resources/protobuf-schema/model.mustache | 3 ++- 3 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/protobuf-schema/enum.mustache diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java index f04a58fcf426..58ec9c56b67b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java @@ -183,6 +183,14 @@ public String toOperationId(String operationId) { return camelize(sanitizeName(operationId)); } + public void addEnumIndexes(List> enumVars){ + int enumIndex = 0; + for (Map enumVar : enumVars) { + enumVar.put("protobuf-enum-index", enumIndex); + enumIndex++; + } + } + @Override public Map postProcessModels(Map objs) { objs = postProcessModelsEnum(objs); @@ -192,6 +200,14 @@ public Map postProcessModels(Map objs) { Map mo = (Map) _mo; CodegenModel cm = (CodegenModel) mo.get("model"); + if(cm.isEnum) { + Map allowableValues = cm.getAllowableValues(); + if (allowableValues.containsKey("enumVars")) { + List> enumVars = (List>)allowableValues.get("enumVars"); + addEnumIndexes(enumVars); + } + } + for (CodegenProperty var : cm.vars) { // add x-protobuf-type: repeated if it's an array if (Boolean.TRUE.equals(var.isArray)) { @@ -209,12 +225,8 @@ public Map postProcessModels(Map objs) { } if (var.isEnum && var.allowableValues.containsKey("enumVars")) { - List> enumVars = (List>) var.allowableValues.get("enumVars"); - int enumIndex = 0; - for (Map enumVar : enumVars) { - enumVar.put("protobuf-enum-index", enumIndex); - enumIndex++; - } + List> enumVars = (List>)var.allowableValues.get("enumVars"); + addEnumIndexes(enumVars); } // Add x-protobuf-index, unless already specified diff --git a/modules/openapi-generator/src/main/resources/protobuf-schema/enum.mustache b/modules/openapi-generator/src/main/resources/protobuf-schema/enum.mustache new file mode 100644 index 000000000000..aa26522c8809 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/protobuf-schema/enum.mustache @@ -0,0 +1,7 @@ +enum {{classname}} { + {{#allowableValues}} + {{#enumVars}} + {{{name}}} = {{{protobuf-enum-index}}}; + {{/enumVars}} + {{/allowableValues}} +} diff --git a/modules/openapi-generator/src/main/resources/protobuf-schema/model.mustache b/modules/openapi-generator/src/main/resources/protobuf-schema/model.mustache index f16f097771d7..2a609db9a8d1 100644 --- a/modules/openapi-generator/src/main/resources/protobuf-schema/model.mustache +++ b/modules/openapi-generator/src/main/resources/protobuf-schema/model.mustache @@ -11,7 +11,7 @@ import public "{{{modelPackage}}}/{{{import}}}.proto"; {{#models}} {{#model}} -message {{classname}} { +{{#isEnum}}{{>enum}}{{/isEnum}}{{^isEnum}}message {{classname}} { {{#vars}} {{#description}} @@ -34,5 +34,6 @@ message {{classname}} { {{/vars}} } +{{/isEnum}} {{/model}} {{/models}} From c7bd3aa29473fb4f9e8f8dcca6ed32c0c5edbdff Mon Sep 17 00:00:00 2001 From: Felix Winterhalter Date: Mon, 22 Nov 2021 09:56:57 +0100 Subject: [PATCH 014/117] fix: Support Netcore 6.0 (#10634) --- docs/generators/csharp-netcore.md | 2 +- .../codegen/languages/CSharpNetCoreClientCodegen.java | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/generators/csharp-netcore.md b/docs/generators/csharp-netcore.md index 7a30e18f899e..bb138ef414d0 100644 --- a/docs/generators/csharp-netcore.md +++ b/docs/generators/csharp-netcore.md @@ -31,7 +31,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |returnICollection|Return ICollection<T> instead of the concrete type.| |false| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|source folder for generated code| |src| -|targetFramework|The target .NET framework version. To target multiple frameworks, use `;` as the separator, e.g. `netstandard2.1;netcoreapp3.0`|
**netstandard1.3**
.NET Standard 1.3 compatible
**netstandard1.4**
.NET Standard 1.4 compatible
**netstandard1.5**
.NET Standard 1.5 compatible
**netstandard1.6**
.NET Standard 1.6 compatible
**netstandard2.0**
.NET Standard 2.0 compatible
**netstandard2.1**
.NET Standard 2.1 compatible
**netcoreapp2.0**
.NET Core 2.0 compatible
**netcoreapp2.1**
.NET Core 2.1 compatible
**netcoreapp3.0**
.NET Core 3.0 compatible
**netcoreapp3.1**
.NET Core 3.1 compatible
**net47**
.NET Framework 4.7 compatible
**net5.0**
.NET 5.0 compatible
|netstandard2.0| +|targetFramework|The target .NET framework version. To target multiple frameworks, use `;` as the separator, e.g. `netstandard2.1;netcoreapp3.0`|
**netstandard1.3**
.NET Standard 1.3 compatible
**netstandard1.4**
.NET Standard 1.4 compatible
**netstandard1.5**
.NET Standard 1.5 compatible
**netstandard1.6**
.NET Standard 1.6 compatible
**netstandard2.0**
.NET Standard 2.0 compatible
**netstandard2.1**
.NET Standard 2.1 compatible
**netcoreapp2.0**
.NET Core 2.0 compatible
**netcoreapp2.1**
.NET Core 2.1 compatible
**netcoreapp3.0**
.NET Core 3.0 compatible
**netcoreapp3.1**
.NET Core 3.1 compatible
**net47**
.NET Framework 4.7 compatible
**net5.0**
.NET 5.0 compatible
**net6.0**
.NET 6.0 compatible
|netstandard2.0| |useCollection|Deserialize array types to Collection<T> instead of List<T>.| |false| |useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false| |useOneOfDiscriminatorLookup|Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and only one match in oneOf's schemas) will be skipped.| |false| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java index b6e54b0fa214..1d6a13603f66 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java @@ -70,7 +70,8 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { FrameworkStrategy.NETCOREAPP_3_0, FrameworkStrategy.NETCOREAPP_3_1, FrameworkStrategy.NETFRAMEWORK_4_7, - FrameworkStrategy.NET_5_0 + FrameworkStrategy.NET_5_0, + FrameworkStrategy.NET_6_0 ); private static FrameworkStrategy defaultFramework = FrameworkStrategy.NETSTANDARD_2_0; protected final Map frameworks; @@ -1001,6 +1002,8 @@ private static abstract class FrameworkStrategy { }; static FrameworkStrategy NET_5_0 = new FrameworkStrategy("net5.0", ".NET 5.0 compatible", "net5.0", Boolean.FALSE) { }; + static FrameworkStrategy NET_6_0 = new FrameworkStrategy("net6.0", ".NET 6.0 compatible", "net6.0", Boolean.FALSE) { + }; protected String name; protected String description; protected String testTargetFramework; From c13067d100c43cfbedea205df37f365014cbdb2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20=C4=8Cerm=C3=A1k?= Date: Mon, 22 Nov 2021 14:57:33 +0100 Subject: [PATCH 015/117] [Protobuf-Schema] Add unknown to enum switch (#10892) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [Protobuf-Schema] Add unknown to enum switch * [Protobuf-Schema] Bugfix: unique unknown by prefix * [Protobuf-Schema] Add unknown to enum switch * [Protobuf-Schema] Bugfix: unique unknown by prefix * [Protobuf-Schema] Bugfix after merge, format file * [Docs][Protobuf-Schema] Generated docs Co-authored-by: Tomáš Čermák --- docs/generators/protobuf-schema.md | 1 + .../languages/ProtobufSchemaCodegen.java | 43 +++++++++++++++++-- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/docs/generators/protobuf-schema.md b/docs/generators/protobuf-schema.md index 104a47fe59ca..53e5334ef976 100644 --- a/docs/generators/protobuf-schema.md +++ b/docs/generators/protobuf-schema.md @@ -7,6 +7,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | +|startEnumsWithUnknown|Introduces "UNKNOWN" as the first element of enumerations.| |false| ## IMPORT MAPPING diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java index 58ec9c56b67b..30a8b4c3c32f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java @@ -47,10 +47,14 @@ public class ProtobufSchemaCodegen extends DefaultCodegen implements CodegenConf private static final String IMPORTS = "imports"; + public static final String START_ENUMS_WITH_UNKNOWN = "startEnumsWithUnknown"; + private final Logger LOGGER = LoggerFactory.getLogger(ProtobufSchemaCodegen.class); protected String packageName = "openapitools"; + private boolean startEnumsWithUnknown = false; + @Override public CodegenType getTag() { return CodegenType.SCHEMA; @@ -145,6 +149,7 @@ public ProtobufSchemaCodegen() { cliOptions.clear(); + addSwitch(START_ENUMS_WITH_UNKNOWN, "Introduces \"UNKNOWN\" as the first element of enumerations.", startEnumsWithUnknown); } @Override @@ -164,6 +169,10 @@ public void processOpts() { setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME)); } + if (additionalProperties.containsKey(this.START_ENUMS_WITH_UNKNOWN)) { + this.startEnumsWithUnknown = convertPropertyToBooleanAndWriteBack(START_ENUMS_WITH_UNKNOWN); + } + supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); } @@ -183,7 +192,27 @@ public String toOperationId(String operationId) { return camelize(sanitizeName(operationId)); } - public void addEnumIndexes(List> enumVars){ + public void addUnknownToAllowableValues(Map allowableValues, String name) { + if(startEnumsWithUnknown) { + if(allowableValues.containsKey("enumVars")) { + List> enumVars = (List>)allowableValues.get("enumVars"); + + HashMap unknown = new HashMap(); + unknown.put("name", name + "_UNKNOWN"); + unknown.put("isString", "false"); + unknown.put("value", "\"" + name + "_UNKNOWN\""); + + enumVars.add(0, unknown); + } + + if(allowableValues.containsKey("values")) { + List values = (List)allowableValues.get("values"); + values.add(0, name + "_UNKNOWN"); + } + } + } + + public void addEnumIndexes(List> enumVars) { int enumIndex = 0; for (Map enumVar : enumVars) { enumVar.put("protobuf-enum-index", enumIndex); @@ -202,6 +231,8 @@ public Map postProcessModels(Map objs) { if(cm.isEnum) { Map allowableValues = cm.getAllowableValues(); + addUnknownToAllowableValues(allowableValues, cm.getClassname()); + if (allowableValues.containsKey("enumVars")) { List> enumVars = (List>)allowableValues.get("enumVars"); addEnumIndexes(enumVars); @@ -224,9 +255,13 @@ public Map postProcessModels(Map objs) { } } - if (var.isEnum && var.allowableValues.containsKey("enumVars")) { - List> enumVars = (List>)var.allowableValues.get("enumVars"); - addEnumIndexes(enumVars); + if (var.isEnum) { + addUnknownToAllowableValues(var.allowableValues, var.getEnumName()); + + if(var.allowableValues.containsKey("enumVars")) { + List> enumVars = (List>) var.allowableValues.get("enumVars"); + addEnumIndexes(enumVars); + } } // Add x-protobuf-index, unless already specified From e9f2ccde677e59402a46e957ac6169cfd8b05bcb Mon Sep 17 00:00:00 2001 From: Tomasz Prus Date: Mon, 22 Nov 2021 17:41:04 +0100 Subject: [PATCH 016/117] =?UTF-8?q?[Python]=20Add=20option=20to=20select?= =?UTF-8?q?=20content-type=20using=20body=20or=20force=20it=20for=E2=80=A6?= =?UTF-8?q?=20(#10686)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [Python] Add option to select content-type using body or force it for API call * Add support for application/json-patch+json * Add unittests. --- .../main/resources/python-legacy/api.mustache | 10 +- .../python-legacy/api_client.mustache | 9 +- .../petstore_api/api/another_fake_api.py | 10 +- .../petstore_api/api/fake_api.py | 104 ++++++++---- .../api/fake_classname_tags_123_api.py | 10 +- .../petstore_api/api/pet_api.py | 66 +++++--- .../petstore_api/api/store_api.py | 16 +- .../petstore_api/api/user_api.py | 32 +++- .../python-asyncio/petstore_api/api_client.py | 9 +- .../petstore_api/api/another_fake_api.py | 10 +- .../petstore_api/api/fake_api.py | 104 ++++++++---- .../api/fake_classname_tags_123_api.py | 10 +- .../python-legacy/petstore_api/api/pet_api.py | 66 +++++--- .../petstore_api/api/store_api.py | 16 +- .../petstore_api/api/user_api.py | 32 +++- .../python-legacy/petstore_api/api_client.py | 9 +- .../python-legacy/tests/test_api_client.py | 10 ++ .../python-legacy/tests/test_pet_api.py | 22 +++ .../petstore_api/api/another_fake_api.py | 10 +- .../petstore_api/api/fake_api.py | 104 ++++++++---- .../api/fake_classname_tags_123_api.py | 10 +- .../petstore_api/api/pet_api.py | 66 +++++--- .../petstore_api/api/store_api.py | 16 +- .../petstore_api/api/user_api.py | 32 +++- .../python-tornado/petstore_api/api_client.py | 9 +- .../petstore_api/api/another_fake_api.py | 10 +- .../petstore_api/api/default_api.py | 4 +- .../petstore_api/api/fake_api.py | 152 ++++++++++++------ .../api/fake_classname_tags_123_api.py | 10 +- .../python-legacy/petstore_api/api/pet_api.py | 66 +++++--- .../petstore_api/api/store_api.py | 22 ++- .../petstore_api/api/user_api.py | 56 +++++-- .../python-legacy/petstore_api/api_client.py | 9 +- 33 files changed, 819 insertions(+), 302 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python-legacy/api.mustache b/modules/openapi-generator/src/main/resources/python-legacy/api.mustache index cca4ae9bd376..afde9560aa9a 100644 --- a/modules/openapi-generator/src/main/resources/python-legacy/api.mustache +++ b/modules/openapi-generator/src/main/resources/python-legacy/api.mustache @@ -107,6 +107,7 @@ class {{classname}}(object): request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -142,7 +143,8 @@ class {{classname}}(object): '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -247,8 +249,10 @@ class {{classname}}(object): {{/hasProduces}} {{#hasConsumes}} # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - [{{#consumes}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/consumes}}]) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + [{{#consumes}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/consumes}}], + '{{httpMethod}}', body_params)) # noqa: E501 {{/hasConsumes}} # Authentication setting diff --git a/modules/openapi-generator/src/main/resources/python-legacy/api_client.mustache b/modules/openapi-generator/src/main/resources/python-legacy/api_client.mustache index daeb30ddc268..0bd333302623 100644 --- a/modules/openapi-generator/src/main/resources/python-legacy/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python-legacy/api_client.mustache @@ -545,10 +545,12 @@ class ApiClient(object): else: return ', '.join(accepts) - def select_header_content_type(self, content_types): + def select_header_content_type(self, content_types, method=None, body=None): """Returns `Content-Type` based on an array of content_types provided. :param content_types: List of content-types. + :param method: http method (e.g. POST, PATCH). + :param body: http body to send. :return: Content-Type (e.g. application/json). """ if not content_types: @@ -556,6 +558,11 @@ class ApiClient(object): content_types = [x.lower() for x in content_types] + if (method == 'PATCH' and + 'application/json-patch+json' in content_types and + isinstance(body, list)): + return 'application/json-patch+json' + if 'application/json' in content_types or '*/*' in content_types: return 'application/json' else: diff --git a/samples/client/petstore/python-asyncio/petstore_api/api/another_fake_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/another_fake_api.py index b95df897b493..b76ee3b916cd 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api/another_fake_api.py @@ -95,6 +95,7 @@ def call_123_test_special_tags_with_http_info(self, body, **kwargs): # noqa: E5 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -112,7 +113,8 @@ def call_123_test_special_tags_with_http_info(self, body, **kwargs): # noqa: E5 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -148,8 +150,10 @@ def call_123_test_special_tags_with_http_info(self, body, **kwargs): # noqa: E5 ['application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'PATCH', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 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 063ac8e08d14..b97f43f60f93 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 @@ -95,6 +95,7 @@ def create_xml_item_with_http_info(self, xml_item, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -112,7 +113,8 @@ def create_xml_item_with_http_info(self, xml_item, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -144,8 +146,10 @@ def create_xml_item_with_http_info(self, xml_item, **kwargs): # noqa: E501 if 'xml_item' in local_var_params: body_params = local_var_params['xml_item'] # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/xml', 'application/xml; charset=utf-8', 'application/xml; charset=utf-16', 'text/xml', 'text/xml; charset=utf-8', 'text/xml; charset=utf-16']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.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'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -228,6 +232,7 @@ def fake_outer_boolean_serialize_with_http_info(self, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -245,7 +250,8 @@ def fake_outer_boolean_serialize_with_http_info(self, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -359,6 +365,7 @@ def fake_outer_composite_serialize_with_http_info(self, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -376,7 +383,8 @@ def fake_outer_composite_serialize_with_http_info(self, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -490,6 +498,7 @@ def fake_outer_number_serialize_with_http_info(self, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -507,7 +516,8 @@ def fake_outer_number_serialize_with_http_info(self, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -621,6 +631,7 @@ def fake_outer_string_serialize_with_http_info(self, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -638,7 +649,8 @@ def fake_outer_string_serialize_with_http_info(self, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -752,6 +764,7 @@ def test_body_with_file_schema_with_http_info(self, body, **kwargs): # noqa: E5 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -769,7 +782,8 @@ def test_body_with_file_schema_with_http_info(self, body, **kwargs): # noqa: E5 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -801,8 +815,10 @@ def test_body_with_file_schema_with_http_info(self, body, **kwargs): # noqa: E5 if 'body' in local_var_params: body_params = local_var_params['body'] # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'PUT', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -887,6 +903,7 @@ def test_body_with_query_params_with_http_info(self, query, body, **kwargs): # request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -905,7 +922,8 @@ def test_body_with_query_params_with_http_info(self, query, body, **kwargs): # '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -943,8 +961,10 @@ def test_body_with_query_params_with_http_info(self, query, body, **kwargs): # if 'body' in local_var_params: body_params = local_var_params['body'] # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'PUT', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -1027,6 +1047,7 @@ def test_client_model_with_http_info(self, body, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1044,7 +1065,8 @@ def test_client_model_with_http_info(self, body, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1080,8 +1102,10 @@ def test_client_model_with_http_info(self, body, **kwargs): # noqa: E501 ['application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'PATCH', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -1218,6 +1242,7 @@ def test_endpoint_parameters_with_http_info(self, number, double, pattern_withou request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1248,7 +1273,8 @@ def test_endpoint_parameters_with_http_info(self, number, double, pattern_withou '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1346,8 +1372,10 @@ def test_endpoint_parameters_with_http_info(self, number, double, pattern_withou body_params = None # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/x-www-form-urlencoded']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/x-www-form-urlencoded'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = ['http_basic_test'] # noqa: E501 @@ -1458,6 +1486,7 @@ def test_enum_parameters_with_http_info(self, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1482,7 +1511,8 @@ def test_enum_parameters_with_http_info(self, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1527,8 +1557,10 @@ def test_enum_parameters_with_http_info(self, **kwargs): # noqa: E501 body_params = None # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/x-www-form-urlencoded']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/x-www-form-urlencoded'], + 'GET', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -1631,6 +1663,7 @@ def test_group_parameters_with_http_info(self, required_string_group, required_b request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1653,7 +1686,8 @@ def test_group_parameters_with_http_info(self, required_string_group, required_b '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1781,6 +1815,7 @@ def test_inline_additional_properties_with_http_info(self, param, **kwargs): # request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1798,7 +1833,8 @@ def test_inline_additional_properties_with_http_info(self, param, **kwargs): # '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1830,8 +1866,10 @@ def test_inline_additional_properties_with_http_info(self, param, **kwargs): # if 'param' in local_var_params: body_params = local_var_params['param'] # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -1916,6 +1954,7 @@ def test_json_form_data_with_http_info(self, param, param2, **kwargs): # noqa: request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1934,7 +1973,8 @@ def test_json_form_data_with_http_info(self, param, param2, **kwargs): # noqa: '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1972,8 +2012,10 @@ def test_json_form_data_with_http_info(self, param, param2, **kwargs): # noqa: body_params = None # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/x-www-form-urlencoded']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/x-www-form-urlencoded'], + 'GET', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -2072,6 +2114,7 @@ def test_query_parameter_collection_format_with_http_info(self, pipe, ioutil, ht request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -2093,7 +2136,8 @@ def test_query_parameter_collection_format_with_http_info(self, pipe, ioutil, ht '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) diff --git a/samples/client/petstore/python-asyncio/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/fake_classname_tags_123_api.py index 5d6405e2cbdb..2b46147fed58 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api/fake_classname_tags_123_api.py @@ -95,6 +95,7 @@ def test_classname_with_http_info(self, body, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -112,7 +113,8 @@ def test_classname_with_http_info(self, body, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -148,8 +150,10 @@ def test_classname_with_http_info(self, body, **kwargs): # noqa: E501 ['application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'PATCH', body_params)) # noqa: E501 # Authentication setting auth_settings = ['api_key_query'] # noqa: E501 diff --git a/samples/client/petstore/python-asyncio/petstore_api/api/pet_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/pet_api.py index 50dab4563e92..e20e57a7f865 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api/pet_api.py @@ -93,6 +93,7 @@ def add_pet_with_http_info(self, body, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -110,7 +111,8 @@ def add_pet_with_http_info(self, body, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -142,8 +144,10 @@ def add_pet_with_http_info(self, body, **kwargs): # noqa: E501 if 'body' in local_var_params: body_params = local_var_params['body'] # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json', 'application/xml']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json', 'application/xml'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = ['petstore_auth'] # noqa: E501 @@ -228,6 +232,7 @@ def delete_pet_with_http_info(self, pet_id, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -246,7 +251,8 @@ def delete_pet_with_http_info(self, pet_id, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -360,6 +366,7 @@ def find_pets_by_status_with_http_info(self, status, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -377,7 +384,8 @@ def find_pets_by_status_with_http_info(self, status, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -497,6 +505,7 @@ def find_pets_by_tags_with_http_info(self, tags, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -514,7 +523,8 @@ def find_pets_by_tags_with_http_info(self, tags, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -634,6 +644,7 @@ def get_pet_by_id_with_http_info(self, pet_id, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -651,7 +662,8 @@ def get_pet_by_id_with_http_info(self, pet_id, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -769,6 +781,7 @@ def update_pet_with_http_info(self, body, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -786,7 +799,8 @@ def update_pet_with_http_info(self, body, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -818,8 +832,10 @@ def update_pet_with_http_info(self, body, **kwargs): # noqa: E501 if 'body' in local_var_params: body_params = local_var_params['body'] # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json', 'application/xml']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json', 'application/xml'], + 'PUT', body_params)) # noqa: E501 # Authentication setting auth_settings = ['petstore_auth'] # noqa: E501 @@ -908,6 +924,7 @@ def update_pet_with_form_with_http_info(self, pet_id, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -927,7 +944,8 @@ def update_pet_with_form_with_http_info(self, pet_id, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -963,8 +981,10 @@ def update_pet_with_form_with_http_info(self, pet_id, **kwargs): # noqa: E501 body_params = None # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/x-www-form-urlencoded']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/x-www-form-urlencoded'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = ['petstore_auth'] # noqa: E501 @@ -1053,6 +1073,7 @@ def upload_file_with_http_info(self, pet_id, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1072,7 +1093,8 @@ def upload_file_with_http_info(self, pet_id, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1112,8 +1134,10 @@ def upload_file_with_http_info(self, pet_id, **kwargs): # noqa: E501 ['application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['multipart/form-data']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['multipart/form-data'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = ['petstore_auth'] # noqa: E501 @@ -1204,6 +1228,7 @@ def upload_file_with_required_file_with_http_info(self, pet_id, required_file, * request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1223,7 +1248,8 @@ def upload_file_with_required_file_with_http_info(self, pet_id, required_file, * '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1267,8 +1293,10 @@ def upload_file_with_required_file_with_http_info(self, pet_id, required_file, * ['application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['multipart/form-data']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['multipart/form-data'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = ['petstore_auth'] # noqa: E501 diff --git a/samples/client/petstore/python-asyncio/petstore_api/api/store_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/store_api.py index 092a4542774d..4425692aec0d 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api/store_api.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api/store_api.py @@ -95,6 +95,7 @@ def delete_order_with_http_info(self, order_id, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -112,7 +113,8 @@ def delete_order_with_http_info(self, order_id, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -220,6 +222,7 @@ def get_inventory_with_http_info(self, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -236,7 +239,8 @@ def get_inventory_with_http_info(self, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -348,6 +352,7 @@ def get_order_by_id_with_http_info(self, order_id, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -365,7 +370,8 @@ def get_order_by_id_with_http_info(self, order_id, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -487,6 +493,7 @@ def place_order_with_http_info(self, body, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -504,7 +511,8 @@ def place_order_with_http_info(self, body, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) diff --git a/samples/client/petstore/python-asyncio/petstore_api/api/user_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/user_api.py index 7c68a89e624d..593e5e5856ba 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api/user_api.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api/user_api.py @@ -95,6 +95,7 @@ def create_user_with_http_info(self, body, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -112,7 +113,8 @@ def create_user_with_http_info(self, body, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -222,6 +224,7 @@ def create_users_with_array_input_with_http_info(self, body, **kwargs): # noqa: request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -239,7 +242,8 @@ def create_users_with_array_input_with_http_info(self, body, **kwargs): # noqa: '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -349,6 +353,7 @@ def create_users_with_list_input_with_http_info(self, body, **kwargs): # noqa: request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -366,7 +371,8 @@ def create_users_with_list_input_with_http_info(self, body, **kwargs): # noqa: '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -478,6 +484,7 @@ def delete_user_with_http_info(self, username, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -495,7 +502,8 @@ def delete_user_with_http_info(self, username, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -605,6 +613,7 @@ def get_user_by_name_with_http_info(self, username, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -622,7 +631,8 @@ def get_user_by_name_with_http_info(self, username, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -744,6 +754,7 @@ def login_user_with_http_info(self, username, password, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -762,7 +773,8 @@ def login_user_with_http_info(self, username, password, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -881,6 +893,7 @@ def logout_user_with_http_info(self, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -897,7 +910,8 @@ def logout_user_with_http_info(self, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1007,6 +1021,7 @@ def update_user_with_http_info(self, username, body, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1025,7 +1040,8 @@ def update_user_with_http_info(self, username, body, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) diff --git a/samples/client/petstore/python-asyncio/petstore_api/api_client.py b/samples/client/petstore/python-asyncio/petstore_api/api_client.py index 4e718812e556..122a18d0cab7 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api_client.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api_client.py @@ -522,10 +522,12 @@ def select_header_accept(self, accepts): else: return ', '.join(accepts) - def select_header_content_type(self, content_types): + def select_header_content_type(self, content_types, method=None, body=None): """Returns `Content-Type` based on an array of content_types provided. :param content_types: List of content-types. + :param method: http method (e.g. POST, PATCH). + :param body: http body to send. :return: Content-Type (e.g. application/json). """ if not content_types: @@ -533,6 +535,11 @@ def select_header_content_type(self, content_types): content_types = [x.lower() for x in content_types] + if (method == 'PATCH' and + 'application/json-patch+json' in content_types and + isinstance(body, list)): + return 'application/json-patch+json' + if 'application/json' in content_types or '*/*' in content_types: return 'application/json' else: diff --git a/samples/client/petstore/python-legacy/petstore_api/api/another_fake_api.py b/samples/client/petstore/python-legacy/petstore_api/api/another_fake_api.py index b95df897b493..b76ee3b916cd 100644 --- a/samples/client/petstore/python-legacy/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python-legacy/petstore_api/api/another_fake_api.py @@ -95,6 +95,7 @@ def call_123_test_special_tags_with_http_info(self, body, **kwargs): # noqa: E5 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -112,7 +113,8 @@ def call_123_test_special_tags_with_http_info(self, body, **kwargs): # noqa: E5 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -148,8 +150,10 @@ def call_123_test_special_tags_with_http_info(self, body, **kwargs): # noqa: E5 ['application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'PATCH', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 diff --git a/samples/client/petstore/python-legacy/petstore_api/api/fake_api.py b/samples/client/petstore/python-legacy/petstore_api/api/fake_api.py index 063ac8e08d14..b97f43f60f93 100644 --- a/samples/client/petstore/python-legacy/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python-legacy/petstore_api/api/fake_api.py @@ -95,6 +95,7 @@ def create_xml_item_with_http_info(self, xml_item, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -112,7 +113,8 @@ def create_xml_item_with_http_info(self, xml_item, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -144,8 +146,10 @@ def create_xml_item_with_http_info(self, xml_item, **kwargs): # noqa: E501 if 'xml_item' in local_var_params: body_params = local_var_params['xml_item'] # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/xml', 'application/xml; charset=utf-8', 'application/xml; charset=utf-16', 'text/xml', 'text/xml; charset=utf-8', 'text/xml; charset=utf-16']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.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'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -228,6 +232,7 @@ def fake_outer_boolean_serialize_with_http_info(self, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -245,7 +250,8 @@ def fake_outer_boolean_serialize_with_http_info(self, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -359,6 +365,7 @@ def fake_outer_composite_serialize_with_http_info(self, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -376,7 +383,8 @@ def fake_outer_composite_serialize_with_http_info(self, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -490,6 +498,7 @@ def fake_outer_number_serialize_with_http_info(self, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -507,7 +516,8 @@ def fake_outer_number_serialize_with_http_info(self, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -621,6 +631,7 @@ def fake_outer_string_serialize_with_http_info(self, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -638,7 +649,8 @@ def fake_outer_string_serialize_with_http_info(self, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -752,6 +764,7 @@ def test_body_with_file_schema_with_http_info(self, body, **kwargs): # noqa: E5 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -769,7 +782,8 @@ def test_body_with_file_schema_with_http_info(self, body, **kwargs): # noqa: E5 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -801,8 +815,10 @@ def test_body_with_file_schema_with_http_info(self, body, **kwargs): # noqa: E5 if 'body' in local_var_params: body_params = local_var_params['body'] # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'PUT', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -887,6 +903,7 @@ def test_body_with_query_params_with_http_info(self, query, body, **kwargs): # request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -905,7 +922,8 @@ def test_body_with_query_params_with_http_info(self, query, body, **kwargs): # '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -943,8 +961,10 @@ def test_body_with_query_params_with_http_info(self, query, body, **kwargs): # if 'body' in local_var_params: body_params = local_var_params['body'] # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'PUT', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -1027,6 +1047,7 @@ def test_client_model_with_http_info(self, body, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1044,7 +1065,8 @@ def test_client_model_with_http_info(self, body, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1080,8 +1102,10 @@ def test_client_model_with_http_info(self, body, **kwargs): # noqa: E501 ['application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'PATCH', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -1218,6 +1242,7 @@ def test_endpoint_parameters_with_http_info(self, number, double, pattern_withou request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1248,7 +1273,8 @@ def test_endpoint_parameters_with_http_info(self, number, double, pattern_withou '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1346,8 +1372,10 @@ def test_endpoint_parameters_with_http_info(self, number, double, pattern_withou body_params = None # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/x-www-form-urlencoded']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/x-www-form-urlencoded'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = ['http_basic_test'] # noqa: E501 @@ -1458,6 +1486,7 @@ def test_enum_parameters_with_http_info(self, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1482,7 +1511,8 @@ def test_enum_parameters_with_http_info(self, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1527,8 +1557,10 @@ def test_enum_parameters_with_http_info(self, **kwargs): # noqa: E501 body_params = None # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/x-www-form-urlencoded']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/x-www-form-urlencoded'], + 'GET', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -1631,6 +1663,7 @@ def test_group_parameters_with_http_info(self, required_string_group, required_b request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1653,7 +1686,8 @@ def test_group_parameters_with_http_info(self, required_string_group, required_b '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1781,6 +1815,7 @@ def test_inline_additional_properties_with_http_info(self, param, **kwargs): # request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1798,7 +1833,8 @@ def test_inline_additional_properties_with_http_info(self, param, **kwargs): # '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1830,8 +1866,10 @@ def test_inline_additional_properties_with_http_info(self, param, **kwargs): # if 'param' in local_var_params: body_params = local_var_params['param'] # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -1916,6 +1954,7 @@ def test_json_form_data_with_http_info(self, param, param2, **kwargs): # noqa: request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1934,7 +1973,8 @@ def test_json_form_data_with_http_info(self, param, param2, **kwargs): # noqa: '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1972,8 +2012,10 @@ def test_json_form_data_with_http_info(self, param, param2, **kwargs): # noqa: body_params = None # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/x-www-form-urlencoded']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/x-www-form-urlencoded'], + 'GET', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -2072,6 +2114,7 @@ def test_query_parameter_collection_format_with_http_info(self, pipe, ioutil, ht request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -2093,7 +2136,8 @@ def test_query_parameter_collection_format_with_http_info(self, pipe, ioutil, ht '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) diff --git a/samples/client/petstore/python-legacy/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python-legacy/petstore_api/api/fake_classname_tags_123_api.py index 5d6405e2cbdb..2b46147fed58 100644 --- a/samples/client/petstore/python-legacy/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/client/petstore/python-legacy/petstore_api/api/fake_classname_tags_123_api.py @@ -95,6 +95,7 @@ def test_classname_with_http_info(self, body, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -112,7 +113,8 @@ def test_classname_with_http_info(self, body, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -148,8 +150,10 @@ def test_classname_with_http_info(self, body, **kwargs): # noqa: E501 ['application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'PATCH', body_params)) # noqa: E501 # Authentication setting auth_settings = ['api_key_query'] # noqa: E501 diff --git a/samples/client/petstore/python-legacy/petstore_api/api/pet_api.py b/samples/client/petstore/python-legacy/petstore_api/api/pet_api.py index 50dab4563e92..e20e57a7f865 100644 --- a/samples/client/petstore/python-legacy/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python-legacy/petstore_api/api/pet_api.py @@ -93,6 +93,7 @@ def add_pet_with_http_info(self, body, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -110,7 +111,8 @@ def add_pet_with_http_info(self, body, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -142,8 +144,10 @@ def add_pet_with_http_info(self, body, **kwargs): # noqa: E501 if 'body' in local_var_params: body_params = local_var_params['body'] # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json', 'application/xml']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json', 'application/xml'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = ['petstore_auth'] # noqa: E501 @@ -228,6 +232,7 @@ def delete_pet_with_http_info(self, pet_id, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -246,7 +251,8 @@ def delete_pet_with_http_info(self, pet_id, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -360,6 +366,7 @@ def find_pets_by_status_with_http_info(self, status, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -377,7 +384,8 @@ def find_pets_by_status_with_http_info(self, status, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -497,6 +505,7 @@ def find_pets_by_tags_with_http_info(self, tags, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -514,7 +523,8 @@ def find_pets_by_tags_with_http_info(self, tags, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -634,6 +644,7 @@ def get_pet_by_id_with_http_info(self, pet_id, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -651,7 +662,8 @@ def get_pet_by_id_with_http_info(self, pet_id, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -769,6 +781,7 @@ def update_pet_with_http_info(self, body, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -786,7 +799,8 @@ def update_pet_with_http_info(self, body, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -818,8 +832,10 @@ def update_pet_with_http_info(self, body, **kwargs): # noqa: E501 if 'body' in local_var_params: body_params = local_var_params['body'] # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json', 'application/xml']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json', 'application/xml'], + 'PUT', body_params)) # noqa: E501 # Authentication setting auth_settings = ['petstore_auth'] # noqa: E501 @@ -908,6 +924,7 @@ def update_pet_with_form_with_http_info(self, pet_id, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -927,7 +944,8 @@ def update_pet_with_form_with_http_info(self, pet_id, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -963,8 +981,10 @@ def update_pet_with_form_with_http_info(self, pet_id, **kwargs): # noqa: E501 body_params = None # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/x-www-form-urlencoded']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/x-www-form-urlencoded'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = ['petstore_auth'] # noqa: E501 @@ -1053,6 +1073,7 @@ def upload_file_with_http_info(self, pet_id, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1072,7 +1093,8 @@ def upload_file_with_http_info(self, pet_id, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1112,8 +1134,10 @@ def upload_file_with_http_info(self, pet_id, **kwargs): # noqa: E501 ['application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['multipart/form-data']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['multipart/form-data'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = ['petstore_auth'] # noqa: E501 @@ -1204,6 +1228,7 @@ def upload_file_with_required_file_with_http_info(self, pet_id, required_file, * request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1223,7 +1248,8 @@ def upload_file_with_required_file_with_http_info(self, pet_id, required_file, * '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1267,8 +1293,10 @@ def upload_file_with_required_file_with_http_info(self, pet_id, required_file, * ['application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['multipart/form-data']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['multipart/form-data'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = ['petstore_auth'] # noqa: E501 diff --git a/samples/client/petstore/python-legacy/petstore_api/api/store_api.py b/samples/client/petstore/python-legacy/petstore_api/api/store_api.py index 092a4542774d..4425692aec0d 100644 --- a/samples/client/petstore/python-legacy/petstore_api/api/store_api.py +++ b/samples/client/petstore/python-legacy/petstore_api/api/store_api.py @@ -95,6 +95,7 @@ def delete_order_with_http_info(self, order_id, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -112,7 +113,8 @@ def delete_order_with_http_info(self, order_id, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -220,6 +222,7 @@ def get_inventory_with_http_info(self, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -236,7 +239,8 @@ def get_inventory_with_http_info(self, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -348,6 +352,7 @@ def get_order_by_id_with_http_info(self, order_id, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -365,7 +370,8 @@ def get_order_by_id_with_http_info(self, order_id, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -487,6 +493,7 @@ def place_order_with_http_info(self, body, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -504,7 +511,8 @@ def place_order_with_http_info(self, body, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) diff --git a/samples/client/petstore/python-legacy/petstore_api/api/user_api.py b/samples/client/petstore/python-legacy/petstore_api/api/user_api.py index 7c68a89e624d..593e5e5856ba 100644 --- a/samples/client/petstore/python-legacy/petstore_api/api/user_api.py +++ b/samples/client/petstore/python-legacy/petstore_api/api/user_api.py @@ -95,6 +95,7 @@ def create_user_with_http_info(self, body, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -112,7 +113,8 @@ def create_user_with_http_info(self, body, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -222,6 +224,7 @@ def create_users_with_array_input_with_http_info(self, body, **kwargs): # noqa: request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -239,7 +242,8 @@ def create_users_with_array_input_with_http_info(self, body, **kwargs): # noqa: '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -349,6 +353,7 @@ def create_users_with_list_input_with_http_info(self, body, **kwargs): # noqa: request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -366,7 +371,8 @@ def create_users_with_list_input_with_http_info(self, body, **kwargs): # noqa: '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -478,6 +484,7 @@ def delete_user_with_http_info(self, username, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -495,7 +502,8 @@ def delete_user_with_http_info(self, username, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -605,6 +613,7 @@ def get_user_by_name_with_http_info(self, username, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -622,7 +631,8 @@ def get_user_by_name_with_http_info(self, username, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -744,6 +754,7 @@ def login_user_with_http_info(self, username, password, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -762,7 +773,8 @@ def login_user_with_http_info(self, username, password, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -881,6 +893,7 @@ def logout_user_with_http_info(self, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -897,7 +910,8 @@ def logout_user_with_http_info(self, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1007,6 +1021,7 @@ def update_user_with_http_info(self, username, body, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1025,7 +1040,8 @@ def update_user_with_http_info(self, username, body, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) diff --git a/samples/client/petstore/python-legacy/petstore_api/api_client.py b/samples/client/petstore/python-legacy/petstore_api/api_client.py index 7c3a69abd761..15464e6282be 100644 --- a/samples/client/petstore/python-legacy/petstore_api/api_client.py +++ b/samples/client/petstore/python-legacy/petstore_api/api_client.py @@ -521,10 +521,12 @@ def select_header_accept(self, accepts): else: return ', '.join(accepts) - def select_header_content_type(self, content_types): + def select_header_content_type(self, content_types, method=None, body=None): """Returns `Content-Type` based on an array of content_types provided. :param content_types: List of content-types. + :param method: http method (e.g. POST, PATCH). + :param body: http body to send. :return: Content-Type (e.g. application/json). """ if not content_types: @@ -532,6 +534,11 @@ def select_header_content_type(self, content_types): content_types = [x.lower() for x in content_types] + if (method == 'PATCH' and + 'application/json-patch+json' in content_types and + isinstance(body, list)): + return 'application/json-patch+json' + if 'application/json' in content_types or '*/*' in content_types: return 'application/json' else: diff --git a/samples/client/petstore/python-legacy/tests/test_api_client.py b/samples/client/petstore/python-legacy/tests/test_api_client.py index 216e1f9ec1b4..8da54be7ae7a 100644 --- a/samples/client/petstore/python-legacy/tests/test_api_client.py +++ b/samples/client/petstore/python-legacy/tests/test_api_client.py @@ -98,6 +98,16 @@ def test_select_header_content_type(self): content_type = self.api_client.select_header_content_type(content_types) self.assertEqual(content_type, 'application/json') + content_types = ['application/json-patch+json', 'application/json'] + content_type = self.api_client.select_header_content_type(content_types, + 'PATCH', [{ "op": "add", "path": "/myPath", "value": ["myValue"]}]) + self.assertEqual(content_type, 'application/json-patch+json') + + content_types = ['application/json-patch+json', 'application/json'] + content_type = self.api_client.select_header_content_type(content_types, + 'PATCH', {"value": ["myValue"]}) + self.assertEqual(content_type, 'application/json') + def test_sanitize_for_serialization(self): # None data = None diff --git a/samples/client/petstore/python-legacy/tests/test_pet_api.py b/samples/client/petstore/python-legacy/tests/test_pet_api.py index a7b47bdc5670..4e894436d4b3 100644 --- a/samples/client/petstore/python-legacy/tests/test_pet_api.py +++ b/samples/client/petstore/python-legacy/tests/test_pet_api.py @@ -13,6 +13,7 @@ import os import unittest +from unittest.mock import patch import petstore_api from petstore_api import Configuration @@ -293,5 +294,26 @@ def test_delete_pet(self): except ApiException as e: self.assertEqual(404, e.status) + @patch.object(petstore_api.ApiClient, 'call_api') + @patch.object(petstore_api.ApiClient, 'select_header_content_type') + def test_call_select_header_content_type(self, mock_select_ct, mock_call_api): + mock_select_ct.return_value = 'application/json' + self.pet_api.add_pet({'id': 1000, 'name': 'my pet'}) + mock_select_ct.assert_called_once_with( + ['application/json', 'application/xml'], + 'POST', + {'id': 1000, 'name': 'my pet'}) + mock_call_api.assert_called_once() + self.assertEqual(mock_call_api.mock_calls[0][1][4], + {'Content-Type': 'application/json'}) + + @patch.object(petstore_api.ApiClient, 'call_api') + def test_call_with_forced_content_type(self, mock_call_api): + mock_call_api.return_value = 'application/xml' + self.pet_api.add_pet('', _content_type='application/xml') + mock_call_api.assert_called_once() + self.assertEqual(mock_call_api.mock_calls[0][1][4], + {'Content-Type': 'application/xml'}) + if __name__ == '__main__': unittest.main() diff --git a/samples/client/petstore/python-tornado/petstore_api/api/another_fake_api.py b/samples/client/petstore/python-tornado/petstore_api/api/another_fake_api.py index b95df897b493..b76ee3b916cd 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python-tornado/petstore_api/api/another_fake_api.py @@ -95,6 +95,7 @@ def call_123_test_special_tags_with_http_info(self, body, **kwargs): # noqa: E5 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -112,7 +113,8 @@ def call_123_test_special_tags_with_http_info(self, body, **kwargs): # noqa: E5 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -148,8 +150,10 @@ def call_123_test_special_tags_with_http_info(self, body, **kwargs): # noqa: E5 ['application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'PATCH', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # 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 063ac8e08d14..b97f43f60f93 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 @@ -95,6 +95,7 @@ def create_xml_item_with_http_info(self, xml_item, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -112,7 +113,8 @@ def create_xml_item_with_http_info(self, xml_item, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -144,8 +146,10 @@ def create_xml_item_with_http_info(self, xml_item, **kwargs): # noqa: E501 if 'xml_item' in local_var_params: body_params = local_var_params['xml_item'] # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/xml', 'application/xml; charset=utf-8', 'application/xml; charset=utf-16', 'text/xml', 'text/xml; charset=utf-8', 'text/xml; charset=utf-16']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.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'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -228,6 +232,7 @@ def fake_outer_boolean_serialize_with_http_info(self, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -245,7 +250,8 @@ def fake_outer_boolean_serialize_with_http_info(self, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -359,6 +365,7 @@ def fake_outer_composite_serialize_with_http_info(self, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -376,7 +383,8 @@ def fake_outer_composite_serialize_with_http_info(self, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -490,6 +498,7 @@ def fake_outer_number_serialize_with_http_info(self, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -507,7 +516,8 @@ def fake_outer_number_serialize_with_http_info(self, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -621,6 +631,7 @@ def fake_outer_string_serialize_with_http_info(self, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -638,7 +649,8 @@ def fake_outer_string_serialize_with_http_info(self, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -752,6 +764,7 @@ def test_body_with_file_schema_with_http_info(self, body, **kwargs): # noqa: E5 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -769,7 +782,8 @@ def test_body_with_file_schema_with_http_info(self, body, **kwargs): # noqa: E5 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -801,8 +815,10 @@ def test_body_with_file_schema_with_http_info(self, body, **kwargs): # noqa: E5 if 'body' in local_var_params: body_params = local_var_params['body'] # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'PUT', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -887,6 +903,7 @@ def test_body_with_query_params_with_http_info(self, query, body, **kwargs): # request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -905,7 +922,8 @@ def test_body_with_query_params_with_http_info(self, query, body, **kwargs): # '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -943,8 +961,10 @@ def test_body_with_query_params_with_http_info(self, query, body, **kwargs): # if 'body' in local_var_params: body_params = local_var_params['body'] # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'PUT', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -1027,6 +1047,7 @@ def test_client_model_with_http_info(self, body, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1044,7 +1065,8 @@ def test_client_model_with_http_info(self, body, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1080,8 +1102,10 @@ def test_client_model_with_http_info(self, body, **kwargs): # noqa: E501 ['application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'PATCH', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -1218,6 +1242,7 @@ def test_endpoint_parameters_with_http_info(self, number, double, pattern_withou request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1248,7 +1273,8 @@ def test_endpoint_parameters_with_http_info(self, number, double, pattern_withou '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1346,8 +1372,10 @@ def test_endpoint_parameters_with_http_info(self, number, double, pattern_withou body_params = None # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/x-www-form-urlencoded']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/x-www-form-urlencoded'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = ['http_basic_test'] # noqa: E501 @@ -1458,6 +1486,7 @@ def test_enum_parameters_with_http_info(self, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1482,7 +1511,8 @@ def test_enum_parameters_with_http_info(self, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1527,8 +1557,10 @@ def test_enum_parameters_with_http_info(self, **kwargs): # noqa: E501 body_params = None # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/x-www-form-urlencoded']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/x-www-form-urlencoded'], + 'GET', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -1631,6 +1663,7 @@ def test_group_parameters_with_http_info(self, required_string_group, required_b request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1653,7 +1686,8 @@ def test_group_parameters_with_http_info(self, required_string_group, required_b '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1781,6 +1815,7 @@ def test_inline_additional_properties_with_http_info(self, param, **kwargs): # request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1798,7 +1833,8 @@ def test_inline_additional_properties_with_http_info(self, param, **kwargs): # '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1830,8 +1866,10 @@ def test_inline_additional_properties_with_http_info(self, param, **kwargs): # if 'param' in local_var_params: body_params = local_var_params['param'] # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -1916,6 +1954,7 @@ def test_json_form_data_with_http_info(self, param, param2, **kwargs): # noqa: request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1934,7 +1973,8 @@ def test_json_form_data_with_http_info(self, param, param2, **kwargs): # noqa: '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1972,8 +2012,10 @@ def test_json_form_data_with_http_info(self, param, param2, **kwargs): # noqa: body_params = None # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/x-www-form-urlencoded']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/x-www-form-urlencoded'], + 'GET', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -2072,6 +2114,7 @@ def test_query_parameter_collection_format_with_http_info(self, pipe, ioutil, ht request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -2093,7 +2136,8 @@ def test_query_parameter_collection_format_with_http_info(self, pipe, ioutil, ht '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) diff --git a/samples/client/petstore/python-tornado/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python-tornado/petstore_api/api/fake_classname_tags_123_api.py index 5d6405e2cbdb..2b46147fed58 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/client/petstore/python-tornado/petstore_api/api/fake_classname_tags_123_api.py @@ -95,6 +95,7 @@ def test_classname_with_http_info(self, body, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -112,7 +113,8 @@ def test_classname_with_http_info(self, body, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -148,8 +150,10 @@ def test_classname_with_http_info(self, body, **kwargs): # noqa: E501 ['application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'PATCH', body_params)) # noqa: E501 # Authentication setting auth_settings = ['api_key_query'] # noqa: E501 diff --git a/samples/client/petstore/python-tornado/petstore_api/api/pet_api.py b/samples/client/petstore/python-tornado/petstore_api/api/pet_api.py index 50dab4563e92..e20e57a7f865 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python-tornado/petstore_api/api/pet_api.py @@ -93,6 +93,7 @@ def add_pet_with_http_info(self, body, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -110,7 +111,8 @@ def add_pet_with_http_info(self, body, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -142,8 +144,10 @@ def add_pet_with_http_info(self, body, **kwargs): # noqa: E501 if 'body' in local_var_params: body_params = local_var_params['body'] # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json', 'application/xml']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json', 'application/xml'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = ['petstore_auth'] # noqa: E501 @@ -228,6 +232,7 @@ def delete_pet_with_http_info(self, pet_id, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -246,7 +251,8 @@ def delete_pet_with_http_info(self, pet_id, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -360,6 +366,7 @@ def find_pets_by_status_with_http_info(self, status, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -377,7 +384,8 @@ def find_pets_by_status_with_http_info(self, status, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -497,6 +505,7 @@ def find_pets_by_tags_with_http_info(self, tags, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -514,7 +523,8 @@ def find_pets_by_tags_with_http_info(self, tags, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -634,6 +644,7 @@ def get_pet_by_id_with_http_info(self, pet_id, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -651,7 +662,8 @@ def get_pet_by_id_with_http_info(self, pet_id, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -769,6 +781,7 @@ def update_pet_with_http_info(self, body, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -786,7 +799,8 @@ def update_pet_with_http_info(self, body, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -818,8 +832,10 @@ def update_pet_with_http_info(self, body, **kwargs): # noqa: E501 if 'body' in local_var_params: body_params = local_var_params['body'] # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json', 'application/xml']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json', 'application/xml'], + 'PUT', body_params)) # noqa: E501 # Authentication setting auth_settings = ['petstore_auth'] # noqa: E501 @@ -908,6 +924,7 @@ def update_pet_with_form_with_http_info(self, pet_id, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -927,7 +944,8 @@ def update_pet_with_form_with_http_info(self, pet_id, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -963,8 +981,10 @@ def update_pet_with_form_with_http_info(self, pet_id, **kwargs): # noqa: E501 body_params = None # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/x-www-form-urlencoded']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/x-www-form-urlencoded'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = ['petstore_auth'] # noqa: E501 @@ -1053,6 +1073,7 @@ def upload_file_with_http_info(self, pet_id, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1072,7 +1093,8 @@ def upload_file_with_http_info(self, pet_id, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1112,8 +1134,10 @@ def upload_file_with_http_info(self, pet_id, **kwargs): # noqa: E501 ['application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['multipart/form-data']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['multipart/form-data'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = ['petstore_auth'] # noqa: E501 @@ -1204,6 +1228,7 @@ def upload_file_with_required_file_with_http_info(self, pet_id, required_file, * request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1223,7 +1248,8 @@ def upload_file_with_required_file_with_http_info(self, pet_id, required_file, * '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1267,8 +1293,10 @@ def upload_file_with_required_file_with_http_info(self, pet_id, required_file, * ['application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['multipart/form-data']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['multipart/form-data'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = ['petstore_auth'] # noqa: E501 diff --git a/samples/client/petstore/python-tornado/petstore_api/api/store_api.py b/samples/client/petstore/python-tornado/petstore_api/api/store_api.py index 092a4542774d..4425692aec0d 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api/store_api.py +++ b/samples/client/petstore/python-tornado/petstore_api/api/store_api.py @@ -95,6 +95,7 @@ def delete_order_with_http_info(self, order_id, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -112,7 +113,8 @@ def delete_order_with_http_info(self, order_id, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -220,6 +222,7 @@ def get_inventory_with_http_info(self, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -236,7 +239,8 @@ def get_inventory_with_http_info(self, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -348,6 +352,7 @@ def get_order_by_id_with_http_info(self, order_id, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -365,7 +370,8 @@ def get_order_by_id_with_http_info(self, order_id, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -487,6 +493,7 @@ def place_order_with_http_info(self, body, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -504,7 +511,8 @@ def place_order_with_http_info(self, body, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) diff --git a/samples/client/petstore/python-tornado/petstore_api/api/user_api.py b/samples/client/petstore/python-tornado/petstore_api/api/user_api.py index 7c68a89e624d..593e5e5856ba 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api/user_api.py +++ b/samples/client/petstore/python-tornado/petstore_api/api/user_api.py @@ -95,6 +95,7 @@ def create_user_with_http_info(self, body, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -112,7 +113,8 @@ def create_user_with_http_info(self, body, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -222,6 +224,7 @@ def create_users_with_array_input_with_http_info(self, body, **kwargs): # noqa: request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -239,7 +242,8 @@ def create_users_with_array_input_with_http_info(self, body, **kwargs): # noqa: '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -349,6 +353,7 @@ def create_users_with_list_input_with_http_info(self, body, **kwargs): # noqa: request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -366,7 +371,8 @@ def create_users_with_list_input_with_http_info(self, body, **kwargs): # noqa: '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -478,6 +484,7 @@ def delete_user_with_http_info(self, username, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -495,7 +502,8 @@ def delete_user_with_http_info(self, username, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -605,6 +613,7 @@ def get_user_by_name_with_http_info(self, username, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -622,7 +631,8 @@ def get_user_by_name_with_http_info(self, username, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -744,6 +754,7 @@ def login_user_with_http_info(self, username, password, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -762,7 +773,8 @@ def login_user_with_http_info(self, username, password, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -881,6 +893,7 @@ def logout_user_with_http_info(self, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -897,7 +910,8 @@ def logout_user_with_http_info(self, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1007,6 +1021,7 @@ def update_user_with_http_info(self, username, body, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1025,7 +1040,8 @@ def update_user_with_http_info(self, username, body, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) diff --git a/samples/client/petstore/python-tornado/petstore_api/api_client.py b/samples/client/petstore/python-tornado/petstore_api/api_client.py index 8c41c345d573..5a833ebd1c0d 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api_client.py +++ b/samples/client/petstore/python-tornado/petstore_api/api_client.py @@ -523,10 +523,12 @@ def select_header_accept(self, accepts): else: return ', '.join(accepts) - def select_header_content_type(self, content_types): + def select_header_content_type(self, content_types, method=None, body=None): """Returns `Content-Type` based on an array of content_types provided. :param content_types: List of content-types. + :param method: http method (e.g. POST, PATCH). + :param body: http body to send. :return: Content-Type (e.g. application/json). """ if not content_types: @@ -534,6 +536,11 @@ def select_header_content_type(self, content_types): content_types = [x.lower() for x in content_types] + if (method == 'PATCH' and + 'application/json-patch+json' in content_types and + isinstance(body, list)): + return 'application/json-patch+json' + if 'application/json' in content_types or '*/*' in content_types: return 'application/json' else: diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/another_fake_api.py index 7dad5ca84ae7..43e5339dcc96 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/another_fake_api.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/another_fake_api.py @@ -95,6 +95,7 @@ def call_123_test_special_tags_with_http_info(self, client, **kwargs): # noqa: request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -112,7 +113,8 @@ def call_123_test_special_tags_with_http_info(self, client, **kwargs): # noqa: '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -148,8 +150,10 @@ def call_123_test_special_tags_with_http_info(self, client, **kwargs): # noqa: ['application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'PATCH', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/default_api.py index 7f2691f7cf54..d3be5ae092aa 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/default_api.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/default_api.py @@ -89,6 +89,7 @@ def foo_get_with_http_info(self, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -105,7 +106,8 @@ def foo_get_with_http_info(self, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py index 7de994ea5654..a08aee25453d 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py @@ -89,6 +89,7 @@ def fake_health_get_with_http_info(self, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -105,7 +106,8 @@ def fake_health_get_with_http_info(self, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -223,6 +225,7 @@ def fake_http_signature_test_with_http_info(self, pet, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -242,7 +245,8 @@ def fake_http_signature_test_with_http_info(self, pet, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -278,8 +282,10 @@ def fake_http_signature_test_with_http_info(self, pet, **kwargs): # noqa: E501 if 'pet' in local_var_params: body_params = local_var_params['pet'] # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json', 'application/xml']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json', 'application/xml'], + 'GET', body_params)) # noqa: E501 # Authentication setting auth_settings = ['http_signature_test'] # noqa: E501 @@ -362,6 +368,7 @@ def fake_outer_boolean_serialize_with_http_info(self, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -379,7 +386,8 @@ def fake_outer_boolean_serialize_with_http_info(self, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -411,8 +419,10 @@ def fake_outer_boolean_serialize_with_http_info(self, **kwargs): # noqa: E501 ['*/*']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -497,6 +507,7 @@ def fake_outer_composite_serialize_with_http_info(self, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -514,7 +525,8 @@ def fake_outer_composite_serialize_with_http_info(self, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -546,8 +558,10 @@ def fake_outer_composite_serialize_with_http_info(self, **kwargs): # noqa: E501 ['*/*']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -632,6 +646,7 @@ def fake_outer_number_serialize_with_http_info(self, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -649,7 +664,8 @@ def fake_outer_number_serialize_with_http_info(self, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -681,8 +697,10 @@ def fake_outer_number_serialize_with_http_info(self, **kwargs): # noqa: E501 ['*/*']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -767,6 +785,7 @@ def fake_outer_string_serialize_with_http_info(self, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -784,7 +803,8 @@ def fake_outer_string_serialize_with_http_info(self, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -816,8 +836,10 @@ def fake_outer_string_serialize_with_http_info(self, **kwargs): # noqa: E501 ['*/*']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -902,6 +924,7 @@ def fake_property_enum_integer_serialize_with_http_info(self, outer_object_with_ request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -919,7 +942,8 @@ def fake_property_enum_integer_serialize_with_http_info(self, outer_object_with_ '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -955,8 +979,10 @@ def fake_property_enum_integer_serialize_with_http_info(self, outer_object_with_ ['*/*']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -1041,6 +1067,7 @@ def test_body_with_binary_with_http_info(self, body, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1058,7 +1085,8 @@ def test_body_with_binary_with_http_info(self, body, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1086,8 +1114,10 @@ def test_body_with_binary_with_http_info(self, body, **kwargs): # noqa: E501 if 'body' in local_var_params: body_params = local_var_params['body'] # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['image/png']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['image/png'], + 'PUT', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -1170,6 +1200,7 @@ def test_body_with_file_schema_with_http_info(self, file_schema_test_class, **kw request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1187,7 +1218,8 @@ def test_body_with_file_schema_with_http_info(self, file_schema_test_class, **kw '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1219,8 +1251,10 @@ def test_body_with_file_schema_with_http_info(self, file_schema_test_class, **kw if 'file_schema_test_class' in local_var_params: body_params = local_var_params['file_schema_test_class'] # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'PUT', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -1305,6 +1339,7 @@ def test_body_with_query_params_with_http_info(self, query, user, **kwargs): # request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1323,7 +1358,8 @@ def test_body_with_query_params_with_http_info(self, query, user, **kwargs): # '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1361,8 +1397,10 @@ def test_body_with_query_params_with_http_info(self, query, user, **kwargs): # if 'user' in local_var_params: body_params = local_var_params['user'] # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'PUT', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -1445,6 +1483,7 @@ def test_client_model_with_http_info(self, client, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1462,7 +1501,8 @@ def test_client_model_with_http_info(self, client, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1498,8 +1538,10 @@ def test_client_model_with_http_info(self, client, **kwargs): # noqa: E501 ['application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'PATCH', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -1636,6 +1678,7 @@ def test_endpoint_parameters_with_http_info(self, number, double, pattern_withou request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1666,7 +1709,8 @@ def test_endpoint_parameters_with_http_info(self, number, double, pattern_withou '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1764,8 +1808,10 @@ def test_endpoint_parameters_with_http_info(self, number, double, pattern_withou body_params = None # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/x-www-form-urlencoded']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/x-www-form-urlencoded'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = ['http_basic_test'] # noqa: E501 @@ -1876,6 +1922,7 @@ def test_enum_parameters_with_http_info(self, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1900,7 +1947,8 @@ def test_enum_parameters_with_http_info(self, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1945,8 +1993,10 @@ def test_enum_parameters_with_http_info(self, **kwargs): # noqa: E501 body_params = None # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/x-www-form-urlencoded']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/x-www-form-urlencoded'], + 'GET', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -2049,6 +2099,7 @@ def test_group_parameters_with_http_info(self, required_string_group, required_b request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -2071,7 +2122,8 @@ def test_group_parameters_with_http_info(self, required_string_group, required_b '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -2199,6 +2251,7 @@ def test_inline_additional_properties_with_http_info(self, request_body, **kwarg request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -2216,7 +2269,8 @@ def test_inline_additional_properties_with_http_info(self, request_body, **kwarg '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -2248,8 +2302,10 @@ def test_inline_additional_properties_with_http_info(self, request_body, **kwarg if 'request_body' in local_var_params: body_params = local_var_params['request_body'] # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -2334,6 +2390,7 @@ def test_json_form_data_with_http_info(self, param, param2, **kwargs): # noqa: request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -2352,7 +2409,8 @@ def test_json_form_data_with_http_info(self, param, param2, **kwargs): # noqa: '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -2390,8 +2448,10 @@ def test_json_form_data_with_http_info(self, param, param2, **kwargs): # noqa: body_params = None # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/x-www-form-urlencoded']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/x-www-form-urlencoded'], + 'GET', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -2498,6 +2558,7 @@ def test_query_parameter_collection_format_with_http_info(self, pipe, ioutil, ht request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -2521,7 +2582,8 @@ def test_query_parameter_collection_format_with_http_info(self, pipe, ioutil, ht '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_classname_tags_123_api.py index dffc78620e9e..1dd90624e719 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_classname_tags_123_api.py @@ -95,6 +95,7 @@ def test_classname_with_http_info(self, client, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -112,7 +113,8 @@ def test_classname_with_http_info(self, client, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -148,8 +150,10 @@ def test_classname_with_http_info(self, client, **kwargs): # noqa: E501 ['application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'PATCH', body_params)) # noqa: E501 # Authentication setting auth_settings = ['api_key_query'] # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/pet_api.py index a4195ecad3e1..5f4bcb8888b9 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/pet_api.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/pet_api.py @@ -93,6 +93,7 @@ def add_pet_with_http_info(self, pet, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -123,7 +124,8 @@ def add_pet_with_http_info(self, pet, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -155,8 +157,10 @@ def add_pet_with_http_info(self, pet, **kwargs): # noqa: E501 if 'pet' in local_var_params: body_params = local_var_params['pet'] # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json', 'application/xml']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json', 'application/xml'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = ['petstore_auth'] # noqa: E501 @@ -242,6 +246,7 @@ def delete_pet_with_http_info(self, pet_id, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -260,7 +265,8 @@ def delete_pet_with_http_info(self, pet_id, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -374,6 +380,7 @@ def find_pets_by_status_with_http_info(self, status, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -391,7 +398,8 @@ def find_pets_by_status_with_http_info(self, status, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -511,6 +519,7 @@ def find_pets_by_tags_with_http_info(self, tags, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -528,7 +537,8 @@ def find_pets_by_tags_with_http_info(self, tags, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -648,6 +658,7 @@ def get_pet_by_id_with_http_info(self, pet_id, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -665,7 +676,8 @@ def get_pet_by_id_with_http_info(self, pet_id, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -783,6 +795,7 @@ def update_pet_with_http_info(self, pet, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -813,7 +826,8 @@ def update_pet_with_http_info(self, pet, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -845,8 +859,10 @@ def update_pet_with_http_info(self, pet, **kwargs): # noqa: E501 if 'pet' in local_var_params: body_params = local_var_params['pet'] # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json', 'application/xml']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json', 'application/xml'], + 'PUT', body_params)) # noqa: E501 # Authentication setting auth_settings = ['petstore_auth'] # noqa: E501 @@ -936,6 +952,7 @@ def update_pet_with_form_with_http_info(self, pet_id, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -955,7 +972,8 @@ def update_pet_with_form_with_http_info(self, pet_id, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -991,8 +1009,10 @@ def update_pet_with_form_with_http_info(self, pet_id, **kwargs): # noqa: E501 body_params = None # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/x-www-form-urlencoded']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/x-www-form-urlencoded'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = ['petstore_auth'] # noqa: E501 @@ -1081,6 +1101,7 @@ def upload_file_with_http_info(self, pet_id, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1100,7 +1121,8 @@ def upload_file_with_http_info(self, pet_id, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1140,8 +1162,10 @@ def upload_file_with_http_info(self, pet_id, **kwargs): # noqa: E501 ['application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['multipart/form-data']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['multipart/form-data'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = ['petstore_auth'] # noqa: E501 @@ -1232,6 +1256,7 @@ def upload_file_with_required_file_with_http_info(self, pet_id, required_file, * request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1251,7 +1276,8 @@ def upload_file_with_required_file_with_http_info(self, pet_id, required_file, * '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1295,8 +1321,10 @@ def upload_file_with_required_file_with_http_info(self, pet_id, required_file, * ['application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['multipart/form-data']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['multipart/form-data'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = ['petstore_auth'] # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/store_api.py index 0d6c2fdf6b7d..48c85b36d7b8 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/store_api.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/store_api.py @@ -95,6 +95,7 @@ def delete_order_with_http_info(self, order_id, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -112,7 +113,8 @@ def delete_order_with_http_info(self, order_id, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -220,6 +222,7 @@ def get_inventory_with_http_info(self, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -236,7 +239,8 @@ def get_inventory_with_http_info(self, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -348,6 +352,7 @@ def get_order_by_id_with_http_info(self, order_id, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -365,7 +370,8 @@ def get_order_by_id_with_http_info(self, order_id, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -487,6 +493,7 @@ def place_order_with_http_info(self, order, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -504,7 +511,8 @@ def place_order_with_http_info(self, order, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -540,8 +548,10 @@ def place_order_with_http_info(self, order, **kwargs): # noqa: E501 ['application/xml', 'application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/user_api.py index 8e4f70e6c7ad..89fd46adef9e 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/user_api.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/user_api.py @@ -95,6 +95,7 @@ def create_user_with_http_info(self, user, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -112,7 +113,8 @@ def create_user_with_http_info(self, user, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -144,8 +146,10 @@ def create_user_with_http_info(self, user, **kwargs): # noqa: E501 if 'user' in local_var_params: body_params = local_var_params['user'] # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -226,6 +230,7 @@ def create_users_with_array_input_with_http_info(self, user, **kwargs): # noqa: request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -243,7 +248,8 @@ def create_users_with_array_input_with_http_info(self, user, **kwargs): # noqa: '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -275,8 +281,10 @@ def create_users_with_array_input_with_http_info(self, user, **kwargs): # noqa: if 'user' in local_var_params: body_params = local_var_params['user'] # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -357,6 +365,7 @@ def create_users_with_list_input_with_http_info(self, user, **kwargs): # noqa: request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -374,7 +383,8 @@ def create_users_with_list_input_with_http_info(self, user, **kwargs): # noqa: '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -406,8 +416,10 @@ def create_users_with_list_input_with_http_info(self, user, **kwargs): # noqa: if 'user' in local_var_params: body_params = local_var_params['user'] # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'POST', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 @@ -490,6 +502,7 @@ def delete_user_with_http_info(self, username, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -507,7 +520,8 @@ def delete_user_with_http_info(self, username, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -617,6 +631,7 @@ def get_user_by_name_with_http_info(self, username, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -634,7 +649,8 @@ def get_user_by_name_with_http_info(self, username, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -756,6 +772,7 @@ def login_user_with_http_info(self, username, password, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -774,7 +791,8 @@ def login_user_with_http_info(self, username, password, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -893,6 +911,7 @@ def logout_user_with_http_info(self, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -909,7 +928,8 @@ def logout_user_with_http_info(self, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1019,6 +1039,7 @@ def update_user_with_http_info(self, username, user, **kwargs): # noqa: E501 request; this effectively ignores the authentication in the spec for a single request. :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1037,7 +1058,8 @@ def update_user_with_http_info(self, username, user, **kwargs): # noqa: E501 '_return_http_data_only', '_preload_content', '_request_timeout', - '_request_auth' + '_request_auth', + '_content_type' ] ) @@ -1075,8 +1097,10 @@ def update_user_with_http_info(self, username, user, **kwargs): # noqa: E501 if 'user' in local_var_params: body_params = local_var_params['user'] # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + header_params['Content-Type'] = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'], + 'PUT', body_params)) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api_client.py index 7c3a69abd761..15464e6282be 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api_client.py @@ -521,10 +521,12 @@ def select_header_accept(self, accepts): else: return ', '.join(accepts) - def select_header_content_type(self, content_types): + def select_header_content_type(self, content_types, method=None, body=None): """Returns `Content-Type` based on an array of content_types provided. :param content_types: List of content-types. + :param method: http method (e.g. POST, PATCH). + :param body: http body to send. :return: Content-Type (e.g. application/json). """ if not content_types: @@ -532,6 +534,11 @@ def select_header_content_type(self, content_types): content_types = [x.lower() for x in content_types] + if (method == 'PATCH' and + 'application/json-patch+json' in content_types and + isinstance(body, list)): + return 'application/json-patch+json' + if 'application/json' in content_types or '*/*' in content_types: return 'application/json' else: From 49e9911b3ffd6e0730e04a3bdbbb29e100b03c8a Mon Sep 17 00:00:00 2001 From: Jens L Date: Mon, 22 Nov 2021 22:17:15 +0100 Subject: [PATCH 017/117] [typescript-fetch] fix circular imports being generated (#10798) templates based off of #6140 and @ajaska closes #6140 --- .../resources/typescript-fetch/modelGeneric.mustache | 6 +++--- .../main/resources/typescript-fetch/modelOneOf.mustache | 9 ++++----- .../builds/default-v3.0/models/ArrayTest.ts | 2 +- .../typescript-fetch/builds/default-v3.0/models/Cat.ts | 4 +++- .../typescript-fetch/builds/default-v3.0/models/Dog.ts | 4 +++- .../builds/default-v3.0/models/EnumTest.ts | 8 +++++++- .../builds/default-v3.0/models/FormatTest.ts | 2 +- .../builds/default-v3.0/models/InlineResponseDefault.ts | 2 +- .../MixedPropertiesAndAdditionalPropertiesClass.ts | 2 +- .../default-v3.0/models/ObjectWithDeprecatedFields.ts | 2 +- .../default-v3.0/models/OuterObjectWithEnumProperty.ts | 2 +- .../typescript-fetch/builds/default-v3.0/models/Pet.ts | 4 +++- .../typescript-fetch/builds/default/models/Pet.ts | 4 +++- .../builds/enum/models/EnumPatternObject.ts | 4 +++- .../typescript-fetch/builds/es6-target/src/models/Pet.ts | 4 +++- .../builds/multiple-parameters/models/Pet.ts | 4 +++- .../builds/prefix-parameter-interfaces/src/models/Pet.ts | 4 +++- .../src/models/DefaultMetaOnlyResponse.ts | 2 +- .../src/models/FindPetsByStatusResponse.ts | 4 +++- .../src/models/FindPetsByUserResponse.ts | 4 +++- .../src/models/GetBehaviorPermissionsResponse.ts | 2 +- .../src/models/GetBehaviorTypeResponse.ts | 4 +++- .../src/models/GetMatchingPartsResponse.ts | 4 +++- .../src/models/GetPetPartTypeResponse.ts | 4 +++- .../builds/sagas-and-records/src/models/MatchingParts.ts | 2 +- .../builds/sagas-and-records/src/models/ModelError.ts | 2 +- .../builds/sagas-and-records/src/models/Pet.ts | 8 +++++++- .../sagas-and-records/src/models/PetRegionsResponse.ts | 2 +- .../builds/sagas-and-records/src/models/ResponseMeta.ts | 2 +- .../builds/typescript-three-plus/src/models/Pet.ts | 4 +++- .../builds/with-interfaces/models/Pet.ts | 4 +++- .../builds/with-npm-version/src/models/Pet.ts | 4 +++- 32 files changed, 81 insertions(+), 38 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/modelGeneric.mustache index 1428b031f5a6..b37cfdec9daa 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/modelGeneric.mustache @@ -1,13 +1,13 @@ import { exists, mapValues } from '../runtime'; {{#hasImports}} +{{#imports}} import { - {{#imports}} {{{.}}}, {{.}}FromJSON, {{.}}FromJSONTyped, {{.}}ToJSON, - {{/imports}} -} from './'; +} from './{{.}}'; +{{/imports}} {{/hasImports}} {{#discriminator}} diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/modelOneOf.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/modelOneOf.mustache index 12d60088b42c..7cb97abeba85 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/modelOneOf.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/modelOneOf.mustache @@ -1,13 +1,12 @@ {{#hasImports}} +{{#oneOf}} import { - {{#imports}} {{{.}}}, - {{/imports}} - {{#oneOf}} + {{{.}}}FromJSON, {{{.}}}FromJSONTyped, {{{.}}}ToJSON, - {{/oneOf}} -} from './'; +} from './{{.}}'; +{{/oneOf}} {{/hasImports}} {{>modelOneOfInterfaces}} diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ArrayTest.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ArrayTest.ts index e4c5f1e0c5b6..17144b782818 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ArrayTest.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ArrayTest.ts @@ -18,7 +18,7 @@ import { ReadOnlyFirstFromJSON, ReadOnlyFirstFromJSONTyped, ReadOnlyFirstToJSON, -} from './'; +} from './ReadOnlyFirst'; /** * diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Cat.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Cat.ts index 9ca592b7f455..7d6db07958ad 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Cat.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Cat.ts @@ -18,11 +18,13 @@ import { AnimalFromJSON, AnimalFromJSONTyped, AnimalToJSON, +} from './Animal'; +import { CatAllOf, CatAllOfFromJSON, CatAllOfFromJSONTyped, CatAllOfToJSON, -} from './'; +} from './CatAllOf'; /** * diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Dog.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Dog.ts index 2194d53d12fc..f68b8e025105 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Dog.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Dog.ts @@ -18,11 +18,13 @@ import { AnimalFromJSON, AnimalFromJSONTyped, AnimalToJSON, +} from './Animal'; +import { DogAllOf, DogAllOfFromJSON, DogAllOfFromJSONTyped, DogAllOfToJSON, -} from './'; +} from './DogAllOf'; /** * diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/EnumTest.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/EnumTest.ts index 0dad062d603e..22e369f39864 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/EnumTest.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/EnumTest.ts @@ -18,19 +18,25 @@ import { OuterEnumFromJSON, OuterEnumFromJSONTyped, OuterEnumToJSON, +} from './OuterEnum'; +import { OuterEnumDefaultValue, OuterEnumDefaultValueFromJSON, OuterEnumDefaultValueFromJSONTyped, OuterEnumDefaultValueToJSON, +} from './OuterEnumDefaultValue'; +import { OuterEnumInteger, OuterEnumIntegerFromJSON, OuterEnumIntegerFromJSONTyped, OuterEnumIntegerToJSON, +} from './OuterEnumInteger'; +import { OuterEnumIntegerDefaultValue, OuterEnumIntegerDefaultValueFromJSON, OuterEnumIntegerDefaultValueFromJSONTyped, OuterEnumIntegerDefaultValueToJSON, -} from './'; +} from './OuterEnumIntegerDefaultValue'; /** * diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/FormatTest.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/FormatTest.ts index dc076e5ed75a..b60fcb5756a7 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/FormatTest.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/FormatTest.ts @@ -18,7 +18,7 @@ import { DecimalFromJSON, DecimalFromJSONTyped, DecimalToJSON, -} from './'; +} from './Decimal'; /** * diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/InlineResponseDefault.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/InlineResponseDefault.ts index 572379f86a4d..adcfc15dfbdd 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/InlineResponseDefault.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/InlineResponseDefault.ts @@ -18,7 +18,7 @@ import { FooFromJSON, FooFromJSONTyped, FooToJSON, -} from './'; +} from './Foo'; /** * diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/MixedPropertiesAndAdditionalPropertiesClass.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/MixedPropertiesAndAdditionalPropertiesClass.ts index ebb07fd89cb4..15e830ea39c8 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/MixedPropertiesAndAdditionalPropertiesClass.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/MixedPropertiesAndAdditionalPropertiesClass.ts @@ -18,7 +18,7 @@ import { AnimalFromJSON, AnimalFromJSONTyped, AnimalToJSON, -} from './'; +} from './Animal'; /** * diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ObjectWithDeprecatedFields.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ObjectWithDeprecatedFields.ts index 6fa59dbfca80..c14eb976bfad 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ObjectWithDeprecatedFields.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ObjectWithDeprecatedFields.ts @@ -18,7 +18,7 @@ import { DeprecatedObjectFromJSON, DeprecatedObjectFromJSONTyped, DeprecatedObjectToJSON, -} from './'; +} from './DeprecatedObject'; /** * diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterObjectWithEnumProperty.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterObjectWithEnumProperty.ts index 7e638d062923..878aef40cdf1 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterObjectWithEnumProperty.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterObjectWithEnumProperty.ts @@ -18,7 +18,7 @@ import { OuterEnumIntegerFromJSON, OuterEnumIntegerFromJSONTyped, OuterEnumIntegerToJSON, -} from './'; +} from './OuterEnumInteger'; /** * diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Pet.ts index fc8cdac43298..4b88dc214eb3 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Pet.ts @@ -18,11 +18,13 @@ import { CategoryFromJSON, CategoryFromJSONTyped, CategoryToJSON, +} from './Category'; +import { Tag, TagFromJSON, TagFromJSONTyped, TagToJSON, -} from './'; +} from './Tag'; /** * diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/default/models/Pet.ts index 9417338414aa..6a75faae4262 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/models/Pet.ts @@ -18,11 +18,13 @@ import { CategoryFromJSON, CategoryFromJSONTyped, CategoryToJSON, +} from './Category'; +import { Tag, TagFromJSON, TagFromJSONTyped, TagToJSON, -} from './'; +} from './Tag'; /** * A pet for sale in the pet store diff --git a/samples/client/petstore/typescript-fetch/builds/enum/models/EnumPatternObject.ts b/samples/client/petstore/typescript-fetch/builds/enum/models/EnumPatternObject.ts index e8fc617e08d1..463eadb6d552 100644 --- a/samples/client/petstore/typescript-fetch/builds/enum/models/EnumPatternObject.ts +++ b/samples/client/petstore/typescript-fetch/builds/enum/models/EnumPatternObject.ts @@ -18,11 +18,13 @@ import { NumberEnumFromJSON, NumberEnumFromJSONTyped, NumberEnumToJSON, +} from './NumberEnum'; +import { StringEnum, StringEnumFromJSON, StringEnumFromJSONTyped, StringEnumToJSON, -} from './'; +} from './StringEnum'; /** * diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Pet.ts index 9417338414aa..6a75faae4262 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Pet.ts @@ -18,11 +18,13 @@ import { CategoryFromJSON, CategoryFromJSONTyped, CategoryToJSON, +} from './Category'; +import { Tag, TagFromJSON, TagFromJSONTyped, TagToJSON, -} from './'; +} from './Tag'; /** * A pet for sale in the pet store diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Pet.ts index 9417338414aa..6a75faae4262 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Pet.ts @@ -18,11 +18,13 @@ import { CategoryFromJSON, CategoryFromJSONTyped, CategoryToJSON, +} from './Category'; +import { Tag, TagFromJSON, TagFromJSONTyped, TagToJSON, -} from './'; +} from './Tag'; /** * A pet for sale in the pet store diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Pet.ts index 9417338414aa..6a75faae4262 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Pet.ts @@ -18,11 +18,13 @@ import { CategoryFromJSON, CategoryFromJSONTyped, CategoryToJSON, +} from './Category'; +import { Tag, TagFromJSON, TagFromJSONTyped, TagToJSON, -} from './'; +} from './Tag'; /** * A pet for sale in the pet store diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/DefaultMetaOnlyResponse.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/DefaultMetaOnlyResponse.ts index b7fda0a183e1..5b4dc83e5fef 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/DefaultMetaOnlyResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/DefaultMetaOnlyResponse.ts @@ -18,7 +18,7 @@ import { ResponseMetaFromJSON, ResponseMetaFromJSONTyped, ResponseMetaToJSON, -} from './'; +} from './ResponseMeta'; /** * diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/FindPetsByStatusResponse.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/FindPetsByStatusResponse.ts index 9562ca6e87c1..28dd4020cd86 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/FindPetsByStatusResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/FindPetsByStatusResponse.ts @@ -18,11 +18,13 @@ import { PetFromJSON, PetFromJSONTyped, PetToJSON, +} from './Pet'; +import { ResponseMeta, ResponseMetaFromJSON, ResponseMetaFromJSONTyped, ResponseMetaToJSON, -} from './'; +} from './ResponseMeta'; /** * diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/FindPetsByUserResponse.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/FindPetsByUserResponse.ts index 42c2da380fac..4b7674651686 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/FindPetsByUserResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/FindPetsByUserResponse.ts @@ -18,11 +18,13 @@ import { ResponseMetaFromJSON, ResponseMetaFromJSONTyped, ResponseMetaToJSON, +} from './ResponseMeta'; +import { User, UserFromJSON, UserFromJSONTyped, UserToJSON, -} from './'; +} from './User'; /** * diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetBehaviorPermissionsResponse.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetBehaviorPermissionsResponse.ts index b011c2c69a71..a53838a74645 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetBehaviorPermissionsResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetBehaviorPermissionsResponse.ts @@ -18,7 +18,7 @@ import { ResponseMetaFromJSON, ResponseMetaFromJSONTyped, ResponseMetaToJSON, -} from './'; +} from './ResponseMeta'; /** * diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetBehaviorTypeResponse.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetBehaviorTypeResponse.ts index 924639ae1961..c770b29beb72 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetBehaviorTypeResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetBehaviorTypeResponse.ts @@ -18,11 +18,13 @@ import { BehaviorTypeFromJSON, BehaviorTypeFromJSONTyped, BehaviorTypeToJSON, +} from './BehaviorType'; +import { ResponseMeta, ResponseMetaFromJSON, ResponseMetaFromJSONTyped, ResponseMetaToJSON, -} from './'; +} from './ResponseMeta'; /** * diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetMatchingPartsResponse.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetMatchingPartsResponse.ts index 76174ef6fcd8..3690c3954f1a 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetMatchingPartsResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetMatchingPartsResponse.ts @@ -18,11 +18,13 @@ import { MatchingPartsFromJSON, MatchingPartsFromJSONTyped, MatchingPartsToJSON, +} from './MatchingParts'; +import { ResponseMeta, ResponseMetaFromJSON, ResponseMetaFromJSONTyped, ResponseMetaToJSON, -} from './'; +} from './ResponseMeta'; /** * diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetPetPartTypeResponse.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetPetPartTypeResponse.ts index d7a281137413..9a70cdc1a698 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetPetPartTypeResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetPetPartTypeResponse.ts @@ -18,11 +18,13 @@ import { PetPartTypeFromJSON, PetPartTypeFromJSONTyped, PetPartTypeToJSON, +} from './PetPartType'; +import { ResponseMeta, ResponseMetaFromJSON, ResponseMetaFromJSONTyped, ResponseMetaToJSON, -} from './'; +} from './ResponseMeta'; /** * diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/MatchingParts.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/MatchingParts.ts index 7cd3d6c3352a..70177cf458c4 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/MatchingParts.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/MatchingParts.ts @@ -18,7 +18,7 @@ import { PartFromJSON, PartFromJSONTyped, PartToJSON, -} from './'; +} from './Part'; /** * Contains all the matching parts diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ModelError.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ModelError.ts index 8e509add65c2..7a4c5b62d034 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ModelError.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ModelError.ts @@ -18,7 +18,7 @@ import { ItemIdFromJSON, ItemIdFromJSONTyped, ItemIdToJSON, -} from './'; +} from './ItemId'; /** * This represent an error normally linked to a specific item from a previous request diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/Pet.ts index 2b59b900171a..26e07c36c0f7 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/Pet.ts @@ -18,19 +18,25 @@ import { CategoryFromJSON, CategoryFromJSONTyped, CategoryToJSON, +} from './Category'; +import { DeploymentRequestStatus, DeploymentRequestStatusFromJSON, DeploymentRequestStatusFromJSONTyped, DeploymentRequestStatusToJSON, +} from './DeploymentRequestStatus'; +import { Tag, TagFromJSON, TagFromJSONTyped, TagToJSON, +} from './Tag'; +import { WarningCode, WarningCodeFromJSON, WarningCodeFromJSONTyped, WarningCodeToJSON, -} from './'; +} from './WarningCode'; /** * A pet for sale in the pet store diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/PetRegionsResponse.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/PetRegionsResponse.ts index 7b4c268864d4..2a2c7fb6a513 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/PetRegionsResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/PetRegionsResponse.ts @@ -18,7 +18,7 @@ import { ResponseMetaFromJSON, ResponseMetaFromJSONTyped, ResponseMetaToJSON, -} from './'; +} from './ResponseMeta'; /** * diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ResponseMeta.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ResponseMeta.ts index 38fdca904cf5..8c84dd4b5564 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ResponseMeta.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ResponseMeta.ts @@ -18,7 +18,7 @@ import { ErrorCodeFromJSON, ErrorCodeFromJSONTyped, ErrorCodeToJSON, -} from './'; +} from './ErrorCode'; /** * Mandatory part of each response given by our API diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Pet.ts index 9417338414aa..6a75faae4262 100644 --- a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/src/models/Pet.ts @@ -18,11 +18,13 @@ import { CategoryFromJSON, CategoryFromJSONTyped, CategoryToJSON, +} from './Category'; +import { Tag, TagFromJSON, TagFromJSONTyped, TagToJSON, -} from './'; +} from './Tag'; /** * A pet for sale in the pet store diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Pet.ts index 9417338414aa..6a75faae4262 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Pet.ts @@ -18,11 +18,13 @@ import { CategoryFromJSON, CategoryFromJSONTyped, CategoryToJSON, +} from './Category'; +import { Tag, TagFromJSON, TagFromJSONTyped, TagToJSON, -} from './'; +} from './Tag'; /** * A pet for sale in the pet store diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Pet.ts index 9417338414aa..6a75faae4262 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Pet.ts @@ -18,11 +18,13 @@ import { CategoryFromJSON, CategoryFromJSONTyped, CategoryToJSON, +} from './Category'; +import { Tag, TagFromJSON, TagFromJSONTyped, TagToJSON, -} from './'; +} from './Tag'; /** * A pet for sale in the pet store From e5159ef8d5a7f39777eaefe5d7fc0c4c83f79c6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20=C4=8Cerm=C3=A1k?= Date: Tue, 23 Nov 2021 03:43:34 +0100 Subject: [PATCH 018/117] [Protobuf-Schema] Add numbered field number list switch (#10893) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [Protobuf-Schema] Add numbered field number list switch * [Protobuf-Schema] Add numbered field number list switch * [Protobuf-Schema] Added switch * [Docs][Protobuf-Schema] Generated docs Co-authored-by: Tomáš Čermák --- docs/generators/protobuf-schema.md | 1 + .../languages/ProtobufSchemaCodegen.java | 26 +++++++++++++++---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/docs/generators/protobuf-schema.md b/docs/generators/protobuf-schema.md index 53e5334ef976..a7d1f1d095b5 100644 --- a/docs/generators/protobuf-schema.md +++ b/docs/generators/protobuf-schema.md @@ -7,6 +7,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | +|numberedFieldNumberList|Field numbers in order.| |false| |startEnumsWithUnknown|Introduces "UNKNOWN" as the first element of enumerations.| |false| ## IMPORT MAPPING diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java index 30a8b4c3c32f..5f55e9d47f04 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java @@ -47,12 +47,16 @@ public class ProtobufSchemaCodegen extends DefaultCodegen implements CodegenConf private static final String IMPORTS = "imports"; + public static final String NUMBERED_FIELD_NUMBER_LIST = "numberedFieldNumberList"; + public static final String START_ENUMS_WITH_UNKNOWN = "startEnumsWithUnknown"; private final Logger LOGGER = LoggerFactory.getLogger(ProtobufSchemaCodegen.class); protected String packageName = "openapitools"; + private boolean numberedFieldNumberList = false; + private boolean startEnumsWithUnknown = false; @Override @@ -149,6 +153,7 @@ public ProtobufSchemaCodegen() { cliOptions.clear(); + addSwitch(NUMBERED_FIELD_NUMBER_LIST, "Field numbers in order.", numberedFieldNumberList); addSwitch(START_ENUMS_WITH_UNKNOWN, "Introduces \"UNKNOWN\" as the first element of enumerations.", startEnumsWithUnknown); } @@ -169,6 +174,10 @@ public void processOpts() { setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME)); } + if (additionalProperties.containsKey(this.NUMBERED_FIELD_NUMBER_LIST)) { + this.numberedFieldNumberList = convertPropertyToBooleanAndWriteBack(NUMBERED_FIELD_NUMBER_LIST); + } + if (additionalProperties.containsKey(this.START_ENUMS_WITH_UNKNOWN)) { this.startEnumsWithUnknown = convertPropertyToBooleanAndWriteBack(START_ENUMS_WITH_UNKNOWN); } @@ -239,6 +248,7 @@ public Map postProcessModels(Map objs) { } } + int index = 1; for (CodegenProperty var : cm.vars) { // add x-protobuf-type: repeated if it's an array if (Boolean.TRUE.equals(var.isArray)) { @@ -265,11 +275,17 @@ public Map postProcessModels(Map objs) { } // Add x-protobuf-index, unless already specified - try { - var.vendorExtensions.putIfAbsent("x-protobuf-index", generateFieldNumberFromString(var.getName())); - } catch (ProtoBufIndexComputationException e) { - LOGGER.error("Exception when assigning a index to a protobuf field", e); - var.vendorExtensions.putIfAbsent("x-protobuf-index", "Generated field number is in reserved range (19000, 19999)"); + if(this.numberedFieldNumberList) { + var.vendorExtensions.putIfAbsent("x-protobuf-index", index); + index++; + } + else { + try { + var.vendorExtensions.putIfAbsent("x-protobuf-index", generateFieldNumberFromString(var.getName())); + } catch (ProtoBufIndexComputationException e) { + LOGGER.error("Exception when assigning a index to a protobuf field", e); + var.vendorExtensions.putIfAbsent("x-protobuf-index", "Generated field number is in reserved range (19000, 19999)"); + } } } } From 39b8f83e6de3209c6d0619fd4259af591323e386 Mon Sep 17 00:00:00 2001 From: Tal Kirshboim Date: Tue, 23 Nov 2021 14:01:17 +0100 Subject: [PATCH 019/117] Add Airthings to list of generator users (#10936) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5774c2164472..8aca24c1a675 100644 --- a/README.md +++ b/README.md @@ -577,6 +577,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - [Adaptant Solutions AG](https://www.adaptant.io/) - [adesso SE](https://www.adesso.de/) - [Agoda](https://www.agoda.com/) +- [Airthings](https://www.airthings.com/) - [Allianz](https://www.allianz.com) - [Angular.Schule](https://angular.schule/) - [Aqovia](https://aqovia.com/) From 8338962debb123faca81aedfc29b134b644a45f1 Mon Sep 17 00:00:00 2001 From: cyangle Date: Tue, 23 Nov 2021 07:02:49 -0600 Subject: [PATCH 020/117] [crystal] Add annotation to reserved key word list of crystal lang (#10932) * add annotation to reserved key word list of crystal * Update crystal docs --- docs/generators/crystal.md | 1 + .../openapitools/codegen/languages/CrystalClientCodegen.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/generators/crystal.md b/docs/generators/crystal.md index 721384c810cc..93a893215ca4 100644 --- a/docs/generators/crystal.md +++ b/docs/generators/crystal.md @@ -58,6 +58,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
  • abstract
  • alias
  • +
  • annotation
  • as
  • as?
  • asm
  • diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CrystalClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CrystalClientCodegen.java index 0ff2d657e7a0..2e77181d7a3d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CrystalClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CrystalClientCodegen.java @@ -132,7 +132,7 @@ public CrystalClientCodegen() { // reserved word. Ref: https://github.com/crystal-lang/crystal/wiki/Crystal-for-Rubyists#available-keywords reservedWords = new HashSet<>( Arrays.asList( - "abstract", "do", "if", "nil?", "select", "union", + "abstract", "annotation", "do", "if", "nil?", "select", "union", "alias", "else", "in", "of", "self", "unless", "as", "elsif", "include", "out", "sizeof", "until", "as?", "end", "instance", "sizeof", "pointerof", "struct", "verbatim", From 3a12b6144f605eb3c206fdc3fcbf879ce8f5d701 Mon Sep 17 00:00:00 2001 From: Tal Kirshboim Date: Tue, 23 Nov 2021 14:04:43 +0100 Subject: [PATCH 021/117] Fix enum generation (#10923) --- .../src/main/resources/kotlin-client/enum_class.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/enum_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/enum_class.mustache index 3548914cd0a9..57b1e5f12728 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/enum_class.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/enum_class.mustache @@ -22,7 +22,7 @@ import kotlinx.serialization.* * * Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} */ -{{#multiplatform}}@Serializable(with = {{classname}}.Serializer::class){{/multiplatform}}{{#kotlinx_serialization}}@Serializable{{/kotlinx_serialization}} +{{#multiplatform}}@Serializable{{/multiplatform}}{{#kotlinx_serialization}}@Serializable{{/kotlinx_serialization}} {{#nonPublicApi}}internal {{/nonPublicApi}}enum class {{classname}}(val value: {{{dataType}}}) { {{#allowableValues}}{{#enumVars}} {{^multiplatform}} From faae00df91f24ad4e3b8ad58f6a7052cd7811417 Mon Sep 17 00:00:00 2001 From: Fumito Nakazawa Date: Tue, 23 Nov 2021 22:18:42 +0900 Subject: [PATCH 022/117] [swift5] Refactor some codes (#10937) * Use compactMap * Remove as Any cast * Remove array * Update samples --- .../main/resources/swift5/APIHelper.mustache | 25 +++++++++++++++---- .../main/resources/swift5/Extensions.mustache | 20 +++++++-------- .../Classes/OpenAPIs/APIHelper.swift | 25 +++++++++++++++---- .../Classes/OpenAPIs/Extensions.swift | 20 +++++++-------- .../Classes/OpenAPIs/APIHelper.swift | 25 +++++++++++++++---- .../Classes/OpenAPIs/Extensions.swift | 20 +++++++-------- .../Classes/OpenAPIs/APIHelper.swift | 25 +++++++++++++++---- .../Classes/OpenAPIs/Extensions.swift | 20 +++++++-------- .../Classes/OpenAPIs/APIHelper.swift | 25 +++++++++++++++---- .../Classes/OpenAPIs/Extensions.swift | 20 +++++++-------- .../Classes/OpenAPIs/APIHelper.swift | 25 +++++++++++++++---- .../Classes/OpenAPIs/Extensions.swift | 20 +++++++-------- .../Classes/OpenAPIs/APIHelper.swift | 25 +++++++++++++++---- .../Classes/OpenAPIs/Extensions.swift | 20 +++++++-------- .../Classes/OpenAPIs/APIHelper.swift | 25 +++++++++++++++---- .../Classes/OpenAPIs/Extensions.swift | 20 +++++++-------- .../Classes/OpenAPIs/APIHelper.swift | 25 +++++++++++++++---- .../Classes/OpenAPIs/Extensions.swift | 20 +++++++-------- .../Classes/OpenAPIs/APIHelper.swift | 25 +++++++++++++++---- .../Classes/OpenAPIs/Extensions.swift | 20 +++++++-------- .../Classes/OpenAPIs/APIHelper.swift | 25 +++++++++++++++---- .../Classes/OpenAPIs/Extensions.swift | 20 +++++++-------- .../Classes/OpenAPIs/APIHelper.swift | 25 +++++++++++++++---- .../Classes/OpenAPIs/Extensions.swift | 20 +++++++-------- .../Classes/OpenAPIs/APIHelper.swift | 25 +++++++++++++++---- .../Classes/OpenAPIs/Extensions.swift | 20 +++++++-------- .../Sources/PetstoreClient/APIHelper.swift | 25 +++++++++++++++---- .../Sources/PetstoreClient/Extensions.swift | 20 +++++++-------- .../Classes/OpenAPIs/APIHelper.swift | 25 +++++++++++++++---- .../Classes/OpenAPIs/Extensions.swift | 20 +++++++-------- 30 files changed, 450 insertions(+), 225 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/swift5/APIHelper.mustache b/modules/openapi-generator/src/main/resources/swift5/APIHelper.mustache index e535c7df4c44..78c98979b9c4 100644 --- a/modules/openapi-generator/src/main/resources/swift5/APIHelper.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/APIHelper.mustache @@ -24,7 +24,12 @@ import Vapor{{/useVapor}} {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} 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: ",") + result[item.key] = collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } @@ -48,7 +53,12 @@ import Vapor{{/useVapor}} {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func mapValueToPathItem(_ source: Any) -> Any { if let collection = source as? [Any?] { - return collection.filter { $0 != nil }.map { "\($0!)" }.joined(separator: ",") + return collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .joined(separator: ",") } return source } @@ -56,9 +66,14 @@ import Vapor{{/useVapor}} {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { let destination = source.filter { $0.value != nil }.reduce(into: [URLQueryItem]()) { result, item in if let collection = item.value as? [Any?] { - collection.filter { $0 != nil }.map { "\($0!)" }.forEach { value in - result.append(URLQueryItem(name: item.key, value: value)) - } + collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .forEach { value in + result.append(URLQueryItem(name: item.key, value: value)) + } } else if let value = item.value { result.append(URLQueryItem(name: item.key, value: "\(value)")) } diff --git a/modules/openapi-generator/src/main/resources/swift5/Extensions.mustache b/modules/openapi-generator/src/main/resources/swift5/Extensions.mustache index 7f5d8b582f7e..b286fa9f42a4 100644 --- a/modules/openapi-generator/src/main/resources/swift5/Extensions.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/Extensions.mustache @@ -12,15 +12,15 @@ import PromiseKit{{/usePromiseKit}}{{#useVapor}} import Vapor{{/useVapor}}{{^useVapor}} extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Int32: JSONEncodable { @@ -32,22 +32,22 @@ extension Int64: JSONEncodable { } extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension String: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { return self.rawValue as Any } + func encodeToJSON() -> Any { return self.rawValue } } private func encodeIfPossible(_ object: T) -> Any { if let encodableObject = object as? JSONEncodable { return encodableObject.encodeToJSON() } else { - return object as Any + return object } } @@ -69,7 +69,7 @@ extension Dictionary: JSONEncodable { for (key, value) in self { dictionary[key] = encodeIfPossible(value) } - return dictionary as Any + return dictionary } } @@ -81,7 +81,7 @@ extension Data: JSONEncodable { extension Date: JSONEncodable { func encodeToJSON() -> Any { - return CodableHelper.dateFormatter.string(from: self) as Any + return CodableHelper.dateFormatter.string(from: self) } } @@ -185,7 +185,7 @@ extension KeyedDecodingContainerProtocol { extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { - return Array(200 ..< 300).contains(statusCode) + return (200 ..< 300).contains(statusCode) } }{{/useVapor}}{{#usePromiseKit}} 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 f7bb5274bd98..049b7f655f17 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -23,7 +23,12 @@ public struct APIHelper { 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: ",") + result[item.key] = collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } @@ -47,7 +52,12 @@ public struct APIHelper { public static func mapValueToPathItem(_ source: Any) -> Any { if let collection = source as? [Any?] { - return collection.filter { $0 != nil }.map { "\($0!)" }.joined(separator: ",") + return collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .joined(separator: ",") } return source } @@ -55,9 +65,14 @@ public struct APIHelper { public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { let destination = source.filter { $0.value != nil }.reduce(into: [URLQueryItem]()) { result, item in if let collection = item.value as? [Any?] { - collection.filter { $0 != nil }.map { "\($0!)" }.forEach { value in - result.append(URLQueryItem(name: item.key, value: value)) - } + collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .forEach { value in + result.append(URLQueryItem(name: item.key, value: value)) + } } else if let value = item.value { result.append(URLQueryItem(name: item.key, value: "\(value)")) } 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 e23035dde30e..5831422f09d8 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -10,15 +10,15 @@ import AnyCodable #endif extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Int32: JSONEncodable { @@ -30,22 +30,22 @@ extension Int64: JSONEncodable { } extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension String: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { return self.rawValue as Any } + func encodeToJSON() -> Any { return self.rawValue } } private func encodeIfPossible(_ object: T) -> Any { if let encodableObject = object as? JSONEncodable { return encodableObject.encodeToJSON() } else { - return object as Any + return object } } @@ -67,7 +67,7 @@ extension Dictionary: JSONEncodable { for (key, value) in self { dictionary[key] = encodeIfPossible(value) } - return dictionary as Any + return dictionary } } @@ -79,7 +79,7 @@ extension Data: JSONEncodable { extension Date: JSONEncodable { func encodeToJSON() -> Any { - return CodableHelper.dateFormatter.string(from: self) as Any + return CodableHelper.dateFormatter.string(from: self) } } @@ -183,6 +183,6 @@ extension KeyedDecodingContainerProtocol { extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { - return Array(200 ..< 300).contains(statusCode) + return (200 ..< 300).contains(statusCode) } } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index f7bb5274bd98..049b7f655f17 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -23,7 +23,12 @@ public struct APIHelper { 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: ",") + result[item.key] = collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } @@ -47,7 +52,12 @@ public struct APIHelper { public static func mapValueToPathItem(_ source: Any) -> Any { if let collection = source as? [Any?] { - return collection.filter { $0 != nil }.map { "\($0!)" }.joined(separator: ",") + return collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .joined(separator: ",") } return source } @@ -55,9 +65,14 @@ public struct APIHelper { public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { let destination = source.filter { $0.value != nil }.reduce(into: [URLQueryItem]()) { result, item in if let collection = item.value as? [Any?] { - collection.filter { $0 != nil }.map { "\($0!)" }.forEach { value in - result.append(URLQueryItem(name: item.key, value: value)) - } + collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .forEach { value in + result.append(URLQueryItem(name: item.key, value: value)) + } } else if let value = item.value { result.append(URLQueryItem(name: item.key, value: "\(value)")) } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index e23035dde30e..5831422f09d8 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -10,15 +10,15 @@ import AnyCodable #endif extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Int32: JSONEncodable { @@ -30,22 +30,22 @@ extension Int64: JSONEncodable { } extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension String: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { return self.rawValue as Any } + func encodeToJSON() -> Any { return self.rawValue } } private func encodeIfPossible(_ object: T) -> Any { if let encodableObject = object as? JSONEncodable { return encodableObject.encodeToJSON() } else { - return object as Any + return object } } @@ -67,7 +67,7 @@ extension Dictionary: JSONEncodable { for (key, value) in self { dictionary[key] = encodeIfPossible(value) } - return dictionary as Any + return dictionary } } @@ -79,7 +79,7 @@ extension Data: JSONEncodable { extension Date: JSONEncodable { func encodeToJSON() -> Any { - return CodableHelper.dateFormatter.string(from: self) as Any + return CodableHelper.dateFormatter.string(from: self) } } @@ -183,6 +183,6 @@ extension KeyedDecodingContainerProtocol { extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { - return Array(200 ..< 300).contains(statusCode) + return (200 ..< 300).contains(statusCode) } } 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 f7bb5274bd98..049b7f655f17 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -23,7 +23,12 @@ public struct APIHelper { 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: ",") + result[item.key] = collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } @@ -47,7 +52,12 @@ public struct APIHelper { public static func mapValueToPathItem(_ source: Any) -> Any { if let collection = source as? [Any?] { - return collection.filter { $0 != nil }.map { "\($0!)" }.joined(separator: ",") + return collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .joined(separator: ",") } return source } @@ -55,9 +65,14 @@ public struct APIHelper { public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { let destination = source.filter { $0.value != nil }.reduce(into: [URLQueryItem]()) { result, item in if let collection = item.value as? [Any?] { - collection.filter { $0 != nil }.map { "\($0!)" }.forEach { value in - result.append(URLQueryItem(name: item.key, value: value)) - } + collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .forEach { value in + result.append(URLQueryItem(name: item.key, value: value)) + } } else if let value = item.value { result.append(URLQueryItem(name: item.key, value: "\(value)")) } 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 e23035dde30e..5831422f09d8 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -10,15 +10,15 @@ import AnyCodable #endif extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Int32: JSONEncodable { @@ -30,22 +30,22 @@ extension Int64: JSONEncodable { } extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension String: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { return self.rawValue as Any } + func encodeToJSON() -> Any { return self.rawValue } } private func encodeIfPossible(_ object: T) -> Any { if let encodableObject = object as? JSONEncodable { return encodableObject.encodeToJSON() } else { - return object as Any + return object } } @@ -67,7 +67,7 @@ extension Dictionary: JSONEncodable { for (key, value) in self { dictionary[key] = encodeIfPossible(value) } - return dictionary as Any + return dictionary } } @@ -79,7 +79,7 @@ extension Data: JSONEncodable { extension Date: JSONEncodable { func encodeToJSON() -> Any { - return CodableHelper.dateFormatter.string(from: self) as Any + return CodableHelper.dateFormatter.string(from: self) } } @@ -183,6 +183,6 @@ extension KeyedDecodingContainerProtocol { extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { - return Array(200 ..< 300).contains(statusCode) + return (200 ..< 300).contains(statusCode) } } 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 f7bb5274bd98..049b7f655f17 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -23,7 +23,12 @@ public struct APIHelper { 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: ",") + result[item.key] = collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } @@ -47,7 +52,12 @@ public struct APIHelper { public static func mapValueToPathItem(_ source: Any) -> Any { if let collection = source as? [Any?] { - return collection.filter { $0 != nil }.map { "\($0!)" }.joined(separator: ",") + return collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .joined(separator: ",") } return source } @@ -55,9 +65,14 @@ public struct APIHelper { public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { let destination = source.filter { $0.value != nil }.reduce(into: [URLQueryItem]()) { result, item in if let collection = item.value as? [Any?] { - collection.filter { $0 != nil }.map { "\($0!)" }.forEach { value in - result.append(URLQueryItem(name: item.key, value: value)) - } + collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .forEach { value in + result.append(URLQueryItem(name: item.key, value: value)) + } } else if let value = item.value { result.append(URLQueryItem(name: item.key, value: "\(value)")) } 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 e23035dde30e..5831422f09d8 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -10,15 +10,15 @@ import AnyCodable #endif extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Int32: JSONEncodable { @@ -30,22 +30,22 @@ extension Int64: JSONEncodable { } extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension String: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { return self.rawValue as Any } + func encodeToJSON() -> Any { return self.rawValue } } private func encodeIfPossible(_ object: T) -> Any { if let encodableObject = object as? JSONEncodable { return encodableObject.encodeToJSON() } else { - return object as Any + return object } } @@ -67,7 +67,7 @@ extension Dictionary: JSONEncodable { for (key, value) in self { dictionary[key] = encodeIfPossible(value) } - return dictionary as Any + return dictionary } } @@ -79,7 +79,7 @@ extension Data: JSONEncodable { extension Date: JSONEncodable { func encodeToJSON() -> Any { - return CodableHelper.dateFormatter.string(from: self) as Any + return CodableHelper.dateFormatter.string(from: self) } } @@ -183,6 +183,6 @@ extension KeyedDecodingContainerProtocol { extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { - return Array(200 ..< 300).contains(statusCode) + return (200 ..< 300).contains(statusCode) } } diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index f7bb5274bd98..049b7f655f17 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -23,7 +23,12 @@ public struct APIHelper { 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: ",") + result[item.key] = collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } @@ -47,7 +52,12 @@ public struct APIHelper { public static func mapValueToPathItem(_ source: Any) -> Any { if let collection = source as? [Any?] { - return collection.filter { $0 != nil }.map { "\($0!)" }.joined(separator: ",") + return collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .joined(separator: ",") } return source } @@ -55,9 +65,14 @@ public struct APIHelper { public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { let destination = source.filter { $0.value != nil }.reduce(into: [URLQueryItem]()) { result, item in if let collection = item.value as? [Any?] { - collection.filter { $0 != nil }.map { "\($0!)" }.forEach { value in - result.append(URLQueryItem(name: item.key, value: value)) - } + collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .forEach { value in + result.append(URLQueryItem(name: item.key, value: value)) + } } else if let value = item.value { result.append(URLQueryItem(name: item.key, value: "\(value)")) } diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Extensions.swift index e23035dde30e..5831422f09d8 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -10,15 +10,15 @@ import AnyCodable #endif extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Int32: JSONEncodable { @@ -30,22 +30,22 @@ extension Int64: JSONEncodable { } extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension String: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { return self.rawValue as Any } + func encodeToJSON() -> Any { return self.rawValue } } private func encodeIfPossible(_ object: T) -> Any { if let encodableObject = object as? JSONEncodable { return encodableObject.encodeToJSON() } else { - return object as Any + return object } } @@ -67,7 +67,7 @@ extension Dictionary: JSONEncodable { for (key, value) in self { dictionary[key] = encodeIfPossible(value) } - return dictionary as Any + return dictionary } } @@ -79,7 +79,7 @@ extension Data: JSONEncodable { extension Date: JSONEncodable { func encodeToJSON() -> Any { - return CodableHelper.dateFormatter.string(from: self) as Any + return CodableHelper.dateFormatter.string(from: self) } } @@ -183,6 +183,6 @@ extension KeyedDecodingContainerProtocol { extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { - return Array(200 ..< 300).contains(statusCode) + return (200 ..< 300).contains(statusCode) } } 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 5d8f35bff492..83d36bb64349 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -23,7 +23,12 @@ internal struct APIHelper { 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: ",") + result[item.key] = collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } @@ -47,7 +52,12 @@ internal struct APIHelper { internal static func mapValueToPathItem(_ source: Any) -> Any { if let collection = source as? [Any?] { - return collection.filter { $0 != nil }.map { "\($0!)" }.joined(separator: ",") + return collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .joined(separator: ",") } return source } @@ -55,9 +65,14 @@ internal struct APIHelper { 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?] { - collection.filter { $0 != nil }.map { "\($0!)" }.forEach { value in - result.append(URLQueryItem(name: item.key, value: value)) - } + collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .forEach { value in + result.append(URLQueryItem(name: item.key, value: value)) + } } else if let value = item.value { result.append(URLQueryItem(name: item.key, value: "\(value)")) } 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 65ae1c6c6425..63647fe3703b 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -10,15 +10,15 @@ import AnyCodable #endif extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Int32: JSONEncodable { @@ -30,22 +30,22 @@ extension Int64: JSONEncodable { } extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension String: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { return self.rawValue as Any } + func encodeToJSON() -> Any { return self.rawValue } } private func encodeIfPossible(_ object: T) -> Any { if let encodableObject = object as? JSONEncodable { return encodableObject.encodeToJSON() } else { - return object as Any + return object } } @@ -67,7 +67,7 @@ extension Dictionary: JSONEncodable { for (key, value) in self { dictionary[key] = encodeIfPossible(value) } - return dictionary as Any + return dictionary } } @@ -79,7 +79,7 @@ extension Data: JSONEncodable { extension Date: JSONEncodable { func encodeToJSON() -> Any { - return CodableHelper.dateFormatter.string(from: self) as Any + return CodableHelper.dateFormatter.string(from: self) } } @@ -183,6 +183,6 @@ extension KeyedDecodingContainerProtocol { extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { - return Array(200 ..< 300).contains(statusCode) + return (200 ..< 300).contains(statusCode) } } 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 f7bb5274bd98..049b7f655f17 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -23,7 +23,12 @@ public struct APIHelper { 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: ",") + result[item.key] = collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } @@ -47,7 +52,12 @@ public struct APIHelper { public static func mapValueToPathItem(_ source: Any) -> Any { if let collection = source as? [Any?] { - return collection.filter { $0 != nil }.map { "\($0!)" }.joined(separator: ",") + return collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .joined(separator: ",") } return source } @@ -55,9 +65,14 @@ public struct APIHelper { public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { let destination = source.filter { $0.value != nil }.reduce(into: [URLQueryItem]()) { result, item in if let collection = item.value as? [Any?] { - collection.filter { $0 != nil }.map { "\($0!)" }.forEach { value in - result.append(URLQueryItem(name: item.key, value: value)) - } + collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .forEach { value in + result.append(URLQueryItem(name: item.key, value: value)) + } } else if let value = item.value { result.append(URLQueryItem(name: item.key, value: "\(value)")) } 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 e23035dde30e..5831422f09d8 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -10,15 +10,15 @@ import AnyCodable #endif extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Int32: JSONEncodable { @@ -30,22 +30,22 @@ extension Int64: JSONEncodable { } extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension String: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { return self.rawValue as Any } + func encodeToJSON() -> Any { return self.rawValue } } private func encodeIfPossible(_ object: T) -> Any { if let encodableObject = object as? JSONEncodable { return encodableObject.encodeToJSON() } else { - return object as Any + return object } } @@ -67,7 +67,7 @@ extension Dictionary: JSONEncodable { for (key, value) in self { dictionary[key] = encodeIfPossible(value) } - return dictionary as Any + return dictionary } } @@ -79,7 +79,7 @@ extension Data: JSONEncodable { extension Date: JSONEncodable { func encodeToJSON() -> Any { - return CodableHelper.dateFormatter.string(from: self) as Any + return CodableHelper.dateFormatter.string(from: self) } } @@ -183,6 +183,6 @@ extension KeyedDecodingContainerProtocol { extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { - return Array(200 ..< 300).contains(statusCode) + return (200 ..< 300).contains(statusCode) } } diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index f7bb5274bd98..049b7f655f17 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -23,7 +23,12 @@ public struct APIHelper { 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: ",") + result[item.key] = collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } @@ -47,7 +52,12 @@ public struct APIHelper { public static func mapValueToPathItem(_ source: Any) -> Any { if let collection = source as? [Any?] { - return collection.filter { $0 != nil }.map { "\($0!)" }.joined(separator: ",") + return collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .joined(separator: ",") } return source } @@ -55,9 +65,14 @@ public struct APIHelper { public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { let destination = source.filter { $0.value != nil }.reduce(into: [URLQueryItem]()) { result, item in if let collection = item.value as? [Any?] { - collection.filter { $0 != nil }.map { "\($0!)" }.forEach { value in - result.append(URLQueryItem(name: item.key, value: value)) - } + collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .forEach { value in + result.append(URLQueryItem(name: item.key, value: value)) + } } else if let value = item.value { result.append(URLQueryItem(name: item.key, value: "\(value)")) } diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Extensions.swift index e23035dde30e..5831422f09d8 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -10,15 +10,15 @@ import AnyCodable #endif extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Int32: JSONEncodable { @@ -30,22 +30,22 @@ extension Int64: JSONEncodable { } extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension String: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { return self.rawValue as Any } + func encodeToJSON() -> Any { return self.rawValue } } private func encodeIfPossible(_ object: T) -> Any { if let encodableObject = object as? JSONEncodable { return encodableObject.encodeToJSON() } else { - return object as Any + return object } } @@ -67,7 +67,7 @@ extension Dictionary: JSONEncodable { for (key, value) in self { dictionary[key] = encodeIfPossible(value) } - return dictionary as Any + return dictionary } } @@ -79,7 +79,7 @@ extension Data: JSONEncodable { extension Date: JSONEncodable { func encodeToJSON() -> Any { - return CodableHelper.dateFormatter.string(from: self) as Any + return CodableHelper.dateFormatter.string(from: self) } } @@ -183,6 +183,6 @@ extension KeyedDecodingContainerProtocol { extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { - return Array(200 ..< 300).contains(statusCode) + return (200 ..< 300).contains(statusCode) } } 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 f7bb5274bd98..049b7f655f17 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -23,7 +23,12 @@ public struct APIHelper { 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: ",") + result[item.key] = collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } @@ -47,7 +52,12 @@ public struct APIHelper { public static func mapValueToPathItem(_ source: Any) -> Any { if let collection = source as? [Any?] { - return collection.filter { $0 != nil }.map { "\($0!)" }.joined(separator: ",") + return collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .joined(separator: ",") } return source } @@ -55,9 +65,14 @@ public struct APIHelper { public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { let destination = source.filter { $0.value != nil }.reduce(into: [URLQueryItem]()) { result, item in if let collection = item.value as? [Any?] { - collection.filter { $0 != nil }.map { "\($0!)" }.forEach { value in - result.append(URLQueryItem(name: item.key, value: value)) - } + collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .forEach { value in + result.append(URLQueryItem(name: item.key, value: value)) + } } else if let value = item.value { result.append(URLQueryItem(name: item.key, value: "\(value)")) } 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 68c3c6ee7e40..2c1ceeb385be 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -11,15 +11,15 @@ import AnyCodable import PromiseKit extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Int32: JSONEncodable { @@ -31,22 +31,22 @@ extension Int64: JSONEncodable { } extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension String: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { return self.rawValue as Any } + func encodeToJSON() -> Any { return self.rawValue } } private func encodeIfPossible(_ object: T) -> Any { if let encodableObject = object as? JSONEncodable { return encodableObject.encodeToJSON() } else { - return object as Any + return object } } @@ -68,7 +68,7 @@ extension Dictionary: JSONEncodable { for (key, value) in self { dictionary[key] = encodeIfPossible(value) } - return dictionary as Any + return dictionary } } @@ -80,7 +80,7 @@ extension Data: JSONEncodable { extension Date: JSONEncodable { func encodeToJSON() -> Any { - return CodableHelper.dateFormatter.string(from: self) as Any + return CodableHelper.dateFormatter.string(from: self) } } @@ -184,7 +184,7 @@ extension KeyedDecodingContainerProtocol { extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { - return Array(200 ..< 300).contains(statusCode) + return (200 ..< 300).contains(statusCode) } } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index f7bb5274bd98..049b7f655f17 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -23,7 +23,12 @@ public struct APIHelper { 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: ",") + result[item.key] = collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } @@ -47,7 +52,12 @@ public struct APIHelper { public static func mapValueToPathItem(_ source: Any) -> Any { if let collection = source as? [Any?] { - return collection.filter { $0 != nil }.map { "\($0!)" }.joined(separator: ",") + return collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .joined(separator: ",") } return source } @@ -55,9 +65,14 @@ public struct APIHelper { public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { let destination = source.filter { $0.value != nil }.reduce(into: [URLQueryItem]()) { result, item in if let collection = item.value as? [Any?] { - collection.filter { $0 != nil }.map { "\($0!)" }.forEach { value in - result.append(URLQueryItem(name: item.key, value: value)) - } + collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .forEach { value in + result.append(URLQueryItem(name: item.key, value: value)) + } } else if let value = item.value { result.append(URLQueryItem(name: item.key, value: "\(value)")) } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Extensions.swift index e23035dde30e..5831422f09d8 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -10,15 +10,15 @@ import AnyCodable #endif extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Int32: JSONEncodable { @@ -30,22 +30,22 @@ extension Int64: JSONEncodable { } extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension String: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { return self.rawValue as Any } + func encodeToJSON() -> Any { return self.rawValue } } private func encodeIfPossible(_ object: T) -> Any { if let encodableObject = object as? JSONEncodable { return encodableObject.encodeToJSON() } else { - return object as Any + return object } } @@ -67,7 +67,7 @@ extension Dictionary: JSONEncodable { for (key, value) in self { dictionary[key] = encodeIfPossible(value) } - return dictionary as Any + return dictionary } } @@ -79,7 +79,7 @@ extension Data: JSONEncodable { extension Date: JSONEncodable { func encodeToJSON() -> Any { - return CodableHelper.dateFormatter.string(from: self) as Any + return CodableHelper.dateFormatter.string(from: self) } } @@ -183,6 +183,6 @@ extension KeyedDecodingContainerProtocol { extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { - return Array(200 ..< 300).contains(statusCode) + return (200 ..< 300).contains(statusCode) } } 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 f7bb5274bd98..049b7f655f17 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -23,7 +23,12 @@ public struct APIHelper { 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: ",") + result[item.key] = collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } @@ -47,7 +52,12 @@ public struct APIHelper { public static func mapValueToPathItem(_ source: Any) -> Any { if let collection = source as? [Any?] { - return collection.filter { $0 != nil }.map { "\($0!)" }.joined(separator: ",") + return collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .joined(separator: ",") } return source } @@ -55,9 +65,14 @@ public struct APIHelper { public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { let destination = source.filter { $0.value != nil }.reduce(into: [URLQueryItem]()) { result, item in if let collection = item.value as? [Any?] { - collection.filter { $0 != nil }.map { "\($0!)" }.forEach { value in - result.append(URLQueryItem(name: item.key, value: value)) - } + collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .forEach { value in + result.append(URLQueryItem(name: item.key, value: value)) + } } else if let value = item.value { result.append(URLQueryItem(name: item.key, value: "\(value)")) } 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 e23035dde30e..5831422f09d8 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -10,15 +10,15 @@ import AnyCodable #endif extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Int32: JSONEncodable { @@ -30,22 +30,22 @@ extension Int64: JSONEncodable { } extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension String: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { return self.rawValue as Any } + func encodeToJSON() -> Any { return self.rawValue } } private func encodeIfPossible(_ object: T) -> Any { if let encodableObject = object as? JSONEncodable { return encodableObject.encodeToJSON() } else { - return object as Any + return object } } @@ -67,7 +67,7 @@ extension Dictionary: JSONEncodable { for (key, value) in self { dictionary[key] = encodeIfPossible(value) } - return dictionary as Any + return dictionary } } @@ -79,7 +79,7 @@ extension Data: JSONEncodable { extension Date: JSONEncodable { func encodeToJSON() -> Any { - return CodableHelper.dateFormatter.string(from: self) as Any + return CodableHelper.dateFormatter.string(from: self) } } @@ -183,6 +183,6 @@ extension KeyedDecodingContainerProtocol { extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { - return Array(200 ..< 300).contains(statusCode) + return (200 ..< 300).contains(statusCode) } } 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 f7bb5274bd98..049b7f655f17 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -23,7 +23,12 @@ public struct APIHelper { 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: ",") + result[item.key] = collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } @@ -47,7 +52,12 @@ public struct APIHelper { public static func mapValueToPathItem(_ source: Any) -> Any { if let collection = source as? [Any?] { - return collection.filter { $0 != nil }.map { "\($0!)" }.joined(separator: ",") + return collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .joined(separator: ",") } return source } @@ -55,9 +65,14 @@ public struct APIHelper { public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { let destination = source.filter { $0.value != nil }.reduce(into: [URLQueryItem]()) { result, item in if let collection = item.value as? [Any?] { - collection.filter { $0 != nil }.map { "\($0!)" }.forEach { value in - result.append(URLQueryItem(name: item.key, value: value)) - } + collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .forEach { value in + result.append(URLQueryItem(name: item.key, value: value)) + } } else if let value = item.value { result.append(URLQueryItem(name: item.key, value: "\(value)")) } 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 dc0913d093f8..4077c82552a6 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -10,15 +10,15 @@ import AnyCodable #endif extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Int32: JSONEncodable { @@ -30,22 +30,22 @@ extension Int64: JSONEncodable { } extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension String: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { return self.rawValue as Any } + func encodeToJSON() -> Any { return self.rawValue } } private func encodeIfPossible(_ object: T) -> Any { if let encodableObject = object as? JSONEncodable { return encodableObject.encodeToJSON() } else { - return object as Any + return object } } @@ -67,7 +67,7 @@ extension Dictionary: JSONEncodable { for (key, value) in self { dictionary[key] = encodeIfPossible(value) } - return dictionary as Any + return dictionary } } @@ -79,7 +79,7 @@ extension Data: JSONEncodable { extension Date: JSONEncodable { func encodeToJSON() -> Any { - return CodableHelper.dateFormatter.string(from: self) as Any + return CodableHelper.dateFormatter.string(from: self) } } @@ -97,6 +97,6 @@ extension UUID: JSONEncodable { extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { - return Array(200 ..< 300).contains(statusCode) + return (200 ..< 300).contains(statusCode) } } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIHelper.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIHelper.swift index f7bb5274bd98..049b7f655f17 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIHelper.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIHelper.swift @@ -23,7 +23,12 @@ public struct APIHelper { 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: ",") + result[item.key] = collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } @@ -47,7 +52,12 @@ public struct APIHelper { public static func mapValueToPathItem(_ source: Any) -> Any { if let collection = source as? [Any?] { - return collection.filter { $0 != nil }.map { "\($0!)" }.joined(separator: ",") + return collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .joined(separator: ",") } return source } @@ -55,9 +65,14 @@ public struct APIHelper { public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { let destination = source.filter { $0.value != nil }.reduce(into: [URLQueryItem]()) { result, item in if let collection = item.value as? [Any?] { - collection.filter { $0 != nil }.map { "\($0!)" }.forEach { value in - result.append(URLQueryItem(name: item.key, value: value)) - } + collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .forEach { value in + result.append(URLQueryItem(name: item.key, value: value)) + } } else if let value = item.value { result.append(URLQueryItem(name: item.key, value: "\(value)")) } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Extensions.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Extensions.swift index e23035dde30e..5831422f09d8 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Extensions.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Extensions.swift @@ -10,15 +10,15 @@ import AnyCodable #endif extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Int32: JSONEncodable { @@ -30,22 +30,22 @@ extension Int64: JSONEncodable { } extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension String: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { return self.rawValue as Any } + func encodeToJSON() -> Any { return self.rawValue } } private func encodeIfPossible(_ object: T) -> Any { if let encodableObject = object as? JSONEncodable { return encodableObject.encodeToJSON() } else { - return object as Any + return object } } @@ -67,7 +67,7 @@ extension Dictionary: JSONEncodable { for (key, value) in self { dictionary[key] = encodeIfPossible(value) } - return dictionary as Any + return dictionary } } @@ -79,7 +79,7 @@ extension Data: JSONEncodable { extension Date: JSONEncodable { func encodeToJSON() -> Any { - return CodableHelper.dateFormatter.string(from: self) as Any + return CodableHelper.dateFormatter.string(from: self) } } @@ -183,6 +183,6 @@ extension KeyedDecodingContainerProtocol { extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { - return Array(200 ..< 300).contains(statusCode) + return (200 ..< 300).contains(statusCode) } } diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index f7bb5274bd98..049b7f655f17 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -23,7 +23,12 @@ public struct APIHelper { 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: ",") + result[item.key] = collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } @@ -47,7 +52,12 @@ public struct APIHelper { public static func mapValueToPathItem(_ source: Any) -> Any { if let collection = source as? [Any?] { - return collection.filter { $0 != nil }.map { "\($0!)" }.joined(separator: ",") + return collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .joined(separator: ",") } return source } @@ -55,9 +65,14 @@ public struct APIHelper { public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { let destination = source.filter { $0.value != nil }.reduce(into: [URLQueryItem]()) { result, item in if let collection = item.value as? [Any?] { - collection.filter { $0 != nil }.map { "\($0!)" }.forEach { value in - result.append(URLQueryItem(name: item.key, value: value)) - } + collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .forEach { value in + result.append(URLQueryItem(name: item.key, value: value)) + } } else if let value = item.value { result.append(URLQueryItem(name: item.key, value: "\(value)")) } diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Extensions.swift index e23035dde30e..5831422f09d8 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -10,15 +10,15 @@ import AnyCodable #endif extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension Int32: JSONEncodable { @@ -30,22 +30,22 @@ extension Int64: JSONEncodable { } extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension String: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } + func encodeToJSON() -> Any { return self } } extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { return self.rawValue as Any } + func encodeToJSON() -> Any { return self.rawValue } } private func encodeIfPossible(_ object: T) -> Any { if let encodableObject = object as? JSONEncodable { return encodableObject.encodeToJSON() } else { - return object as Any + return object } } @@ -67,7 +67,7 @@ extension Dictionary: JSONEncodable { for (key, value) in self { dictionary[key] = encodeIfPossible(value) } - return dictionary as Any + return dictionary } } @@ -79,7 +79,7 @@ extension Data: JSONEncodable { extension Date: JSONEncodable { func encodeToJSON() -> Any { - return CodableHelper.dateFormatter.string(from: self) as Any + return CodableHelper.dateFormatter.string(from: self) } } @@ -183,6 +183,6 @@ extension KeyedDecodingContainerProtocol { extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { - return Array(200 ..< 300).contains(statusCode) + return (200 ..< 300).contains(statusCode) } } From 64a478a93c1163f816634acb81a1e35283ed71f1 Mon Sep 17 00:00:00 2001 From: Fumito Nakazawa Date: Tue, 23 Nov 2021 22:18:56 +0900 Subject: [PATCH 023/117] [swift5] Remove optional from body (#10938) * Unwrap body * Remove unsupported type from nonDecodableBuilder * Update samples * Remove ! * Fix typo --- .../src/main/resources/swift5/Models.mustache | 6 +- .../src/main/resources/swift5/api.mustache | 10 +- .../AlamofireImplementations.mustache | 92 ++----------------- .../URLSessionImplementations.mustache | 60 ++---------- .../OpenAPIs/AlamofireImplementations.swift | 92 ++----------------- .../Classes/OpenAPIs/Models.swift | 6 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 10 +- .../APIs/FakeClassnameTags123API.swift | 2 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 10 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 6 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 4 +- .../Classes/OpenAPIs/Models.swift | 6 +- .../OpenAPIs/URLSessionImplementations.swift | 60 ++---------- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 10 +- .../APIs/FakeClassnameTags123API.swift | 2 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 10 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 6 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 4 +- .../Classes/OpenAPIs/Models.swift | 6 +- .../OpenAPIs/URLSessionImplementations.swift | 60 ++---------- .../Classes/OpenAPIs/Models.swift | 6 +- .../OpenAPIs/URLSessionImplementations.swift | 60 ++---------- .../Classes/OpenAPIs/Models.swift | 6 +- .../OpenAPIs/URLSessionImplementations.swift | 60 ++---------- .../Classes/OpenAPIs/Models.swift | 6 +- .../OpenAPIs/URLSessionImplementations.swift | 60 ++---------- .../Classes/OpenAPIs/Models.swift | 6 +- .../OpenAPIs/URLSessionImplementations.swift | 60 ++---------- .../Classes/OpenAPIs/Models.swift | 6 +- .../OpenAPIs/URLSessionImplementations.swift | 60 ++---------- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 10 +- .../APIs/FakeClassnameTags123API.swift | 2 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 10 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 6 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 4 +- .../Classes/OpenAPIs/Models.swift | 6 +- .../OpenAPIs/URLSessionImplementations.swift | 60 ++---------- .../Classes/OpenAPIs/Models.swift | 6 +- .../OpenAPIs/URLSessionImplementations.swift | 60 ++---------- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 10 +- .../APIs/FakeClassnameTags123API.swift | 2 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 10 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 6 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 4 +- .../Classes/OpenAPIs/Models.swift | 6 +- .../OpenAPIs/URLSessionImplementations.swift | 60 ++---------- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 10 +- .../APIs/FakeClassnameTags123API.swift | 2 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 10 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 6 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 4 +- .../Classes/OpenAPIs/Models.swift | 6 +- .../OpenAPIs/URLSessionImplementations.swift | 60 ++---------- .../Sources/PetstoreClient/Models.swift | 6 +- .../URLSessionImplementations.swift | 60 ++---------- .../Classes/OpenAPIs/Models.swift | 6 +- .../OpenAPIs/URLSessionImplementations.swift | 60 ++---------- 62 files changed, 231 insertions(+), 1063 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/swift5/Models.mustache b/modules/openapi-generator/src/main/resources/swift5/Models.mustache index 74ce973b2872..e8ca64cdc524 100644 --- a/modules/openapi-generator/src/main/resources/swift5/Models.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/Models.mustache @@ -33,15 +33,15 @@ protocol JSONEncodable { {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class Response { {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} let statusCode: Int {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} let header: [String: String] - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} let body: T? + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} let body: T - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} init(statusCode: Int, header: [String: String], body: T?) { + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} init(statusCode: Int, header: [String: String], body: T) { self.statusCode = statusCode self.header = header self.body = body } - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} convenience init(response: HTTPURLResponse, body: T?) { + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} convenience init(response: HTTPURLResponse, body: T) { let rawHeader = response.allHeaderFields var header = [String: String]() for (key, value) in rawHeader { diff --git a/modules/openapi-generator/src/main/resources/swift5/api.mustache b/modules/openapi-generator/src/main/resources/swift5/api.mustache index d0b300c64c1c..6e95e653a32f 100644 --- a/modules/openapi-generator/src/main/resources/swift5/api.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/api.mustache @@ -97,7 +97,7 @@ extension {{projectName}}API { switch result { {{#returnType}} case let .success(response): - deferred.resolver.fulfill(response.body!) + deferred.resolver.fulfill(response.body) {{/returnType}} {{^returnType}} case .success: @@ -128,7 +128,7 @@ extension {{projectName}}API { switch result { {{#returnType}} case let .success(response): - observer.onNext(response.body!) + observer.onNext(response.body) {{/returnType}} {{^returnType}} case .success: @@ -167,7 +167,7 @@ extension {{projectName}}API { switch result { {{#returnType}} case let .success(response): - promise(.success(response.body!)) + promise(.success(response.body)) {{/returnType}} {{^returnType}} case .success: @@ -212,7 +212,7 @@ extension {{projectName}}API { switch result { {{#returnType}} case let .success(response): - continuation.resume(returning: response.body!) + continuation.resume(returning: response.body) {{/returnType}} {{^returnType}} case .success: @@ -246,7 +246,7 @@ extension {{projectName}}API { switch result { {{#returnType}} case let .success(response): - completion(.success(response.body!)) + completion(.success(response.body)) {{/returnType}} {{^returnType}} case .success: diff --git a/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache b/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache index 31446b095433..48105ef58d95 100644 --- a/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache @@ -160,100 +160,20 @@ private var managerStore = SynchronizedDictionary() let validatedRequest = request.validate() switch T.self { - 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, stringResponse.response, error))) - } - - }) - case is URL.Type: - validatedRequest.responseData(queue: apiResponseQueue, completionHandler: { dataResponse in - cleanupRequest() - - do { - - guard case .success = dataResponse.result else { - throw DownloadException.responseFailed - } - - guard let data = dataResponse.data else { - throw DownloadException.responseDataMissing - } - - guard let request = request.request else { - throw DownloadException.requestMissing - } - - let fileManager = FileManager.default - let urlRequest = try request.asURLRequest() - let cachesDirectory = fileManager.urls(for: .cachesDirectory, in: .userDomainMask)[0] - let requestURL = try self.getURL(from: urlRequest) - - var requestPath = try self.getPath(from: requestURL) - - if let headerFileName = self.getFileName(fromContentDisposition: dataResponse.response?.allHeaderFields["Content-Disposition"] as? String) { - requestPath = requestPath.appending("/\(headerFileName)") - } else { - requestPath = requestPath.appending("/tmp.{{projectName}}.\(UUID().uuidString)") - } - - let filePath = cachesDirectory.appendingPathComponent(requestPath) - let directoryPath = filePath.deletingLastPathComponent().path - - try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) - try data.write(to: filePath, options: .atomic) - - completion(.success(Response(response: dataResponse.response!, body: filePath as? T))) - - } catch let requestParserError as DownloadException { - completion(.failure(ErrorResponse.error(400, dataResponse.data, dataResponse.response, requestParserError))) - } catch { - completion(.failure(ErrorResponse.error(400, dataResponse.data, dataResponse.response, error))) - } - return - }) 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))) + completion(.success(Response(response: voidResponse.response!, body: () as! T))) case let .failure(error): completion(.failure(ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.response, error))) } - }) - 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))) - case let .failure(error): - completion(.failure(ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.response, 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, dataResponse.response, error))) - } - - }) + fatalError("Unsupported Response Body Type - \(String(describing: T.self))") } } @@ -338,7 +258,7 @@ private var managerStore = SynchronizedDictionary() switch stringResponse.result { case let .success(value): - completion(.success(Response(response: stringResponse.response!, body: value as? T))) + completion(.success(Response(response: stringResponse.response!, body: value as! T))) case let .failure(error): completion(.failure(ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.response, error))) } @@ -381,7 +301,7 @@ private var managerStore = SynchronizedDictionary() try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) try data.write(to: filePath, options: .atomic) - completion(.success(Response(response: dataResponse.response!, body: filePath as? T))) + completion(.success(Response(response: dataResponse.response!, body: filePath as! T))) } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, dataResponse.data, dataResponse.response, requestParserError))) @@ -396,7 +316,7 @@ private var managerStore = SynchronizedDictionary() switch voidResponse.result { case .success: - completion(.success(Response(response: voidResponse.response!, body: nil))) + completion(.success(Response(response: voidResponse.response!, body: () as! T))) case let .failure(error): completion(.failure(ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.response, error))) } @@ -408,7 +328,7 @@ private var managerStore = SynchronizedDictionary() switch dataResponse.result { case .success: - completion(.success(Response(response: dataResponse.response!, body: dataResponse.data as? T))) + 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, dataResponse.response, error))) } diff --git a/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache b/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache index 648556996cac..707577e0da31 100644 --- a/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache @@ -200,60 +200,12 @@ private var credentialStore = SynchronizedDictionary() } 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 cachesDirectory = fileManager.urls(for: .cachesDirectory, in: .userDomainMask)[0] - let requestURL = try getURL(from: urlRequest) - - var requestPath = try getPath(from: requestURL) - - if let headerFileName = getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { - requestPath = requestPath.appending("/\(headerFileName)") - } else { - requestPath = requestPath.appending("/tmp.{{projectName}}.\(UUID().uuidString)") - } - - let filePath = cachesDirectory.appendingPathComponent(requestPath) - let directoryPath = filePath.deletingLastPathComponent().path - - try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) - try data.write(to: filePath, options: .atomic) - - completion(.success(Response(response: httpResponse, body: filePath as? T))) - - } catch let requestParserError as DownloadException { - completion(.failure(ErrorResponse.error(400, data, response, requestParserError))) - } catch { - completion(.failure(ErrorResponse.error(400, data, response, error))) - } - case is Void.Type: - completion(.success(Response(response: httpResponse, body: nil))) - - case is Data.Type: - - completion(.success(Response(response: httpResponse, body: data as? T))) + completion(.success(Response(response: httpResponse, body: () as! T))) default: - - completion(.success(Response(response: httpResponse, body: data as? T))) + fatalError("Unsupported Response Body Type - \(String(describing: T.self))") } } @@ -345,7 +297,7 @@ private var credentialStore = SynchronizedDictionary() let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - completion(.success(Response(response: httpResponse, body: body as? T))) + completion(.success(Response(response: httpResponse, body: body as! T))) case is URL.Type: do { @@ -376,7 +328,7 @@ private var credentialStore = SynchronizedDictionary() 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))) + completion(.success(Response(response: httpResponse, body: filePath as! T))) } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, response, requestParserError))) @@ -386,11 +338,11 @@ private var credentialStore = SynchronizedDictionary() case is Void.Type: - completion(.success(Response(response: httpResponse, body: nil))) + completion(.success(Response(response: httpResponse, body: () as! T))) case is Data.Type: - completion(.success(Response(response: httpResponse, body: data as? T))) + completion(.success(Response(response: httpResponse, body: data as! T))) default: 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 5fe5eaa7bec1..c8f1b663434c 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -160,100 +160,20 @@ open class AlamofireRequestBuilder: RequestBuilder { let validatedRequest = request.validate() switch T.self { - 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, stringResponse.response, error))) - } - - }) - case is URL.Type: - validatedRequest.responseData(queue: apiResponseQueue, completionHandler: { dataResponse in - cleanupRequest() - - do { - - guard case .success = dataResponse.result else { - throw DownloadException.responseFailed - } - - guard let data = dataResponse.data else { - throw DownloadException.responseDataMissing - } - - guard let request = request.request else { - throw DownloadException.requestMissing - } - - let fileManager = FileManager.default - let urlRequest = try request.asURLRequest() - let cachesDirectory = fileManager.urls(for: .cachesDirectory, in: .userDomainMask)[0] - let requestURL = try self.getURL(from: urlRequest) - - var requestPath = try self.getPath(from: requestURL) - - if let headerFileName = self.getFileName(fromContentDisposition: dataResponse.response?.allHeaderFields["Content-Disposition"] as? String) { - requestPath = requestPath.appending("/\(headerFileName)") - } else { - requestPath = requestPath.appending("/tmp.PetstoreClient.\(UUID().uuidString)") - } - - let filePath = cachesDirectory.appendingPathComponent(requestPath) - let directoryPath = filePath.deletingLastPathComponent().path - - try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) - try data.write(to: filePath, options: .atomic) - - completion(.success(Response(response: dataResponse.response!, body: filePath as? T))) - - } catch let requestParserError as DownloadException { - completion(.failure(ErrorResponse.error(400, dataResponse.data, dataResponse.response, requestParserError))) - } catch { - completion(.failure(ErrorResponse.error(400, dataResponse.data, dataResponse.response, error))) - } - return - }) 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))) + completion(.success(Response(response: voidResponse.response!, body: () as! T))) case let .failure(error): completion(.failure(ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.response, error))) } - }) - 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))) - case let .failure(error): - completion(.failure(ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.response, 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, dataResponse.response, error))) - } - - }) + fatalError("Unsupported Response Body Type - \(String(describing: T.self))") } } @@ -338,7 +258,7 @@ open class AlamofireDecodableRequestBuilder: AlamofireRequestBuild switch stringResponse.result { case let .success(value): - completion(.success(Response(response: stringResponse.response!, body: value as? T))) + completion(.success(Response(response: stringResponse.response!, body: value as! T))) case let .failure(error): completion(.failure(ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.response, error))) } @@ -381,7 +301,7 @@ open class AlamofireDecodableRequestBuilder: AlamofireRequestBuild try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) try data.write(to: filePath, options: .atomic) - completion(.success(Response(response: dataResponse.response!, body: filePath as? T))) + completion(.success(Response(response: dataResponse.response!, body: filePath as! T))) } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, dataResponse.data, dataResponse.response, requestParserError))) @@ -396,7 +316,7 @@ open class AlamofireDecodableRequestBuilder: AlamofireRequestBuild switch voidResponse.result { case .success: - completion(.success(Response(response: voidResponse.response!, body: nil))) + completion(.success(Response(response: voidResponse.response!, body: () as! T))) case let .failure(error): completion(.failure(ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.response, error))) } @@ -408,7 +328,7 @@ open class AlamofireDecodableRequestBuilder: AlamofireRequestBuild switch dataResponse.result { case .success: - completion(.success(Response(response: dataResponse.response!, body: dataResponse.data as? T))) + 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, dataResponse.response, error))) } 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 96e26a20f7d6..e58029901670 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -33,15 +33,15 @@ public enum DecodableRequestBuilderError: Error { open class Response { public let statusCode: Int public let header: [String: String] - public let body: T? + public let body: T - public init(statusCode: Int, header: [String: String], body: T?) { + public init(statusCode: Int, header: [String: String], body: T) { self.statusCode = statusCode self.header = header self.body = body } - public convenience init(response: HTTPURLResponse, body: T?) { + public convenience init(response: HTTPURLResponse, body: T) { let rawHeader = response.allHeaderFields var header = [String: String]() for (key, value) in rawHeader { diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 45ca9d14c100..4877906db165 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -33,7 +33,7 @@ open class AnotherFakeAPI { task = call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - continuation.resume(returning: response.body!) + continuation.resume(returning: response.body) case let .failure(error): continuation.resume(throwing: error) } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 50aa3c4f2dda..e773584bb02b 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -32,7 +32,7 @@ open class FakeAPI { task = fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - continuation.resume(returning: response.body!) + continuation.resume(returning: response.body) case let .failure(error): continuation.resume(throwing: error) } @@ -87,7 +87,7 @@ open class FakeAPI { task = fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - continuation.resume(returning: response.body!) + continuation.resume(returning: response.body) case let .failure(error): continuation.resume(throwing: error) } @@ -142,7 +142,7 @@ open class FakeAPI { task = fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - continuation.resume(returning: response.body!) + continuation.resume(returning: response.body) case let .failure(error): continuation.resume(throwing: error) } @@ -197,7 +197,7 @@ open class FakeAPI { task = fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - continuation.resume(returning: response.body!) + continuation.resume(returning: response.body) case let .failure(error): continuation.resume(throwing: error) } @@ -367,7 +367,7 @@ open class FakeAPI { task = testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - continuation.resume(returning: response.body!) + continuation.resume(returning: response.body) case let .failure(error): continuation.resume(throwing: error) } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 5bb42aa34652..66d801132d26 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -33,7 +33,7 @@ open class FakeClassnameTags123API { task = testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - continuation.resume(returning: response.body!) + continuation.resume(returning: response.body) case let .failure(error): continuation.resume(throwing: error) } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 8bc53adc9c06..2f713417bfb0 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -165,7 +165,7 @@ open class PetAPI { task = findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): - continuation.resume(returning: response.body!) + continuation.resume(returning: response.body) case let .failure(error): continuation.resume(throwing: error) } @@ -229,7 +229,7 @@ open class PetAPI { task = findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): - continuation.resume(returning: response.body!) + continuation.resume(returning: response.body) case let .failure(error): continuation.resume(throwing: error) } @@ -293,7 +293,7 @@ open class PetAPI { task = getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): - continuation.resume(returning: response.body!) + continuation.resume(returning: response.body) case let .failure(error): continuation.resume(throwing: error) } @@ -489,7 +489,7 @@ open class PetAPI { task = uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): - continuation.resume(returning: response.body!) + continuation.resume(returning: response.body) case let .failure(error): continuation.resume(throwing: error) } @@ -561,7 +561,7 @@ open class PetAPI { task = uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in switch result { case let .success(response): - continuation.resume(returning: response.body!) + continuation.resume(returning: response.body) case let .failure(error): continuation.resume(throwing: error) } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 6cfed59b37ac..41d3a6047dc2 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -92,7 +92,7 @@ open class StoreAPI { task = getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): - continuation.resume(returning: response.body!) + continuation.resume(returning: response.body) case let .failure(error): continuation.resume(throwing: error) } @@ -151,7 +151,7 @@ open class StoreAPI { task = getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): - continuation.resume(returning: response.body!) + continuation.resume(returning: response.body) case let .failure(error): continuation.resume(throwing: error) } @@ -211,7 +211,7 @@ open class StoreAPI { task = placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - continuation.resume(returning: response.body!) + continuation.resume(returning: response.body) case let .failure(error): continuation.resume(throwing: error) } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 48b052e3fcf9..f0e57f333cdf 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -262,7 +262,7 @@ open class UserAPI { task = getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): - continuation.resume(returning: response.body!) + continuation.resume(returning: response.body) case let .failure(error): continuation.resume(throwing: error) } @@ -322,7 +322,7 @@ open class UserAPI { task = loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): - continuation.resume(returning: response.body!) + continuation.resume(returning: response.body) case let .failure(error): continuation.resume(throwing: error) } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 96e26a20f7d6..e58029901670 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -33,15 +33,15 @@ public enum DecodableRequestBuilderError: Error { open class Response { public let statusCode: Int public let header: [String: String] - public let body: T? + public let body: T - public init(statusCode: Int, header: [String: String], body: T?) { + public init(statusCode: Int, header: [String: String], body: T) { self.statusCode = statusCode self.header = header self.body = body } - public convenience init(response: HTTPURLResponse, body: T?) { + public convenience init(response: HTTPURLResponse, body: T) { let rawHeader = response.allHeaderFields var header = [String: String]() for (key, value) in rawHeader { diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 24ab89eda79d..fe7fb6683bcf 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -200,60 +200,12 @@ 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 cachesDirectory = fileManager.urls(for: .cachesDirectory, in: .userDomainMask)[0] - let requestURL = try getURL(from: urlRequest) - - var requestPath = try getPath(from: requestURL) - - if let headerFileName = getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { - requestPath = requestPath.appending("/\(headerFileName)") - } else { - requestPath = requestPath.appending("/tmp.PetstoreClient.\(UUID().uuidString)") - } - - let filePath = cachesDirectory.appendingPathComponent(requestPath) - let directoryPath = filePath.deletingLastPathComponent().path - - try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) - try data.write(to: filePath, options: .atomic) - - completion(.success(Response(response: httpResponse, body: filePath as? T))) - - } catch let requestParserError as DownloadException { - completion(.failure(ErrorResponse.error(400, data, response, requestParserError))) - } catch { - completion(.failure(ErrorResponse.error(400, data, response, error))) - } - case is Void.Type: - completion(.success(Response(response: httpResponse, body: nil))) - - case is Data.Type: - - completion(.success(Response(response: httpResponse, body: data as? T))) + completion(.success(Response(response: httpResponse, body: () as! T))) default: - - completion(.success(Response(response: httpResponse, body: data as? T))) + fatalError("Unsupported Response Body Type - \(String(describing: T.self))") } } @@ -345,7 +297,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - completion(.success(Response(response: httpResponse, body: body as? T))) + completion(.success(Response(response: httpResponse, body: body as! T))) case is URL.Type: do { @@ -376,7 +328,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui 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))) + completion(.success(Response(response: httpResponse, body: filePath as! T))) } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, response, requestParserError))) @@ -386,11 +338,11 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui case is Void.Type: - completion(.success(Response(response: httpResponse, body: nil))) + completion(.success(Response(response: httpResponse, body: () as! T))) case is Data.Type: - completion(.success(Response(response: httpResponse, body: data as? T))) + completion(.success(Response(response: httpResponse, body: data as! T))) default: 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 6b18892fd71a..724845424e6f 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 @@ -30,7 +30,7 @@ open class AnotherFakeAPI { task = call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - promise(.success(response.body!)) + promise(.success(response.body)) case let .failure(error): promise(.failure(error)) } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 57e4aee7b36c..b64f5581ea63 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 @@ -29,7 +29,7 @@ open class FakeAPI { task = fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - promise(.success(response.body!)) + promise(.success(response.body)) case let .failure(error): promise(.failure(error)) } @@ -80,7 +80,7 @@ open class FakeAPI { task = fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - promise(.success(response.body!)) + promise(.success(response.body)) case let .failure(error): promise(.failure(error)) } @@ -131,7 +131,7 @@ open class FakeAPI { task = fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - promise(.success(response.body!)) + promise(.success(response.body)) case let .failure(error): promise(.failure(error)) } @@ -182,7 +182,7 @@ open class FakeAPI { task = fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - promise(.success(response.body!)) + promise(.success(response.body)) case let .failure(error): promise(.failure(error)) } @@ -340,7 +340,7 @@ open class FakeAPI { task = testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - promise(.success(response.body!)) + promise(.success(response.body)) case let .failure(error): promise(.failure(error)) } 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 963f5b9ff8d7..f95386104723 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 @@ -30,7 +30,7 @@ open class FakeClassnameTags123API { task = testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - promise(.success(response.body!)) + promise(.success(response.body)) case let .failure(error): promise(.failure(error)) } 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 aea9263a7a50..1335065e0133 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 @@ -154,7 +154,7 @@ open class PetAPI { task = findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): - promise(.success(response.body!)) + promise(.success(response.body)) case let .failure(error): promise(.failure(error)) } @@ -214,7 +214,7 @@ open class PetAPI { task = findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): - promise(.success(response.body!)) + promise(.success(response.body)) case let .failure(error): promise(.failure(error)) } @@ -274,7 +274,7 @@ open class PetAPI { task = getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): - promise(.success(response.body!)) + promise(.success(response.body)) case let .failure(error): promise(.failure(error)) } @@ -458,7 +458,7 @@ open class PetAPI { task = uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): - promise(.success(response.body!)) + promise(.success(response.body)) case let .failure(error): promise(.failure(error)) } @@ -526,7 +526,7 @@ open class PetAPI { task = uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in switch result { case let .success(response): - promise(.success(response.body!)) + promise(.success(response.body)) case let .failure(error): promise(.failure(error)) } 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 e4a71a69dfd5..ec3368c105af 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 @@ -85,7 +85,7 @@ open class StoreAPI { task = getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): - promise(.success(response.body!)) + promise(.success(response.body)) case let .failure(error): promise(.failure(error)) } @@ -140,7 +140,7 @@ open class StoreAPI { task = getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): - promise(.success(response.body!)) + promise(.success(response.body)) case let .failure(error): promise(.failure(error)) } @@ -196,7 +196,7 @@ open class StoreAPI { task = placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - promise(.success(response.body!)) + promise(.success(response.body)) case let .failure(error): promise(.failure(error)) } 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 79cce70e949b..5ec63243c521 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 @@ -243,7 +243,7 @@ open class UserAPI { task = getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): - promise(.success(response.body!)) + promise(.success(response.body)) case let .failure(error): promise(.failure(error)) } @@ -299,7 +299,7 @@ open class UserAPI { task = loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): - promise(.success(response.body!)) + promise(.success(response.body)) case let .failure(error): promise(.failure(error)) } 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 96e26a20f7d6..e58029901670 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -33,15 +33,15 @@ public enum DecodableRequestBuilderError: Error { open class Response { public let statusCode: Int public let header: [String: String] - public let body: T? + public let body: T - public init(statusCode: Int, header: [String: String], body: T?) { + public init(statusCode: Int, header: [String: String], body: T) { self.statusCode = statusCode self.header = header self.body = body } - public convenience init(response: HTTPURLResponse, body: T?) { + public convenience init(response: HTTPURLResponse, body: T) { let rawHeader = response.allHeaderFields var header = [String: String]() for (key, value) in rawHeader { 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 24ab89eda79d..fe7fb6683bcf 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -200,60 +200,12 @@ 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 cachesDirectory = fileManager.urls(for: .cachesDirectory, in: .userDomainMask)[0] - let requestURL = try getURL(from: urlRequest) - - var requestPath = try getPath(from: requestURL) - - if let headerFileName = getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { - requestPath = requestPath.appending("/\(headerFileName)") - } else { - requestPath = requestPath.appending("/tmp.PetstoreClient.\(UUID().uuidString)") - } - - let filePath = cachesDirectory.appendingPathComponent(requestPath) - let directoryPath = filePath.deletingLastPathComponent().path - - try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) - try data.write(to: filePath, options: .atomic) - - completion(.success(Response(response: httpResponse, body: filePath as? T))) - - } catch let requestParserError as DownloadException { - completion(.failure(ErrorResponse.error(400, data, response, requestParserError))) - } catch { - completion(.failure(ErrorResponse.error(400, data, response, error))) - } - case is Void.Type: - completion(.success(Response(response: httpResponse, body: nil))) - - case is Data.Type: - - completion(.success(Response(response: httpResponse, body: data as? T))) + completion(.success(Response(response: httpResponse, body: () as! T))) default: - - completion(.success(Response(response: httpResponse, body: data as? T))) + fatalError("Unsupported Response Body Type - \(String(describing: T.self))") } } @@ -345,7 +297,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - completion(.success(Response(response: httpResponse, body: body as? T))) + completion(.success(Response(response: httpResponse, body: body as! T))) case is URL.Type: do { @@ -376,7 +328,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui 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))) + completion(.success(Response(response: httpResponse, body: filePath as! T))) } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, response, requestParserError))) @@ -386,11 +338,11 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui case is Void.Type: - completion(.success(Response(response: httpResponse, body: nil))) + completion(.success(Response(response: httpResponse, body: () as! T))) case is Data.Type: - completion(.success(Response(response: httpResponse, body: data as? T))) + completion(.success(Response(response: httpResponse, body: data as! T))) default: 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 96e26a20f7d6..e58029901670 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -33,15 +33,15 @@ public enum DecodableRequestBuilderError: Error { open class Response { public let statusCode: Int public let header: [String: String] - public let body: T? + public let body: T - public init(statusCode: Int, header: [String: String], body: T?) { + public init(statusCode: Int, header: [String: String], body: T) { self.statusCode = statusCode self.header = header self.body = body } - public convenience init(response: HTTPURLResponse, body: T?) { + public convenience init(response: HTTPURLResponse, body: T) { let rawHeader = response.allHeaderFields var header = [String: String]() for (key, value) in rawHeader { 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 24ab89eda79d..fe7fb6683bcf 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -200,60 +200,12 @@ 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 cachesDirectory = fileManager.urls(for: .cachesDirectory, in: .userDomainMask)[0] - let requestURL = try getURL(from: urlRequest) - - var requestPath = try getPath(from: requestURL) - - if let headerFileName = getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { - requestPath = requestPath.appending("/\(headerFileName)") - } else { - requestPath = requestPath.appending("/tmp.PetstoreClient.\(UUID().uuidString)") - } - - let filePath = cachesDirectory.appendingPathComponent(requestPath) - let directoryPath = filePath.deletingLastPathComponent().path - - try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) - try data.write(to: filePath, options: .atomic) - - completion(.success(Response(response: httpResponse, body: filePath as? T))) - - } catch let requestParserError as DownloadException { - completion(.failure(ErrorResponse.error(400, data, response, requestParserError))) - } catch { - completion(.failure(ErrorResponse.error(400, data, response, error))) - } - case is Void.Type: - completion(.success(Response(response: httpResponse, body: nil))) - - case is Data.Type: - - completion(.success(Response(response: httpResponse, body: data as? T))) + completion(.success(Response(response: httpResponse, body: () as! T))) default: - - completion(.success(Response(response: httpResponse, body: data as? T))) + fatalError("Unsupported Response Body Type - \(String(describing: T.self))") } } @@ -345,7 +297,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - completion(.success(Response(response: httpResponse, body: body as? T))) + completion(.success(Response(response: httpResponse, body: body as! T))) case is URL.Type: do { @@ -376,7 +328,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui 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))) + completion(.success(Response(response: httpResponse, body: filePath as! T))) } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, response, requestParserError))) @@ -386,11 +338,11 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui case is Void.Type: - completion(.success(Response(response: httpResponse, body: nil))) + completion(.success(Response(response: httpResponse, body: () as! T))) case is Data.Type: - completion(.success(Response(response: httpResponse, body: data as? T))) + completion(.success(Response(response: httpResponse, body: data as! T))) default: diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift index 96e26a20f7d6..e58029901670 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -33,15 +33,15 @@ public enum DecodableRequestBuilderError: Error { open class Response { public let statusCode: Int public let header: [String: String] - public let body: T? + public let body: T - public init(statusCode: Int, header: [String: String], body: T?) { + public init(statusCode: Int, header: [String: String], body: T) { self.statusCode = statusCode self.header = header self.body = body } - public convenience init(response: HTTPURLResponse, body: T?) { + public convenience init(response: HTTPURLResponse, body: T) { let rawHeader = response.allHeaderFields var header = [String: String]() for (key, value) in rawHeader { diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 24ab89eda79d..fe7fb6683bcf 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -200,60 +200,12 @@ 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 cachesDirectory = fileManager.urls(for: .cachesDirectory, in: .userDomainMask)[0] - let requestURL = try getURL(from: urlRequest) - - var requestPath = try getPath(from: requestURL) - - if let headerFileName = getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { - requestPath = requestPath.appending("/\(headerFileName)") - } else { - requestPath = requestPath.appending("/tmp.PetstoreClient.\(UUID().uuidString)") - } - - let filePath = cachesDirectory.appendingPathComponent(requestPath) - let directoryPath = filePath.deletingLastPathComponent().path - - try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) - try data.write(to: filePath, options: .atomic) - - completion(.success(Response(response: httpResponse, body: filePath as? T))) - - } catch let requestParserError as DownloadException { - completion(.failure(ErrorResponse.error(400, data, response, requestParserError))) - } catch { - completion(.failure(ErrorResponse.error(400, data, response, error))) - } - case is Void.Type: - completion(.success(Response(response: httpResponse, body: nil))) - - case is Data.Type: - - completion(.success(Response(response: httpResponse, body: data as? T))) + completion(.success(Response(response: httpResponse, body: () as! T))) default: - - completion(.success(Response(response: httpResponse, body: data as? T))) + fatalError("Unsupported Response Body Type - \(String(describing: T.self))") } } @@ -345,7 +297,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - completion(.success(Response(response: httpResponse, body: body as? T))) + completion(.success(Response(response: httpResponse, body: body as! T))) case is URL.Type: do { @@ -376,7 +328,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui 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))) + completion(.success(Response(response: httpResponse, body: filePath as! T))) } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, response, requestParserError))) @@ -386,11 +338,11 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui case is Void.Type: - completion(.success(Response(response: httpResponse, body: nil))) + completion(.success(Response(response: httpResponse, body: () as! T))) case is Data.Type: - completion(.success(Response(response: httpResponse, body: data as? T))) + completion(.success(Response(response: httpResponse, body: data as! T))) default: 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 f372f83aac84..5db24390bd78 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -33,15 +33,15 @@ internal enum DecodableRequestBuilderError: Error { internal class Response { internal let statusCode: Int internal let header: [String: String] - internal let body: T? + internal let body: T - internal init(statusCode: Int, header: [String: String], body: T?) { + internal init(statusCode: Int, header: [String: String], body: T) { self.statusCode = statusCode self.header = header self.body = body } - internal convenience init(response: HTTPURLResponse, body: T?) { + internal convenience init(response: HTTPURLResponse, body: T) { let rawHeader = response.allHeaderFields var header = [String: String]() for (key, value) in rawHeader { 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 3046f05e3cdf..0d4c11bc1ac5 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -200,60 +200,12 @@ 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 cachesDirectory = fileManager.urls(for: .cachesDirectory, in: .userDomainMask)[0] - let requestURL = try getURL(from: urlRequest) - - var requestPath = try getPath(from: requestURL) - - if let headerFileName = getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { - requestPath = requestPath.appending("/\(headerFileName)") - } else { - requestPath = requestPath.appending("/tmp.PetstoreClient.\(UUID().uuidString)") - } - - let filePath = cachesDirectory.appendingPathComponent(requestPath) - let directoryPath = filePath.deletingLastPathComponent().path - - try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) - try data.write(to: filePath, options: .atomic) - - completion(.success(Response(response: httpResponse, body: filePath as? T))) - - } catch let requestParserError as DownloadException { - completion(.failure(ErrorResponse.error(400, data, response, requestParserError))) - } catch { - completion(.failure(ErrorResponse.error(400, data, response, error))) - } - case is Void.Type: - completion(.success(Response(response: httpResponse, body: nil))) - - case is Data.Type: - - completion(.success(Response(response: httpResponse, body: data as? T))) + completion(.success(Response(response: httpResponse, body: () as! T))) default: - - completion(.success(Response(response: httpResponse, body: data as? T))) + fatalError("Unsupported Response Body Type - \(String(describing: T.self))") } } @@ -345,7 +297,7 @@ internal class URLSessionDecodableRequestBuilder: URLSessionReques let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - completion(.success(Response(response: httpResponse, body: body as? T))) + completion(.success(Response(response: httpResponse, body: body as! T))) case is URL.Type: do { @@ -376,7 +328,7 @@ internal class URLSessionDecodableRequestBuilder: URLSessionReques 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))) + completion(.success(Response(response: httpResponse, body: filePath as! T))) } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, response, requestParserError))) @@ -386,11 +338,11 @@ internal class URLSessionDecodableRequestBuilder: URLSessionReques case is Void.Type: - completion(.success(Response(response: httpResponse, body: nil))) + completion(.success(Response(response: httpResponse, body: () as! T))) case is Data.Type: - completion(.success(Response(response: httpResponse, body: data as? T))) + completion(.success(Response(response: httpResponse, body: data as! T))) default: 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 96e26a20f7d6..e58029901670 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -33,15 +33,15 @@ public enum DecodableRequestBuilderError: Error { open class Response { public let statusCode: Int public let header: [String: String] - public let body: T? + public let body: T - public init(statusCode: Int, header: [String: String], body: T?) { + public init(statusCode: Int, header: [String: String], body: T) { self.statusCode = statusCode self.header = header self.body = body } - public convenience init(response: HTTPURLResponse, body: T?) { + public convenience init(response: HTTPURLResponse, body: T) { let rawHeader = response.allHeaderFields var header = [String: String]() for (key, value) in rawHeader { 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 24ab89eda79d..fe7fb6683bcf 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -200,60 +200,12 @@ 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 cachesDirectory = fileManager.urls(for: .cachesDirectory, in: .userDomainMask)[0] - let requestURL = try getURL(from: urlRequest) - - var requestPath = try getPath(from: requestURL) - - if let headerFileName = getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { - requestPath = requestPath.appending("/\(headerFileName)") - } else { - requestPath = requestPath.appending("/tmp.PetstoreClient.\(UUID().uuidString)") - } - - let filePath = cachesDirectory.appendingPathComponent(requestPath) - let directoryPath = filePath.deletingLastPathComponent().path - - try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) - try data.write(to: filePath, options: .atomic) - - completion(.success(Response(response: httpResponse, body: filePath as? T))) - - } catch let requestParserError as DownloadException { - completion(.failure(ErrorResponse.error(400, data, response, requestParserError))) - } catch { - completion(.failure(ErrorResponse.error(400, data, response, error))) - } - case is Void.Type: - completion(.success(Response(response: httpResponse, body: nil))) - - case is Data.Type: - - completion(.success(Response(response: httpResponse, body: data as? T))) + completion(.success(Response(response: httpResponse, body: () as! T))) default: - - completion(.success(Response(response: httpResponse, body: data as? T))) + fatalError("Unsupported Response Body Type - \(String(describing: T.self))") } } @@ -345,7 +297,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - completion(.success(Response(response: httpResponse, body: body as? T))) + completion(.success(Response(response: httpResponse, body: body as! T))) case is URL.Type: do { @@ -376,7 +328,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui 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))) + completion(.success(Response(response: httpResponse, body: filePath as! T))) } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, response, requestParserError))) @@ -386,11 +338,11 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui case is Void.Type: - completion(.success(Response(response: httpResponse, body: nil))) + completion(.success(Response(response: httpResponse, body: () as! T))) case is Data.Type: - completion(.success(Response(response: httpResponse, body: data as? T))) + completion(.success(Response(response: httpResponse, body: data as! T))) default: diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models.swift index 96e26a20f7d6..e58029901670 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -33,15 +33,15 @@ public enum DecodableRequestBuilderError: Error { open class Response { public let statusCode: Int public let header: [String: String] - public let body: T? + public let body: T - public init(statusCode: Int, header: [String: String], body: T?) { + public init(statusCode: Int, header: [String: String], body: T) { self.statusCode = statusCode self.header = header self.body = body } - public convenience init(response: HTTPURLResponse, body: T?) { + public convenience init(response: HTTPURLResponse, body: T) { let rawHeader = response.allHeaderFields var header = [String: String]() for (key, value) in rawHeader { diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 24ab89eda79d..fe7fb6683bcf 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -200,60 +200,12 @@ 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 cachesDirectory = fileManager.urls(for: .cachesDirectory, in: .userDomainMask)[0] - let requestURL = try getURL(from: urlRequest) - - var requestPath = try getPath(from: requestURL) - - if let headerFileName = getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { - requestPath = requestPath.appending("/\(headerFileName)") - } else { - requestPath = requestPath.appending("/tmp.PetstoreClient.\(UUID().uuidString)") - } - - let filePath = cachesDirectory.appendingPathComponent(requestPath) - let directoryPath = filePath.deletingLastPathComponent().path - - try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) - try data.write(to: filePath, options: .atomic) - - completion(.success(Response(response: httpResponse, body: filePath as? T))) - - } catch let requestParserError as DownloadException { - completion(.failure(ErrorResponse.error(400, data, response, requestParserError))) - } catch { - completion(.failure(ErrorResponse.error(400, data, response, error))) - } - case is Void.Type: - completion(.success(Response(response: httpResponse, body: nil))) - - case is Data.Type: - - completion(.success(Response(response: httpResponse, body: data as? T))) + completion(.success(Response(response: httpResponse, body: () as! T))) default: - - completion(.success(Response(response: httpResponse, body: data as? T))) + fatalError("Unsupported Response Body Type - \(String(describing: T.self))") } } @@ -345,7 +297,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - completion(.success(Response(response: httpResponse, body: body as? T))) + completion(.success(Response(response: httpResponse, body: body as! T))) case is URL.Type: do { @@ -376,7 +328,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui 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))) + completion(.success(Response(response: httpResponse, body: filePath as! T))) } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, response, requestParserError))) @@ -386,11 +338,11 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui case is Void.Type: - completion(.success(Response(response: httpResponse, body: nil))) + completion(.success(Response(response: httpResponse, body: () as! T))) case is Data.Type: - completion(.success(Response(response: httpResponse, body: data as? T))) + completion(.success(Response(response: httpResponse, body: data as! T))) default: 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 75fd284604e5..2e86e0cbaa43 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 @@ -25,7 +25,7 @@ open class AnotherFakeAPI { call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - deferred.resolver.fulfill(response.body!) + deferred.resolver.fulfill(response.body) case let .failure(error): deferred.resolver.reject(error) } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 3009dcc5901b..ef784bfffdcf 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 @@ -24,7 +24,7 @@ open class FakeAPI { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - deferred.resolver.fulfill(response.body!) + deferred.resolver.fulfill(response.body) case let .failure(error): deferred.resolver.reject(error) } @@ -67,7 +67,7 @@ open class FakeAPI { fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - deferred.resolver.fulfill(response.body!) + deferred.resolver.fulfill(response.body) case let .failure(error): deferred.resolver.reject(error) } @@ -110,7 +110,7 @@ open class FakeAPI { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - deferred.resolver.fulfill(response.body!) + deferred.resolver.fulfill(response.body) case let .failure(error): deferred.resolver.reject(error) } @@ -153,7 +153,7 @@ open class FakeAPI { fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - deferred.resolver.fulfill(response.body!) + deferred.resolver.fulfill(response.body) case let .failure(error): deferred.resolver.reject(error) } @@ -287,7 +287,7 @@ open class FakeAPI { testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - deferred.resolver.fulfill(response.body!) + deferred.resolver.fulfill(response.body) case let .failure(error): deferred.resolver.reject(error) } 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 1a81a5cc681b..84cc164d5bfe 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 @@ -25,7 +25,7 @@ open class FakeClassnameTags123API { testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - deferred.resolver.fulfill(response.body!) + deferred.resolver.fulfill(response.body) case let .failure(error): deferred.resolver.reject(error) } 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 5545eb0b7acd..a6de43f38702 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 @@ -133,7 +133,7 @@ open class PetAPI { findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): - deferred.resolver.fulfill(response.body!) + deferred.resolver.fulfill(response.body) case let .failure(error): deferred.resolver.reject(error) } @@ -185,7 +185,7 @@ open class PetAPI { findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): - deferred.resolver.fulfill(response.body!) + deferred.resolver.fulfill(response.body) case let .failure(error): deferred.resolver.reject(error) } @@ -237,7 +237,7 @@ open class PetAPI { getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): - deferred.resolver.fulfill(response.body!) + deferred.resolver.fulfill(response.body) case let .failure(error): deferred.resolver.reject(error) } @@ -397,7 +397,7 @@ open class PetAPI { uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): - deferred.resolver.fulfill(response.body!) + deferred.resolver.fulfill(response.body) case let .failure(error): deferred.resolver.reject(error) } @@ -457,7 +457,7 @@ open class PetAPI { uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in switch result { case let .success(response): - deferred.resolver.fulfill(response.body!) + deferred.resolver.fulfill(response.body) case let .failure(error): deferred.resolver.reject(error) } 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 af27df36ea44..dba4582cb83f 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 @@ -72,7 +72,7 @@ open class StoreAPI { getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): - deferred.resolver.fulfill(response.body!) + deferred.resolver.fulfill(response.body) case let .failure(error): deferred.resolver.reject(error) } @@ -119,7 +119,7 @@ open class StoreAPI { getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): - deferred.resolver.fulfill(response.body!) + deferred.resolver.fulfill(response.body) case let .failure(error): deferred.resolver.reject(error) } @@ -167,7 +167,7 @@ open class StoreAPI { placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - deferred.resolver.fulfill(response.body!) + deferred.resolver.fulfill(response.body) case let .failure(error): deferred.resolver.reject(error) } 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 76e6ed4d0b36..0053bffff2b6 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 @@ -206,7 +206,7 @@ open class UserAPI { getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): - deferred.resolver.fulfill(response.body!) + deferred.resolver.fulfill(response.body) case let .failure(error): deferred.resolver.reject(error) } @@ -254,7 +254,7 @@ open class UserAPI { loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): - deferred.resolver.fulfill(response.body!) + deferred.resolver.fulfill(response.body) case let .failure(error): deferred.resolver.reject(error) } 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 96e26a20f7d6..e58029901670 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -33,15 +33,15 @@ public enum DecodableRequestBuilderError: Error { open class Response { public let statusCode: Int public let header: [String: String] - public let body: T? + public let body: T - public init(statusCode: Int, header: [String: String], body: T?) { + public init(statusCode: Int, header: [String: String], body: T) { self.statusCode = statusCode self.header = header self.body = body } - public convenience init(response: HTTPURLResponse, body: T?) { + public convenience init(response: HTTPURLResponse, body: T) { let rawHeader = response.allHeaderFields var header = [String: String]() for (key, value) in rawHeader { 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 24ab89eda79d..fe7fb6683bcf 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -200,60 +200,12 @@ 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 cachesDirectory = fileManager.urls(for: .cachesDirectory, in: .userDomainMask)[0] - let requestURL = try getURL(from: urlRequest) - - var requestPath = try getPath(from: requestURL) - - if let headerFileName = getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { - requestPath = requestPath.appending("/\(headerFileName)") - } else { - requestPath = requestPath.appending("/tmp.PetstoreClient.\(UUID().uuidString)") - } - - let filePath = cachesDirectory.appendingPathComponent(requestPath) - let directoryPath = filePath.deletingLastPathComponent().path - - try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) - try data.write(to: filePath, options: .atomic) - - completion(.success(Response(response: httpResponse, body: filePath as? T))) - - } catch let requestParserError as DownloadException { - completion(.failure(ErrorResponse.error(400, data, response, requestParserError))) - } catch { - completion(.failure(ErrorResponse.error(400, data, response, error))) - } - case is Void.Type: - completion(.success(Response(response: httpResponse, body: nil))) - - case is Data.Type: - - completion(.success(Response(response: httpResponse, body: data as? T))) + completion(.success(Response(response: httpResponse, body: () as! T))) default: - - completion(.success(Response(response: httpResponse, body: data as? T))) + fatalError("Unsupported Response Body Type - \(String(describing: T.self))") } } @@ -345,7 +297,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - completion(.success(Response(response: httpResponse, body: body as? T))) + completion(.success(Response(response: httpResponse, body: body as! T))) case is URL.Type: do { @@ -376,7 +328,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui 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))) + completion(.success(Response(response: httpResponse, body: filePath as! T))) } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, response, requestParserError))) @@ -386,11 +338,11 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui case is Void.Type: - completion(.success(Response(response: httpResponse, body: nil))) + completion(.success(Response(response: httpResponse, body: () as! T))) case is Data.Type: - completion(.success(Response(response: httpResponse, body: data as? T))) + completion(.success(Response(response: httpResponse, body: data as! T))) default: diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift index 96e26a20f7d6..e58029901670 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -33,15 +33,15 @@ public enum DecodableRequestBuilderError: Error { open class Response { public let statusCode: Int public let header: [String: String] - public let body: T? + public let body: T - public init(statusCode: Int, header: [String: String], body: T?) { + public init(statusCode: Int, header: [String: String], body: T) { self.statusCode = statusCode self.header = header self.body = body } - public convenience init(response: HTTPURLResponse, body: T?) { + public convenience init(response: HTTPURLResponse, body: T) { let rawHeader = response.allHeaderFields var header = [String: String]() for (key, value) in rawHeader { diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 24ab89eda79d..fe7fb6683bcf 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -200,60 +200,12 @@ 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 cachesDirectory = fileManager.urls(for: .cachesDirectory, in: .userDomainMask)[0] - let requestURL = try getURL(from: urlRequest) - - var requestPath = try getPath(from: requestURL) - - if let headerFileName = getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { - requestPath = requestPath.appending("/\(headerFileName)") - } else { - requestPath = requestPath.appending("/tmp.PetstoreClient.\(UUID().uuidString)") - } - - let filePath = cachesDirectory.appendingPathComponent(requestPath) - let directoryPath = filePath.deletingLastPathComponent().path - - try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) - try data.write(to: filePath, options: .atomic) - - completion(.success(Response(response: httpResponse, body: filePath as? T))) - - } catch let requestParserError as DownloadException { - completion(.failure(ErrorResponse.error(400, data, response, requestParserError))) - } catch { - completion(.failure(ErrorResponse.error(400, data, response, error))) - } - case is Void.Type: - completion(.success(Response(response: httpResponse, body: nil))) - - case is Data.Type: - - completion(.success(Response(response: httpResponse, body: data as? T))) + completion(.success(Response(response: httpResponse, body: () as! T))) default: - - completion(.success(Response(response: httpResponse, body: data as? T))) + fatalError("Unsupported Response Body Type - \(String(describing: T.self))") } } @@ -345,7 +297,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - completion(.success(Response(response: httpResponse, body: body as? T))) + completion(.success(Response(response: httpResponse, body: body as! T))) case is URL.Type: do { @@ -376,7 +328,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui 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))) + completion(.success(Response(response: httpResponse, body: filePath as! T))) } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, response, requestParserError))) @@ -386,11 +338,11 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui case is Void.Type: - completion(.success(Response(response: httpResponse, body: nil))) + completion(.success(Response(response: httpResponse, body: () as! T))) case is Data.Type: - completion(.success(Response(response: httpResponse, body: data as? T))) + completion(.success(Response(response: httpResponse, body: data as! T))) default: 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 1277c034392c..03e84c9a2e39 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 @@ -24,7 +24,7 @@ open class AnotherFakeAPI { return call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - completion(.success(response.body!)) + completion(.success(response.body)) case let .failure(error): completion(.failure(error)) } 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 2b796b1fd2f9..1bb864f1684f 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 @@ -23,7 +23,7 @@ open class FakeAPI { return fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - completion(.success(response.body!)) + completion(.success(response.body)) case let .failure(error): completion(.failure(error)) } @@ -65,7 +65,7 @@ open class FakeAPI { return fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - completion(.success(response.body!)) + completion(.success(response.body)) case let .failure(error): completion(.failure(error)) } @@ -107,7 +107,7 @@ open class FakeAPI { return fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - completion(.success(response.body!)) + completion(.success(response.body)) case let .failure(error): completion(.failure(error)) } @@ -149,7 +149,7 @@ open class FakeAPI { return fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - completion(.success(response.body!)) + completion(.success(response.body)) case let .failure(error): completion(.failure(error)) } @@ -280,7 +280,7 @@ open class FakeAPI { return testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - completion(.success(response.body!)) + completion(.success(response.body)) case let .failure(error): completion(.failure(error)) } 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 30d24c9a9e35..0749c5c9dc71 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 @@ -24,7 +24,7 @@ open class FakeClassnameTags123API { return testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - completion(.success(response.body!)) + completion(.success(response.body)) case let .failure(error): completion(.failure(error)) } 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 a381d52b651a..ff5d3c3db107 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 @@ -130,7 +130,7 @@ open class PetAPI { return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): - completion(.success(response.body!)) + completion(.success(response.body)) case let .failure(error): completion(.failure(error)) } @@ -181,7 +181,7 @@ open class PetAPI { return findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): - completion(.success(response.body!)) + completion(.success(response.body)) case let .failure(error): completion(.failure(error)) } @@ -232,7 +232,7 @@ open class PetAPI { return getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): - completion(.success(response.body!)) + completion(.success(response.body)) case let .failure(error): completion(.failure(error)) } @@ -389,7 +389,7 @@ open class PetAPI { return uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): - completion(.success(response.body!)) + completion(.success(response.body)) case let .failure(error): completion(.failure(error)) } @@ -448,7 +448,7 @@ open class PetAPI { return uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in switch result { case let .success(response): - completion(.success(response.body!)) + completion(.success(response.body)) case let .failure(error): completion(.failure(error)) } 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 66824247d0d4..6ce5440ab905 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 @@ -70,7 +70,7 @@ open class StoreAPI { return getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): - completion(.success(response.body!)) + completion(.success(response.body)) case let .failure(error): completion(.failure(error)) } @@ -116,7 +116,7 @@ open class StoreAPI { return getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): - completion(.success(response.body!)) + completion(.success(response.body)) case let .failure(error): completion(.failure(error)) } @@ -163,7 +163,7 @@ open class StoreAPI { return placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - completion(.success(response.body!)) + completion(.success(response.body)) case let .failure(error): completion(.failure(error)) } 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 799e257924dc..bca3f08fe834 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 @@ -201,7 +201,7 @@ open class UserAPI { return getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): - completion(.success(response.body!)) + completion(.success(response.body)) case let .failure(error): completion(.failure(error)) } @@ -248,7 +248,7 @@ open class UserAPI { return loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): - completion(.success(response.body!)) + completion(.success(response.body)) case let .failure(error): completion(.failure(error)) } 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 96e26a20f7d6..e58029901670 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -33,15 +33,15 @@ public enum DecodableRequestBuilderError: Error { open class Response { public let statusCode: Int public let header: [String: String] - public let body: T? + public let body: T - public init(statusCode: Int, header: [String: String], body: T?) { + public init(statusCode: Int, header: [String: String], body: T) { self.statusCode = statusCode self.header = header self.body = body } - public convenience init(response: HTTPURLResponse, body: T?) { + public convenience init(response: HTTPURLResponse, body: T) { let rawHeader = response.allHeaderFields var header = [String: String]() for (key, value) in rawHeader { 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 24ab89eda79d..fe7fb6683bcf 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -200,60 +200,12 @@ 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 cachesDirectory = fileManager.urls(for: .cachesDirectory, in: .userDomainMask)[0] - let requestURL = try getURL(from: urlRequest) - - var requestPath = try getPath(from: requestURL) - - if let headerFileName = getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { - requestPath = requestPath.appending("/\(headerFileName)") - } else { - requestPath = requestPath.appending("/tmp.PetstoreClient.\(UUID().uuidString)") - } - - let filePath = cachesDirectory.appendingPathComponent(requestPath) - let directoryPath = filePath.deletingLastPathComponent().path - - try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) - try data.write(to: filePath, options: .atomic) - - completion(.success(Response(response: httpResponse, body: filePath as? T))) - - } catch let requestParserError as DownloadException { - completion(.failure(ErrorResponse.error(400, data, response, requestParserError))) - } catch { - completion(.failure(ErrorResponse.error(400, data, response, error))) - } - case is Void.Type: - completion(.success(Response(response: httpResponse, body: nil))) - - case is Data.Type: - - completion(.success(Response(response: httpResponse, body: data as? T))) + completion(.success(Response(response: httpResponse, body: () as! T))) default: - - completion(.success(Response(response: httpResponse, body: data as? T))) + fatalError("Unsupported Response Body Type - \(String(describing: T.self))") } } @@ -345,7 +297,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - completion(.success(Response(response: httpResponse, body: body as? T))) + completion(.success(Response(response: httpResponse, body: body as! T))) case is URL.Type: do { @@ -376,7 +328,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui 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))) + completion(.success(Response(response: httpResponse, body: filePath as! T))) } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, response, requestParserError))) @@ -386,11 +338,11 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui case is Void.Type: - completion(.success(Response(response: httpResponse, body: nil))) + completion(.success(Response(response: httpResponse, body: () as! T))) case is Data.Type: - completion(.success(Response(response: httpResponse, body: data as? T))) + completion(.success(Response(response: httpResponse, body: data as! T))) default: 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 bc8aa33bf499..34db22eeb118 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 @@ -25,7 +25,7 @@ open class AnotherFakeAPI { let task = call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - observer.onNext(response.body!) + observer.onNext(response.body) case let .failure(error): observer.onError(error) } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 2873a26ba834..7836542dbe09 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 @@ -24,7 +24,7 @@ open class FakeAPI { let task = fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - observer.onNext(response.body!) + observer.onNext(response.body) case let .failure(error): observer.onError(error) } @@ -72,7 +72,7 @@ open class FakeAPI { let task = fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - observer.onNext(response.body!) + observer.onNext(response.body) case let .failure(error): observer.onError(error) } @@ -120,7 +120,7 @@ open class FakeAPI { let task = fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - observer.onNext(response.body!) + observer.onNext(response.body) case let .failure(error): observer.onError(error) } @@ -168,7 +168,7 @@ open class FakeAPI { let task = fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - observer.onNext(response.body!) + observer.onNext(response.body) case let .failure(error): observer.onError(error) } @@ -317,7 +317,7 @@ open class FakeAPI { let task = testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - observer.onNext(response.body!) + observer.onNext(response.body) case let .failure(error): observer.onError(error) } 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 cffcafcba698..a19dd70dd44b 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 @@ -25,7 +25,7 @@ open class FakeClassnameTags123API { let task = testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - observer.onNext(response.body!) + observer.onNext(response.body) case let .failure(error): observer.onError(error) } 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 95d0a84b169d..1f346ba10199 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 @@ -143,7 +143,7 @@ open class PetAPI { let task = findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): - observer.onNext(response.body!) + observer.onNext(response.body) case let .failure(error): observer.onError(error) } @@ -200,7 +200,7 @@ open class PetAPI { let task = findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): - observer.onNext(response.body!) + observer.onNext(response.body) case let .failure(error): observer.onError(error) } @@ -257,7 +257,7 @@ open class PetAPI { let task = getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): - observer.onNext(response.body!) + observer.onNext(response.body) case let .failure(error): observer.onError(error) } @@ -432,7 +432,7 @@ open class PetAPI { let task = uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): - observer.onNext(response.body!) + observer.onNext(response.body) case let .failure(error): observer.onError(error) } @@ -497,7 +497,7 @@ open class PetAPI { let task = uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in switch result { case let .success(response): - observer.onNext(response.body!) + observer.onNext(response.body) case let .failure(error): observer.onError(error) } 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 829ebefaa984..09ef36156209 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 @@ -77,7 +77,7 @@ open class StoreAPI { let task = getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): - observer.onNext(response.body!) + observer.onNext(response.body) case let .failure(error): observer.onError(error) } @@ -129,7 +129,7 @@ open class StoreAPI { let task = getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): - observer.onNext(response.body!) + observer.onNext(response.body) case let .failure(error): observer.onError(error) } @@ -182,7 +182,7 @@ open class StoreAPI { let task = placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): - observer.onNext(response.body!) + observer.onNext(response.body) case let .failure(error): observer.onError(error) } 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 f00d31a838bc..be932ce5e321 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 @@ -226,7 +226,7 @@ open class UserAPI { let task = getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): - observer.onNext(response.body!) + observer.onNext(response.body) case let .failure(error): observer.onError(error) } @@ -279,7 +279,7 @@ open class UserAPI { let task = loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): - observer.onNext(response.body!) + observer.onNext(response.body) case let .failure(error): observer.onError(error) } 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 96e26a20f7d6..e58029901670 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -33,15 +33,15 @@ public enum DecodableRequestBuilderError: Error { open class Response { public let statusCode: Int public let header: [String: String] - public let body: T? + public let body: T - public init(statusCode: Int, header: [String: String], body: T?) { + public init(statusCode: Int, header: [String: String], body: T) { self.statusCode = statusCode self.header = header self.body = body } - public convenience init(response: HTTPURLResponse, body: T?) { + public convenience init(response: HTTPURLResponse, body: T) { let rawHeader = response.allHeaderFields var header = [String: String]() for (key, value) in rawHeader { 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 24ab89eda79d..fe7fb6683bcf 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -200,60 +200,12 @@ 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 cachesDirectory = fileManager.urls(for: .cachesDirectory, in: .userDomainMask)[0] - let requestURL = try getURL(from: urlRequest) - - var requestPath = try getPath(from: requestURL) - - if let headerFileName = getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { - requestPath = requestPath.appending("/\(headerFileName)") - } else { - requestPath = requestPath.appending("/tmp.PetstoreClient.\(UUID().uuidString)") - } - - let filePath = cachesDirectory.appendingPathComponent(requestPath) - let directoryPath = filePath.deletingLastPathComponent().path - - try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) - try data.write(to: filePath, options: .atomic) - - completion(.success(Response(response: httpResponse, body: filePath as? T))) - - } catch let requestParserError as DownloadException { - completion(.failure(ErrorResponse.error(400, data, response, requestParserError))) - } catch { - completion(.failure(ErrorResponse.error(400, data, response, error))) - } - case is Void.Type: - completion(.success(Response(response: httpResponse, body: nil))) - - case is Data.Type: - - completion(.success(Response(response: httpResponse, body: data as? T))) + completion(.success(Response(response: httpResponse, body: () as! T))) default: - - completion(.success(Response(response: httpResponse, body: data as? T))) + fatalError("Unsupported Response Body Type - \(String(describing: T.self))") } } @@ -345,7 +297,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - completion(.success(Response(response: httpResponse, body: body as? T))) + completion(.success(Response(response: httpResponse, body: body as! T))) case is URL.Type: do { @@ -376,7 +328,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui 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))) + completion(.success(Response(response: httpResponse, body: filePath as! T))) } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, response, requestParserError))) @@ -386,11 +338,11 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui case is Void.Type: - completion(.success(Response(response: httpResponse, body: nil))) + completion(.success(Response(response: httpResponse, body: () as! T))) case is Data.Type: - completion(.success(Response(response: httpResponse, body: data as? T))) + completion(.success(Response(response: httpResponse, body: data as! T))) default: diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models.swift index 96e26a20f7d6..e58029901670 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models.swift @@ -33,15 +33,15 @@ public enum DecodableRequestBuilderError: Error { open class Response { public let statusCode: Int public let header: [String: String] - public let body: T? + public let body: T - public init(statusCode: Int, header: [String: String], body: T?) { + public init(statusCode: Int, header: [String: String], body: T) { self.statusCode = statusCode self.header = header self.body = body } - public convenience init(response: HTTPURLResponse, body: T?) { + public convenience init(response: HTTPURLResponse, body: T) { let rawHeader = response.allHeaderFields var header = [String: String]() for (key, value) in rawHeader { diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift index 24ab89eda79d..fe7fb6683bcf 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift @@ -200,60 +200,12 @@ 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 cachesDirectory = fileManager.urls(for: .cachesDirectory, in: .userDomainMask)[0] - let requestURL = try getURL(from: urlRequest) - - var requestPath = try getPath(from: requestURL) - - if let headerFileName = getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { - requestPath = requestPath.appending("/\(headerFileName)") - } else { - requestPath = requestPath.appending("/tmp.PetstoreClient.\(UUID().uuidString)") - } - - let filePath = cachesDirectory.appendingPathComponent(requestPath) - let directoryPath = filePath.deletingLastPathComponent().path - - try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) - try data.write(to: filePath, options: .atomic) - - completion(.success(Response(response: httpResponse, body: filePath as? T))) - - } catch let requestParserError as DownloadException { - completion(.failure(ErrorResponse.error(400, data, response, requestParserError))) - } catch { - completion(.failure(ErrorResponse.error(400, data, response, error))) - } - case is Void.Type: - completion(.success(Response(response: httpResponse, body: nil))) - - case is Data.Type: - - completion(.success(Response(response: httpResponse, body: data as? T))) + completion(.success(Response(response: httpResponse, body: () as! T))) default: - - completion(.success(Response(response: httpResponse, body: data as? T))) + fatalError("Unsupported Response Body Type - \(String(describing: T.self))") } } @@ -345,7 +297,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - completion(.success(Response(response: httpResponse, body: body as? T))) + completion(.success(Response(response: httpResponse, body: body as! T))) case is URL.Type: do { @@ -376,7 +328,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui 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))) + completion(.success(Response(response: httpResponse, body: filePath as! T))) } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, response, requestParserError))) @@ -386,11 +338,11 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui case is Void.Type: - completion(.success(Response(response: httpResponse, body: nil))) + completion(.success(Response(response: httpResponse, body: () as! T))) case is Data.Type: - completion(.success(Response(response: httpResponse, body: data as? T))) + completion(.success(Response(response: httpResponse, body: data as! T))) default: diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models.swift index 96e26a20f7d6..e58029901670 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -33,15 +33,15 @@ public enum DecodableRequestBuilderError: Error { open class Response { public let statusCode: Int public let header: [String: String] - public let body: T? + public let body: T - public init(statusCode: Int, header: [String: String], body: T?) { + public init(statusCode: Int, header: [String: String], body: T) { self.statusCode = statusCode self.header = header self.body = body } - public convenience init(response: HTTPURLResponse, body: T?) { + public convenience init(response: HTTPURLResponse, body: T) { let rawHeader = response.allHeaderFields var header = [String: String]() for (key, value) in rawHeader { diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 24ab89eda79d..fe7fb6683bcf 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -200,60 +200,12 @@ 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 cachesDirectory = fileManager.urls(for: .cachesDirectory, in: .userDomainMask)[0] - let requestURL = try getURL(from: urlRequest) - - var requestPath = try getPath(from: requestURL) - - if let headerFileName = getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { - requestPath = requestPath.appending("/\(headerFileName)") - } else { - requestPath = requestPath.appending("/tmp.PetstoreClient.\(UUID().uuidString)") - } - - let filePath = cachesDirectory.appendingPathComponent(requestPath) - let directoryPath = filePath.deletingLastPathComponent().path - - try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) - try data.write(to: filePath, options: .atomic) - - completion(.success(Response(response: httpResponse, body: filePath as? T))) - - } catch let requestParserError as DownloadException { - completion(.failure(ErrorResponse.error(400, data, response, requestParserError))) - } catch { - completion(.failure(ErrorResponse.error(400, data, response, error))) - } - case is Void.Type: - completion(.success(Response(response: httpResponse, body: nil))) - - case is Data.Type: - - completion(.success(Response(response: httpResponse, body: data as? T))) + completion(.success(Response(response: httpResponse, body: () as! T))) default: - - completion(.success(Response(response: httpResponse, body: data as? T))) + fatalError("Unsupported Response Body Type - \(String(describing: T.self))") } } @@ -345,7 +297,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - completion(.success(Response(response: httpResponse, body: body as? T))) + completion(.success(Response(response: httpResponse, body: body as! T))) case is URL.Type: do { @@ -376,7 +328,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui 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))) + completion(.success(Response(response: httpResponse, body: filePath as! T))) } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, response, requestParserError))) @@ -386,11 +338,11 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui case is Void.Type: - completion(.success(Response(response: httpResponse, body: nil))) + completion(.success(Response(response: httpResponse, body: () as! T))) case is Data.Type: - completion(.success(Response(response: httpResponse, body: data as? T))) + completion(.success(Response(response: httpResponse, body: data as! T))) default: From e2ca42a614e6476701b87a94c05ddeb6e396c5f0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Nov 2021 15:35:54 +0800 Subject: [PATCH 024/117] Bump actions/cache from 2.1.6 to 2.1.7 (#10945) Bumps [actions/cache](https://github.com/actions/cache) from 2.1.6 to 2.1.7. - [Release notes](https://github.com/actions/cache/releases) - [Commits](https://github.com/actions/cache/compare/v2.1.6...v2.1.7) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/check-supported-versions.yaml | 4 ++-- .github/workflows/gradle-test.yaml | 4 ++-- .github/workflows/openapi-generator.yaml | 8 ++++---- .github/workflows/samples-dart.yaml | 8 ++++---- .github/workflows/samples-kotlin.yaml | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/check-supported-versions.yaml b/.github/workflows/check-supported-versions.yaml index 3702fd30fb4f..ba496f3ab5c3 100644 --- a/.github/workflows/check-supported-versions.yaml +++ b/.github/workflows/check-supported-versions.yaml @@ -29,14 +29,14 @@ jobs: distribution: 'adopt' java-version: ${{ matrix.java }} - - uses: actions/cache@v2.1.6 + - uses: actions/cache@v2.1.7 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml', 'modules/**/pom.xml') }} restore-keys: | ${{ runner.os }}-maven- - - uses: actions/cache@v2.1.6 + - uses: actions/cache@v2.1.7 with: path: | ~/.gradle/caches diff --git a/.github/workflows/gradle-test.yaml b/.github/workflows/gradle-test.yaml index 755ca996a155..6be454c68a6b 100644 --- a/.github/workflows/gradle-test.yaml +++ b/.github/workflows/gradle-test.yaml @@ -40,14 +40,14 @@ jobs: java-version: 11 # Cache Gradle Dependencies - name: Setup Gradle Dependencies Cache - uses: actions/cache@v2 + uses: actions/cache@v2.1.7 with: path: ~/.gradle/caches key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts') }} # Cache Gradle Wrapper - name: Setup Gradle Wrapper Cache - uses: actions/cache@v2 + uses: actions/cache@v2.1.7 with: path: ~/.gradle/wrapper key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} diff --git a/.github/workflows/openapi-generator.yaml b/.github/workflows/openapi-generator.yaml index aa1a94e21e91..a5defde9826d 100644 --- a/.github/workflows/openapi-generator.yaml +++ b/.github/workflows/openapi-generator.yaml @@ -21,7 +21,7 @@ jobs: with: java-version: 8 - name: Cache maven dependencies - uses: actions/cache@v2.1.6 + uses: actions/cache@v2.1.7 env: cache-name: cache-maven-repository with: @@ -56,7 +56,7 @@ jobs: with: java-version: 8 - name: Cache maven dependencies - uses: actions/cache@v2.1.6 + uses: actions/cache@v2.1.7 env: cache-name: cache-maven-repository with: @@ -162,7 +162,7 @@ jobs: with: java-version: 11 - name: Cache maven dependencies - uses: actions/cache@v2.1.6 + uses: actions/cache@v2.1.7 env: cache-name: cache-maven-repository with: @@ -194,7 +194,7 @@ jobs: with: java-version: 11 - name: Cache maven dependencies - uses: actions/cache@v2.1.6 + uses: actions/cache@v2.1.7 env: cache-name: cache-maven-repository with: diff --git a/.github/workflows/samples-dart.yaml b/.github/workflows/samples-dart.yaml index 47ae424394d4..e4c94f3f1255 100644 --- a/.github/workflows/samples-dart.yaml +++ b/.github/workflows/samples-dart.yaml @@ -23,7 +23,7 @@ jobs: distribution: 'adopt' java-version: 8 - name: Cache maven dependencies - uses: actions/cache@v2.1.6 + uses: actions/cache@v2.1.7 env: cache-name: maven-repository with: @@ -32,7 +32,7 @@ jobs: ~/.gradle key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} - name: Cache test dependencies - uses: actions/cache@v2.1.6 + uses: actions/cache@v2.1.7 env: cache-name: pub-cache with: @@ -56,7 +56,7 @@ jobs: distribution: 'adopt' java-version: 8 - name: Cache maven dependencies - uses: actions/cache@v2.1.6 + uses: actions/cache@v2.1.7 env: cache-name: maven-repository with: @@ -65,7 +65,7 @@ jobs: ~/.gradle key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} - name: Cache test dependencies - uses: actions/cache@v2.1.6 + uses: actions/cache@v2.1.7 env: cache-name: pub-cache with: diff --git a/.github/workflows/samples-kotlin.yaml b/.github/workflows/samples-kotlin.yaml index ddc46f801cb3..39a7ea7c9576 100644 --- a/.github/workflows/samples-kotlin.yaml +++ b/.github/workflows/samples-kotlin.yaml @@ -48,7 +48,7 @@ jobs: distribution: 'adopt' java-version: 8 - name: Cache maven dependencies - uses: actions/cache@v2.1.6 + uses: actions/cache@v2.1.7 env: cache-name: maven-repository with: From ca848871da40244c64f3737d247df55c144276b0 Mon Sep 17 00:00:00 2001 From: Tomasz Prus Date: Wed, 24 Nov 2021 08:54:25 +0100 Subject: [PATCH 025/117] [Python] Add missing Mock library for Python 2.7. (#10939) * [Python] Add missing Mock library for Python 2.7. * Update template for test-requirements.txt. --- .../resources/python-legacy/test-requirements.mustache | 7 ++++++- .../client/petstore/python-legacy/test-requirements.txt | 1 + .../client/petstore/python-legacy/tests/test_pet_api.py | 7 ++++++- .../client/petstore/python-legacy/test-requirements.txt | 1 + 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python-legacy/test-requirements.mustache b/modules/openapi-generator/src/main/resources/python-legacy/test-requirements.mustache index 12021b47a1c2..a697e6a9e714 100644 --- a/modules/openapi-generator/src/main/resources/python-legacy/test-requirements.mustache +++ b/modules/openapi-generator/src/main/resources/python-legacy/test-requirements.mustache @@ -9,4 +9,9 @@ randomize>=0.13 pytest~=4.6.7 # needed for python 2.7+3.4 pytest-cov>=2.8.1 pytest-randomly==1.2.3 # needed for python 2.7+3.4 -{{/useNose}} \ No newline at end of file +{{/useNose}} +{{^asyncio}} +{{^tornado}} +mock; python_version<'3.0' +{{/tornado}} +{{/asyncio}} diff --git a/samples/client/petstore/python-legacy/test-requirements.txt b/samples/client/petstore/python-legacy/test-requirements.txt index 4ed3991cbec1..96e37c87e984 100644 --- a/samples/client/petstore/python-legacy/test-requirements.txt +++ b/samples/client/petstore/python-legacy/test-requirements.txt @@ -1,3 +1,4 @@ pytest~=4.6.7 # needed for python 2.7+3.4 pytest-cov>=2.8.1 pytest-randomly==1.2.3 # needed for python 2.7+3.4 +mock; python_version<'3.0' diff --git a/samples/client/petstore/python-legacy/tests/test_pet_api.py b/samples/client/petstore/python-legacy/tests/test_pet_api.py index 4e894436d4b3..f18bdd2dd8f8 100644 --- a/samples/client/petstore/python-legacy/tests/test_pet_api.py +++ b/samples/client/petstore/python-legacy/tests/test_pet_api.py @@ -13,7 +13,12 @@ import os import unittest -from unittest.mock import patch + +try: + from unittest.mock import patch +except ImportError: + # Python 2.7 + from mock import patch import petstore_api from petstore_api import Configuration diff --git a/samples/openapi3/client/petstore/python-legacy/test-requirements.txt b/samples/openapi3/client/petstore/python-legacy/test-requirements.txt index 4ed3991cbec1..96e37c87e984 100755 --- a/samples/openapi3/client/petstore/python-legacy/test-requirements.txt +++ b/samples/openapi3/client/petstore/python-legacy/test-requirements.txt @@ -1,3 +1,4 @@ pytest~=4.6.7 # needed for python 2.7+3.4 pytest-cov>=2.8.1 pytest-randomly==1.2.3 # needed for python 2.7+3.4 +mock; python_version<'3.0' From af0babf892014357368cd46d7ed29293793e4efd Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 24 Nov 2021 16:14:29 +0800 Subject: [PATCH 026/117] [C#][netcore] various improvements in HttpSigningConfiguration.cs (#10941) * various improvements in HttpSigningConfiguration.cs * update returns in xml comments --- .../HttpSigningConfiguration.mustache | 94 ++++++++-------- .../Client/HttpSigningConfiguration.cs | 102 ++++++++++-------- .../Client/HttpSigningConfiguration.cs | 102 ++++++++++-------- .../Client/HttpSigningConfiguration.cs | 102 ++++++++++-------- .../Client/HttpSigningConfiguration.cs | 102 ++++++++++-------- .../Client/HttpSigningConfiguration.cs | 102 ++++++++++-------- .../Client/HttpSigningConfiguration.cs | 102 ++++++++++-------- 7 files changed, 391 insertions(+), 315 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/HttpSigningConfiguration.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/HttpSigningConfiguration.mustache index aa788ad62244..f80e584c6663 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/HttpSigningConfiguration.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/HttpSigningConfiguration.mustache @@ -1,3 +1,5 @@ +{{>partial_header}} + using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using System; @@ -82,7 +84,7 @@ namespace {{packageName}}.Client /// HTTP method /// Path /// Request options - /// + /// Http signed headers internal Dictionary GetHttpSignedHeader(string basePath,string method, string path, RequestOptions requestOptions) { const string HEADER_REQUEST_TARGET = "(request-target)"; @@ -133,7 +135,7 @@ namespace {{packageName}}.Client } else { - httpValues.Add(HttpUtility.UrlEncode(parameter.Key), parameter.Value[0]); + httpValues.Add(HttpUtility.UrlEncode(parameter.Key), parameter.Value[0]); } #else if (parameter.Value.Count > 1) @@ -178,7 +180,6 @@ namespace {{packageName}}.Client throw new Exception(string.Format("{0} not supported", HashAlgorithm)); } - foreach (var header in HttpSigningHeader) { if (header.Equals(HEADER_REQUEST_TARGET)) @@ -236,7 +237,6 @@ namespace {{packageName}}.Client foreach (var keyVal in HttpSignatureHeader) { headerValuesList.Add(string.Format("{0}: {1}", keyVal.Key, keyVal.Value)); - } //Concatenate headers value separated by new line var headerValuesString = string.Join("\n", headerValuesList); @@ -252,7 +252,11 @@ namespace {{packageName}}.Client { headerSignatureStr = GetECDSASignature(signatureStringHash); } - var cryptographicScheme = "hs2019"; + else + { + throw new Exception(string.Format("Private key type {0} not supported", keyType)); + } + const string cryptographicScheme = "hs2019"; var authorizationHeaderValue = string.Format("Signature keyId=\"{0}\",algorithm=\"{1}\"", KeyId, cryptographicScheme); @@ -268,9 +272,7 @@ namespace {{packageName}}.Client authorizationHeaderValue += string.Format(",headers=\"{0}\",signature=\"{1}\"", headersKeysString, headerSignatureStr); - HttpSignedRequestHeader.Add(HEADER_AUTHORIZATION, authorizationHeaderValue); - return HttpSignedRequestHeader; } @@ -302,14 +304,17 @@ namespace {{packageName}}.Client var signedbytes = rsa.SignHash(stringToSign, HashAlgorithm, RSASignaturePadding.Pkcs1); return Convert.ToBase64String(signedbytes); } - return string.Empty; + else + { + return string.Empty; + } } /// /// Gets the ECDSA signature /// /// - /// + /// ECDSA signature private string GetECDSASignature(byte[] dataToSign) { if (!File.Exists(KeyFilePath)) @@ -317,8 +322,8 @@ namespace {{packageName}}.Client throw new Exception("key file path does not exist."); } - var ecKeyHeader = "-----BEGIN EC PRIVATE KEY-----"; - var ecKeyFooter = "-----END EC PRIVATE KEY-----"; + const string ecKeyHeader = "-----BEGIN EC PRIVATE KEY-----"; + const string ecKeyFooter = "-----END EC PRIVATE KEY-----"; var keyStr = File.ReadAllText(KeyFilePath); var ecKeyBase64String = keyStr.Replace(ecKeyHeader, "").Replace(ecKeyFooter, "").Trim(); var keyBytes = System.Convert.FromBase64String(ecKeyBase64String); @@ -355,10 +360,9 @@ namespace {{packageName}}.Client #else throw new Exception("ECDSA signing is supported only on NETCOREAPP3_0 and above"); #endif - } - private byte[] ConvertToECDSAANS1Format(byte[] signedBytes) + private byte[] ConvertToECDSAANS1Format(byte[] signedBytes) { var derBytes = new List(); byte derLength = 68; //default length for ECDSA code signing bit 0x44 @@ -481,7 +485,7 @@ namespace {{packageName}}.Client byte[] salt = new byte[saltstr.Length / 2]; for (int i = 0; i < salt.Length; i++) salt[i] = Convert.ToByte(saltstr.Substring(i * 2, 2), 16); - if (!(str.ReadLine() == "")) + if (str.ReadLine() != "") { return null; } @@ -512,7 +516,7 @@ namespace {{packageName}}.Client private RSACryptoServiceProvider DecodeRSAPrivateKey(byte[] privkey) { - byte[] MODULUS, E, D, P, Q, DP, DQ, IQ; + byte[] bytesModulus, bytesE, bytesD, bytesP, bytesQ, bytesDP, bytesDQ, bytesIQ; // --------- Set up stream to decode the asn.1 encoded RSA private key ------ MemoryStream mem = new MemoryStream(privkey); @@ -549,40 +553,40 @@ namespace {{packageName}}.Client //------ all private key components are Integer sequences ---- elems = GetIntegerSize(binr); - MODULUS = binr.ReadBytes(elems); + bytesModulus = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - E = binr.ReadBytes(elems); + bytesE = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - D = binr.ReadBytes(elems); + bytesD = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - P = binr.ReadBytes(elems); + bytesP = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - Q = binr.ReadBytes(elems); + bytesQ = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - DP = binr.ReadBytes(elems); + bytesDP = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - DQ = binr.ReadBytes(elems); + bytesDQ = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - IQ = binr.ReadBytes(elems); + bytesIQ = binr.ReadBytes(elems); // ------- create RSACryptoServiceProvider instance and initialize with public key ----- RSACryptoServiceProvider RSA = new RSACryptoServiceProvider(); RSAParameters RSAparams = new RSAParameters(); - RSAparams.Modulus = MODULUS; - RSAparams.Exponent = E; - RSAparams.D = D; - RSAparams.P = P; - RSAparams.Q = Q; - RSAparams.DP = DP; - RSAparams.DQ = DQ; - RSAparams.InverseQ = IQ; + RSAparams.Modulus = bytesModulus; + RSAparams.Exponent = bytesE; + RSAparams.D = bytesD; + RSAparams.P = bytesP; + RSAparams.Q = bytesQ; + RSAparams.DP = bytesDP; + RSAparams.DQ = bytesDQ; + RSAparams.InverseQ = bytesIQ; RSA.ImportParameters(RSAparams); return RSA; } @@ -637,7 +641,7 @@ namespace {{packageName}}.Client private byte[] GetEncryptedKey(byte[] salt, SecureString secpswd, int count, int miter) { IntPtr unmanagedPswd = IntPtr.Zero; - int HASHLENGTH = 16; //MD5 bytes + const int HASHLENGTH = 16; //MD5 bytes byte[] keymaterial = new byte[HASHLENGTH * miter]; //to store concatenated Mi hashed results byte[] psbytes = new byte[secpswd.Length]; @@ -670,7 +674,9 @@ namespace {{packageName}}.Client } for (int i = 0; i < count; i++) + { result = md5.ComputeHash(result); + } Array.Copy(result, 0, keymaterial, j * HASHLENGTH, result.Length); //concatenate to keymaterial } byte[] deskey = new byte[24]; @@ -708,7 +714,7 @@ namespace {{packageName}}.Client /// Detect the key type from the pem file. /// /// key file path in pem format - /// + /// Private Key Type private PrivateKeyType GetKeyType(string keyFilePath) { if (!File.Exists(keyFilePath)) @@ -716,39 +722,37 @@ namespace {{packageName}}.Client throw new Exception("Key file path does not exist."); } - var ecPrivateKeyHeader = "BEGIN EC PRIVATE KEY"; - var ecPrivateKeyFooter = "END EC PRIVATE KEY"; - var rsaPrivateKeyHeader = "BEGIN RSA PRIVATE KEY"; - var rsaPrivateFooter = "END RSA PRIVATE KEY"; + const string ecPrivateKeyHeader = "BEGIN EC PRIVATE KEY"; + const string ecPrivateKeyFooter = "END EC PRIVATE KEY"; + const string rsaPrivateKeyHeader = "BEGIN RSA PRIVATE KEY"; + const string rsaPrivateFooter = "END RSA PRIVATE KEY"; //var pkcs8Header = "BEGIN PRIVATE KEY"; //var pkcs8Footer = "END PRIVATE KEY"; - var keyType = PrivateKeyType.None; + PrivateKeyType keyType; var key = File.ReadAllLines(keyFilePath); - if (key[0].ToString().Contains(rsaPrivateKeyHeader) && + if (key[0].Contains(rsaPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(rsaPrivateFooter)) { keyType = PrivateKeyType.RSA; } - else if (key[0].ToString().Contains(ecPrivateKeyHeader) && + else if (key[0].Contains(ecPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) { keyType = PrivateKeyType.ECDSA; } - else if (key[0].ToString().Contains(ecPrivateKeyHeader) && + else if (key[0].Contains(ecPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) { - /* this type of key can hold many type different types of private key, but here due lack of pem header - Considering this as EC key - */ + // this type of key can hold many type different types of private key, but here due lack of pem header + // Considering this as EC key //TODO :- update the key based on oid keyType = PrivateKeyType.ECDSA; } else { throw new Exception("Either the key is invalid or key is not supported"); - } return keyType; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs index 9293bc51d32d..f3eaf3c5ade3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -1,3 +1,13 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using System; @@ -82,7 +92,7 @@ private enum PrivateKeyType /// HTTP method /// Path /// Request options - /// + /// Http signed headers internal Dictionary GetHttpSignedHeader(string basePath,string method, string path, RequestOptions requestOptions) { const string HEADER_REQUEST_TARGET = "(request-target)"; @@ -133,7 +143,7 @@ internal Dictionary GetHttpSignedHeader(string basePath,string m } else { - httpValues.Add(HttpUtility.UrlEncode(parameter.Key), parameter.Value[0]); + httpValues.Add(HttpUtility.UrlEncode(parameter.Key), parameter.Value[0]); } #else if (parameter.Value.Count > 1) @@ -178,7 +188,6 @@ internal Dictionary GetHttpSignedHeader(string basePath,string m throw new Exception(string.Format("{0} not supported", HashAlgorithm)); } - foreach (var header in HttpSigningHeader) { if (header.Equals(HEADER_REQUEST_TARGET)) @@ -236,7 +245,6 @@ internal Dictionary GetHttpSignedHeader(string basePath,string m foreach (var keyVal in HttpSignatureHeader) { headerValuesList.Add(string.Format("{0}: {1}", keyVal.Key, keyVal.Value)); - } //Concatenate headers value separated by new line var headerValuesString = string.Join("\n", headerValuesList); @@ -252,7 +260,11 @@ internal Dictionary GetHttpSignedHeader(string basePath,string m { headerSignatureStr = GetECDSASignature(signatureStringHash); } - var cryptographicScheme = "hs2019"; + else + { + throw new Exception(string.Format("Private key type {0} not supported", keyType)); + } + const string cryptographicScheme = "hs2019"; var authorizationHeaderValue = string.Format("Signature keyId=\"{0}\",algorithm=\"{1}\"", KeyId, cryptographicScheme); @@ -268,9 +280,7 @@ internal Dictionary GetHttpSignedHeader(string basePath,string m authorizationHeaderValue += string.Format(",headers=\"{0}\",signature=\"{1}\"", headersKeysString, headerSignatureStr); - HttpSignedRequestHeader.Add(HEADER_AUTHORIZATION, authorizationHeaderValue); - return HttpSignedRequestHeader; } @@ -302,14 +312,17 @@ private string GetRSASignature(byte[] stringToSign) var signedbytes = rsa.SignHash(stringToSign, HashAlgorithm, RSASignaturePadding.Pkcs1); return Convert.ToBase64String(signedbytes); } - return string.Empty; + else + { + return string.Empty; + } } /// /// Gets the ECDSA signature /// /// - /// + /// ECDSA signature private string GetECDSASignature(byte[] dataToSign) { if (!File.Exists(KeyFilePath)) @@ -317,8 +330,8 @@ private string GetECDSASignature(byte[] dataToSign) throw new Exception("key file path does not exist."); } - var ecKeyHeader = "-----BEGIN EC PRIVATE KEY-----"; - var ecKeyFooter = "-----END EC PRIVATE KEY-----"; + const string ecKeyHeader = "-----BEGIN EC PRIVATE KEY-----"; + const string ecKeyFooter = "-----END EC PRIVATE KEY-----"; var keyStr = File.ReadAllText(KeyFilePath); var ecKeyBase64String = keyStr.Replace(ecKeyHeader, "").Replace(ecKeyFooter, "").Trim(); var keyBytes = System.Convert.FromBase64String(ecKeyBase64String); @@ -355,10 +368,9 @@ private string GetECDSASignature(byte[] dataToSign) #else throw new Exception("ECDSA signing is supported only on NETCOREAPP3_0 and above"); #endif - } - private byte[] ConvertToECDSAANS1Format(byte[] signedBytes) + private byte[] ConvertToECDSAANS1Format(byte[] signedBytes) { var derBytes = new List(); byte derLength = 68; //default length for ECDSA code signing bit 0x44 @@ -481,7 +493,7 @@ private byte[] ConvertPrivateKeyToBytes(string instr, SecureString keyPassPhrase byte[] salt = new byte[saltstr.Length / 2]; for (int i = 0; i < salt.Length; i++) salt[i] = Convert.ToByte(saltstr.Substring(i * 2, 2), 16); - if (!(str.ReadLine() == "")) + if (str.ReadLine() != "") { return null; } @@ -512,7 +524,7 @@ private byte[] ConvertPrivateKeyToBytes(string instr, SecureString keyPassPhrase private RSACryptoServiceProvider DecodeRSAPrivateKey(byte[] privkey) { - byte[] MODULUS, E, D, P, Q, DP, DQ, IQ; + byte[] bytesModulus, bytesE, bytesD, bytesP, bytesQ, bytesDP, bytesDQ, bytesIQ; // --------- Set up stream to decode the asn.1 encoded RSA private key ------ MemoryStream mem = new MemoryStream(privkey); @@ -549,40 +561,40 @@ private RSACryptoServiceProvider DecodeRSAPrivateKey(byte[] privkey) //------ all private key components are Integer sequences ---- elems = GetIntegerSize(binr); - MODULUS = binr.ReadBytes(elems); + bytesModulus = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - E = binr.ReadBytes(elems); + bytesE = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - D = binr.ReadBytes(elems); + bytesD = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - P = binr.ReadBytes(elems); + bytesP = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - Q = binr.ReadBytes(elems); + bytesQ = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - DP = binr.ReadBytes(elems); + bytesDP = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - DQ = binr.ReadBytes(elems); + bytesDQ = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - IQ = binr.ReadBytes(elems); + bytesIQ = binr.ReadBytes(elems); // ------- create RSACryptoServiceProvider instance and initialize with public key ----- RSACryptoServiceProvider RSA = new RSACryptoServiceProvider(); RSAParameters RSAparams = new RSAParameters(); - RSAparams.Modulus = MODULUS; - RSAparams.Exponent = E; - RSAparams.D = D; - RSAparams.P = P; - RSAparams.Q = Q; - RSAparams.DP = DP; - RSAparams.DQ = DQ; - RSAparams.InverseQ = IQ; + RSAparams.Modulus = bytesModulus; + RSAparams.Exponent = bytesE; + RSAparams.D = bytesD; + RSAparams.P = bytesP; + RSAparams.Q = bytesQ; + RSAparams.DP = bytesDP; + RSAparams.DQ = bytesDQ; + RSAparams.InverseQ = bytesIQ; RSA.ImportParameters(RSAparams); return RSA; } @@ -637,7 +649,7 @@ private int GetIntegerSize(BinaryReader binr) private byte[] GetEncryptedKey(byte[] salt, SecureString secpswd, int count, int miter) { IntPtr unmanagedPswd = IntPtr.Zero; - int HASHLENGTH = 16; //MD5 bytes + const int HASHLENGTH = 16; //MD5 bytes byte[] keymaterial = new byte[HASHLENGTH * miter]; //to store concatenated Mi hashed results byte[] psbytes = new byte[secpswd.Length]; @@ -670,7 +682,9 @@ private byte[] GetEncryptedKey(byte[] salt, SecureString secpswd, int count, int } for (int i = 0; i < count; i++) + { result = md5.ComputeHash(result); + } Array.Copy(result, 0, keymaterial, j * HASHLENGTH, result.Length); //concatenate to keymaterial } byte[] deskey = new byte[24]; @@ -708,7 +722,7 @@ private byte[] DecryptKey(byte[] cipherData, byte[] desKey, byte[] IV) /// Detect the key type from the pem file. /// /// key file path in pem format - /// + /// Private Key Type private PrivateKeyType GetKeyType(string keyFilePath) { if (!File.Exists(keyFilePath)) @@ -716,39 +730,37 @@ private PrivateKeyType GetKeyType(string keyFilePath) throw new Exception("Key file path does not exist."); } - var ecPrivateKeyHeader = "BEGIN EC PRIVATE KEY"; - var ecPrivateKeyFooter = "END EC PRIVATE KEY"; - var rsaPrivateKeyHeader = "BEGIN RSA PRIVATE KEY"; - var rsaPrivateFooter = "END RSA PRIVATE KEY"; + const string ecPrivateKeyHeader = "BEGIN EC PRIVATE KEY"; + const string ecPrivateKeyFooter = "END EC PRIVATE KEY"; + const string rsaPrivateKeyHeader = "BEGIN RSA PRIVATE KEY"; + const string rsaPrivateFooter = "END RSA PRIVATE KEY"; //var pkcs8Header = "BEGIN PRIVATE KEY"; //var pkcs8Footer = "END PRIVATE KEY"; - var keyType = PrivateKeyType.None; + PrivateKeyType keyType; var key = File.ReadAllLines(keyFilePath); - if (key[0].ToString().Contains(rsaPrivateKeyHeader) && + if (key[0].Contains(rsaPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(rsaPrivateFooter)) { keyType = PrivateKeyType.RSA; } - else if (key[0].ToString().Contains(ecPrivateKeyHeader) && + else if (key[0].Contains(ecPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) { keyType = PrivateKeyType.ECDSA; } - else if (key[0].ToString().Contains(ecPrivateKeyHeader) && + else if (key[0].Contains(ecPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) { - /* this type of key can hold many type different types of private key, but here due lack of pem header - Considering this as EC key - */ + // this type of key can hold many type different types of private key, but here due lack of pem header + // Considering this as EC key //TODO :- update the key based on oid keyType = PrivateKeyType.ECDSA; } else { throw new Exception("Either the key is invalid or key is not supported"); - } return keyType; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs index 9293bc51d32d..f3eaf3c5ade3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -1,3 +1,13 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using System; @@ -82,7 +92,7 @@ private enum PrivateKeyType /// HTTP method /// Path /// Request options - /// + /// Http signed headers internal Dictionary GetHttpSignedHeader(string basePath,string method, string path, RequestOptions requestOptions) { const string HEADER_REQUEST_TARGET = "(request-target)"; @@ -133,7 +143,7 @@ internal Dictionary GetHttpSignedHeader(string basePath,string m } else { - httpValues.Add(HttpUtility.UrlEncode(parameter.Key), parameter.Value[0]); + httpValues.Add(HttpUtility.UrlEncode(parameter.Key), parameter.Value[0]); } #else if (parameter.Value.Count > 1) @@ -178,7 +188,6 @@ internal Dictionary GetHttpSignedHeader(string basePath,string m throw new Exception(string.Format("{0} not supported", HashAlgorithm)); } - foreach (var header in HttpSigningHeader) { if (header.Equals(HEADER_REQUEST_TARGET)) @@ -236,7 +245,6 @@ internal Dictionary GetHttpSignedHeader(string basePath,string m foreach (var keyVal in HttpSignatureHeader) { headerValuesList.Add(string.Format("{0}: {1}", keyVal.Key, keyVal.Value)); - } //Concatenate headers value separated by new line var headerValuesString = string.Join("\n", headerValuesList); @@ -252,7 +260,11 @@ internal Dictionary GetHttpSignedHeader(string basePath,string m { headerSignatureStr = GetECDSASignature(signatureStringHash); } - var cryptographicScheme = "hs2019"; + else + { + throw new Exception(string.Format("Private key type {0} not supported", keyType)); + } + const string cryptographicScheme = "hs2019"; var authorizationHeaderValue = string.Format("Signature keyId=\"{0}\",algorithm=\"{1}\"", KeyId, cryptographicScheme); @@ -268,9 +280,7 @@ internal Dictionary GetHttpSignedHeader(string basePath,string m authorizationHeaderValue += string.Format(",headers=\"{0}\",signature=\"{1}\"", headersKeysString, headerSignatureStr); - HttpSignedRequestHeader.Add(HEADER_AUTHORIZATION, authorizationHeaderValue); - return HttpSignedRequestHeader; } @@ -302,14 +312,17 @@ private string GetRSASignature(byte[] stringToSign) var signedbytes = rsa.SignHash(stringToSign, HashAlgorithm, RSASignaturePadding.Pkcs1); return Convert.ToBase64String(signedbytes); } - return string.Empty; + else + { + return string.Empty; + } } /// /// Gets the ECDSA signature /// /// - /// + /// ECDSA signature private string GetECDSASignature(byte[] dataToSign) { if (!File.Exists(KeyFilePath)) @@ -317,8 +330,8 @@ private string GetECDSASignature(byte[] dataToSign) throw new Exception("key file path does not exist."); } - var ecKeyHeader = "-----BEGIN EC PRIVATE KEY-----"; - var ecKeyFooter = "-----END EC PRIVATE KEY-----"; + const string ecKeyHeader = "-----BEGIN EC PRIVATE KEY-----"; + const string ecKeyFooter = "-----END EC PRIVATE KEY-----"; var keyStr = File.ReadAllText(KeyFilePath); var ecKeyBase64String = keyStr.Replace(ecKeyHeader, "").Replace(ecKeyFooter, "").Trim(); var keyBytes = System.Convert.FromBase64String(ecKeyBase64String); @@ -355,10 +368,9 @@ private string GetECDSASignature(byte[] dataToSign) #else throw new Exception("ECDSA signing is supported only on NETCOREAPP3_0 and above"); #endif - } - private byte[] ConvertToECDSAANS1Format(byte[] signedBytes) + private byte[] ConvertToECDSAANS1Format(byte[] signedBytes) { var derBytes = new List(); byte derLength = 68; //default length for ECDSA code signing bit 0x44 @@ -481,7 +493,7 @@ private byte[] ConvertPrivateKeyToBytes(string instr, SecureString keyPassPhrase byte[] salt = new byte[saltstr.Length / 2]; for (int i = 0; i < salt.Length; i++) salt[i] = Convert.ToByte(saltstr.Substring(i * 2, 2), 16); - if (!(str.ReadLine() == "")) + if (str.ReadLine() != "") { return null; } @@ -512,7 +524,7 @@ private byte[] ConvertPrivateKeyToBytes(string instr, SecureString keyPassPhrase private RSACryptoServiceProvider DecodeRSAPrivateKey(byte[] privkey) { - byte[] MODULUS, E, D, P, Q, DP, DQ, IQ; + byte[] bytesModulus, bytesE, bytesD, bytesP, bytesQ, bytesDP, bytesDQ, bytesIQ; // --------- Set up stream to decode the asn.1 encoded RSA private key ------ MemoryStream mem = new MemoryStream(privkey); @@ -549,40 +561,40 @@ private RSACryptoServiceProvider DecodeRSAPrivateKey(byte[] privkey) //------ all private key components are Integer sequences ---- elems = GetIntegerSize(binr); - MODULUS = binr.ReadBytes(elems); + bytesModulus = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - E = binr.ReadBytes(elems); + bytesE = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - D = binr.ReadBytes(elems); + bytesD = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - P = binr.ReadBytes(elems); + bytesP = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - Q = binr.ReadBytes(elems); + bytesQ = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - DP = binr.ReadBytes(elems); + bytesDP = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - DQ = binr.ReadBytes(elems); + bytesDQ = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - IQ = binr.ReadBytes(elems); + bytesIQ = binr.ReadBytes(elems); // ------- create RSACryptoServiceProvider instance and initialize with public key ----- RSACryptoServiceProvider RSA = new RSACryptoServiceProvider(); RSAParameters RSAparams = new RSAParameters(); - RSAparams.Modulus = MODULUS; - RSAparams.Exponent = E; - RSAparams.D = D; - RSAparams.P = P; - RSAparams.Q = Q; - RSAparams.DP = DP; - RSAparams.DQ = DQ; - RSAparams.InverseQ = IQ; + RSAparams.Modulus = bytesModulus; + RSAparams.Exponent = bytesE; + RSAparams.D = bytesD; + RSAparams.P = bytesP; + RSAparams.Q = bytesQ; + RSAparams.DP = bytesDP; + RSAparams.DQ = bytesDQ; + RSAparams.InverseQ = bytesIQ; RSA.ImportParameters(RSAparams); return RSA; } @@ -637,7 +649,7 @@ private int GetIntegerSize(BinaryReader binr) private byte[] GetEncryptedKey(byte[] salt, SecureString secpswd, int count, int miter) { IntPtr unmanagedPswd = IntPtr.Zero; - int HASHLENGTH = 16; //MD5 bytes + const int HASHLENGTH = 16; //MD5 bytes byte[] keymaterial = new byte[HASHLENGTH * miter]; //to store concatenated Mi hashed results byte[] psbytes = new byte[secpswd.Length]; @@ -670,7 +682,9 @@ private byte[] GetEncryptedKey(byte[] salt, SecureString secpswd, int count, int } for (int i = 0; i < count; i++) + { result = md5.ComputeHash(result); + } Array.Copy(result, 0, keymaterial, j * HASHLENGTH, result.Length); //concatenate to keymaterial } byte[] deskey = new byte[24]; @@ -708,7 +722,7 @@ private byte[] DecryptKey(byte[] cipherData, byte[] desKey, byte[] IV) /// Detect the key type from the pem file. /// /// key file path in pem format - /// + /// Private Key Type private PrivateKeyType GetKeyType(string keyFilePath) { if (!File.Exists(keyFilePath)) @@ -716,39 +730,37 @@ private PrivateKeyType GetKeyType(string keyFilePath) throw new Exception("Key file path does not exist."); } - var ecPrivateKeyHeader = "BEGIN EC PRIVATE KEY"; - var ecPrivateKeyFooter = "END EC PRIVATE KEY"; - var rsaPrivateKeyHeader = "BEGIN RSA PRIVATE KEY"; - var rsaPrivateFooter = "END RSA PRIVATE KEY"; + const string ecPrivateKeyHeader = "BEGIN EC PRIVATE KEY"; + const string ecPrivateKeyFooter = "END EC PRIVATE KEY"; + const string rsaPrivateKeyHeader = "BEGIN RSA PRIVATE KEY"; + const string rsaPrivateFooter = "END RSA PRIVATE KEY"; //var pkcs8Header = "BEGIN PRIVATE KEY"; //var pkcs8Footer = "END PRIVATE KEY"; - var keyType = PrivateKeyType.None; + PrivateKeyType keyType; var key = File.ReadAllLines(keyFilePath); - if (key[0].ToString().Contains(rsaPrivateKeyHeader) && + if (key[0].Contains(rsaPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(rsaPrivateFooter)) { keyType = PrivateKeyType.RSA; } - else if (key[0].ToString().Contains(ecPrivateKeyHeader) && + else if (key[0].Contains(ecPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) { keyType = PrivateKeyType.ECDSA; } - else if (key[0].ToString().Contains(ecPrivateKeyHeader) && + else if (key[0].Contains(ecPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) { - /* this type of key can hold many type different types of private key, but here due lack of pem header - Considering this as EC key - */ + // this type of key can hold many type different types of private key, but here due lack of pem header + // Considering this as EC key //TODO :- update the key based on oid keyType = PrivateKeyType.ECDSA; } else { throw new Exception("Either the key is invalid or key is not supported"); - } return keyType; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs index 9293bc51d32d..f3eaf3c5ade3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -1,3 +1,13 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using System; @@ -82,7 +92,7 @@ private enum PrivateKeyType /// HTTP method /// Path /// Request options - /// + /// Http signed headers internal Dictionary GetHttpSignedHeader(string basePath,string method, string path, RequestOptions requestOptions) { const string HEADER_REQUEST_TARGET = "(request-target)"; @@ -133,7 +143,7 @@ internal Dictionary GetHttpSignedHeader(string basePath,string m } else { - httpValues.Add(HttpUtility.UrlEncode(parameter.Key), parameter.Value[0]); + httpValues.Add(HttpUtility.UrlEncode(parameter.Key), parameter.Value[0]); } #else if (parameter.Value.Count > 1) @@ -178,7 +188,6 @@ internal Dictionary GetHttpSignedHeader(string basePath,string m throw new Exception(string.Format("{0} not supported", HashAlgorithm)); } - foreach (var header in HttpSigningHeader) { if (header.Equals(HEADER_REQUEST_TARGET)) @@ -236,7 +245,6 @@ internal Dictionary GetHttpSignedHeader(string basePath,string m foreach (var keyVal in HttpSignatureHeader) { headerValuesList.Add(string.Format("{0}: {1}", keyVal.Key, keyVal.Value)); - } //Concatenate headers value separated by new line var headerValuesString = string.Join("\n", headerValuesList); @@ -252,7 +260,11 @@ internal Dictionary GetHttpSignedHeader(string basePath,string m { headerSignatureStr = GetECDSASignature(signatureStringHash); } - var cryptographicScheme = "hs2019"; + else + { + throw new Exception(string.Format("Private key type {0} not supported", keyType)); + } + const string cryptographicScheme = "hs2019"; var authorizationHeaderValue = string.Format("Signature keyId=\"{0}\",algorithm=\"{1}\"", KeyId, cryptographicScheme); @@ -268,9 +280,7 @@ internal Dictionary GetHttpSignedHeader(string basePath,string m authorizationHeaderValue += string.Format(",headers=\"{0}\",signature=\"{1}\"", headersKeysString, headerSignatureStr); - HttpSignedRequestHeader.Add(HEADER_AUTHORIZATION, authorizationHeaderValue); - return HttpSignedRequestHeader; } @@ -302,14 +312,17 @@ private string GetRSASignature(byte[] stringToSign) var signedbytes = rsa.SignHash(stringToSign, HashAlgorithm, RSASignaturePadding.Pkcs1); return Convert.ToBase64String(signedbytes); } - return string.Empty; + else + { + return string.Empty; + } } /// /// Gets the ECDSA signature /// /// - /// + /// ECDSA signature private string GetECDSASignature(byte[] dataToSign) { if (!File.Exists(KeyFilePath)) @@ -317,8 +330,8 @@ private string GetECDSASignature(byte[] dataToSign) throw new Exception("key file path does not exist."); } - var ecKeyHeader = "-----BEGIN EC PRIVATE KEY-----"; - var ecKeyFooter = "-----END EC PRIVATE KEY-----"; + const string ecKeyHeader = "-----BEGIN EC PRIVATE KEY-----"; + const string ecKeyFooter = "-----END EC PRIVATE KEY-----"; var keyStr = File.ReadAllText(KeyFilePath); var ecKeyBase64String = keyStr.Replace(ecKeyHeader, "").Replace(ecKeyFooter, "").Trim(); var keyBytes = System.Convert.FromBase64String(ecKeyBase64String); @@ -355,10 +368,9 @@ private string GetECDSASignature(byte[] dataToSign) #else throw new Exception("ECDSA signing is supported only on NETCOREAPP3_0 and above"); #endif - } - private byte[] ConvertToECDSAANS1Format(byte[] signedBytes) + private byte[] ConvertToECDSAANS1Format(byte[] signedBytes) { var derBytes = new List(); byte derLength = 68; //default length for ECDSA code signing bit 0x44 @@ -481,7 +493,7 @@ private byte[] ConvertPrivateKeyToBytes(string instr, SecureString keyPassPhrase byte[] salt = new byte[saltstr.Length / 2]; for (int i = 0; i < salt.Length; i++) salt[i] = Convert.ToByte(saltstr.Substring(i * 2, 2), 16); - if (!(str.ReadLine() == "")) + if (str.ReadLine() != "") { return null; } @@ -512,7 +524,7 @@ private byte[] ConvertPrivateKeyToBytes(string instr, SecureString keyPassPhrase private RSACryptoServiceProvider DecodeRSAPrivateKey(byte[] privkey) { - byte[] MODULUS, E, D, P, Q, DP, DQ, IQ; + byte[] bytesModulus, bytesE, bytesD, bytesP, bytesQ, bytesDP, bytesDQ, bytesIQ; // --------- Set up stream to decode the asn.1 encoded RSA private key ------ MemoryStream mem = new MemoryStream(privkey); @@ -549,40 +561,40 @@ private RSACryptoServiceProvider DecodeRSAPrivateKey(byte[] privkey) //------ all private key components are Integer sequences ---- elems = GetIntegerSize(binr); - MODULUS = binr.ReadBytes(elems); + bytesModulus = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - E = binr.ReadBytes(elems); + bytesE = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - D = binr.ReadBytes(elems); + bytesD = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - P = binr.ReadBytes(elems); + bytesP = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - Q = binr.ReadBytes(elems); + bytesQ = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - DP = binr.ReadBytes(elems); + bytesDP = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - DQ = binr.ReadBytes(elems); + bytesDQ = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - IQ = binr.ReadBytes(elems); + bytesIQ = binr.ReadBytes(elems); // ------- create RSACryptoServiceProvider instance and initialize with public key ----- RSACryptoServiceProvider RSA = new RSACryptoServiceProvider(); RSAParameters RSAparams = new RSAParameters(); - RSAparams.Modulus = MODULUS; - RSAparams.Exponent = E; - RSAparams.D = D; - RSAparams.P = P; - RSAparams.Q = Q; - RSAparams.DP = DP; - RSAparams.DQ = DQ; - RSAparams.InverseQ = IQ; + RSAparams.Modulus = bytesModulus; + RSAparams.Exponent = bytesE; + RSAparams.D = bytesD; + RSAparams.P = bytesP; + RSAparams.Q = bytesQ; + RSAparams.DP = bytesDP; + RSAparams.DQ = bytesDQ; + RSAparams.InverseQ = bytesIQ; RSA.ImportParameters(RSAparams); return RSA; } @@ -637,7 +649,7 @@ private int GetIntegerSize(BinaryReader binr) private byte[] GetEncryptedKey(byte[] salt, SecureString secpswd, int count, int miter) { IntPtr unmanagedPswd = IntPtr.Zero; - int HASHLENGTH = 16; //MD5 bytes + const int HASHLENGTH = 16; //MD5 bytes byte[] keymaterial = new byte[HASHLENGTH * miter]; //to store concatenated Mi hashed results byte[] psbytes = new byte[secpswd.Length]; @@ -670,7 +682,9 @@ private byte[] GetEncryptedKey(byte[] salt, SecureString secpswd, int count, int } for (int i = 0; i < count; i++) + { result = md5.ComputeHash(result); + } Array.Copy(result, 0, keymaterial, j * HASHLENGTH, result.Length); //concatenate to keymaterial } byte[] deskey = new byte[24]; @@ -708,7 +722,7 @@ private byte[] DecryptKey(byte[] cipherData, byte[] desKey, byte[] IV) /// Detect the key type from the pem file. /// /// key file path in pem format - /// + /// Private Key Type private PrivateKeyType GetKeyType(string keyFilePath) { if (!File.Exists(keyFilePath)) @@ -716,39 +730,37 @@ private PrivateKeyType GetKeyType(string keyFilePath) throw new Exception("Key file path does not exist."); } - var ecPrivateKeyHeader = "BEGIN EC PRIVATE KEY"; - var ecPrivateKeyFooter = "END EC PRIVATE KEY"; - var rsaPrivateKeyHeader = "BEGIN RSA PRIVATE KEY"; - var rsaPrivateFooter = "END RSA PRIVATE KEY"; + const string ecPrivateKeyHeader = "BEGIN EC PRIVATE KEY"; + const string ecPrivateKeyFooter = "END EC PRIVATE KEY"; + const string rsaPrivateKeyHeader = "BEGIN RSA PRIVATE KEY"; + const string rsaPrivateFooter = "END RSA PRIVATE KEY"; //var pkcs8Header = "BEGIN PRIVATE KEY"; //var pkcs8Footer = "END PRIVATE KEY"; - var keyType = PrivateKeyType.None; + PrivateKeyType keyType; var key = File.ReadAllLines(keyFilePath); - if (key[0].ToString().Contains(rsaPrivateKeyHeader) && + if (key[0].Contains(rsaPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(rsaPrivateFooter)) { keyType = PrivateKeyType.RSA; } - else if (key[0].ToString().Contains(ecPrivateKeyHeader) && + else if (key[0].Contains(ecPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) { keyType = PrivateKeyType.ECDSA; } - else if (key[0].ToString().Contains(ecPrivateKeyHeader) && + else if (key[0].Contains(ecPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) { - /* this type of key can hold many type different types of private key, but here due lack of pem header - Considering this as EC key - */ + // this type of key can hold many type different types of private key, but here due lack of pem header + // Considering this as EC key //TODO :- update the key based on oid keyType = PrivateKeyType.ECDSA; } else { throw new Exception("Either the key is invalid or key is not supported"); - } return keyType; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs index 9293bc51d32d..f3eaf3c5ade3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -1,3 +1,13 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using System; @@ -82,7 +92,7 @@ private enum PrivateKeyType /// HTTP method /// Path /// Request options - /// + /// Http signed headers internal Dictionary GetHttpSignedHeader(string basePath,string method, string path, RequestOptions requestOptions) { const string HEADER_REQUEST_TARGET = "(request-target)"; @@ -133,7 +143,7 @@ internal Dictionary GetHttpSignedHeader(string basePath,string m } else { - httpValues.Add(HttpUtility.UrlEncode(parameter.Key), parameter.Value[0]); + httpValues.Add(HttpUtility.UrlEncode(parameter.Key), parameter.Value[0]); } #else if (parameter.Value.Count > 1) @@ -178,7 +188,6 @@ internal Dictionary GetHttpSignedHeader(string basePath,string m throw new Exception(string.Format("{0} not supported", HashAlgorithm)); } - foreach (var header in HttpSigningHeader) { if (header.Equals(HEADER_REQUEST_TARGET)) @@ -236,7 +245,6 @@ internal Dictionary GetHttpSignedHeader(string basePath,string m foreach (var keyVal in HttpSignatureHeader) { headerValuesList.Add(string.Format("{0}: {1}", keyVal.Key, keyVal.Value)); - } //Concatenate headers value separated by new line var headerValuesString = string.Join("\n", headerValuesList); @@ -252,7 +260,11 @@ internal Dictionary GetHttpSignedHeader(string basePath,string m { headerSignatureStr = GetECDSASignature(signatureStringHash); } - var cryptographicScheme = "hs2019"; + else + { + throw new Exception(string.Format("Private key type {0} not supported", keyType)); + } + const string cryptographicScheme = "hs2019"; var authorizationHeaderValue = string.Format("Signature keyId=\"{0}\",algorithm=\"{1}\"", KeyId, cryptographicScheme); @@ -268,9 +280,7 @@ internal Dictionary GetHttpSignedHeader(string basePath,string m authorizationHeaderValue += string.Format(",headers=\"{0}\",signature=\"{1}\"", headersKeysString, headerSignatureStr); - HttpSignedRequestHeader.Add(HEADER_AUTHORIZATION, authorizationHeaderValue); - return HttpSignedRequestHeader; } @@ -302,14 +312,17 @@ private string GetRSASignature(byte[] stringToSign) var signedbytes = rsa.SignHash(stringToSign, HashAlgorithm, RSASignaturePadding.Pkcs1); return Convert.ToBase64String(signedbytes); } - return string.Empty; + else + { + return string.Empty; + } } /// /// Gets the ECDSA signature /// /// - /// + /// ECDSA signature private string GetECDSASignature(byte[] dataToSign) { if (!File.Exists(KeyFilePath)) @@ -317,8 +330,8 @@ private string GetECDSASignature(byte[] dataToSign) throw new Exception("key file path does not exist."); } - var ecKeyHeader = "-----BEGIN EC PRIVATE KEY-----"; - var ecKeyFooter = "-----END EC PRIVATE KEY-----"; + const string ecKeyHeader = "-----BEGIN EC PRIVATE KEY-----"; + const string ecKeyFooter = "-----END EC PRIVATE KEY-----"; var keyStr = File.ReadAllText(KeyFilePath); var ecKeyBase64String = keyStr.Replace(ecKeyHeader, "").Replace(ecKeyFooter, "").Trim(); var keyBytes = System.Convert.FromBase64String(ecKeyBase64String); @@ -355,10 +368,9 @@ private string GetECDSASignature(byte[] dataToSign) #else throw new Exception("ECDSA signing is supported only on NETCOREAPP3_0 and above"); #endif - } - private byte[] ConvertToECDSAANS1Format(byte[] signedBytes) + private byte[] ConvertToECDSAANS1Format(byte[] signedBytes) { var derBytes = new List(); byte derLength = 68; //default length for ECDSA code signing bit 0x44 @@ -481,7 +493,7 @@ private byte[] ConvertPrivateKeyToBytes(string instr, SecureString keyPassPhrase byte[] salt = new byte[saltstr.Length / 2]; for (int i = 0; i < salt.Length; i++) salt[i] = Convert.ToByte(saltstr.Substring(i * 2, 2), 16); - if (!(str.ReadLine() == "")) + if (str.ReadLine() != "") { return null; } @@ -512,7 +524,7 @@ private byte[] ConvertPrivateKeyToBytes(string instr, SecureString keyPassPhrase private RSACryptoServiceProvider DecodeRSAPrivateKey(byte[] privkey) { - byte[] MODULUS, E, D, P, Q, DP, DQ, IQ; + byte[] bytesModulus, bytesE, bytesD, bytesP, bytesQ, bytesDP, bytesDQ, bytesIQ; // --------- Set up stream to decode the asn.1 encoded RSA private key ------ MemoryStream mem = new MemoryStream(privkey); @@ -549,40 +561,40 @@ private RSACryptoServiceProvider DecodeRSAPrivateKey(byte[] privkey) //------ all private key components are Integer sequences ---- elems = GetIntegerSize(binr); - MODULUS = binr.ReadBytes(elems); + bytesModulus = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - E = binr.ReadBytes(elems); + bytesE = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - D = binr.ReadBytes(elems); + bytesD = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - P = binr.ReadBytes(elems); + bytesP = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - Q = binr.ReadBytes(elems); + bytesQ = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - DP = binr.ReadBytes(elems); + bytesDP = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - DQ = binr.ReadBytes(elems); + bytesDQ = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - IQ = binr.ReadBytes(elems); + bytesIQ = binr.ReadBytes(elems); // ------- create RSACryptoServiceProvider instance and initialize with public key ----- RSACryptoServiceProvider RSA = new RSACryptoServiceProvider(); RSAParameters RSAparams = new RSAParameters(); - RSAparams.Modulus = MODULUS; - RSAparams.Exponent = E; - RSAparams.D = D; - RSAparams.P = P; - RSAparams.Q = Q; - RSAparams.DP = DP; - RSAparams.DQ = DQ; - RSAparams.InverseQ = IQ; + RSAparams.Modulus = bytesModulus; + RSAparams.Exponent = bytesE; + RSAparams.D = bytesD; + RSAparams.P = bytesP; + RSAparams.Q = bytesQ; + RSAparams.DP = bytesDP; + RSAparams.DQ = bytesDQ; + RSAparams.InverseQ = bytesIQ; RSA.ImportParameters(RSAparams); return RSA; } @@ -637,7 +649,7 @@ private int GetIntegerSize(BinaryReader binr) private byte[] GetEncryptedKey(byte[] salt, SecureString secpswd, int count, int miter) { IntPtr unmanagedPswd = IntPtr.Zero; - int HASHLENGTH = 16; //MD5 bytes + const int HASHLENGTH = 16; //MD5 bytes byte[] keymaterial = new byte[HASHLENGTH * miter]; //to store concatenated Mi hashed results byte[] psbytes = new byte[secpswd.Length]; @@ -670,7 +682,9 @@ private byte[] GetEncryptedKey(byte[] salt, SecureString secpswd, int count, int } for (int i = 0; i < count; i++) + { result = md5.ComputeHash(result); + } Array.Copy(result, 0, keymaterial, j * HASHLENGTH, result.Length); //concatenate to keymaterial } byte[] deskey = new byte[24]; @@ -708,7 +722,7 @@ private byte[] DecryptKey(byte[] cipherData, byte[] desKey, byte[] IV) /// Detect the key type from the pem file. /// /// key file path in pem format - /// + /// Private Key Type private PrivateKeyType GetKeyType(string keyFilePath) { if (!File.Exists(keyFilePath)) @@ -716,39 +730,37 @@ private PrivateKeyType GetKeyType(string keyFilePath) throw new Exception("Key file path does not exist."); } - var ecPrivateKeyHeader = "BEGIN EC PRIVATE KEY"; - var ecPrivateKeyFooter = "END EC PRIVATE KEY"; - var rsaPrivateKeyHeader = "BEGIN RSA PRIVATE KEY"; - var rsaPrivateFooter = "END RSA PRIVATE KEY"; + const string ecPrivateKeyHeader = "BEGIN EC PRIVATE KEY"; + const string ecPrivateKeyFooter = "END EC PRIVATE KEY"; + const string rsaPrivateKeyHeader = "BEGIN RSA PRIVATE KEY"; + const string rsaPrivateFooter = "END RSA PRIVATE KEY"; //var pkcs8Header = "BEGIN PRIVATE KEY"; //var pkcs8Footer = "END PRIVATE KEY"; - var keyType = PrivateKeyType.None; + PrivateKeyType keyType; var key = File.ReadAllLines(keyFilePath); - if (key[0].ToString().Contains(rsaPrivateKeyHeader) && + if (key[0].Contains(rsaPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(rsaPrivateFooter)) { keyType = PrivateKeyType.RSA; } - else if (key[0].ToString().Contains(ecPrivateKeyHeader) && + else if (key[0].Contains(ecPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) { keyType = PrivateKeyType.ECDSA; } - else if (key[0].ToString().Contains(ecPrivateKeyHeader) && + else if (key[0].Contains(ecPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) { - /* this type of key can hold many type different types of private key, but here due lack of pem header - Considering this as EC key - */ + // this type of key can hold many type different types of private key, but here due lack of pem header + // Considering this as EC key //TODO :- update the key based on oid keyType = PrivateKeyType.ECDSA; } else { throw new Exception("Either the key is invalid or key is not supported"); - } return keyType; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs index 9293bc51d32d..f3eaf3c5ade3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -1,3 +1,13 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using System; @@ -82,7 +92,7 @@ private enum PrivateKeyType /// HTTP method /// Path /// Request options - /// + /// Http signed headers internal Dictionary GetHttpSignedHeader(string basePath,string method, string path, RequestOptions requestOptions) { const string HEADER_REQUEST_TARGET = "(request-target)"; @@ -133,7 +143,7 @@ internal Dictionary GetHttpSignedHeader(string basePath,string m } else { - httpValues.Add(HttpUtility.UrlEncode(parameter.Key), parameter.Value[0]); + httpValues.Add(HttpUtility.UrlEncode(parameter.Key), parameter.Value[0]); } #else if (parameter.Value.Count > 1) @@ -178,7 +188,6 @@ internal Dictionary GetHttpSignedHeader(string basePath,string m throw new Exception(string.Format("{0} not supported", HashAlgorithm)); } - foreach (var header in HttpSigningHeader) { if (header.Equals(HEADER_REQUEST_TARGET)) @@ -236,7 +245,6 @@ internal Dictionary GetHttpSignedHeader(string basePath,string m foreach (var keyVal in HttpSignatureHeader) { headerValuesList.Add(string.Format("{0}: {1}", keyVal.Key, keyVal.Value)); - } //Concatenate headers value separated by new line var headerValuesString = string.Join("\n", headerValuesList); @@ -252,7 +260,11 @@ internal Dictionary GetHttpSignedHeader(string basePath,string m { headerSignatureStr = GetECDSASignature(signatureStringHash); } - var cryptographicScheme = "hs2019"; + else + { + throw new Exception(string.Format("Private key type {0} not supported", keyType)); + } + const string cryptographicScheme = "hs2019"; var authorizationHeaderValue = string.Format("Signature keyId=\"{0}\",algorithm=\"{1}\"", KeyId, cryptographicScheme); @@ -268,9 +280,7 @@ internal Dictionary GetHttpSignedHeader(string basePath,string m authorizationHeaderValue += string.Format(",headers=\"{0}\",signature=\"{1}\"", headersKeysString, headerSignatureStr); - HttpSignedRequestHeader.Add(HEADER_AUTHORIZATION, authorizationHeaderValue); - return HttpSignedRequestHeader; } @@ -302,14 +312,17 @@ private string GetRSASignature(byte[] stringToSign) var signedbytes = rsa.SignHash(stringToSign, HashAlgorithm, RSASignaturePadding.Pkcs1); return Convert.ToBase64String(signedbytes); } - return string.Empty; + else + { + return string.Empty; + } } /// /// Gets the ECDSA signature /// /// - /// + /// ECDSA signature private string GetECDSASignature(byte[] dataToSign) { if (!File.Exists(KeyFilePath)) @@ -317,8 +330,8 @@ private string GetECDSASignature(byte[] dataToSign) throw new Exception("key file path does not exist."); } - var ecKeyHeader = "-----BEGIN EC PRIVATE KEY-----"; - var ecKeyFooter = "-----END EC PRIVATE KEY-----"; + const string ecKeyHeader = "-----BEGIN EC PRIVATE KEY-----"; + const string ecKeyFooter = "-----END EC PRIVATE KEY-----"; var keyStr = File.ReadAllText(KeyFilePath); var ecKeyBase64String = keyStr.Replace(ecKeyHeader, "").Replace(ecKeyFooter, "").Trim(); var keyBytes = System.Convert.FromBase64String(ecKeyBase64String); @@ -355,10 +368,9 @@ private string GetECDSASignature(byte[] dataToSign) #else throw new Exception("ECDSA signing is supported only on NETCOREAPP3_0 and above"); #endif - } - private byte[] ConvertToECDSAANS1Format(byte[] signedBytes) + private byte[] ConvertToECDSAANS1Format(byte[] signedBytes) { var derBytes = new List(); byte derLength = 68; //default length for ECDSA code signing bit 0x44 @@ -481,7 +493,7 @@ private byte[] ConvertPrivateKeyToBytes(string instr, SecureString keyPassPhrase byte[] salt = new byte[saltstr.Length / 2]; for (int i = 0; i < salt.Length; i++) salt[i] = Convert.ToByte(saltstr.Substring(i * 2, 2), 16); - if (!(str.ReadLine() == "")) + if (str.ReadLine() != "") { return null; } @@ -512,7 +524,7 @@ private byte[] ConvertPrivateKeyToBytes(string instr, SecureString keyPassPhrase private RSACryptoServiceProvider DecodeRSAPrivateKey(byte[] privkey) { - byte[] MODULUS, E, D, P, Q, DP, DQ, IQ; + byte[] bytesModulus, bytesE, bytesD, bytesP, bytesQ, bytesDP, bytesDQ, bytesIQ; // --------- Set up stream to decode the asn.1 encoded RSA private key ------ MemoryStream mem = new MemoryStream(privkey); @@ -549,40 +561,40 @@ private RSACryptoServiceProvider DecodeRSAPrivateKey(byte[] privkey) //------ all private key components are Integer sequences ---- elems = GetIntegerSize(binr); - MODULUS = binr.ReadBytes(elems); + bytesModulus = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - E = binr.ReadBytes(elems); + bytesE = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - D = binr.ReadBytes(elems); + bytesD = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - P = binr.ReadBytes(elems); + bytesP = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - Q = binr.ReadBytes(elems); + bytesQ = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - DP = binr.ReadBytes(elems); + bytesDP = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - DQ = binr.ReadBytes(elems); + bytesDQ = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - IQ = binr.ReadBytes(elems); + bytesIQ = binr.ReadBytes(elems); // ------- create RSACryptoServiceProvider instance and initialize with public key ----- RSACryptoServiceProvider RSA = new RSACryptoServiceProvider(); RSAParameters RSAparams = new RSAParameters(); - RSAparams.Modulus = MODULUS; - RSAparams.Exponent = E; - RSAparams.D = D; - RSAparams.P = P; - RSAparams.Q = Q; - RSAparams.DP = DP; - RSAparams.DQ = DQ; - RSAparams.InverseQ = IQ; + RSAparams.Modulus = bytesModulus; + RSAparams.Exponent = bytesE; + RSAparams.D = bytesD; + RSAparams.P = bytesP; + RSAparams.Q = bytesQ; + RSAparams.DP = bytesDP; + RSAparams.DQ = bytesDQ; + RSAparams.InverseQ = bytesIQ; RSA.ImportParameters(RSAparams); return RSA; } @@ -637,7 +649,7 @@ private int GetIntegerSize(BinaryReader binr) private byte[] GetEncryptedKey(byte[] salt, SecureString secpswd, int count, int miter) { IntPtr unmanagedPswd = IntPtr.Zero; - int HASHLENGTH = 16; //MD5 bytes + const int HASHLENGTH = 16; //MD5 bytes byte[] keymaterial = new byte[HASHLENGTH * miter]; //to store concatenated Mi hashed results byte[] psbytes = new byte[secpswd.Length]; @@ -670,7 +682,9 @@ private byte[] GetEncryptedKey(byte[] salt, SecureString secpswd, int count, int } for (int i = 0; i < count; i++) + { result = md5.ComputeHash(result); + } Array.Copy(result, 0, keymaterial, j * HASHLENGTH, result.Length); //concatenate to keymaterial } byte[] deskey = new byte[24]; @@ -708,7 +722,7 @@ private byte[] DecryptKey(byte[] cipherData, byte[] desKey, byte[] IV) /// Detect the key type from the pem file. /// /// key file path in pem format - /// + /// Private Key Type private PrivateKeyType GetKeyType(string keyFilePath) { if (!File.Exists(keyFilePath)) @@ -716,39 +730,37 @@ private PrivateKeyType GetKeyType(string keyFilePath) throw new Exception("Key file path does not exist."); } - var ecPrivateKeyHeader = "BEGIN EC PRIVATE KEY"; - var ecPrivateKeyFooter = "END EC PRIVATE KEY"; - var rsaPrivateKeyHeader = "BEGIN RSA PRIVATE KEY"; - var rsaPrivateFooter = "END RSA PRIVATE KEY"; + const string ecPrivateKeyHeader = "BEGIN EC PRIVATE KEY"; + const string ecPrivateKeyFooter = "END EC PRIVATE KEY"; + const string rsaPrivateKeyHeader = "BEGIN RSA PRIVATE KEY"; + const string rsaPrivateFooter = "END RSA PRIVATE KEY"; //var pkcs8Header = "BEGIN PRIVATE KEY"; //var pkcs8Footer = "END PRIVATE KEY"; - var keyType = PrivateKeyType.None; + PrivateKeyType keyType; var key = File.ReadAllLines(keyFilePath); - if (key[0].ToString().Contains(rsaPrivateKeyHeader) && + if (key[0].Contains(rsaPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(rsaPrivateFooter)) { keyType = PrivateKeyType.RSA; } - else if (key[0].ToString().Contains(ecPrivateKeyHeader) && + else if (key[0].Contains(ecPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) { keyType = PrivateKeyType.ECDSA; } - else if (key[0].ToString().Contains(ecPrivateKeyHeader) && + else if (key[0].Contains(ecPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) { - /* this type of key can hold many type different types of private key, but here due lack of pem header - Considering this as EC key - */ + // this type of key can hold many type different types of private key, but here due lack of pem header + // Considering this as EC key //TODO :- update the key based on oid keyType = PrivateKeyType.ECDSA; } else { throw new Exception("Either the key is invalid or key is not supported"); - } return keyType; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs index 9293bc51d32d..f3eaf3c5ade3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -1,3 +1,13 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using System; @@ -82,7 +92,7 @@ private enum PrivateKeyType /// HTTP method /// Path /// Request options - /// + /// Http signed headers internal Dictionary GetHttpSignedHeader(string basePath,string method, string path, RequestOptions requestOptions) { const string HEADER_REQUEST_TARGET = "(request-target)"; @@ -133,7 +143,7 @@ internal Dictionary GetHttpSignedHeader(string basePath,string m } else { - httpValues.Add(HttpUtility.UrlEncode(parameter.Key), parameter.Value[0]); + httpValues.Add(HttpUtility.UrlEncode(parameter.Key), parameter.Value[0]); } #else if (parameter.Value.Count > 1) @@ -178,7 +188,6 @@ internal Dictionary GetHttpSignedHeader(string basePath,string m throw new Exception(string.Format("{0} not supported", HashAlgorithm)); } - foreach (var header in HttpSigningHeader) { if (header.Equals(HEADER_REQUEST_TARGET)) @@ -236,7 +245,6 @@ internal Dictionary GetHttpSignedHeader(string basePath,string m foreach (var keyVal in HttpSignatureHeader) { headerValuesList.Add(string.Format("{0}: {1}", keyVal.Key, keyVal.Value)); - } //Concatenate headers value separated by new line var headerValuesString = string.Join("\n", headerValuesList); @@ -252,7 +260,11 @@ internal Dictionary GetHttpSignedHeader(string basePath,string m { headerSignatureStr = GetECDSASignature(signatureStringHash); } - var cryptographicScheme = "hs2019"; + else + { + throw new Exception(string.Format("Private key type {0} not supported", keyType)); + } + const string cryptographicScheme = "hs2019"; var authorizationHeaderValue = string.Format("Signature keyId=\"{0}\",algorithm=\"{1}\"", KeyId, cryptographicScheme); @@ -268,9 +280,7 @@ internal Dictionary GetHttpSignedHeader(string basePath,string m authorizationHeaderValue += string.Format(",headers=\"{0}\",signature=\"{1}\"", headersKeysString, headerSignatureStr); - HttpSignedRequestHeader.Add(HEADER_AUTHORIZATION, authorizationHeaderValue); - return HttpSignedRequestHeader; } @@ -302,14 +312,17 @@ private string GetRSASignature(byte[] stringToSign) var signedbytes = rsa.SignHash(stringToSign, HashAlgorithm, RSASignaturePadding.Pkcs1); return Convert.ToBase64String(signedbytes); } - return string.Empty; + else + { + return string.Empty; + } } /// /// Gets the ECDSA signature /// /// - /// + /// ECDSA signature private string GetECDSASignature(byte[] dataToSign) { if (!File.Exists(KeyFilePath)) @@ -317,8 +330,8 @@ private string GetECDSASignature(byte[] dataToSign) throw new Exception("key file path does not exist."); } - var ecKeyHeader = "-----BEGIN EC PRIVATE KEY-----"; - var ecKeyFooter = "-----END EC PRIVATE KEY-----"; + const string ecKeyHeader = "-----BEGIN EC PRIVATE KEY-----"; + const string ecKeyFooter = "-----END EC PRIVATE KEY-----"; var keyStr = File.ReadAllText(KeyFilePath); var ecKeyBase64String = keyStr.Replace(ecKeyHeader, "").Replace(ecKeyFooter, "").Trim(); var keyBytes = System.Convert.FromBase64String(ecKeyBase64String); @@ -355,10 +368,9 @@ private string GetECDSASignature(byte[] dataToSign) #else throw new Exception("ECDSA signing is supported only on NETCOREAPP3_0 and above"); #endif - } - private byte[] ConvertToECDSAANS1Format(byte[] signedBytes) + private byte[] ConvertToECDSAANS1Format(byte[] signedBytes) { var derBytes = new List(); byte derLength = 68; //default length for ECDSA code signing bit 0x44 @@ -481,7 +493,7 @@ private byte[] ConvertPrivateKeyToBytes(string instr, SecureString keyPassPhrase byte[] salt = new byte[saltstr.Length / 2]; for (int i = 0; i < salt.Length; i++) salt[i] = Convert.ToByte(saltstr.Substring(i * 2, 2), 16); - if (!(str.ReadLine() == "")) + if (str.ReadLine() != "") { return null; } @@ -512,7 +524,7 @@ private byte[] ConvertPrivateKeyToBytes(string instr, SecureString keyPassPhrase private RSACryptoServiceProvider DecodeRSAPrivateKey(byte[] privkey) { - byte[] MODULUS, E, D, P, Q, DP, DQ, IQ; + byte[] bytesModulus, bytesE, bytesD, bytesP, bytesQ, bytesDP, bytesDQ, bytesIQ; // --------- Set up stream to decode the asn.1 encoded RSA private key ------ MemoryStream mem = new MemoryStream(privkey); @@ -549,40 +561,40 @@ private RSACryptoServiceProvider DecodeRSAPrivateKey(byte[] privkey) //------ all private key components are Integer sequences ---- elems = GetIntegerSize(binr); - MODULUS = binr.ReadBytes(elems); + bytesModulus = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - E = binr.ReadBytes(elems); + bytesE = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - D = binr.ReadBytes(elems); + bytesD = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - P = binr.ReadBytes(elems); + bytesP = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - Q = binr.ReadBytes(elems); + bytesQ = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - DP = binr.ReadBytes(elems); + bytesDP = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - DQ = binr.ReadBytes(elems); + bytesDQ = binr.ReadBytes(elems); elems = GetIntegerSize(binr); - IQ = binr.ReadBytes(elems); + bytesIQ = binr.ReadBytes(elems); // ------- create RSACryptoServiceProvider instance and initialize with public key ----- RSACryptoServiceProvider RSA = new RSACryptoServiceProvider(); RSAParameters RSAparams = new RSAParameters(); - RSAparams.Modulus = MODULUS; - RSAparams.Exponent = E; - RSAparams.D = D; - RSAparams.P = P; - RSAparams.Q = Q; - RSAparams.DP = DP; - RSAparams.DQ = DQ; - RSAparams.InverseQ = IQ; + RSAparams.Modulus = bytesModulus; + RSAparams.Exponent = bytesE; + RSAparams.D = bytesD; + RSAparams.P = bytesP; + RSAparams.Q = bytesQ; + RSAparams.DP = bytesDP; + RSAparams.DQ = bytesDQ; + RSAparams.InverseQ = bytesIQ; RSA.ImportParameters(RSAparams); return RSA; } @@ -637,7 +649,7 @@ private int GetIntegerSize(BinaryReader binr) private byte[] GetEncryptedKey(byte[] salt, SecureString secpswd, int count, int miter) { IntPtr unmanagedPswd = IntPtr.Zero; - int HASHLENGTH = 16; //MD5 bytes + const int HASHLENGTH = 16; //MD5 bytes byte[] keymaterial = new byte[HASHLENGTH * miter]; //to store concatenated Mi hashed results byte[] psbytes = new byte[secpswd.Length]; @@ -670,7 +682,9 @@ private byte[] GetEncryptedKey(byte[] salt, SecureString secpswd, int count, int } for (int i = 0; i < count; i++) + { result = md5.ComputeHash(result); + } Array.Copy(result, 0, keymaterial, j * HASHLENGTH, result.Length); //concatenate to keymaterial } byte[] deskey = new byte[24]; @@ -708,7 +722,7 @@ private byte[] DecryptKey(byte[] cipherData, byte[] desKey, byte[] IV) /// Detect the key type from the pem file. /// /// key file path in pem format - /// + /// Private Key Type private PrivateKeyType GetKeyType(string keyFilePath) { if (!File.Exists(keyFilePath)) @@ -716,39 +730,37 @@ private PrivateKeyType GetKeyType(string keyFilePath) throw new Exception("Key file path does not exist."); } - var ecPrivateKeyHeader = "BEGIN EC PRIVATE KEY"; - var ecPrivateKeyFooter = "END EC PRIVATE KEY"; - var rsaPrivateKeyHeader = "BEGIN RSA PRIVATE KEY"; - var rsaPrivateFooter = "END RSA PRIVATE KEY"; + const string ecPrivateKeyHeader = "BEGIN EC PRIVATE KEY"; + const string ecPrivateKeyFooter = "END EC PRIVATE KEY"; + const string rsaPrivateKeyHeader = "BEGIN RSA PRIVATE KEY"; + const string rsaPrivateFooter = "END RSA PRIVATE KEY"; //var pkcs8Header = "BEGIN PRIVATE KEY"; //var pkcs8Footer = "END PRIVATE KEY"; - var keyType = PrivateKeyType.None; + PrivateKeyType keyType; var key = File.ReadAllLines(keyFilePath); - if (key[0].ToString().Contains(rsaPrivateKeyHeader) && + if (key[0].Contains(rsaPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(rsaPrivateFooter)) { keyType = PrivateKeyType.RSA; } - else if (key[0].ToString().Contains(ecPrivateKeyHeader) && + else if (key[0].Contains(ecPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) { keyType = PrivateKeyType.ECDSA; } - else if (key[0].ToString().Contains(ecPrivateKeyHeader) && + else if (key[0].Contains(ecPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) { - /* this type of key can hold many type different types of private key, but here due lack of pem header - Considering this as EC key - */ + // this type of key can hold many type different types of private key, but here due lack of pem header + // Considering this as EC key //TODO :- update the key based on oid keyType = PrivateKeyType.ECDSA; } else { throw new Exception("Either the key is invalid or key is not supported"); - } return keyType; } From d01ad0524c4cf8f602f6305826ded1173e83d387 Mon Sep 17 00:00:00 2001 From: Sheldon Young Date: Wed, 24 Nov 2021 01:20:44 -0800 Subject: [PATCH 027/117] [rust] Update to modern hyper and futures crates (#9919) * [rust] Update to modern hyper and futures crates * [rust] Update to modern hyper and futures crates --- .../src/main/resources/rust/Cargo.mustache | 6 +- .../main/resources/rust/hyper/api.mustache | 25 ++- .../resources/rust/hyper/api_mod.mustache | 48 ++-- .../main/resources/rust/hyper/client.mustache | 3 +- .../rust/hyper/configuration.mustache | 8 +- .../src/main/resources/rust/request.rs | 205 +++++++++--------- .../petstore/rust/hyper/petstore/Cargo.toml | 6 +- .../rust/hyper/petstore/src/apis/client.rs | 3 +- .../hyper/petstore/src/apis/configuration.rs | 8 +- .../rust/hyper/petstore/src/apis/mod.rs | 48 ++-- .../rust/hyper/petstore/src/apis/pet_api.rs | 69 +++--- .../rust/hyper/petstore/src/apis/request.rs | 205 +++++++++--------- .../rust/hyper/petstore/src/apis/store_api.rs | 41 ++-- .../rust/hyper/petstore/src/apis/user_api.rs | 99 ++++----- 14 files changed, 389 insertions(+), 385 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/rust/Cargo.mustache b/modules/openapi-generator/src/main/resources/rust/Cargo.mustache index 53c02a6f2862..f8da736d4328 100644 --- a/modules/openapi-generator/src/main/resources/rust/Cargo.mustache +++ b/modules/openapi-generator/src/main/resources/rust/Cargo.mustache @@ -10,10 +10,12 @@ serde_derive = "^1.0" serde_json = "^1.0" url = "^2.2" {{#hyper}} -hyper = "~0.11" +hyper = { version = "~0.14", features = ["full"] } +hyper-tls = "~0.5" +http = "~0.2" serde_yaml = "0.7" base64 = "~0.7.0" -futures = "0.1.23" +futures = "^0.3" {{/hyper}} {{#reqwest}} {{^supportAsync}} diff --git a/modules/openapi-generator/src/main/resources/rust/hyper/api.mustache b/modules/openapi-generator/src/main/resources/rust/hyper/api.mustache index e2833f16ed90..a055014fb5c0 100644 --- a/modules/openapi-generator/src/main/resources/rust/hyper/api.mustache +++ b/modules/openapi-generator/src/main/resources/rust/hyper/api.mustache @@ -1,21 +1,23 @@ {{>partial_header}} use std::rc::Rc; use std::borrow::Borrow; +use std::pin::Pin; #[allow(unused_imports)] use std::option::Option; use hyper; -use serde_json; use futures::Future; use super::{Error, configuration}; use super::request as __internal_request; -pub struct {{{classname}}}Client { +pub struct {{{classname}}}Client + where C: Clone + std::marker::Send + Sync + 'static { configuration: Rc>, } -impl {{{classname}}}Client { +impl {{{classname}}}Client + where C: Clone + std::marker::Send + Sync { pub fn new(configuration: Rc>) -> {{{classname}}}Client { {{{classname}}}Client { configuration, @@ -26,16 +28,18 @@ impl {{{classname}}}Client { pub trait {{{classname}}} { {{#operations}} {{#operation}} - fn {{{operationId}}}(&self, {{#allParams}}{{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}&str{{/isString}}{{#isUuid}}&str{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}crate::models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Box>>; + fn {{{operationId}}}(&self, {{#allParams}}{{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}&str{{/isString}}{{#isUuid}}&str{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}crate::models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Pin>>>; {{/operation}} {{/operations}} } -impl{{{classname}}} for {{{classname}}}Client { -{{#operations}} -{{#operation}} - fn {{{operationId}}}(&self, {{#allParams}}{{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}{{^isUuid}}&str{{/isUuid}}{{/isString}}{{#isUuid}}&str{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}crate::models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Box>> { - let mut req = __internal_request::Request::new(hyper::Method::{{{httpMethod}}}, "{{{path}}}".to_string()) +impl{{{classname}}} for {{{classname}}}Client + where C: Clone + std::marker::Send + Sync { + {{#operations}} + {{#operation}} + #[allow(unused_mut)] + fn {{{operationId}}}(&self, {{#allParams}}{{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}&str{{/isString}}{{#isUuid}}&str{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}crate::models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::{{{httpMethod.toUpperCase}}}, "{{{path}}}".to_string()) {{#hasAuthMethods}} {{#authMethods}} {{#isApiKey}} @@ -68,7 +72,8 @@ impl{{{classname}}} for {{{classname}}}Client { {{/required}} {{^required}} if let Some(ref s) = {{{paramName}}} { - req = req.with_query_param("{{{baseName}}}".to_string(), s{{#isArray}}.join(","){{/isArray}}.to_string()); + let query_value = {{#isArray}}s.iter().map(|s| s.to_string()).collect::>().join(","){{/isArray}}{{^isArray}}s.to_string(){{/isArray}}; + req = req.with_query_param("{{{baseName}}}".to_string(), query_value); } {{/required}} {{/queryParams}} diff --git a/modules/openapi-generator/src/main/resources/rust/hyper/api_mod.mustache b/modules/openapi-generator/src/main/resources/rust/hyper/api_mod.mustache index 4f220c93d56f..8314cb60b07b 100644 --- a/modules/openapi-generator/src/main/resources/rust/hyper/api_mod.mustache +++ b/modules/openapi-generator/src/main/resources/rust/hyper/api_mod.mustache @@ -1,49 +1,45 @@ +use http; use hyper; -use serde; use serde_json; #[derive(Debug)] -pub enum Error { - UriError(hyper::error::UriError), +pub enum Error { + Api(ApiError), + Header(hyper::http::header::InvalidHeaderValue), + Http(http::Error), Hyper(hyper::Error), Serde(serde_json::Error), - ApiError(ApiError), + UriError(http::uri::InvalidUri), } #[derive(Debug)] -pub struct ApiError { +pub struct ApiError { pub code: hyper::StatusCode, - pub content: Option, + pub body: hyper::body::Body, } -impl<'de, T> From<(hyper::StatusCode, &'de [u8])> for Error - where T: serde::Deserialize<'de> { - fn from(e: (hyper::StatusCode, &'de [u8])) -> Self { - if e.1.len() == 0 { - return Error::ApiError(ApiError{ - code: e.0, - content: None, - }); - } - match serde_json::from_slice::(e.1) { - Ok(t) => Error::ApiError(ApiError{ - code: e.0, - content: Some(t), - }), - Err(e) => { - Error::from(e) - } - } +impl From<(hyper::StatusCode, hyper::body::Body)> for Error { + fn from(e: (hyper::StatusCode, hyper::body::Body)) -> Self { + Error::Api(ApiError { + code: e.0, + body: e.1, + }) } } -impl From for Error { +impl From for Error { + fn from(e: http::Error) -> Self { + return Error::Http(e) + } +} + +impl From for Error { fn from(e: hyper::Error) -> Self { return Error::Hyper(e) } } -impl From for Error { +impl From for Error { fn from(e: serde_json::Error) -> Self { return Error::Serde(e) } diff --git a/modules/openapi-generator/src/main/resources/rust/hyper/client.mustache b/modules/openapi-generator/src/main/resources/rust/hyper/client.mustache index 5b3bcf85c75e..25124d94b36a 100644 --- a/modules/openapi-generator/src/main/resources/rust/hyper/client.mustache +++ b/modules/openapi-generator/src/main/resources/rust/hyper/client.mustache @@ -18,7 +18,8 @@ pub struct APIClient { } impl APIClient { - pub fn new(configuration: Configuration) -> APIClient { + pub fn new(configuration: Configuration) -> APIClient + where C: Clone + std::marker::Send + Sync + 'static { let rc = Rc::new(configuration); APIClient { diff --git a/modules/openapi-generator/src/main/resources/rust/hyper/configuration.mustache b/modules/openapi-generator/src/main/resources/rust/hyper/configuration.mustache index adb51d6e92c2..ee6f407d31b1 100644 --- a/modules/openapi-generator/src/main/resources/rust/hyper/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/rust/hyper/configuration.mustache @@ -1,7 +1,8 @@ {{>partial_header}} use hyper; -pub struct Configuration { +pub struct Configuration + where C: Clone + std::marker::Send + Sync + 'static { pub base_path: String, pub user_agent: Option, pub client: hyper::client::Client, @@ -18,12 +19,13 @@ pub struct ApiKey { pub key: String, } -impl Configuration { +impl Configuration + where C: Clone + std::marker::Send + Sync { pub fn new(client: hyper::client::Client) -> Configuration { Configuration { base_path: "{{{basePath}}}".to_owned(), user_agent: {{#httpUserAgent}}Some("{{{.}}}".to_owned()){{/httpUserAgent}}{{^httpUserAgent}}Some("OpenAPI-Generator/{{{version}}}/rust".to_owned()){{/httpUserAgent}}, - client: client, + client, basic_auth: None, oauth_access_token: None, api_key: None, diff --git a/modules/openapi-generator/src/main/resources/rust/request.rs b/modules/openapi-generator/src/main/resources/rust/request.rs index f97b5277196a..0aa51fa0c592 100644 --- a/modules/openapi-generator/src/main/resources/rust/request.rs +++ b/modules/openapi-generator/src/main/resources/rust/request.rs @@ -1,14 +1,16 @@ -use std::borrow::Cow; use std::collections::HashMap; +use std::pin::Pin; -use super::{configuration, Error}; use futures; -use futures::{Future, Stream}; +use futures::Future; +use futures::future::*; use hyper; -use hyper::header::UserAgent; +use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, HeaderValue, USER_AGENT}; use serde; use serde_json; +use super::{configuration, Error}; + pub(crate) struct ApiKey { pub in_header: bool, pub in_query: bool, @@ -32,8 +34,11 @@ pub(crate) enum Auth { Oauth, } +/// If the authorization type is unspecified then it will be automatically detected based +/// on the configuration. This functionality is useful when the OpenAPI definition does not +/// include an authorization scheme. pub(crate) struct Request { - auth: Auth, + auth: Option, method: hyper::Method, path: String, query_params: HashMap, @@ -48,9 +53,9 @@ pub(crate) struct Request { impl Request { pub fn new(method: hyper::Method, path: String) -> Self { Request { - auth: Auth::None, - method: method, - path: path, + auth: None, + method, + path, query_params: HashMap::new(), path_params: HashMap::new(), form_params: HashMap::new(), @@ -91,24 +96,20 @@ impl Request { } pub fn with_auth(mut self, auth: Auth) -> Self { - self.auth = auth; + self.auth = Some(auth); self } pub fn execute<'a, C, U>( self, conf: &configuration::Configuration, - ) -> Box> + 'a> - where - C: hyper::client::Connect, - U: Sized + 'a, - for<'de> U: serde::Deserialize<'de>, + ) -> Pin> + 'a>> + where + C: hyper::client::connect::Connect + Clone + std::marker::Send + Sync, + U: Sized + std::marker::Send + 'a, + for<'de> U: serde::Deserialize<'de>, { let mut query_string = ::url::form_urlencoded::Serializer::new("".to_owned()); - // raw_headers is for headers we don't know the proper type of (e.g. custom api key - // headers); headers is for ones we do know the type of. - let mut raw_headers = HashMap::new(); - let mut headers: hyper::header::Headers = hyper::header::Headers::new(); let mut path = self.path; for (k, v) in self.path_params { @@ -116,15 +117,39 @@ impl Request { path = path.replace(&format!("{{{}}}", k), &v); } - for (k, v) in self.header_params { - raw_headers.insert(k, v); - } - for (key, val) in self.query_params { query_string.append_pair(&key, &val); } - match self.auth { + let mut uri_str = format!("{}{}", conf.base_path, path); + + let query_string_str = query_string.finish(); + if query_string_str != "" { + uri_str += "?"; + uri_str += &query_string_str; + } + let uri: hyper::Uri = match uri_str.parse() { + Err(e) => return Box::pin(futures::future::err(Error::UriError(e))), + Ok(u) => u, + }; + + let mut req_builder = hyper::Request::builder() + .uri(uri) + .method(self.method); + + // Detect the authorization type if it hasn't been set. + let auth = self.auth.unwrap_or_else(|| + if conf.api_key.is_some() { + panic!("Cannot automatically set the API key from the configuration, it must be specified in the OpenAPI definition") + } else if conf.oauth_access_token.is_some() { + Auth::Oauth + } else if conf.basic_auth.is_some() { + Auth::Basic + } else { + Auth::None + } + ); + match auth { Auth::ApiKey(apikey) => { if let Some(ref key) = conf.api_key { let val = apikey.key(&key.prefix, &key.key); @@ -132,108 +157,82 @@ impl Request { query_string.append_pair(&apikey.param_name, &val); } if apikey.in_header { - raw_headers.insert(apikey.param_name, val); + req_builder = req_builder.header(&apikey.param_name, val); } } } Auth::Basic => { if let Some(ref auth_conf) = conf.basic_auth { - let auth = hyper::header::Authorization(hyper::header::Basic { - username: auth_conf.0.to_owned(), - password: auth_conf.1.to_owned(), - }); - headers.set(auth); + let mut text = auth_conf.0.clone(); + text.push(':'); + if let Some(ref pass) = auth_conf.1 { + text.push_str(&pass[..]); + } + let encoded = base64::encode(&text); + req_builder = req_builder.header(AUTHORIZATION, encoded); } } Auth::Oauth => { if let Some(ref token) = conf.oauth_access_token { - let auth = hyper::header::Authorization(hyper::header::Bearer { - token: token.to_owned(), - }); - headers.set(auth); + let text = "Bearer ".to_owned() + token; + req_builder = req_builder.header(AUTHORIZATION, text); } } Auth::None => {} } - let mut uri_str = format!("{}{}", conf.base_path, path); - - let query_string_str = query_string.finish(); - if query_string_str != "" { - uri_str += "?"; - uri_str += &query_string_str; + if let Some(ref user_agent) = conf.user_agent { + req_builder = req_builder.header(USER_AGENT, match HeaderValue::from_str(user_agent) { + Ok(header_value) => header_value, + Err(e) => return Box::pin(futures::future::err(super::Error::Header(e))) + }); } - let uri: hyper::Uri = match uri_str.parse() { - Err(e) => { - return Box::new(futures::future::err(Error::UriError(e))); - } - Ok(u) => u, - }; - - let mut req = hyper::Request::new(self.method, uri); - { - let req_headers = req.headers_mut(); - if let Some(ref user_agent) = conf.user_agent { - req_headers.set(UserAgent::new(Cow::Owned(user_agent.clone()))); - } - req_headers.extend(headers.iter()); - - for (key, val) in raw_headers { - req_headers.set_raw(key, val); - } + for (k, v) in self.header_params { + req_builder = req_builder.header(&k, v); } - if self.form_params.len() > 0 { - req.headers_mut().set(hyper::header::ContentType::form_url_encoded()); + let req_headers = req_builder.headers_mut().unwrap(); + let request_result = if self.form_params.len() > 0 { + req_headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/ x-www-form-urlencoded")); let mut enc = ::url::form_urlencoded::Serializer::new("".to_owned()); for (k, v) in self.form_params { enc.append_pair(&k, &v); } - req.set_body(enc.finish()); - } - - if let Some(body) = self.serialized_body { - req.headers_mut().set(hyper::header::ContentType::json()); - req.headers_mut() - .set(hyper::header::ContentLength(body.len() as u64)); - req.set_body(body); - } + req_builder.body(hyper::Body::from(enc.finish())) + } else if let Some(body) = self.serialized_body { + req_headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/json")); + req_headers.insert(CONTENT_LENGTH, body.len().into()); + req_builder.body(hyper::Body::from(body)) + } else { + req_builder.body(hyper::Body::default()) + }; + let request = match request_result { + Ok(request) => request, + Err(e) => return Box::pin(futures::future::err(Error::from(e))) + }; - let no_ret_type = self.no_return_type; - let res = conf.client - .request(req) - .map_err(|e| Error::from(e)) - .and_then(|resp| { - let status = resp.status(); - resp.body() - .concat2() - .and_then(move |body| Ok((status, body))) - .map_err(|e| Error::from(e)) - }) - .and_then(|(status, body)| { - if status.is_success() { - Ok(body) - } else { - Err(Error::from((status, &*body))) - } - }); - Box::new( - res - .and_then(move |body| { - let parsed: Result = if no_ret_type { - // This is a hack; if there's no_ret_type, U is (), but serde_json gives an - // error when deserializing "" into (), so deserialize 'null' into it - // instead. - // An alternate option would be to require U: Default, and then return - // U::default() here instead since () implements that, but then we'd - // need to impl default for all models. - serde_json::from_str("null") - } else { - serde_json::from_slice(&body) - }; - parsed.map_err(|e| Error::from(e)) - }) - ) + let no_return_type = self.no_return_type; + Box::pin(conf.client + .request(request) + .map_err(|e| Error::from(e)) + .and_then(move |response| { + let status = response.status(); + if !status.is_success() { + futures::future::err::(Error::from((status, response.into_body()))).boxed() + } else if no_return_type { + // This is a hack; if there's no_ret_type, U is (), but serde_json gives an + // error when deserializing "" into (), so deserialize 'null' into it + // instead. + // An alternate option would be to require U: Default, and then return + // U::default() here instead since () implements that, but then we'd + // need to impl default for all models. + futures::future::ok::(serde_json::from_str("null").expect("serde null value")).boxed() + } else { + hyper::body::to_bytes(response.into_body()) + .map(|bytes| serde_json::from_slice(&bytes.unwrap())) + .map_err(|e| Error::from(e)).boxed() + } + })) } } diff --git a/samples/client/petstore/rust/hyper/petstore/Cargo.toml b/samples/client/petstore/rust/hyper/petstore/Cargo.toml index 4bed4953a557..443de5b186a9 100644 --- a/samples/client/petstore/rust/hyper/petstore/Cargo.toml +++ b/samples/client/petstore/rust/hyper/petstore/Cargo.toml @@ -9,10 +9,12 @@ serde = "^1.0" serde_derive = "^1.0" serde_json = "^1.0" url = "^2.2" -hyper = "~0.11" +hyper = { version = "~0.14", features = ["full"] } +hyper-tls = "~0.5" +http = "~0.2" serde_yaml = "0.7" base64 = "~0.7.0" -futures = "0.1.23" +futures = "^0.3" [dev-dependencies] tokio-core = "*" diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/client.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/client.rs index 34953d4a0631..290b99e86f34 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/client.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/client.rs @@ -10,7 +10,8 @@ pub struct APIClient { } impl APIClient { - pub fn new(configuration: Configuration) -> APIClient { + pub fn new(configuration: Configuration) -> APIClient + where C: Clone + std::marker::Send + Sync + 'static { let rc = Rc::new(configuration); APIClient { diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/configuration.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/configuration.rs index 83d5f1c3d0cc..ae41a7529763 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/configuration.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/configuration.rs @@ -10,7 +10,8 @@ use hyper; -pub struct Configuration { +pub struct Configuration + where C: Clone + std::marker::Send + Sync + 'static { pub base_path: String, pub user_agent: Option, pub client: hyper::client::Client, @@ -27,12 +28,13 @@ pub struct ApiKey { pub key: String, } -impl Configuration { +impl Configuration + where C: Clone + std::marker::Send + Sync { pub fn new(client: hyper::client::Client) -> Configuration { Configuration { base_path: "http://petstore.swagger.io/v2".to_owned(), user_agent: Some("OpenAPI-Generator/1.0.0/rust".to_owned()), - client: client, + client, basic_auth: None, oauth_access_token: None, api_key: None, diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/mod.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/mod.rs index c9d96c29fd0c..1245257e5d8a 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/mod.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/mod.rs @@ -1,49 +1,45 @@ +use http; use hyper; -use serde; use serde_json; #[derive(Debug)] -pub enum Error { - UriError(hyper::error::UriError), +pub enum Error { + Api(ApiError), + Header(hyper::http::header::InvalidHeaderValue), + Http(http::Error), Hyper(hyper::Error), Serde(serde_json::Error), - ApiError(ApiError), + UriError(http::uri::InvalidUri), } #[derive(Debug)] -pub struct ApiError { +pub struct ApiError { pub code: hyper::StatusCode, - pub content: Option, + pub body: hyper::body::Body, } -impl<'de, T> From<(hyper::StatusCode, &'de [u8])> for Error - where T: serde::Deserialize<'de> { - fn from(e: (hyper::StatusCode, &'de [u8])) -> Self { - if e.1.len() == 0 { - return Error::ApiError(ApiError{ - code: e.0, - content: None, - }); - } - match serde_json::from_slice::(e.1) { - Ok(t) => Error::ApiError(ApiError{ - code: e.0, - content: Some(t), - }), - Err(e) => { - Error::from(e) - } - } +impl From<(hyper::StatusCode, hyper::body::Body)> for Error { + fn from(e: (hyper::StatusCode, hyper::body::Body)) -> Self { + Error::Api(ApiError { + code: e.0, + body: e.1, + }) } } -impl From for Error { +impl From for Error { + fn from(e: http::Error) -> Self { + return Error::Http(e) + } +} + +impl From for Error { fn from(e: hyper::Error) -> Self { return Error::Hyper(e) } } -impl From for Error { +impl From for Error { fn from(e: serde_json::Error) -> Self { return Error::Serde(e) } diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/pet_api.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/pet_api.rs index f1bdaf0e89ac..3d90eae36b37 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/pet_api.rs @@ -4,27 +4,29 @@ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 - * + * * Generated by: https://openapi-generator.tech */ use std::rc::Rc; use std::borrow::Borrow; +use std::pin::Pin; #[allow(unused_imports)] use std::option::Option; use hyper; -use serde_json; use futures::Future; use super::{Error, configuration}; use super::request as __internal_request; -pub struct PetApiClient { +pub struct PetApiClient + where C: Clone + std::marker::Send + Sync + 'static { configuration: Rc>, } -impl PetApiClient { +impl PetApiClient + where C: Clone + std::marker::Send + Sync { pub fn new(configuration: Rc>) -> PetApiClient { PetApiClient { configuration, @@ -33,19 +35,21 @@ impl PetApiClient { } pub trait PetApi { - fn add_pet(&self, pet: crate::models::Pet) -> Box>>; - fn delete_pet(&self, pet_id: i64, api_key: Option<&str>) -> Box>>; - fn find_pets_by_status(&self, status: Vec) -> Box, Error = Error>>; - fn find_pets_by_tags(&self, tags: Vec) -> Box, Error = Error>>; - fn get_pet_by_id(&self, pet_id: i64) -> Box>>; - fn update_pet(&self, pet: crate::models::Pet) -> Box>>; - fn update_pet_with_form(&self, pet_id: i64, name: Option<&str>, status: Option<&str>) -> Box>>; - fn upload_file(&self, pet_id: i64, additional_metadata: Option<&str>, file: Option) -> Box>>; + fn add_pet(&self, body: crate::models::Pet) -> Pin>>>; + fn delete_pet(&self, pet_id: i64, api_key: Option<&str>) -> Pin>>>; + fn find_pets_by_status(&self, status: Vec) -> Pin, Error>>>>; + fn find_pets_by_tags(&self, tags: Vec) -> Pin, Error>>>>; + fn get_pet_by_id(&self, pet_id: i64) -> Pin>>>; + fn update_pet(&self, body: crate::models::Pet) -> Pin>>>; + fn update_pet_with_form(&self, pet_id: i64, name: Option<&str>, status: Option<&str>) -> Pin>>>; + fn upload_file(&self, pet_id: i64, additional_metadata: Option<&str>, file: Option) -> Pin>>>; } -implPetApi for PetApiClient { - fn add_pet(&self, pet: crate::models::Pet) -> Box>> { - let mut req = __internal_request::Request::new(hyper::Method::Post, "/pet".to_string()) +implPetApi for PetApiClient + where C: Clone + std::marker::Send + Sync { + #[allow(unused_mut)] + fn add_pet(&self, body: crate::models::Pet) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::POST, "/pet".to_string()) .with_auth(__internal_request::Auth::Oauth) ; req = req.with_body_param(pet); @@ -53,8 +57,9 @@ implPetApi for PetApiClient { req.execute(self.configuration.borrow()) } - fn delete_pet(&self, pet_id: i64, api_key: Option<&str>) -> Box>> { - let mut req = __internal_request::Request::new(hyper::Method::Delete, "/pet/{petId}".to_string()) + #[allow(unused_mut)] + fn delete_pet(&self, pet_id: i64, api_key: Option<&str>) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::DELETE, "/pet/{petId}".to_string()) .with_auth(__internal_request::Auth::Oauth) ; req = req.with_path_param("petId".to_string(), pet_id.to_string()); @@ -66,8 +71,9 @@ implPetApi for PetApiClient { req.execute(self.configuration.borrow()) } - fn find_pets_by_status(&self, status: Vec) -> Box, Error = Error>> { - let mut req = __internal_request::Request::new(hyper::Method::Get, "/pet/findByStatus".to_string()) + #[allow(unused_mut)] + fn find_pets_by_status(&self, status: Vec) -> Pin, Error>>>> { + let mut req = __internal_request::Request::new(hyper::Method::GET, "/pet/findByStatus".to_string()) .with_auth(__internal_request::Auth::Oauth) ; req = req.with_query_param("status".to_string(), status.join(",").to_string()); @@ -75,8 +81,9 @@ implPetApi for PetApiClient { req.execute(self.configuration.borrow()) } - fn find_pets_by_tags(&self, tags: Vec) -> Box, Error = Error>> { - let mut req = __internal_request::Request::new(hyper::Method::Get, "/pet/findByTags".to_string()) + #[allow(unused_mut)] + fn find_pets_by_tags(&self, tags: Vec) -> Pin, Error>>>> { + let mut req = __internal_request::Request::new(hyper::Method::GET, "/pet/findByTags".to_string()) .with_auth(__internal_request::Auth::Oauth) ; req = req.with_query_param("tags".to_string(), tags.join(",").to_string()); @@ -84,8 +91,9 @@ implPetApi for PetApiClient { req.execute(self.configuration.borrow()) } - fn get_pet_by_id(&self, pet_id: i64) -> Box>> { - let mut req = __internal_request::Request::new(hyper::Method::Get, "/pet/{petId}".to_string()) + #[allow(unused_mut)] + fn get_pet_by_id(&self, pet_id: i64) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::GET, "/pet/{petId}".to_string()) .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ in_header: true, in_query: false, @@ -97,8 +105,9 @@ implPetApi for PetApiClient { req.execute(self.configuration.borrow()) } - fn update_pet(&self, pet: crate::models::Pet) -> Box>> { - let mut req = __internal_request::Request::new(hyper::Method::Put, "/pet".to_string()) + #[allow(unused_mut)] + fn update_pet(&self, body: crate::models::Pet) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::PUT, "/pet".to_string()) .with_auth(__internal_request::Auth::Oauth) ; req = req.with_body_param(pet); @@ -106,8 +115,9 @@ implPetApi for PetApiClient { req.execute(self.configuration.borrow()) } - fn update_pet_with_form(&self, pet_id: i64, name: Option<&str>, status: Option<&str>) -> Box>> { - let mut req = __internal_request::Request::new(hyper::Method::Post, "/pet/{petId}".to_string()) + #[allow(unused_mut)] + fn update_pet_with_form(&self, pet_id: i64, name: Option<&str>, status: Option<&str>) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::POST, "/pet/{petId}".to_string()) .with_auth(__internal_request::Auth::Oauth) ; req = req.with_path_param("petId".to_string(), pet_id.to_string()); @@ -122,8 +132,9 @@ implPetApi for PetApiClient { req.execute(self.configuration.borrow()) } - fn upload_file(&self, pet_id: i64, additional_metadata: Option<&str>, file: Option) -> Box>> { - let mut req = __internal_request::Request::new(hyper::Method::Post, "/pet/{petId}/uploadImage".to_string()) + #[allow(unused_mut)] + fn upload_file(&self, pet_id: i64, additional_metadata: Option<&str>, file: Option) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::POST, "/pet/{petId}/uploadImage".to_string()) .with_auth(__internal_request::Auth::Oauth) ; req = req.with_path_param("petId".to_string(), pet_id.to_string()); diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/request.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/request.rs index f97b5277196a..0aa51fa0c592 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/request.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/request.rs @@ -1,14 +1,16 @@ -use std::borrow::Cow; use std::collections::HashMap; +use std::pin::Pin; -use super::{configuration, Error}; use futures; -use futures::{Future, Stream}; +use futures::Future; +use futures::future::*; use hyper; -use hyper::header::UserAgent; +use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, HeaderValue, USER_AGENT}; use serde; use serde_json; +use super::{configuration, Error}; + pub(crate) struct ApiKey { pub in_header: bool, pub in_query: bool, @@ -32,8 +34,11 @@ pub(crate) enum Auth { Oauth, } +/// If the authorization type is unspecified then it will be automatically detected based +/// on the configuration. This functionality is useful when the OpenAPI definition does not +/// include an authorization scheme. pub(crate) struct Request { - auth: Auth, + auth: Option, method: hyper::Method, path: String, query_params: HashMap, @@ -48,9 +53,9 @@ pub(crate) struct Request { impl Request { pub fn new(method: hyper::Method, path: String) -> Self { Request { - auth: Auth::None, - method: method, - path: path, + auth: None, + method, + path, query_params: HashMap::new(), path_params: HashMap::new(), form_params: HashMap::new(), @@ -91,24 +96,20 @@ impl Request { } pub fn with_auth(mut self, auth: Auth) -> Self { - self.auth = auth; + self.auth = Some(auth); self } pub fn execute<'a, C, U>( self, conf: &configuration::Configuration, - ) -> Box> + 'a> - where - C: hyper::client::Connect, - U: Sized + 'a, - for<'de> U: serde::Deserialize<'de>, + ) -> Pin> + 'a>> + where + C: hyper::client::connect::Connect + Clone + std::marker::Send + Sync, + U: Sized + std::marker::Send + 'a, + for<'de> U: serde::Deserialize<'de>, { let mut query_string = ::url::form_urlencoded::Serializer::new("".to_owned()); - // raw_headers is for headers we don't know the proper type of (e.g. custom api key - // headers); headers is for ones we do know the type of. - let mut raw_headers = HashMap::new(); - let mut headers: hyper::header::Headers = hyper::header::Headers::new(); let mut path = self.path; for (k, v) in self.path_params { @@ -116,15 +117,39 @@ impl Request { path = path.replace(&format!("{{{}}}", k), &v); } - for (k, v) in self.header_params { - raw_headers.insert(k, v); - } - for (key, val) in self.query_params { query_string.append_pair(&key, &val); } - match self.auth { + let mut uri_str = format!("{}{}", conf.base_path, path); + + let query_string_str = query_string.finish(); + if query_string_str != "" { + uri_str += "?"; + uri_str += &query_string_str; + } + let uri: hyper::Uri = match uri_str.parse() { + Err(e) => return Box::pin(futures::future::err(Error::UriError(e))), + Ok(u) => u, + }; + + let mut req_builder = hyper::Request::builder() + .uri(uri) + .method(self.method); + + // Detect the authorization type if it hasn't been set. + let auth = self.auth.unwrap_or_else(|| + if conf.api_key.is_some() { + panic!("Cannot automatically set the API key from the configuration, it must be specified in the OpenAPI definition") + } else if conf.oauth_access_token.is_some() { + Auth::Oauth + } else if conf.basic_auth.is_some() { + Auth::Basic + } else { + Auth::None + } + ); + match auth { Auth::ApiKey(apikey) => { if let Some(ref key) = conf.api_key { let val = apikey.key(&key.prefix, &key.key); @@ -132,108 +157,82 @@ impl Request { query_string.append_pair(&apikey.param_name, &val); } if apikey.in_header { - raw_headers.insert(apikey.param_name, val); + req_builder = req_builder.header(&apikey.param_name, val); } } } Auth::Basic => { if let Some(ref auth_conf) = conf.basic_auth { - let auth = hyper::header::Authorization(hyper::header::Basic { - username: auth_conf.0.to_owned(), - password: auth_conf.1.to_owned(), - }); - headers.set(auth); + let mut text = auth_conf.0.clone(); + text.push(':'); + if let Some(ref pass) = auth_conf.1 { + text.push_str(&pass[..]); + } + let encoded = base64::encode(&text); + req_builder = req_builder.header(AUTHORIZATION, encoded); } } Auth::Oauth => { if let Some(ref token) = conf.oauth_access_token { - let auth = hyper::header::Authorization(hyper::header::Bearer { - token: token.to_owned(), - }); - headers.set(auth); + let text = "Bearer ".to_owned() + token; + req_builder = req_builder.header(AUTHORIZATION, text); } } Auth::None => {} } - let mut uri_str = format!("{}{}", conf.base_path, path); - - let query_string_str = query_string.finish(); - if query_string_str != "" { - uri_str += "?"; - uri_str += &query_string_str; + if let Some(ref user_agent) = conf.user_agent { + req_builder = req_builder.header(USER_AGENT, match HeaderValue::from_str(user_agent) { + Ok(header_value) => header_value, + Err(e) => return Box::pin(futures::future::err(super::Error::Header(e))) + }); } - let uri: hyper::Uri = match uri_str.parse() { - Err(e) => { - return Box::new(futures::future::err(Error::UriError(e))); - } - Ok(u) => u, - }; - - let mut req = hyper::Request::new(self.method, uri); - { - let req_headers = req.headers_mut(); - if let Some(ref user_agent) = conf.user_agent { - req_headers.set(UserAgent::new(Cow::Owned(user_agent.clone()))); - } - req_headers.extend(headers.iter()); - - for (key, val) in raw_headers { - req_headers.set_raw(key, val); - } + for (k, v) in self.header_params { + req_builder = req_builder.header(&k, v); } - if self.form_params.len() > 0 { - req.headers_mut().set(hyper::header::ContentType::form_url_encoded()); + let req_headers = req_builder.headers_mut().unwrap(); + let request_result = if self.form_params.len() > 0 { + req_headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/ x-www-form-urlencoded")); let mut enc = ::url::form_urlencoded::Serializer::new("".to_owned()); for (k, v) in self.form_params { enc.append_pair(&k, &v); } - req.set_body(enc.finish()); - } - - if let Some(body) = self.serialized_body { - req.headers_mut().set(hyper::header::ContentType::json()); - req.headers_mut() - .set(hyper::header::ContentLength(body.len() as u64)); - req.set_body(body); - } + req_builder.body(hyper::Body::from(enc.finish())) + } else if let Some(body) = self.serialized_body { + req_headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/json")); + req_headers.insert(CONTENT_LENGTH, body.len().into()); + req_builder.body(hyper::Body::from(body)) + } else { + req_builder.body(hyper::Body::default()) + }; + let request = match request_result { + Ok(request) => request, + Err(e) => return Box::pin(futures::future::err(Error::from(e))) + }; - let no_ret_type = self.no_return_type; - let res = conf.client - .request(req) - .map_err(|e| Error::from(e)) - .and_then(|resp| { - let status = resp.status(); - resp.body() - .concat2() - .and_then(move |body| Ok((status, body))) - .map_err(|e| Error::from(e)) - }) - .and_then(|(status, body)| { - if status.is_success() { - Ok(body) - } else { - Err(Error::from((status, &*body))) - } - }); - Box::new( - res - .and_then(move |body| { - let parsed: Result = if no_ret_type { - // This is a hack; if there's no_ret_type, U is (), but serde_json gives an - // error when deserializing "" into (), so deserialize 'null' into it - // instead. - // An alternate option would be to require U: Default, and then return - // U::default() here instead since () implements that, but then we'd - // need to impl default for all models. - serde_json::from_str("null") - } else { - serde_json::from_slice(&body) - }; - parsed.map_err(|e| Error::from(e)) - }) - ) + let no_return_type = self.no_return_type; + Box::pin(conf.client + .request(request) + .map_err(|e| Error::from(e)) + .and_then(move |response| { + let status = response.status(); + if !status.is_success() { + futures::future::err::(Error::from((status, response.into_body()))).boxed() + } else if no_return_type { + // This is a hack; if there's no_ret_type, U is (), but serde_json gives an + // error when deserializing "" into (), so deserialize 'null' into it + // instead. + // An alternate option would be to require U: Default, and then return + // U::default() here instead since () implements that, but then we'd + // need to impl default for all models. + futures::future::ok::(serde_json::from_str("null").expect("serde null value")).boxed() + } else { + hyper::body::to_bytes(response.into_body()) + .map(|bytes| serde_json::from_slice(&bytes.unwrap())) + .map_err(|e| Error::from(e)).boxed() + } + })) } } diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/store_api.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/store_api.rs index 7e5aaa33da24..303a418d6961 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/store_api.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/store_api.rs @@ -4,27 +4,29 @@ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 - * + * * Generated by: https://openapi-generator.tech */ use std::rc::Rc; use std::borrow::Borrow; +use std::pin::Pin; #[allow(unused_imports)] use std::option::Option; use hyper; -use serde_json; use futures::Future; use super::{Error, configuration}; use super::request as __internal_request; -pub struct StoreApiClient { +pub struct StoreApiClient + where C: Clone + std::marker::Send + Sync + 'static { configuration: Rc>, } -impl StoreApiClient { +impl StoreApiClient + where C: Clone + std::marker::Send + Sync { pub fn new(configuration: Rc>) -> StoreApiClient { StoreApiClient { configuration, @@ -33,15 +35,17 @@ impl StoreApiClient { } pub trait StoreApi { - fn delete_order(&self, order_id: &str) -> Box>>; - fn get_inventory(&self, ) -> Box, Error = Error>>; - fn get_order_by_id(&self, order_id: i64) -> Box>>; - fn place_order(&self, order: crate::models::Order) -> Box>>; + fn delete_order(&self, order_id: &str) -> Pin>>>; + fn get_inventory(&self, ) -> Pin, Error>>>>; + fn get_order_by_id(&self, order_id: i64) -> Pin>>>; + fn place_order(&self, body: crate::models::Order) -> Pin>>>; } -implStoreApi for StoreApiClient { - fn delete_order(&self, order_id: &str) -> Box>> { - let mut req = __internal_request::Request::new(hyper::Method::Delete, "/store/order/{orderId}".to_string()) +implStoreApi for StoreApiClient + where C: Clone + std::marker::Send + Sync { + #[allow(unused_mut)] + fn delete_order(&self, order_id: &str) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::DELETE, "/store/order/{orderId}".to_string()) ; req = req.with_path_param("orderId".to_string(), order_id.to_string()); req = req.returns_nothing(); @@ -49,8 +53,9 @@ implStoreApi for StoreApiClient { req.execute(self.configuration.borrow()) } - fn get_inventory(&self, ) -> Box, Error = Error>> { - let mut req = __internal_request::Request::new(hyper::Method::Get, "/store/inventory".to_string()) + #[allow(unused_mut)] + fn get_inventory(&self, ) -> Pin, Error>>>> { + let mut req = __internal_request::Request::new(hyper::Method::GET, "/store/inventory".to_string()) .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ in_header: true, in_query: false, @@ -61,16 +66,18 @@ implStoreApi for StoreApiClient { req.execute(self.configuration.borrow()) } - fn get_order_by_id(&self, order_id: i64) -> Box>> { - let mut req = __internal_request::Request::new(hyper::Method::Get, "/store/order/{orderId}".to_string()) + #[allow(unused_mut)] + fn get_order_by_id(&self, order_id: i64) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::GET, "/store/order/{orderId}".to_string()) ; req = req.with_path_param("orderId".to_string(), order_id.to_string()); req.execute(self.configuration.borrow()) } - fn place_order(&self, order: crate::models::Order) -> Box>> { - let mut req = __internal_request::Request::new(hyper::Method::Post, "/store/order".to_string()) + #[allow(unused_mut)] + fn place_order(&self, body: crate::models::Order) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::POST, "/store/order".to_string()) ; req = req.with_body_param(order); diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/user_api.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/user_api.rs index e7326d05c4da..2651e807362b 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/user_api.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/user_api.rs @@ -4,27 +4,29 @@ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 - * + * * Generated by: https://openapi-generator.tech */ use std::rc::Rc; use std::borrow::Borrow; +use std::pin::Pin; #[allow(unused_imports)] use std::option::Option; use hyper; -use serde_json; use futures::Future; use super::{Error, configuration}; use super::request as __internal_request; -pub struct UserApiClient { +pub struct UserApiClient + where C: Clone + std::marker::Send + Sync + 'static { configuration: Rc>, } -impl UserApiClient { +impl UserApiClient + where C: Clone + std::marker::Send + Sync { pub fn new(configuration: Rc>) -> UserApiClient { UserApiClient { configuration, @@ -33,24 +35,21 @@ impl UserApiClient { } pub trait UserApi { - fn create_user(&self, user: crate::models::User) -> Box>>; - fn create_users_with_array_input(&self, user: Vec) -> Box>>; - fn create_users_with_list_input(&self, user: Vec) -> Box>>; - fn delete_user(&self, username: &str) -> Box>>; - fn get_user_by_name(&self, username: &str) -> Box>>; - fn login_user(&self, username: &str, password: &str) -> Box>>; - fn logout_user(&self, ) -> Box>>; - fn update_user(&self, username: &str, user: crate::models::User) -> Box>>; + fn create_user(&self, body: crate::models::User) -> Pin>>>; + fn create_users_with_array_input(&self, body: Vec) -> Pin>>>; + fn create_users_with_list_input(&self, body: Vec) -> Pin>>>; + fn delete_user(&self, username: &str) -> Pin>>>; + fn get_user_by_name(&self, username: &str) -> Pin>>>; + fn login_user(&self, username: &str, password: &str) -> Pin>>>; + fn logout_user(&self, ) -> Pin>>>; + fn update_user(&self, username: &str, body: crate::models::User) -> Pin>>>; } -implUserApi for UserApiClient { - fn create_user(&self, user: crate::models::User) -> Box>> { - let mut req = __internal_request::Request::new(hyper::Method::Post, "/user".to_string()) - .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ - in_header: true, - in_query: false, - param_name: "api_key".to_owned(), - })) +implUserApi for UserApiClient + where C: Clone + std::marker::Send + Sync { + #[allow(unused_mut)] + fn create_user(&self, body: crate::models::User) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::POST, "/user".to_string()) ; req = req.with_body_param(user); req = req.returns_nothing(); @@ -58,13 +57,9 @@ implUserApi for UserApiClient { req.execute(self.configuration.borrow()) } - fn create_users_with_array_input(&self, user: Vec) -> Box>> { - let mut req = __internal_request::Request::new(hyper::Method::Post, "/user/createWithArray".to_string()) - .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ - in_header: true, - in_query: false, - param_name: "api_key".to_owned(), - })) + #[allow(unused_mut)] + fn create_users_with_array_input(&self, body: Vec) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::POST, "/user/createWithArray".to_string()) ; req = req.with_body_param(user); req = req.returns_nothing(); @@ -72,13 +67,9 @@ implUserApi for UserApiClient { req.execute(self.configuration.borrow()) } - fn create_users_with_list_input(&self, user: Vec) -> Box>> { - let mut req = __internal_request::Request::new(hyper::Method::Post, "/user/createWithList".to_string()) - .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ - in_header: true, - in_query: false, - param_name: "api_key".to_owned(), - })) + #[allow(unused_mut)] + fn create_users_with_list_input(&self, body: Vec) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::POST, "/user/createWithList".to_string()) ; req = req.with_body_param(user); req = req.returns_nothing(); @@ -86,13 +77,9 @@ implUserApi for UserApiClient { req.execute(self.configuration.borrow()) } - fn delete_user(&self, username: &str) -> Box>> { - let mut req = __internal_request::Request::new(hyper::Method::Delete, "/user/{username}".to_string()) - .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ - in_header: true, - in_query: false, - param_name: "api_key".to_owned(), - })) + #[allow(unused_mut)] + fn delete_user(&self, username: &str) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::DELETE, "/user/{username}".to_string()) ; req = req.with_path_param("username".to_string(), username.to_string()); req = req.returns_nothing(); @@ -100,16 +87,18 @@ implUserApi for UserApiClient { req.execute(self.configuration.borrow()) } - fn get_user_by_name(&self, username: &str) -> Box>> { - let mut req = __internal_request::Request::new(hyper::Method::Get, "/user/{username}".to_string()) + #[allow(unused_mut)] + fn get_user_by_name(&self, username: &str) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::GET, "/user/{username}".to_string()) ; req = req.with_path_param("username".to_string(), username.to_string()); req.execute(self.configuration.borrow()) } - fn login_user(&self, username: &str, password: &str) -> Box>> { - let mut req = __internal_request::Request::new(hyper::Method::Get, "/user/login".to_string()) + #[allow(unused_mut)] + fn login_user(&self, username: &str, password: &str) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::GET, "/user/login".to_string()) ; req = req.with_query_param("username".to_string(), username.to_string()); req = req.with_query_param("password".to_string(), password.to_string()); @@ -117,26 +106,18 @@ implUserApi for UserApiClient { req.execute(self.configuration.borrow()) } - fn logout_user(&self, ) -> Box>> { - let mut req = __internal_request::Request::new(hyper::Method::Get, "/user/logout".to_string()) - .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ - in_header: true, - in_query: false, - param_name: "api_key".to_owned(), - })) + #[allow(unused_mut)] + fn logout_user(&self, ) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::GET, "/user/logout".to_string()) ; req = req.returns_nothing(); req.execute(self.configuration.borrow()) } - fn update_user(&self, username: &str, user: crate::models::User) -> Box>> { - let mut req = __internal_request::Request::new(hyper::Method::Put, "/user/{username}".to_string()) - .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ - in_header: true, - in_query: false, - param_name: "api_key".to_owned(), - })) + #[allow(unused_mut)] + fn update_user(&self, username: &str, body: crate::models::User) -> Pin>>> { + let mut req = __internal_request::Request::new(hyper::Method::PUT, "/user/{username}".to_string()) ; req = req.with_path_param("username".to_string(), username.to_string()); req = req.with_body_param(user); From 962e8c42178ae5445f6d60a44337a59112c4b018 Mon Sep 17 00:00:00 2001 From: WILLIAM CHENG Date: Wed, 24 Nov 2021 17:24:19 +0800 Subject: [PATCH 028/117] update samples --- .../rust/hyper/petstore/src/apis/pet_api.rs | 10 ++-- .../rust/hyper/petstore/src/apis/store_api.rs | 6 +-- .../rust/hyper/petstore/src/apis/user_api.rs | 48 +++++++++++++++---- 3 files changed, 47 insertions(+), 17 deletions(-) diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/pet_api.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/pet_api.rs index 3d90eae36b37..019ed347cdff 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/pet_api.rs @@ -4,7 +4,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 - * + * * Generated by: https://openapi-generator.tech */ @@ -35,12 +35,12 @@ impl PetApiClient } pub trait PetApi { - fn add_pet(&self, body: crate::models::Pet) -> Pin>>>; + fn add_pet(&self, pet: crate::models::Pet) -> Pin>>>; fn delete_pet(&self, pet_id: i64, api_key: Option<&str>) -> Pin>>>; fn find_pets_by_status(&self, status: Vec) -> Pin, Error>>>>; fn find_pets_by_tags(&self, tags: Vec) -> Pin, Error>>>>; fn get_pet_by_id(&self, pet_id: i64) -> Pin>>>; - fn update_pet(&self, body: crate::models::Pet) -> Pin>>>; + fn update_pet(&self, pet: crate::models::Pet) -> Pin>>>; fn update_pet_with_form(&self, pet_id: i64, name: Option<&str>, status: Option<&str>) -> Pin>>>; fn upload_file(&self, pet_id: i64, additional_metadata: Option<&str>, file: Option) -> Pin>>>; } @@ -48,7 +48,7 @@ pub trait PetApi { implPetApi for PetApiClient where C: Clone + std::marker::Send + Sync { #[allow(unused_mut)] - fn add_pet(&self, body: crate::models::Pet) -> Pin>>> { + fn add_pet(&self, pet: crate::models::Pet) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::POST, "/pet".to_string()) .with_auth(__internal_request::Auth::Oauth) ; @@ -106,7 +106,7 @@ implPetApi for PetApiClient } #[allow(unused_mut)] - fn update_pet(&self, body: crate::models::Pet) -> Pin>>> { + fn update_pet(&self, pet: crate::models::Pet) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::PUT, "/pet".to_string()) .with_auth(__internal_request::Auth::Oauth) ; diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/store_api.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/store_api.rs index 303a418d6961..e4bb56308283 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/store_api.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/store_api.rs @@ -4,7 +4,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 - * + * * Generated by: https://openapi-generator.tech */ @@ -38,7 +38,7 @@ pub trait StoreApi { fn delete_order(&self, order_id: &str) -> Pin>>>; fn get_inventory(&self, ) -> Pin, Error>>>>; fn get_order_by_id(&self, order_id: i64) -> Pin>>>; - fn place_order(&self, body: crate::models::Order) -> Pin>>>; + fn place_order(&self, order: crate::models::Order) -> Pin>>>; } implStoreApi for StoreApiClient @@ -76,7 +76,7 @@ implStoreApi for StoreApiClient } #[allow(unused_mut)] - fn place_order(&self, body: crate::models::Order) -> Pin>>> { + fn place_order(&self, order: crate::models::Order) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::POST, "/store/order".to_string()) ; req = req.with_body_param(order); diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/user_api.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/user_api.rs index 2651e807362b..817d9166a8b5 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/user_api.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/user_api.rs @@ -4,7 +4,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 - * + * * Generated by: https://openapi-generator.tech */ @@ -35,21 +35,26 @@ impl UserApiClient } pub trait UserApi { - fn create_user(&self, body: crate::models::User) -> Pin>>>; - fn create_users_with_array_input(&self, body: Vec) -> Pin>>>; - fn create_users_with_list_input(&self, body: Vec) -> Pin>>>; + fn create_user(&self, user: crate::models::User) -> Pin>>>; + fn create_users_with_array_input(&self, user: Vec) -> Pin>>>; + fn create_users_with_list_input(&self, user: Vec) -> Pin>>>; fn delete_user(&self, username: &str) -> Pin>>>; fn get_user_by_name(&self, username: &str) -> Pin>>>; fn login_user(&self, username: &str, password: &str) -> Pin>>>; fn logout_user(&self, ) -> Pin>>>; - fn update_user(&self, username: &str, body: crate::models::User) -> Pin>>>; + fn update_user(&self, username: &str, user: crate::models::User) -> Pin>>>; } implUserApi for UserApiClient where C: Clone + std::marker::Send + Sync { #[allow(unused_mut)] - fn create_user(&self, body: crate::models::User) -> Pin>>> { + fn create_user(&self, user: crate::models::User) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::POST, "/user".to_string()) + .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ + in_header: true, + in_query: false, + param_name: "api_key".to_owned(), + })) ; req = req.with_body_param(user); req = req.returns_nothing(); @@ -58,8 +63,13 @@ implUserApi for UserApiClient } #[allow(unused_mut)] - fn create_users_with_array_input(&self, body: Vec) -> Pin>>> { + fn create_users_with_array_input(&self, user: Vec) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::POST, "/user/createWithArray".to_string()) + .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ + in_header: true, + in_query: false, + param_name: "api_key".to_owned(), + })) ; req = req.with_body_param(user); req = req.returns_nothing(); @@ -68,8 +78,13 @@ implUserApi for UserApiClient } #[allow(unused_mut)] - fn create_users_with_list_input(&self, body: Vec) -> Pin>>> { + fn create_users_with_list_input(&self, user: Vec) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::POST, "/user/createWithList".to_string()) + .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ + in_header: true, + in_query: false, + param_name: "api_key".to_owned(), + })) ; req = req.with_body_param(user); req = req.returns_nothing(); @@ -80,6 +95,11 @@ implUserApi for UserApiClient #[allow(unused_mut)] fn delete_user(&self, username: &str) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::DELETE, "/user/{username}".to_string()) + .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ + in_header: true, + in_query: false, + param_name: "api_key".to_owned(), + })) ; req = req.with_path_param("username".to_string(), username.to_string()); req = req.returns_nothing(); @@ -109,6 +129,11 @@ implUserApi for UserApiClient #[allow(unused_mut)] fn logout_user(&self, ) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::GET, "/user/logout".to_string()) + .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ + in_header: true, + in_query: false, + param_name: "api_key".to_owned(), + })) ; req = req.returns_nothing(); @@ -116,8 +141,13 @@ implUserApi for UserApiClient } #[allow(unused_mut)] - fn update_user(&self, username: &str, body: crate::models::User) -> Pin>>> { + fn update_user(&self, username: &str, user: crate::models::User) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::PUT, "/user/{username}".to_string()) + .with_auth(__internal_request::Auth::ApiKey(__internal_request::ApiKey{ + in_header: true, + in_query: false, + param_name: "api_key".to_owned(), + })) ; req = req.with_path_param("username".to_string(), username.to_string()); req = req.with_body_param(user); From 375f0a5c2db06bb5d50dbcd5feca38078cd8d85b Mon Sep 17 00:00:00 2001 From: Hui Yu Date: Wed, 24 Nov 2021 17:42:04 +0800 Subject: [PATCH 029/117] [C][Client] Use cpack to build deb package (#10935) --- .../languages/CLibcurlClientCodegen.java | 1 + .../C-libcurl/CMakeLists.txt.mustache | 19 +++++++++++---- .../C-libcurl/Packing.cmake.mustache | 24 +++++++++++++++++++ 3 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/C-libcurl/Packing.cmake.mustache 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 d48d0f774890..788639ab1d77 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 @@ -323,6 +323,7 @@ public void processOpts() { // root folder supportingFiles.add(new SupportingFile("CMakeLists.txt.mustache", "", "CMakeLists.txt")); + supportingFiles.add(new SupportingFile("Packing.cmake.mustache", "", "Packing.cmake")); supportingFiles.add(new SupportingFile("libcurl.licence.mustache", "", "libcurl.licence")); supportingFiles.add(new SupportingFile("uncrustify-rules.cfg.mustache", "", "uncrustify-rules.cfg")); supportingFiles.add(new SupportingFile("README.md.mustache", "", "README.md")); diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/CMakeLists.txt.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/CMakeLists.txt.mustache index 7ff01b17c0ee..8d2ef17609c3 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/CMakeLists.txt.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/CMakeLists.txt.mustache @@ -28,7 +28,11 @@ else() endif() set(pkgName "{{projectName}}") -set(VERSION 0.0.1) # this default version can be overridden in PreTarget.cmake + +# this default version can be overridden in PreTarget.cmake +set(PROJECT_VERSION_MAJOR 0) +set(PROJECT_VERSION_MINOR 0) +set(PROJECT_VERSION_PATCH 1) find_package(CURL 7.58.0 REQUIRED) if(CURL_FOUND) @@ -84,6 +88,8 @@ set(HDRS include(PreTarget.cmake OPTIONAL) +set(PROJECT_VERSION_STRING "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") + # Add library with project file with project name as library name add_library(${pkgName} ${SRCS} ${HDRS}) # Link dependent libraries @@ -100,22 +106,22 @@ include(PostTarget.cmake OPTIONAL) # installation of libraries, headers, and config files if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in) - install(TARGETS ${pkgName} DESTINATION ${CMAKE_INSTALL_PREFIX}) + install(TARGETS ${pkgName} DESTINATION lib) else() include(GNUInstallDirs) - install(TARGETS ${pkgName} DESTINATION ${CMAKE_INSTALL_PREFIX} EXPORT ${pkgName}Targets) + install(TARGETS ${pkgName} DESTINATION lib EXPORT ${pkgName}Targets) foreach(HDR_FILE ${HDRS}) get_filename_component(HDR_DIRECTORY ${HDR_FILE} DIRECTORY) get_filename_component(ABSOLUTE_HDR_DIRECTORY ${HDR_DIRECTORY} ABSOLUTE) file(RELATIVE_PATH RELATIVE_HDR_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${ABSOLUTE_HDR_DIRECTORY}) - install(FILES ${HDR_FILE} DESTINATION include/${RELATIVE_HDR_PATH}) + install(FILES ${HDR_FILE} DESTINATION include/${pkgName}/${RELATIVE_HDR_PATH}) endforeach() include(CMakePackageConfigHelpers) write_basic_package_version_file( "${CMAKE_CURRENT_BINARY_DIR}/${pkgName}/${pkgName}ConfigVersion.cmake" - VERSION "${VERSION}" + VERSION "${PROJECT_VERSION_STRING}" COMPATIBILITY AnyNewerVersion ) @@ -147,6 +153,9 @@ else() ) endif() +# make installation packages +include(Packing.cmake OPTIONAL) + # Setting file variables to null set(SRCS "") set(HDRS "") diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/Packing.cmake.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/Packing.cmake.mustache new file mode 100644 index 000000000000..15bd4c8d5e9b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/C-libcurl/Packing.cmake.mustache @@ -0,0 +1,24 @@ +set(CPACK_PACKAGE_NAME lib${pkgName}) + +set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) +set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) +set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) + +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${PROJECT_PACKAGE_DESCRIPTION_SUMMARY}) +set(CPACK_PACKAGE_VENDOR ${PROJECT_PACKAGE_VENDOR}) +set(CPACK_PACKAGE_CONTACT ${PROJECT_PACKAGE_CONTACT}) +set(CPACK_DEBIAN_PACKAGE_MAINTAINER ${PROJECT_PACKAGE_MAINTAINER}) + +set(CPACK_VERBATIM_VARIABLES YES) + +set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME}) + +set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}) + +set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT) + +set(CPACK_DEB_COMPONENT_INSTALL YES) + +set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS TRUE) + +include(CPack) \ No newline at end of file From 887fe07bc1a6cbe06128189c23c6fe536986bbb5 Mon Sep 17 00:00:00 2001 From: WILLIAM CHENG Date: Wed, 24 Nov 2021 17:47:31 +0800 Subject: [PATCH 030/117] upadte samples --- samples/client/petstore/c/.openapi-generator/FILES | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/client/petstore/c/.openapi-generator/FILES b/samples/client/petstore/c/.openapi-generator/FILES index 4f49546590e6..51014a47cdcc 100644 --- a/samples/client/petstore/c/.openapi-generator/FILES +++ b/samples/client/petstore/c/.openapi-generator/FILES @@ -1,3 +1,4 @@ +Packing.cmake README.md api/PetAPI.c api/PetAPI.h From 1314e229f58cf056850dc912bbf55e49bcda2db8 Mon Sep 17 00:00:00 2001 From: dever4eg Date: Wed, 24 Nov 2021 16:46:41 +0200 Subject: [PATCH 031/117] Fixed http errors deserialization (#10940) * Fixed http errors deserialization I've found this bug in @kubernetes/client-node npm package. By the way, Here is the issue https://github.com/OpenAPITools/openapi-generator/issues/2924# * Update typescript-node samples with a fix of error handling * Update samples version Co-authored-by: Bogdan Onischenko --- .../main/resources/typescript-node/api-single.mustache | 6 +++--- .../client/petstore/typescript-node/default/api/petApi.ts | 8 ++++---- .../petstore/typescript-node/default/api/storeApi.ts | 6 +++--- .../petstore/typescript-node/default/api/userApi.ts | 4 ++-- samples/client/petstore/typescript-node/npm/api/petApi.ts | 8 ++++---- .../client/petstore/typescript-node/npm/api/storeApi.ts | 6 +++--- .../client/petstore/typescript-node/npm/api/userApi.ts | 4 ++-- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-node/api-single.mustache b/modules/openapi-generator/src/main/resources/typescript-node/api-single.mustache index 6b7154dd6c89..43b9f074069e 100644 --- a/modules/openapi-generator/src/main/resources/typescript-node/api-single.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-node/api-single.mustache @@ -266,10 +266,10 @@ export class {{classname}} { if (error) { reject(error); } else { - {{#returnType}} - body = ObjectSerializer.deserialize(body, "{{{.}}}"); - {{/returnType}} if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + {{#returnType}} + body = ObjectSerializer.deserialize(body, "{{{.}}}"); + {{/returnType}} resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); diff --git a/samples/client/petstore/typescript-node/default/api/petApi.ts b/samples/client/petstore/typescript-node/default/api/petApi.ts index 1dfd5447c6f2..d518c2b66c8f 100644 --- a/samples/client/petstore/typescript-node/default/api/petApi.ts +++ b/samples/client/petstore/typescript-node/default/api/petApi.ts @@ -289,8 +289,8 @@ export class PetApi { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "Array"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "Array"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); @@ -364,8 +364,8 @@ export class PetApi { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "Array"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "Array"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); @@ -436,8 +436,8 @@ export class PetApi { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "Pet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "Pet"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); @@ -657,8 +657,8 @@ export class PetApi { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "ApiResponse"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ApiResponse"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); diff --git a/samples/client/petstore/typescript-node/default/api/storeApi.ts b/samples/client/petstore/typescript-node/default/api/storeApi.ts index 500c63256647..aa66df0b98a3 100644 --- a/samples/client/petstore/typescript-node/default/api/storeApi.ts +++ b/samples/client/petstore/typescript-node/default/api/storeApi.ts @@ -209,8 +209,8 @@ export class StoreApi { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "{ [key: string]: number; }"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "{ [key: string]: number; }"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); @@ -278,8 +278,8 @@ export class StoreApi { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "Order"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "Order"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); @@ -347,8 +347,8 @@ export class StoreApi { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "Order"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "Order"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); diff --git a/samples/client/petstore/typescript-node/default/api/userApi.ts b/samples/client/petstore/typescript-node/default/api/userApi.ts index 3a29f079eafb..ff11964e4396 100644 --- a/samples/client/petstore/typescript-node/default/api/userApi.ts +++ b/samples/client/petstore/typescript-node/default/api/userApi.ts @@ -396,8 +396,8 @@ export class UserApi { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "User"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "User"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); @@ -478,8 +478,8 @@ export class UserApi { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "string"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); diff --git a/samples/client/petstore/typescript-node/npm/api/petApi.ts b/samples/client/petstore/typescript-node/npm/api/petApi.ts index 1dfd5447c6f2..d518c2b66c8f 100644 --- a/samples/client/petstore/typescript-node/npm/api/petApi.ts +++ b/samples/client/petstore/typescript-node/npm/api/petApi.ts @@ -289,8 +289,8 @@ export class PetApi { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "Array"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "Array"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); @@ -364,8 +364,8 @@ export class PetApi { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "Array"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "Array"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); @@ -436,8 +436,8 @@ export class PetApi { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "Pet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "Pet"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); @@ -657,8 +657,8 @@ export class PetApi { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "ApiResponse"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "ApiResponse"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); diff --git a/samples/client/petstore/typescript-node/npm/api/storeApi.ts b/samples/client/petstore/typescript-node/npm/api/storeApi.ts index 500c63256647..aa66df0b98a3 100644 --- a/samples/client/petstore/typescript-node/npm/api/storeApi.ts +++ b/samples/client/petstore/typescript-node/npm/api/storeApi.ts @@ -209,8 +209,8 @@ export class StoreApi { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "{ [key: string]: number; }"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "{ [key: string]: number; }"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); @@ -278,8 +278,8 @@ export class StoreApi { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "Order"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "Order"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); @@ -347,8 +347,8 @@ export class StoreApi { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "Order"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "Order"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); diff --git a/samples/client/petstore/typescript-node/npm/api/userApi.ts b/samples/client/petstore/typescript-node/npm/api/userApi.ts index 3a29f079eafb..ff11964e4396 100644 --- a/samples/client/petstore/typescript-node/npm/api/userApi.ts +++ b/samples/client/petstore/typescript-node/npm/api/userApi.ts @@ -396,8 +396,8 @@ export class UserApi { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "User"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "User"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); @@ -478,8 +478,8 @@ export class UserApi { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + body = ObjectSerializer.deserialize(body, "string"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); From 2e47f3e84c418c7b02fb1dbaccb55cf94bcb338c Mon Sep 17 00:00:00 2001 From: "Brian J. Miller" Date: Wed, 24 Nov 2021 08:48:21 -0600 Subject: [PATCH 032/117] Allows install typescript-axios client via npm from Git (#10890) --- .../src/main/resources/typescript-axios/package.mustache | 2 +- .../petstore/typescript-axios/builds/es6-target/package.json | 2 +- .../with-npm-version-and-separate-models-and-api/package.json | 2 +- .../typescript-axios/builds/with-npm-version/package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/package.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/package.mustache index 266e9de70b7d..8fb030634644 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/package.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/package.mustache @@ -15,7 +15,7 @@ "typings": "./dist/index.d.ts", "scripts": { "build": "tsc --outDir dist/", - "prepublishOnly": "npm run build" + "prepare": "npm run build" }, "dependencies": { "axios": "^0.21.4" diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/package.json b/samples/client/petstore/typescript-axios/builds/es6-target/package.json index 95c1617e37f9..86412c07b3db 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/package.json +++ b/samples/client/petstore/typescript-axios/builds/es6-target/package.json @@ -15,7 +15,7 @@ "typings": "./dist/index.d.ts", "scripts": { "build": "tsc --outDir dist/", - "prepublishOnly": "npm run build" + "prepare": "npm run build" }, "dependencies": { "axios": "^0.21.4" diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/package.json b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/package.json index 95c1617e37f9..86412c07b3db 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/package.json +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/package.json @@ -15,7 +15,7 @@ "typings": "./dist/index.d.ts", "scripts": { "build": "tsc --outDir dist/", - "prepublishOnly": "npm run build" + "prepare": "npm run build" }, "dependencies": { "axios": "^0.21.4" diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/package.json b/samples/client/petstore/typescript-axios/builds/with-npm-version/package.json index 95c1617e37f9..86412c07b3db 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version/package.json +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/package.json @@ -15,7 +15,7 @@ "typings": "./dist/index.d.ts", "scripts": { "build": "tsc --outDir dist/", - "prepublishOnly": "npm run build" + "prepare": "npm run build" }, "dependencies": { "axios": "^0.21.4" From 1953e706613cdedf26eebcdfedfca8483e85f5d9 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 25 Nov 2021 13:28:33 +0800 Subject: [PATCH 033/117] [C#][netcore] minor code improvement (#10951) * minor code improvement * better code format --- .../resources/csharp-netcore/api.mustache | 53 +- .../csharp-netcore/modelGeneric.mustache | 28 +- .../src/Org.OpenAPITools/Api/MultipartApi.cs | 109 +++- .../Org.OpenAPITools/Model/InlineObject.cs | 6 +- .../Org.OpenAPITools/Model/InlineObject1.cs | 6 +- .../Org.OpenAPITools/Model/InlineObject2.cs | 10 +- .../Model/MultipartMixedMarker.cs | 6 +- .../Org.OpenAPITools/Api/AnotherFakeApi.cs | 37 +- .../src/Org.OpenAPITools/Api/DefaultApi.cs | 33 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 551 +++++++++++++----- .../Api/FakeClassnameTags123Api.cs | 37 +- .../src/Org.OpenAPITools/Api/PetApi.cs | 317 +++++++--- .../src/Org.OpenAPITools/Api/StoreApi.cs | 140 +++-- .../src/Org.OpenAPITools/Api/UserApi.cs | 300 +++++++--- .../Model/AdditionalPropertiesClass.cs | 38 +- .../src/Org.OpenAPITools/Model/Animal.cs | 14 +- .../src/Org.OpenAPITools/Model/ApiResponse.cs | 16 +- .../src/Org.OpenAPITools/Model/Apple.cs | 14 +- .../src/Org.OpenAPITools/Model/AppleReq.cs | 8 +- .../Model/ArrayOfArrayOfNumberOnly.cs | 10 +- .../Model/ArrayOfNumberOnly.cs | 10 +- .../src/Org.OpenAPITools/Model/ArrayTest.cs | 18 +- .../src/Org.OpenAPITools/Model/Banana.cs | 8 +- .../src/Org.OpenAPITools/Model/BananaReq.cs | 6 +- .../src/Org.OpenAPITools/Model/BasquePig.cs | 10 +- .../Org.OpenAPITools/Model/Capitalization.cs | 30 +- .../src/Org.OpenAPITools/Model/Cat.cs | 13 +- .../src/Org.OpenAPITools/Model/CatAllOf.cs | 8 +- .../src/Org.OpenAPITools/Model/Category.cs | 12 +- .../src/Org.OpenAPITools/Model/ChildCat.cs | 17 +- .../Org.OpenAPITools/Model/ChildCatAllOf.cs | 12 +- .../src/Org.OpenAPITools/Model/ClassModel.cs | 10 +- .../Model/ComplexQuadrilateral.cs | 14 +- .../src/Org.OpenAPITools/Model/DanishPig.cs | 10 +- .../Model/DeprecatedObject.cs | 10 +- .../src/Org.OpenAPITools/Model/Dog.cs | 15 +- .../src/Org.OpenAPITools/Model/DogAllOf.cs | 10 +- .../src/Org.OpenAPITools/Model/Drawing.cs | 18 +- .../src/Org.OpenAPITools/Model/EnumArrays.cs | 10 +- .../src/Org.OpenAPITools/Model/EnumTest.cs | 24 +- .../Model/EquilateralTriangle.cs | 14 +- .../src/Org.OpenAPITools/Model/File.cs | 10 +- .../Model/FileSchemaTestClass.cs | 14 +- .../src/Org.OpenAPITools/Model/Foo.cs | 10 +- .../src/Org.OpenAPITools/Model/FormatTest.cs | 80 ++- .../Model/GrandparentAnimal.cs | 10 +- .../Org.OpenAPITools/Model/HasOnlyReadOnly.cs | 14 +- .../Model/HealthCheckResult.cs | 10 +- .../Model/InlineResponseDefault.cs | 10 +- .../Model/IsoscelesTriangle.cs | 10 +- .../src/Org.OpenAPITools/Model/List.cs | 10 +- .../src/Org.OpenAPITools/Model/MapTest.cs | 20 +- ...dPropertiesAndAdditionalPropertiesClass.cs | 18 +- .../Model/Model200Response.cs | 12 +- .../src/Org.OpenAPITools/Model/ModelClient.cs | 10 +- .../src/Org.OpenAPITools/Model/Name.cs | 16 +- .../Org.OpenAPITools/Model/NullableClass.cs | 50 +- .../src/Org.OpenAPITools/Model/NumberOnly.cs | 8 +- .../Model/ObjectWithDeprecatedFields.cs | 20 +- .../src/Org.OpenAPITools/Model/Order.cs | 20 +- .../Org.OpenAPITools/Model/OuterComposite.cs | 14 +- .../src/Org.OpenAPITools/Model/ParentPet.cs | 11 +- .../src/Org.OpenAPITools/Model/Pet.cs | 26 +- .../Model/QuadrilateralInterface.cs | 10 +- .../Org.OpenAPITools/Model/ReadOnlyFirst.cs | 14 +- .../src/Org.OpenAPITools/Model/Return.cs | 8 +- .../Org.OpenAPITools/Model/ScaleneTriangle.cs | 14 +- .../Org.OpenAPITools/Model/ShapeInterface.cs | 10 +- .../Model/SimpleQuadrilateral.cs | 14 +- .../Model/SpecialModelName.cs | 12 +- .../src/Org.OpenAPITools/Model/Tag.cs | 12 +- .../Model/TriangleInterface.cs | 10 +- .../src/Org.OpenAPITools/Model/User.cs | 50 +- .../src/Org.OpenAPITools/Model/Whale.cs | 14 +- .../src/Org.OpenAPITools/Model/Zebra.cs | 12 +- .../Model/AdditionalPropertiesClass.cs | 38 +- .../src/Org.OpenAPITools/Model/Animal.cs | 14 +- .../src/Org.OpenAPITools/Model/ApiResponse.cs | 16 +- .../src/Org.OpenAPITools/Model/Apple.cs | 14 +- .../src/Org.OpenAPITools/Model/AppleReq.cs | 8 +- .../Model/ArrayOfArrayOfNumberOnly.cs | 10 +- .../Model/ArrayOfNumberOnly.cs | 10 +- .../src/Org.OpenAPITools/Model/ArrayTest.cs | 18 +- .../src/Org.OpenAPITools/Model/Banana.cs | 8 +- .../src/Org.OpenAPITools/Model/BananaReq.cs | 6 +- .../src/Org.OpenAPITools/Model/BasquePig.cs | 10 +- .../Org.OpenAPITools/Model/Capitalization.cs | 30 +- .../src/Org.OpenAPITools/Model/Cat.cs | 13 +- .../src/Org.OpenAPITools/Model/CatAllOf.cs | 8 +- .../src/Org.OpenAPITools/Model/Category.cs | 12 +- .../src/Org.OpenAPITools/Model/ChildCat.cs | 17 +- .../Org.OpenAPITools/Model/ChildCatAllOf.cs | 12 +- .../src/Org.OpenAPITools/Model/ClassModel.cs | 10 +- .../Model/ComplexQuadrilateral.cs | 14 +- .../src/Org.OpenAPITools/Model/DanishPig.cs | 10 +- .../Model/DeprecatedObject.cs | 10 +- .../src/Org.OpenAPITools/Model/Dog.cs | 15 +- .../src/Org.OpenAPITools/Model/DogAllOf.cs | 10 +- .../src/Org.OpenAPITools/Model/Drawing.cs | 18 +- .../src/Org.OpenAPITools/Model/EnumArrays.cs | 10 +- .../src/Org.OpenAPITools/Model/EnumTest.cs | 24 +- .../Model/EquilateralTriangle.cs | 14 +- .../src/Org.OpenAPITools/Model/File.cs | 10 +- .../Model/FileSchemaTestClass.cs | 14 +- .../src/Org.OpenAPITools/Model/Foo.cs | 10 +- .../src/Org.OpenAPITools/Model/FormatTest.cs | 80 ++- .../Model/GrandparentAnimal.cs | 10 +- .../Org.OpenAPITools/Model/HasOnlyReadOnly.cs | 14 +- .../Model/HealthCheckResult.cs | 10 +- .../Model/InlineResponseDefault.cs | 10 +- .../Model/IsoscelesTriangle.cs | 10 +- .../src/Org.OpenAPITools/Model/List.cs | 10 +- .../src/Org.OpenAPITools/Model/MapTest.cs | 20 +- ...dPropertiesAndAdditionalPropertiesClass.cs | 18 +- .../Model/Model200Response.cs | 12 +- .../src/Org.OpenAPITools/Model/ModelClient.cs | 10 +- .../src/Org.OpenAPITools/Model/Name.cs | 16 +- .../Org.OpenAPITools/Model/NullableClass.cs | 50 +- .../src/Org.OpenAPITools/Model/NumberOnly.cs | 8 +- .../Model/ObjectWithDeprecatedFields.cs | 20 +- .../src/Org.OpenAPITools/Model/Order.cs | 20 +- .../Org.OpenAPITools/Model/OuterComposite.cs | 14 +- .../src/Org.OpenAPITools/Model/ParentPet.cs | 11 +- .../src/Org.OpenAPITools/Model/Pet.cs | 26 +- .../Model/QuadrilateralInterface.cs | 10 +- .../Org.OpenAPITools/Model/ReadOnlyFirst.cs | 14 +- .../src/Org.OpenAPITools/Model/Return.cs | 8 +- .../Org.OpenAPITools/Model/ScaleneTriangle.cs | 14 +- .../Org.OpenAPITools/Model/ShapeInterface.cs | 10 +- .../Model/SimpleQuadrilateral.cs | 14 +- .../Model/SpecialModelName.cs | 12 +- .../src/Org.OpenAPITools/Model/Tag.cs | 12 +- .../Model/TriangleInterface.cs | 10 +- .../src/Org.OpenAPITools/Model/User.cs | 50 +- .../src/Org.OpenAPITools/Model/Whale.cs | 14 +- .../src/Org.OpenAPITools/Model/Zebra.cs | 12 +- .../Org.OpenAPITools/Api/AnotherFakeApi.cs | 37 +- .../src/Org.OpenAPITools/Api/DefaultApi.cs | 33 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 551 +++++++++++++----- .../Api/FakeClassnameTags123Api.cs | 37 +- .../src/Org.OpenAPITools/Api/PetApi.cs | 317 +++++++--- .../src/Org.OpenAPITools/Api/StoreApi.cs | 140 +++-- .../src/Org.OpenAPITools/Api/UserApi.cs | 300 +++++++--- .../Model/AdditionalPropertiesClass.cs | 38 +- .../src/Org.OpenAPITools/Model/Animal.cs | 14 +- .../src/Org.OpenAPITools/Model/ApiResponse.cs | 16 +- .../src/Org.OpenAPITools/Model/Apple.cs | 14 +- .../src/Org.OpenAPITools/Model/AppleReq.cs | 8 +- .../Model/ArrayOfArrayOfNumberOnly.cs | 10 +- .../Model/ArrayOfNumberOnly.cs | 10 +- .../src/Org.OpenAPITools/Model/ArrayTest.cs | 18 +- .../src/Org.OpenAPITools/Model/Banana.cs | 8 +- .../src/Org.OpenAPITools/Model/BananaReq.cs | 6 +- .../src/Org.OpenAPITools/Model/BasquePig.cs | 10 +- .../Org.OpenAPITools/Model/Capitalization.cs | 30 +- .../src/Org.OpenAPITools/Model/Cat.cs | 13 +- .../src/Org.OpenAPITools/Model/CatAllOf.cs | 8 +- .../src/Org.OpenAPITools/Model/Category.cs | 12 +- .../src/Org.OpenAPITools/Model/ChildCat.cs | 17 +- .../Org.OpenAPITools/Model/ChildCatAllOf.cs | 12 +- .../src/Org.OpenAPITools/Model/ClassModel.cs | 10 +- .../Model/ComplexQuadrilateral.cs | 14 +- .../src/Org.OpenAPITools/Model/DanishPig.cs | 10 +- .../Model/DeprecatedObject.cs | 10 +- .../src/Org.OpenAPITools/Model/Dog.cs | 15 +- .../src/Org.OpenAPITools/Model/DogAllOf.cs | 10 +- .../src/Org.OpenAPITools/Model/Drawing.cs | 18 +- .../src/Org.OpenAPITools/Model/EnumArrays.cs | 10 +- .../src/Org.OpenAPITools/Model/EnumTest.cs | 24 +- .../Model/EquilateralTriangle.cs | 14 +- .../src/Org.OpenAPITools/Model/File.cs | 10 +- .../Model/FileSchemaTestClass.cs | 14 +- .../src/Org.OpenAPITools/Model/Foo.cs | 10 +- .../src/Org.OpenAPITools/Model/FormatTest.cs | 80 ++- .../Model/GrandparentAnimal.cs | 10 +- .../Org.OpenAPITools/Model/HasOnlyReadOnly.cs | 14 +- .../Model/HealthCheckResult.cs | 10 +- .../Model/InlineResponseDefault.cs | 10 +- .../Model/IsoscelesTriangle.cs | 10 +- .../src/Org.OpenAPITools/Model/List.cs | 10 +- .../src/Org.OpenAPITools/Model/MapTest.cs | 20 +- ...dPropertiesAndAdditionalPropertiesClass.cs | 18 +- .../Model/Model200Response.cs | 12 +- .../src/Org.OpenAPITools/Model/ModelClient.cs | 10 +- .../src/Org.OpenAPITools/Model/Name.cs | 16 +- .../Org.OpenAPITools/Model/NullableClass.cs | 50 +- .../src/Org.OpenAPITools/Model/NumberOnly.cs | 8 +- .../Model/ObjectWithDeprecatedFields.cs | 20 +- .../src/Org.OpenAPITools/Model/Order.cs | 20 +- .../Org.OpenAPITools/Model/OuterComposite.cs | 14 +- .../src/Org.OpenAPITools/Model/ParentPet.cs | 11 +- .../src/Org.OpenAPITools/Model/Pet.cs | 26 +- .../Model/QuadrilateralInterface.cs | 10 +- .../Org.OpenAPITools/Model/ReadOnlyFirst.cs | 14 +- .../src/Org.OpenAPITools/Model/Return.cs | 8 +- .../Org.OpenAPITools/Model/ScaleneTriangle.cs | 14 +- .../Org.OpenAPITools/Model/ShapeInterface.cs | 10 +- .../Model/SimpleQuadrilateral.cs | 14 +- .../Model/SpecialModelName.cs | 12 +- .../src/Org.OpenAPITools/Model/Tag.cs | 12 +- .../Model/TriangleInterface.cs | 10 +- .../src/Org.OpenAPITools/Model/User.cs | 50 +- .../src/Org.OpenAPITools/Model/Whale.cs | 14 +- .../src/Org.OpenAPITools/Model/Zebra.cs | 12 +- .../Org.OpenAPITools/Api/AnotherFakeApi.cs | 37 +- .../src/Org.OpenAPITools/Api/DefaultApi.cs | 33 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 551 +++++++++++++----- .../Api/FakeClassnameTags123Api.cs | 37 +- .../src/Org.OpenAPITools/Api/PetApi.cs | 317 +++++++--- .../src/Org.OpenAPITools/Api/StoreApi.cs | 140 +++-- .../src/Org.OpenAPITools/Api/UserApi.cs | 300 +++++++--- .../Model/AdditionalPropertiesClass.cs | 38 +- .../src/Org.OpenAPITools/Model/Animal.cs | 14 +- .../src/Org.OpenAPITools/Model/ApiResponse.cs | 16 +- .../src/Org.OpenAPITools/Model/Apple.cs | 14 +- .../src/Org.OpenAPITools/Model/AppleReq.cs | 8 +- .../Model/ArrayOfArrayOfNumberOnly.cs | 10 +- .../Model/ArrayOfNumberOnly.cs | 10 +- .../src/Org.OpenAPITools/Model/ArrayTest.cs | 18 +- .../src/Org.OpenAPITools/Model/Banana.cs | 8 +- .../src/Org.OpenAPITools/Model/BananaReq.cs | 6 +- .../src/Org.OpenAPITools/Model/BasquePig.cs | 10 +- .../Org.OpenAPITools/Model/Capitalization.cs | 30 +- .../src/Org.OpenAPITools/Model/Cat.cs | 13 +- .../src/Org.OpenAPITools/Model/CatAllOf.cs | 8 +- .../src/Org.OpenAPITools/Model/Category.cs | 12 +- .../src/Org.OpenAPITools/Model/ChildCat.cs | 17 +- .../Org.OpenAPITools/Model/ChildCatAllOf.cs | 12 +- .../src/Org.OpenAPITools/Model/ClassModel.cs | 10 +- .../Model/ComplexQuadrilateral.cs | 14 +- .../src/Org.OpenAPITools/Model/DanishPig.cs | 10 +- .../Model/DeprecatedObject.cs | 10 +- .../src/Org.OpenAPITools/Model/Dog.cs | 15 +- .../src/Org.OpenAPITools/Model/DogAllOf.cs | 10 +- .../src/Org.OpenAPITools/Model/Drawing.cs | 18 +- .../src/Org.OpenAPITools/Model/EnumArrays.cs | 10 +- .../src/Org.OpenAPITools/Model/EnumTest.cs | 24 +- .../Model/EquilateralTriangle.cs | 14 +- .../src/Org.OpenAPITools/Model/File.cs | 10 +- .../Model/FileSchemaTestClass.cs | 14 +- .../src/Org.OpenAPITools/Model/Foo.cs | 10 +- .../src/Org.OpenAPITools/Model/FormatTest.cs | 80 ++- .../Model/GrandparentAnimal.cs | 10 +- .../Org.OpenAPITools/Model/HasOnlyReadOnly.cs | 14 +- .../Model/HealthCheckResult.cs | 10 +- .../Model/InlineResponseDefault.cs | 10 +- .../Model/IsoscelesTriangle.cs | 10 +- .../src/Org.OpenAPITools/Model/List.cs | 10 +- .../src/Org.OpenAPITools/Model/MapTest.cs | 20 +- ...dPropertiesAndAdditionalPropertiesClass.cs | 18 +- .../Model/Model200Response.cs | 12 +- .../src/Org.OpenAPITools/Model/ModelClient.cs | 10 +- .../src/Org.OpenAPITools/Model/Name.cs | 16 +- .../Org.OpenAPITools/Model/NullableClass.cs | 50 +- .../src/Org.OpenAPITools/Model/NumberOnly.cs | 8 +- .../Model/ObjectWithDeprecatedFields.cs | 20 +- .../src/Org.OpenAPITools/Model/Order.cs | 20 +- .../Org.OpenAPITools/Model/OuterComposite.cs | 14 +- .../src/Org.OpenAPITools/Model/ParentPet.cs | 11 +- .../src/Org.OpenAPITools/Model/Pet.cs | 26 +- .../Model/QuadrilateralInterface.cs | 10 +- .../Org.OpenAPITools/Model/ReadOnlyFirst.cs | 14 +- .../src/Org.OpenAPITools/Model/Return.cs | 8 +- .../Org.OpenAPITools/Model/ScaleneTriangle.cs | 14 +- .../Org.OpenAPITools/Model/ShapeInterface.cs | 10 +- .../Model/SimpleQuadrilateral.cs | 14 +- .../Model/SpecialModelName.cs | 12 +- .../src/Org.OpenAPITools/Model/Tag.cs | 12 +- .../Model/TriangleInterface.cs | 10 +- .../src/Org.OpenAPITools/Model/User.cs | 50 +- .../src/Org.OpenAPITools/Model/Whale.cs | 14 +- .../src/Org.OpenAPITools/Model/Zebra.cs | 12 +- .../Org.OpenAPITools/Api/AnotherFakeApi.cs | 37 +- .../src/Org.OpenAPITools/Api/DefaultApi.cs | 33 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 551 +++++++++++++----- .../Api/FakeClassnameTags123Api.cs | 37 +- .../src/Org.OpenAPITools/Api/PetApi.cs | 317 +++++++--- .../src/Org.OpenAPITools/Api/StoreApi.cs | 140 +++-- .../src/Org.OpenAPITools/Api/UserApi.cs | 300 +++++++--- .../Model/AdditionalPropertiesClass.cs | 38 +- .../src/Org.OpenAPITools/Model/Animal.cs | 14 +- .../src/Org.OpenAPITools/Model/ApiResponse.cs | 16 +- .../src/Org.OpenAPITools/Model/Apple.cs | 14 +- .../src/Org.OpenAPITools/Model/AppleReq.cs | 8 +- .../Model/ArrayOfArrayOfNumberOnly.cs | 10 +- .../Model/ArrayOfNumberOnly.cs | 10 +- .../src/Org.OpenAPITools/Model/ArrayTest.cs | 18 +- .../src/Org.OpenAPITools/Model/Banana.cs | 8 +- .../src/Org.OpenAPITools/Model/BananaReq.cs | 6 +- .../src/Org.OpenAPITools/Model/BasquePig.cs | 10 +- .../Org.OpenAPITools/Model/Capitalization.cs | 30 +- .../src/Org.OpenAPITools/Model/Cat.cs | 13 +- .../src/Org.OpenAPITools/Model/CatAllOf.cs | 8 +- .../src/Org.OpenAPITools/Model/Category.cs | 12 +- .../src/Org.OpenAPITools/Model/ChildCat.cs | 17 +- .../Org.OpenAPITools/Model/ChildCatAllOf.cs | 12 +- .../src/Org.OpenAPITools/Model/ClassModel.cs | 10 +- .../Model/ComplexQuadrilateral.cs | 14 +- .../src/Org.OpenAPITools/Model/DanishPig.cs | 10 +- .../Model/DeprecatedObject.cs | 10 +- .../src/Org.OpenAPITools/Model/Dog.cs | 15 +- .../src/Org.OpenAPITools/Model/DogAllOf.cs | 10 +- .../src/Org.OpenAPITools/Model/Drawing.cs | 18 +- .../src/Org.OpenAPITools/Model/EnumArrays.cs | 10 +- .../src/Org.OpenAPITools/Model/EnumTest.cs | 24 +- .../Model/EquilateralTriangle.cs | 14 +- .../src/Org.OpenAPITools/Model/File.cs | 10 +- .../Model/FileSchemaTestClass.cs | 14 +- .../src/Org.OpenAPITools/Model/Foo.cs | 10 +- .../src/Org.OpenAPITools/Model/FormatTest.cs | 80 ++- .../Model/GrandparentAnimal.cs | 10 +- .../Org.OpenAPITools/Model/HasOnlyReadOnly.cs | 14 +- .../Model/HealthCheckResult.cs | 10 +- .../Model/InlineResponseDefault.cs | 10 +- .../Model/IsoscelesTriangle.cs | 10 +- .../src/Org.OpenAPITools/Model/List.cs | 10 +- .../src/Org.OpenAPITools/Model/MapTest.cs | 20 +- ...dPropertiesAndAdditionalPropertiesClass.cs | 18 +- .../Model/Model200Response.cs | 12 +- .../src/Org.OpenAPITools/Model/ModelClient.cs | 10 +- .../src/Org.OpenAPITools/Model/Name.cs | 16 +- .../Org.OpenAPITools/Model/NullableClass.cs | 50 +- .../src/Org.OpenAPITools/Model/NumberOnly.cs | 8 +- .../Model/ObjectWithDeprecatedFields.cs | 20 +- .../src/Org.OpenAPITools/Model/Order.cs | 20 +- .../Org.OpenAPITools/Model/OuterComposite.cs | 14 +- .../src/Org.OpenAPITools/Model/ParentPet.cs | 11 +- .../src/Org.OpenAPITools/Model/Pet.cs | 26 +- .../Model/QuadrilateralInterface.cs | 10 +- .../Org.OpenAPITools/Model/ReadOnlyFirst.cs | 14 +- .../src/Org.OpenAPITools/Model/Return.cs | 8 +- .../Org.OpenAPITools/Model/ScaleneTriangle.cs | 14 +- .../Org.OpenAPITools/Model/ShapeInterface.cs | 10 +- .../Model/SimpleQuadrilateral.cs | 14 +- .../Model/SpecialModelName.cs | 12 +- .../src/Org.OpenAPITools/Model/Tag.cs | 12 +- .../Model/TriangleInterface.cs | 10 +- .../src/Org.OpenAPITools/Model/User.cs | 50 +- .../src/Org.OpenAPITools/Model/Whale.cs | 14 +- .../src/Org.OpenAPITools/Model/Zebra.cs | 12 +- .../Org.OpenAPITools/Api/AnotherFakeApi.cs | 37 +- .../src/Org.OpenAPITools/Api/DefaultApi.cs | 33 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 551 +++++++++++++----- .../Api/FakeClassnameTags123Api.cs | 37 +- .../src/Org.OpenAPITools/Api/PetApi.cs | 317 +++++++--- .../src/Org.OpenAPITools/Api/StoreApi.cs | 140 +++-- .../src/Org.OpenAPITools/Api/UserApi.cs | 300 +++++++--- .../Model/AdditionalPropertiesClass.cs | 34 +- .../src/Org.OpenAPITools/Model/Animal.cs | 10 +- .../src/Org.OpenAPITools/Model/ApiResponse.cs | 12 +- .../src/Org.OpenAPITools/Model/Apple.cs | 10 +- .../src/Org.OpenAPITools/Model/AppleReq.cs | 8 +- .../Model/ArrayOfArrayOfNumberOnly.cs | 6 +- .../Model/ArrayOfNumberOnly.cs | 6 +- .../src/Org.OpenAPITools/Model/ArrayTest.cs | 14 +- .../src/Org.OpenAPITools/Model/Banana.cs | 4 +- .../src/Org.OpenAPITools/Model/BananaReq.cs | 6 +- .../src/Org.OpenAPITools/Model/BasquePig.cs | 6 +- .../Org.OpenAPITools/Model/Capitalization.cs | 26 +- .../src/Org.OpenAPITools/Model/Cat.cs | 9 +- .../src/Org.OpenAPITools/Model/CatAllOf.cs | 4 +- .../src/Org.OpenAPITools/Model/Category.cs | 8 +- .../src/Org.OpenAPITools/Model/ChildCat.cs | 13 +- .../Org.OpenAPITools/Model/ChildCatAllOf.cs | 8 +- .../src/Org.OpenAPITools/Model/ClassModel.cs | 6 +- .../Model/ComplexQuadrilateral.cs | 10 +- .../src/Org.OpenAPITools/Model/DanishPig.cs | 6 +- .../Model/DeprecatedObject.cs | 6 +- .../src/Org.OpenAPITools/Model/Dog.cs | 11 +- .../src/Org.OpenAPITools/Model/DogAllOf.cs | 6 +- .../src/Org.OpenAPITools/Model/Drawing.cs | 18 +- .../src/Org.OpenAPITools/Model/EnumArrays.cs | 6 +- .../src/Org.OpenAPITools/Model/EnumTest.cs | 20 +- .../Model/EquilateralTriangle.cs | 10 +- .../src/Org.OpenAPITools/Model/File.cs | 6 +- .../Model/FileSchemaTestClass.cs | 10 +- .../src/Org.OpenAPITools/Model/Foo.cs | 6 +- .../src/Org.OpenAPITools/Model/FormatTest.cs | 76 ++- .../Model/GrandparentAnimal.cs | 6 +- .../Org.OpenAPITools/Model/HasOnlyReadOnly.cs | 10 +- .../Model/HealthCheckResult.cs | 6 +- .../Model/InlineResponseDefault.cs | 6 +- .../Model/IsoscelesTriangle.cs | 10 +- .../src/Org.OpenAPITools/Model/List.cs | 6 +- .../src/Org.OpenAPITools/Model/MapTest.cs | 16 +- ...dPropertiesAndAdditionalPropertiesClass.cs | 14 +- .../Model/Model200Response.cs | 8 +- .../src/Org.OpenAPITools/Model/ModelClient.cs | 6 +- .../src/Org.OpenAPITools/Model/Name.cs | 12 +- .../Org.OpenAPITools/Model/NullableClass.cs | 50 +- .../src/Org.OpenAPITools/Model/NumberOnly.cs | 4 +- .../Model/ObjectWithDeprecatedFields.cs | 16 +- .../src/Org.OpenAPITools/Model/Order.cs | 16 +- .../Org.OpenAPITools/Model/OuterComposite.cs | 10 +- .../src/Org.OpenAPITools/Model/ParentPet.cs | 7 +- .../src/Org.OpenAPITools/Model/Pet.cs | 22 +- .../Model/QuadrilateralInterface.cs | 6 +- .../Org.OpenAPITools/Model/ReadOnlyFirst.cs | 10 +- .../src/Org.OpenAPITools/Model/Return.cs | 4 +- .../Org.OpenAPITools/Model/ScaleneTriangle.cs | 10 +- .../Org.OpenAPITools/Model/ShapeInterface.cs | 6 +- .../Model/SimpleQuadrilateral.cs | 10 +- .../Model/SpecialModelName.cs | 8 +- .../src/Org.OpenAPITools/Model/Tag.cs | 8 +- .../Model/TriangleInterface.cs | 6 +- .../src/Org.OpenAPITools/Model/User.cs | 46 +- .../src/Org.OpenAPITools/Model/Whale.cs | 10 +- .../src/Org.OpenAPITools/Model/Zebra.cs | 12 +- .../src/Org.OpenAPITools/Api/PetApi.cs | 280 ++++++--- .../src/Org.OpenAPITools/Api/StoreApi.cs | 140 +++-- .../src/Org.OpenAPITools/Api/UserApi.cs | 300 +++++++--- .../src/Org.OpenAPITools/Model/ApiResponse.cs | 12 +- .../src/Org.OpenAPITools/Model/Category.cs | 8 +- .../src/Org.OpenAPITools/Model/Order.cs | 16 +- .../src/Org.OpenAPITools/Model/Pet.cs | 22 +- .../src/Org.OpenAPITools/Model/Tag.cs | 8 +- .../src/Org.OpenAPITools/Model/User.cs | 30 +- 417 files changed, 9873 insertions(+), 3788 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache index 86ea63f978ea..ce2000f63e97 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache @@ -259,7 +259,9 @@ namespace {{packageName}}.{{apiPackage}} {{^vendorExtensions.x-csharp-value-type}} // verify the required parameter '{{paramName}}' is set if ({{paramName}} == null) + { throw new {{packageName}}.Client.ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); + } {{/vendorExtensions.x-csharp-value-type}} {{/required}} @@ -280,10 +282,16 @@ namespace {{packageName}}.{{apiPackage}} }; var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } {{#pathParams}} {{#required}} @@ -314,12 +322,12 @@ namespace {{packageName}}.{{apiPackage}} if ({{paramName}} != null) { {{#isDeepObject}} - {{#items.vars}} + {{#items.vars}} if ({{paramName}}.{{name}} != null) { localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); } - {{/items.vars}} + {{/items.vars}} {{^items}} localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); {{/items}} @@ -345,7 +353,8 @@ namespace {{packageName}}.{{apiPackage}} {{#required}} {{#isFile}} {{#isArray}} - foreach (var file in {{paramName}}) { + foreach (var file in {{paramName}}) + { localVarRequestOptions.FileParameters.Add("{{baseName}}", file); } {{/isArray}} @@ -362,7 +371,8 @@ namespace {{packageName}}.{{apiPackage}} { {{#isFile}} {{#isArray}} - foreach (var file in {{paramName}}) { + foreach (var file in {{paramName}}) + { localVarRequestOptions.FileParameters.Add("{{baseName}}", file); } {{/isArray}} @@ -445,11 +455,13 @@ namespace {{packageName}}.{{apiPackage}} // make the HTTP request var localVarResponse = this.Client.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("{{operationId}}", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -493,7 +505,9 @@ namespace {{packageName}}.{{apiPackage}} {{^vendorExtensions.x-csharp-value-type}} // verify the required parameter '{{paramName}}' is set if ({{paramName}} == null) + { throw new {{packageName}}.Client.ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); + } {{/vendorExtensions.x-csharp-value-type}} {{/required}} @@ -514,12 +528,17 @@ namespace {{packageName}}.{{apiPackage}} {{/produces}} }; - var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } {{#pathParams}} {{#required}} @@ -558,7 +577,8 @@ namespace {{packageName}}.{{apiPackage}} {{#required}} {{#isFile}} {{#isArray}} - foreach (var file in {{paramName}}) { + foreach (var file in {{paramName}}) + { localVarRequestOptions.FileParameters.Add("{{baseName}}", file); } {{/isArray}} @@ -575,7 +595,8 @@ namespace {{packageName}}.{{apiPackage}} { {{#isFile}} {{#isArray}} - foreach (var file in {{paramName}}) { + foreach (var file in {{paramName}}) + { localVarRequestOptions.FileParameters.Add("{{baseName}}", file); } {{/isArray}} @@ -659,13 +680,15 @@ namespace {{packageName}}.{{apiPackage}} {{/authMethods}} // make the HTTP request - var localVarResponse = await this.AsynchronousClient.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}Async<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("{{operationId}}", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/modelGeneric.mustache index e7dfa174d9b3..3e554c1f9804 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/modelGeneric.mustache @@ -284,7 +284,7 @@ /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class {{classname}} {\n"); {{#parent}} sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); @@ -335,8 +335,9 @@ {{/useCompareNetObjects}} {{^useCompareNetObjects}} if (input == null) + { return false; - + } return {{#vars}}{{#parent}}base.Equals(input) && {{/parent}}{{^isContainer}} ( this.{{name}} == input.{{name}} || @@ -377,15 +378,19 @@ {{#vars}} {{^vendorExtensions.x-is-value-type}} if (this.{{name}} != null) - hashCode = hashCode * 59 + this.{{name}}.GetHashCode(); + { + hashCode = (hashCode * 59) + this.{{name}}.GetHashCode(); + } {{/vendorExtensions.x-is-value-type}} {{#vendorExtensions.x-is-value-type}} - hashCode = hashCode * 59 + this.{{name}}.GetHashCode(); + hashCode = (hashCode * 59) + this.{{name}}.GetHashCode(); {{/vendorExtensions.x-is-value-type}} {{/vars}} {{#isAdditionalPropertiesTrue}} if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } {{/isAdditionalPropertiesTrue}} return hashCode; } @@ -423,7 +428,10 @@ {{#parent}} {{^isArray}} {{^isMap}} - foreach(var x in BaseValidate(validationContext)) yield return x; + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } {{/isMap}} {{/isArray}} {{/parent}} @@ -432,7 +440,7 @@ {{^isEnum}} {{#maxLength}} // {{{name}}} ({{{dataType}}}) maxLength - if(this.{{{name}}} != null && this.{{{name}}}.Length > {{maxLength}}) + if (this.{{{name}}} != null && this.{{{name}}}.Length > {{maxLength}}) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, length must be less than {{maxLength}}.", new [] { "{{{name}}}" }); } @@ -440,7 +448,7 @@ {{/maxLength}} {{#minLength}} // {{{name}}} ({{{dataType}}}) minLength - if(this.{{{name}}} != null && this.{{{name}}}.Length < {{minLength}}) + if (this.{{{name}}} != null && this.{{{name}}}.Length < {{minLength}}) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, length must be greater than {{minLength}}.", new [] { "{{{name}}}" }); } @@ -448,7 +456,7 @@ {{/minLength}} {{#maximum}} // {{{name}}} ({{{dataType}}}) maximum - if(this.{{{name}}} > ({{{dataType}}}){{maximum}}) + if (this.{{{name}}} > ({{{dataType}}}){{maximum}}) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, must be a value less than or equal to {{maximum}}.", new [] { "{{{name}}}" }); } @@ -456,7 +464,7 @@ {{/maximum}} {{#minimum}} // {{{name}}} ({{{dataType}}}) minimum - if(this.{{{name}}} < ({{{dataType}}}){{minimum}}) + if (this.{{{name}}} < ({{{dataType}}}){{minimum}}) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, must be a value greater than or equal to {{minimum}}.", new [] { "{{{name}}}" }); } diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Api/MultipartApi.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Api/MultipartApi.cs index 30aaf723ab47..aa92ab8297b3 100644 --- a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Api/MultipartApi.cs +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Api/MultipartApi.cs @@ -321,14 +321,21 @@ public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } if (files != null) { - foreach (var file in files) { + foreach (var file in files) + { localVarRequestOptions.FileParameters.Add("files", file); } } @@ -336,11 +343,13 @@ public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory // make the HTTP request var localVarResponse = this.Client.Post("/multipart-array", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("MultipartArray", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -378,29 +387,37 @@ public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } if (files != null) { - foreach (var file in files) { + foreach (var file in files) + { localVarRequestOptions.FileParameters.Add("files", file); } } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/multipart-array", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("MultipartArray", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -429,7 +446,9 @@ public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory { // verify the required parameter 'file' is set if (file == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'file' when calling MultipartApi->MultipartMixed"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -442,10 +461,16 @@ public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } if (marker != null) { @@ -456,11 +481,13 @@ public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory // make the HTTP request var localVarResponse = this.Client.Post("/multipart-mixed", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("MultipartMixed", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -491,7 +518,9 @@ public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory { // verify the required parameter 'file' is set if (file == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'file' when calling MultipartApi->MultipartMixed"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -504,12 +533,17 @@ public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } if (marker != null) { @@ -519,13 +553,15 @@ public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/multipart-mixed", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("MultipartMixed", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -561,10 +597,16 @@ public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } if (file != null) { @@ -574,11 +616,13 @@ public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory // make the HTTP request var localVarResponse = this.Client.Post("/multipart-single", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("MultipartSingle", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -616,12 +660,17 @@ public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } if (file != null) { @@ -630,13 +679,15 @@ public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/multipart-single", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("MultipartSingle", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/InlineObject.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/InlineObject.cs index 1fd426b347ff..ae2d365c5e23 100644 --- a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/InlineObject.cs +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/InlineObject.cs @@ -54,7 +54,7 @@ public partial class InlineObject : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class InlineObject {\n"); sb.Append(" Files: ").Append(Files).Append("\n"); sb.Append("}\n"); @@ -100,7 +100,9 @@ public override int GetHashCode() { int hashCode = 41; if (this.Files != null) - hashCode = hashCode * 59 + this.Files.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Files.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/InlineObject1.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/InlineObject1.cs index cda1fbd4a740..aee5f5ed83c5 100644 --- a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/InlineObject1.cs +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/InlineObject1.cs @@ -54,7 +54,7 @@ public partial class InlineObject1 : IEquatable, IValidatableObje /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class InlineObject1 {\n"); sb.Append(" File: ").Append(File).Append("\n"); sb.Append("}\n"); @@ -100,7 +100,9 @@ public override int GetHashCode() { int hashCode = 41; if (this.File != null) - hashCode = hashCode * 59 + this.File.GetHashCode(); + { + hashCode = (hashCode * 59) + this.File.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/InlineObject2.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/InlineObject2.cs index 18d60e31ac8d..f16962cc4eb1 100644 --- a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/InlineObject2.cs +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/InlineObject2.cs @@ -71,7 +71,7 @@ protected InlineObject2() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class InlineObject2 {\n"); sb.Append(" Marker: ").Append(Marker).Append("\n"); sb.Append(" File: ").Append(File).Append("\n"); @@ -118,9 +118,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.Marker != null) - hashCode = hashCode * 59 + this.Marker.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Marker.GetHashCode(); + } if (this.File != null) - hashCode = hashCode * 59 + this.File.GetHashCode(); + { + hashCode = (hashCode * 59) + this.File.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartMixedMarker.cs b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartMixedMarker.cs index b10b4a7afeb3..ee18f1fc14b7 100644 --- a/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartMixedMarker.cs +++ b/samples/client/others/csharp-netcore-complex-files/src/Org.OpenAPITools/Model/MultipartMixedMarker.cs @@ -53,7 +53,7 @@ public partial class MultipartMixedMarker : IEquatable, IV /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class MultipartMixedMarker {\n"); sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append("}\n"); @@ -99,7 +99,9 @@ public override int GetHashCode() { int hashCode = 41; if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index ad48306e00ce..ac8fbdcdc946 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -221,7 +221,9 @@ public Org.OpenAPITools.Client.ApiResponse Call123TestSpecialTagsWi { // verify the required parameter 'modelClient' is set if (modelClient == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling AnotherFakeApi->Call123TestSpecialTags"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -235,21 +237,29 @@ public Org.OpenAPITools.Client.ApiResponse Call123TestSpecialTagsWi }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = modelClient; // make the HTTP request var localVarResponse = this.Client.Patch("/another-fake/dummy", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("Call123TestSpecialTags", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -279,7 +289,9 @@ public Org.OpenAPITools.Client.ApiResponse Call123TestSpecialTagsWi { // verify the required parameter 'modelClient' is set if (modelClient == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling AnotherFakeApi->Call123TestSpecialTags"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -293,24 +305,31 @@ public Org.OpenAPITools.Client.ApiResponse Call123TestSpecialTagsWi "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = modelClient; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PatchAsync("/another-fake/dummy", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("Call123TestSpecialTags", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/DefaultApi.cs index 8844aca4ab73..a9e5cfb9c4d2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -221,20 +221,28 @@ public Org.OpenAPITools.Client.ApiResponse FooGetWithHttp }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request var localVarResponse = this.Client.Get("/foo", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FooGet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -271,23 +279,30 @@ public Org.OpenAPITools.Client.ApiResponse FooGetWithHttp "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/foo", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FooGet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/FakeApi.cs index dab406002f81..57a99469634f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/FakeApi.cs @@ -945,20 +945,28 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request var localVarResponse = this.Client.Get("/fake/health", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeHealthGet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -995,23 +1003,30 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/fake/health", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeHealthGet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1049,21 +1064,29 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = body; // make the HTTP request var localVarResponse = this.Client.Post("/fake/outer/boolean", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterBooleanSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1103,24 +1126,31 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH "*/*" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = body; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/boolean", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterBooleanSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1158,21 +1188,29 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = outerComposite; // make the HTTP request var localVarResponse = this.Client.Post("/fake/outer/composite", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterCompositeSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1212,24 +1250,31 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH "*/*" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = outerComposite; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/composite", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterCompositeSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1267,21 +1312,29 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = body; // make the HTTP request var localVarResponse = this.Client.Post("/fake/outer/number", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterNumberSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1321,24 +1374,31 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH "*/*" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = body; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/number", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterNumberSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1376,21 +1436,29 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = body; // make the HTTP request var localVarResponse = this.Client.Post("/fake/outer/string", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterStringSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1430,24 +1498,31 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH "*/*" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = body; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/string", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterStringSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1482,20 +1557,28 @@ public Org.OpenAPITools.Client.ApiResponse> GetArrayOfEnumsWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request var localVarResponse = this.Client.Get>("/fake/array-of-enums", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetArrayOfEnums", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1532,23 +1615,30 @@ public Org.OpenAPITools.Client.ApiResponse> GetArrayOfEnumsWithH "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync>("/fake/array-of-enums", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetArrayOfEnums", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1575,7 +1665,9 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithFileSchemaWithHtt { // verify the required parameter 'fileSchemaTestClass' is set if (fileSchemaTestClass == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'fileSchemaTestClass' when calling FakeApi->TestBodyWithFileSchema"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1588,21 +1680,29 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithFileSchemaWithHtt }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = fileSchemaTestClass; // make the HTTP request var localVarResponse = this.Client.Put("/fake/body-with-file-schema", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestBodyWithFileSchema", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1631,7 +1731,9 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithFileSchemaWithHtt { // verify the required parameter 'fileSchemaTestClass' is set if (fileSchemaTestClass == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'fileSchemaTestClass' when calling FakeApi->TestBodyWithFileSchema"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1644,24 +1746,31 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithFileSchemaWithHtt string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = fileSchemaTestClass; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/body-with-file-schema", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestBodyWithFileSchema", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1690,11 +1799,15 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithQueryParamsWithHt { // verify the required parameter 'query' is set if (query == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'query' when calling FakeApi->TestBodyWithQueryParams"); + } // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling FakeApi->TestBodyWithQueryParams"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1707,10 +1820,16 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithQueryParamsWithHt }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "query", query)); localVarRequestOptions.Data = user; @@ -1718,11 +1837,13 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithQueryParamsWithHt // make the HTTP request var localVarResponse = this.Client.Put("/fake/body-with-query-params", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestBodyWithQueryParams", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1753,11 +1874,15 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithQueryParamsWithHt { // verify the required parameter 'query' is set if (query == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'query' when calling FakeApi->TestBodyWithQueryParams"); + } // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling FakeApi->TestBodyWithQueryParams"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1770,25 +1895,32 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithQueryParamsWithHt string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "query", query)); localVarRequestOptions.Data = user; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/body-with-query-params", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestBodyWithQueryParams", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1816,7 +1948,9 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI { // verify the required parameter 'modelClient' is set if (modelClient == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling FakeApi->TestClientModel"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1830,21 +1964,29 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = modelClient; // make the HTTP request var localVarResponse = this.Client.Patch("/fake", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestClientModel", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1874,7 +2016,9 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI { // verify the required parameter 'modelClient' is set if (modelClient == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling FakeApi->TestClientModel"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1888,24 +2032,31 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = modelClient; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PatchAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestClientModel", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1958,11 +2109,15 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI { // verify the required parameter 'patternWithoutDelimiter' is set if (patternWithoutDelimiter == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'patternWithoutDelimiter' when calling FakeApi->TestEndpointParameters"); + } // verify the required parameter '_byte' is set if (_byte == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter '_byte' when calling FakeApi->TestEndpointParameters"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1975,10 +2130,16 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } if (integer != null) { @@ -2034,11 +2195,13 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI // make the HTTP request var localVarResponse = this.Client.Post("/fake", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestEndpointParameters", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2093,11 +2256,15 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI { // verify the required parameter 'patternWithoutDelimiter' is set if (patternWithoutDelimiter == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'patternWithoutDelimiter' when calling FakeApi->TestEndpointParameters"); + } // verify the required parameter '_byte' is set if (_byte == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter '_byte' when calling FakeApi->TestEndpointParameters"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2110,12 +2277,17 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } if (integer != null) { @@ -2170,13 +2342,15 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestEndpointParameters", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2226,10 +2400,16 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } if (enumQueryStringArray != null) { @@ -2267,11 +2447,13 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI // make the HTTP request var localVarResponse = this.Client.Get("/fake", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestEnumParameters", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2323,12 +2505,17 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } if (enumQueryStringArray != null) { @@ -2365,13 +2552,15 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestEnumParameters", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2416,10 +2605,16 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group)); @@ -2446,11 +2641,13 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI // make the HTTP request var localVarResponse = this.Client.Delete("/fake", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestGroupParameters", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2497,12 +2694,17 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group)); @@ -2528,13 +2730,15 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestGroupParameters", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2561,7 +2765,9 @@ public Org.OpenAPITools.Client.ApiResponse TestInlineAdditionalPropertie { // verify the required parameter 'requestBody' is set if (requestBody == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestInlineAdditionalProperties"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2574,21 +2780,29 @@ public Org.OpenAPITools.Client.ApiResponse TestInlineAdditionalPropertie }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = requestBody; // make the HTTP request var localVarResponse = this.Client.Post("/fake/inline-additionalProperties", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestInlineAdditionalProperties", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2617,7 +2831,9 @@ public Org.OpenAPITools.Client.ApiResponse TestInlineAdditionalPropertie { // verify the required parameter 'requestBody' is set if (requestBody == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestInlineAdditionalProperties"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2630,24 +2846,31 @@ public Org.OpenAPITools.Client.ApiResponse TestInlineAdditionalPropertie string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = requestBody; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/inline-additionalProperties", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestInlineAdditionalProperties", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2676,11 +2899,15 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo( { // verify the required parameter 'param' is set if (param == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestJsonFormData"); + } // verify the required parameter 'param2' is set if (param2 == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'param2' when calling FakeApi->TestJsonFormData"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2693,10 +2920,16 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo( }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.FormParameters.Add("param", Org.OpenAPITools.Client.ClientUtils.ParameterToString(param)); // form parameter localVarRequestOptions.FormParameters.Add("param2", Org.OpenAPITools.Client.ClientUtils.ParameterToString(param2)); // form parameter @@ -2704,11 +2937,13 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo( // make the HTTP request var localVarResponse = this.Client.Get("/fake/jsonFormData", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestJsonFormData", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2739,11 +2974,15 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo( { // verify the required parameter 'param' is set if (param == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestJsonFormData"); + } // verify the required parameter 'param2' is set if (param2 == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'param2' when calling FakeApi->TestJsonFormData"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2756,25 +2995,32 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo( string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.FormParameters.Add("param", Org.OpenAPITools.Client.ClientUtils.ParameterToString(param)); // form parameter localVarRequestOptions.FormParameters.Add("param2", Org.OpenAPITools.Client.ClientUtils.ParameterToString(param2)); // form parameter // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/fake/jsonFormData", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestJsonFormData", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2809,23 +3055,33 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF { // verify the required parameter 'pipe' is set if (pipe == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pipe' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'ioutil' is set if (ioutil == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'ioutil' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'http' is set if (http == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'http' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'url' is set if (url == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'url' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'context' is set if (context == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'context' when calling FakeApi->TestQueryParameterCollectionFormat"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2837,10 +3093,16 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "pipe", pipe)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil)); @@ -2851,11 +3113,13 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF // make the HTTP request var localVarResponse = this.Client.Put("/fake/test-query-parameters", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestQueryParameterCollectionFormat", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2892,23 +3156,33 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF { // verify the required parameter 'pipe' is set if (pipe == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pipe' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'ioutil' is set if (ioutil == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'ioutil' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'http' is set if (http == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'http' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'url' is set if (url == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'url' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'context' is set if (context == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'context' when calling FakeApi->TestQueryParameterCollectionFormat"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2920,12 +3194,17 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "pipe", pipe)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil)); @@ -2935,13 +3214,15 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/test-query-parameters", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestQueryParameterCollectionFormat", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index d4fbb5868adb..c2852b36a44b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -221,7 +221,9 @@ public Org.OpenAPITools.Client.ApiResponse TestClassnameWithHttpInf { // verify the required parameter 'modelClient' is set if (modelClient == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling FakeClassnameTags123Api->TestClassname"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -235,10 +237,16 @@ public Org.OpenAPITools.Client.ApiResponse TestClassnameWithHttpInf }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = modelClient; @@ -250,11 +258,13 @@ public Org.OpenAPITools.Client.ApiResponse TestClassnameWithHttpInf // make the HTTP request var localVarResponse = this.Client.Patch("/fake_classname_test", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestClassname", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -284,7 +294,9 @@ public Org.OpenAPITools.Client.ApiResponse TestClassnameWithHttpInf { // verify the required parameter 'modelClient' is set if (modelClient == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling FakeClassnameTags123Api->TestClassname"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -298,12 +310,17 @@ public Org.OpenAPITools.Client.ApiResponse TestClassnameWithHttpInf "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = modelClient; @@ -314,13 +331,15 @@ public Org.OpenAPITools.Client.ApiResponse TestClassnameWithHttpInf } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PatchAsync("/fake_classname_test", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestClassname", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/PetApi.cs index d73282dfca5f..39d2e425e630 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/PetApi.cs @@ -586,7 +586,9 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) { // verify the required parameter 'pet' is set if (pet == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->AddPet"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -600,10 +602,16 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = pet; @@ -632,11 +640,13 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) // make the HTTP request var localVarResponse = this.Client.Post("/pet", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("AddPet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -665,7 +675,9 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) { // verify the required parameter 'pet' is set if (pet == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->AddPet"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -679,12 +691,17 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = pet; @@ -712,13 +729,15 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/pet", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("AddPet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -755,10 +774,16 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (apiKey != null) @@ -775,11 +800,13 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) // make the HTTP request var localVarResponse = this.Client.Delete("/pet/{petId}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeletePet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -818,12 +845,17 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (apiKey != null) @@ -839,13 +871,15 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeletePet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -873,7 +907,9 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn { // verify the required parameter 'status' is set if (status == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'status' when calling PetApi->FindPetsByStatus"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -887,10 +923,16 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "status", status)); @@ -919,11 +961,13 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn // make the HTTP request var localVarResponse = this.Client.Get>("/pet/findByStatus", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FindPetsByStatus", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -953,7 +997,9 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn { // verify the required parameter 'status' is set if (status == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'status' when calling PetApi->FindPetsByStatus"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -967,12 +1013,17 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "status", status)); @@ -1000,13 +1051,15 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync>("/pet/findByStatus", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FindPetsByStatus", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1036,7 +1089,9 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo { // verify the required parameter 'tags' is set if (tags == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'tags' when calling PetApi->FindPetsByTags"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1050,10 +1105,16 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "tags", tags)); @@ -1082,11 +1143,13 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo // make the HTTP request var localVarResponse = this.Client.Get>("/pet/findByTags", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FindPetsByTags", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1118,7 +1181,9 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo { // verify the required parameter 'tags' is set if (tags == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'tags' when calling PetApi->FindPetsByTags"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1132,12 +1197,17 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "tags", tags)); @@ -1165,13 +1235,15 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync>("/pet/findByTags", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FindPetsByTags", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1209,10 +1281,16 @@ public Org.OpenAPITools.Client.ApiResponse GetPetByIdWithHttpInfo(long petI }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter @@ -1224,11 +1302,13 @@ public Org.OpenAPITools.Client.ApiResponse GetPetByIdWithHttpInfo(long petI // make the HTTP request var localVarResponse = this.Client.Get("/pet/{petId}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetPetById", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1268,12 +1348,17 @@ public Org.OpenAPITools.Client.ApiResponse GetPetByIdWithHttpInfo(long petI "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter @@ -1284,13 +1369,15 @@ public Org.OpenAPITools.Client.ApiResponse GetPetByIdWithHttpInfo(long petI } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetPetById", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1317,7 +1404,9 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet { // verify the required parameter 'pet' is set if (pet == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->UpdatePet"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1331,10 +1420,16 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = pet; @@ -1363,11 +1458,13 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet // make the HTTP request var localVarResponse = this.Client.Put("/pet", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdatePet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1396,7 +1493,9 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet { // verify the required parameter 'pet' is set if (pet == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->UpdatePet"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1410,12 +1509,17 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = pet; @@ -1443,13 +1547,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/pet", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdatePet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1489,10 +1595,16 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (name != null) @@ -1513,11 +1625,13 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet // make the HTTP request var localVarResponse = this.Client.Post("/pet/{petId}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdatePetWithForm", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1559,12 +1673,17 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (name != null) @@ -1584,13 +1703,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdatePetWithForm", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1632,10 +1753,16 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (additionalMetadata != null) @@ -1656,11 +1783,13 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet // make the HTTP request var localVarResponse = this.Client.Post("/pet/{petId}/uploadImage", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UploadFile", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1704,12 +1833,17 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (additionalMetadata != null) @@ -1729,13 +1863,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/pet/{petId}/uploadImage", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UploadFile", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1767,7 +1903,9 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet { // verify the required parameter 'requiredFile' is set if (requiredFile == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredFile' when calling PetApi->UploadFileWithRequiredFile"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1781,10 +1919,16 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (additionalMetadata != null) @@ -1802,11 +1946,13 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet // make the HTTP request var localVarResponse = this.Client.Post("/fake/{petId}/uploadImageWithRequiredFile", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UploadFileWithRequiredFile", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1840,7 +1986,9 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet { // verify the required parameter 'requiredFile' is set if (requiredFile == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredFile' when calling PetApi->UploadFileWithRequiredFile"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1854,12 +2002,17 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (additionalMetadata != null) @@ -1876,13 +2029,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/{petId}/uploadImageWithRequiredFile", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UploadFileWithRequiredFile", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/StoreApi.cs index ad7387db7057..7cda385b3b40 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/StoreApi.cs @@ -345,7 +345,9 @@ public Org.OpenAPITools.Client.ApiResponse DeleteOrderWithHttpInfo(strin { // verify the required parameter 'orderId' is set if (orderId == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -357,21 +359,29 @@ public Org.OpenAPITools.Client.ApiResponse DeleteOrderWithHttpInfo(strin }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter // make the HTTP request var localVarResponse = this.Client.Delete("/store/order/{order_id}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeleteOrder", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -400,7 +410,9 @@ public Org.OpenAPITools.Client.ApiResponse DeleteOrderWithHttpInfo(strin { // verify the required parameter 'orderId' is set if (orderId == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -412,24 +424,31 @@ public Org.OpenAPITools.Client.ApiResponse DeleteOrderWithHttpInfo(strin string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/store/order/{order_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeleteOrder", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -464,10 +483,16 @@ public Org.OpenAPITools.Client.ApiResponse> GetInventory }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // authentication (api_key) required @@ -478,11 +503,13 @@ public Org.OpenAPITools.Client.ApiResponse> GetInventory // make the HTTP request var localVarResponse = this.Client.Get>("/store/inventory", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetInventory", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -519,12 +546,17 @@ public Org.OpenAPITools.Client.ApiResponse> GetInventory "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // authentication (api_key) required @@ -534,13 +566,15 @@ public Org.OpenAPITools.Client.ApiResponse> GetInventory } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync>("/store/inventory", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetInventory", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -578,21 +612,29 @@ public Org.OpenAPITools.Client.ApiResponse GetOrderByIdWithHttpInfo(long }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter // make the HTTP request var localVarResponse = this.Client.Get("/store/order/{order_id}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetOrderById", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -632,24 +674,31 @@ public Org.OpenAPITools.Client.ApiResponse GetOrderByIdWithHttpInfo(long "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/store/order/{order_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetOrderById", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -677,7 +726,9 @@ public Org.OpenAPITools.Client.ApiResponse PlaceOrderWithHttpInfo(Order o { // verify the required parameter 'order' is set if (order == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'order' when calling StoreApi->PlaceOrder"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -692,21 +743,29 @@ public Org.OpenAPITools.Client.ApiResponse PlaceOrderWithHttpInfo(Order o }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = order; // make the HTTP request var localVarResponse = this.Client.Post("/store/order", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("PlaceOrder", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -736,7 +795,9 @@ public Org.OpenAPITools.Client.ApiResponse PlaceOrderWithHttpInfo(Order o { // verify the required parameter 'order' is set if (order == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'order' when calling StoreApi->PlaceOrder"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -751,24 +812,31 @@ public Org.OpenAPITools.Client.ApiResponse PlaceOrderWithHttpInfo(Order o "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = order; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/store/order", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("PlaceOrder", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/UserApi.cs index a2f2598c8acd..a1716303f6f3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/UserApi.cs @@ -517,7 +517,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUserWithHttpInfo(User u { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -530,21 +532,29 @@ public Org.OpenAPITools.Client.ApiResponse CreateUserWithHttpInfo(User u }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; // make the HTTP request var localVarResponse = this.Client.Post("/user", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -573,7 +583,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUserWithHttpInfo(User u { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -586,24 +598,31 @@ public Org.OpenAPITools.Client.ApiResponse CreateUserWithHttpInfo(User u string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/user", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -630,7 +649,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithArrayInputWith { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithArrayInput"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -643,21 +664,29 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithArrayInputWith }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; // make the HTTP request var localVarResponse = this.Client.Post("/user/createWithArray", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUsersWithArrayInput", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -686,7 +715,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithArrayInputWith { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithArrayInput"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -699,24 +730,31 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithArrayInputWith string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/user/createWithArray", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUsersWithArrayInput", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -743,7 +781,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithListInputWithH { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithListInput"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -756,21 +796,29 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithListInputWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; // make the HTTP request var localVarResponse = this.Client.Post("/user/createWithList", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUsersWithListInput", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -799,7 +847,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithListInputWithH { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithListInput"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -812,24 +862,31 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithListInputWithH string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/user/createWithList", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUsersWithListInput", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -856,7 +913,9 @@ public Org.OpenAPITools.Client.ApiResponse DeleteUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->DeleteUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -868,21 +927,29 @@ public Org.OpenAPITools.Client.ApiResponse DeleteUserWithHttpInfo(string }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter // make the HTTP request var localVarResponse = this.Client.Delete("/user/{username}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeleteUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -911,7 +978,9 @@ public Org.OpenAPITools.Client.ApiResponse DeleteUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->DeleteUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -923,24 +992,31 @@ public Org.OpenAPITools.Client.ApiResponse DeleteUserWithHttpInfo(string string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeleteUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -968,7 +1044,9 @@ public Org.OpenAPITools.Client.ApiResponse GetUserByNameWithHttpInfo(strin { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->GetUserByName"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -982,21 +1060,29 @@ public Org.OpenAPITools.Client.ApiResponse GetUserByNameWithHttpInfo(strin }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter // make the HTTP request var localVarResponse = this.Client.Get("/user/{username}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetUserByName", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1026,7 +1112,9 @@ public Org.OpenAPITools.Client.ApiResponse GetUserByNameWithHttpInfo(strin { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->GetUserByName"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1040,24 +1128,31 @@ public Org.OpenAPITools.Client.ApiResponse GetUserByNameWithHttpInfo(strin "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetUserByName", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1087,11 +1182,15 @@ public Org.OpenAPITools.Client.ApiResponse LoginUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->LoginUser"); + } // verify the required parameter 'password' is set if (password == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'password' when calling UserApi->LoginUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1105,10 +1204,16 @@ public Org.OpenAPITools.Client.ApiResponse LoginUserWithHttpInfo(string }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "username", username)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "password", password)); @@ -1116,11 +1221,13 @@ public Org.OpenAPITools.Client.ApiResponse LoginUserWithHttpInfo(string // make the HTTP request var localVarResponse = this.Client.Get("/user/login", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("LoginUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1152,11 +1259,15 @@ public Org.OpenAPITools.Client.ApiResponse LoginUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->LoginUser"); + } // verify the required parameter 'password' is set if (password == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'password' when calling UserApi->LoginUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1170,25 +1281,32 @@ public Org.OpenAPITools.Client.ApiResponse LoginUserWithHttpInfo(string "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "username", username)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "password", password)); // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/user/login", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("LoginUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1221,20 +1339,28 @@ public Org.OpenAPITools.Client.ApiResponse LogoutUserWithHttpInfo() }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request var localVarResponse = this.Client.Get("/user/logout", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("LogoutUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1269,23 +1395,30 @@ public Org.OpenAPITools.Client.ApiResponse LogoutUserWithHttpInfo() string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/user/logout", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("LogoutUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1314,11 +1447,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); + } // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->UpdateUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1331,10 +1468,16 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo(string }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter localVarRequestOptions.Data = user; @@ -1342,11 +1485,13 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo(string // make the HTTP request var localVarResponse = this.Client.Put("/user/{username}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdateUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1377,11 +1522,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); + } // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->UpdateUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1394,25 +1543,32 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo(string string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter localVarRequestOptions.Data = user; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdateUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index 33b039366746..ec5eb3cdd93a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -261,7 +261,7 @@ public bool ShouldSerializeMapWithUndeclaredPropertiesString() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class AdditionalPropertiesClass {\n"); sb.Append(" MapProperty: ").Append(MapProperty).Append("\n"); sb.Append(" MapOfMapProperty: ").Append(MapOfMapProperty).Append("\n"); @@ -315,23 +315,41 @@ public override int GetHashCode() { int hashCode = 41; if (this.MapProperty != null) - hashCode = hashCode * 59 + this.MapProperty.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapProperty.GetHashCode(); + } if (this.MapOfMapProperty != null) - hashCode = hashCode * 59 + this.MapOfMapProperty.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapOfMapProperty.GetHashCode(); + } if (this.Anytype1 != null) - hashCode = hashCode * 59 + this.Anytype1.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Anytype1.GetHashCode(); + } if (this.MapWithUndeclaredPropertiesAnytype1 != null) - hashCode = hashCode * 59 + this.MapWithUndeclaredPropertiesAnytype1.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesAnytype1.GetHashCode(); + } if (this.MapWithUndeclaredPropertiesAnytype2 != null) - hashCode = hashCode * 59 + this.MapWithUndeclaredPropertiesAnytype2.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesAnytype2.GetHashCode(); + } if (this.MapWithUndeclaredPropertiesAnytype3 != null) - hashCode = hashCode * 59 + this.MapWithUndeclaredPropertiesAnytype3.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesAnytype3.GetHashCode(); + } if (this.EmptyMap != null) - hashCode = hashCode * 59 + this.EmptyMap.GetHashCode(); + { + hashCode = (hashCode * 59) + this.EmptyMap.GetHashCode(); + } if (this.MapWithUndeclaredPropertiesString != null) - hashCode = hashCode * 59 + this.MapWithUndeclaredPropertiesString.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesString.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Animal.cs index b741cb66392b..1ecea975be7e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Animal.cs @@ -119,7 +119,7 @@ public bool ShouldSerializeColor() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Animal {\n"); sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" Color: ").Append(Color).Append("\n"); @@ -167,11 +167,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.ClassName != null) - hashCode = hashCode * 59 + this.ClassName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } if (this.Color != null) - hashCode = hashCode * 59 + this.Color.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Color.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ApiResponse.cs index acceaf62ed85..87db69a8d850 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -130,7 +130,7 @@ public bool ShouldSerializeMessage() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ApiResponse {\n"); sb.Append(" Code: ").Append(Code).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); @@ -178,13 +178,19 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Code.GetHashCode(); + hashCode = (hashCode * 59) + this.Code.GetHashCode(); if (this.Type != null) - hashCode = hashCode * 59 + this.Type.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + } if (this.Message != null) - hashCode = hashCode * 59 + this.Message.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Message.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Apple.cs index 66244fcd4b2c..f5bfb1230b52 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Apple.cs @@ -104,7 +104,7 @@ public bool ShouldSerializeOrigin() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Apple {\n"); sb.Append(" Cultivar: ").Append(Cultivar).Append("\n"); sb.Append(" Origin: ").Append(Origin).Append("\n"); @@ -152,11 +152,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.Cultivar != null) - hashCode = hashCode * 59 + this.Cultivar.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Cultivar.GetHashCode(); + } if (this.Origin != null) - hashCode = hashCode * 59 + this.Origin.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Origin.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/AppleReq.cs index 5a4400200a2a..5f042a01cf96 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/AppleReq.cs @@ -106,7 +106,7 @@ public bool ShouldSerializeMealy() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class AppleReq {\n"); sb.Append(" Cultivar: ").Append(Cultivar).Append("\n"); sb.Append(" Mealy: ").Append(Mealy).Append("\n"); @@ -153,8 +153,10 @@ public override int GetHashCode() { int hashCode = 41; if (this.Cultivar != null) - hashCode = hashCode * 59 + this.Cultivar.GetHashCode(); - hashCode = hashCode * 59 + this.Mealy.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Cultivar.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Mealy.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index dfcbdff093bb..aadaaa720205 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -78,7 +78,7 @@ public bool ShouldSerializeArrayArrayNumber() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ArrayOfArrayOfNumberOnly {\n"); sb.Append(" ArrayArrayNumber: ").Append(ArrayArrayNumber).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -125,9 +125,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ArrayArrayNumber != null) - hashCode = hashCode * 59 + this.ArrayArrayNumber.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayArrayNumber.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index 0ea09adcd6dc..66f7bcce0ac5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -78,7 +78,7 @@ public bool ShouldSerializeArrayNumber() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ArrayOfNumberOnly {\n"); sb.Append(" ArrayNumber: ").Append(ArrayNumber).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -125,9 +125,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ArrayNumber != null) - hashCode = hashCode * 59 + this.ArrayNumber.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayNumber.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayTest.cs index 70c54edeeea0..1825d97b3ea0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -130,7 +130,7 @@ public bool ShouldSerializeArrayArrayOfModel() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ArrayTest {\n"); sb.Append(" ArrayOfString: ").Append(ArrayOfString).Append("\n"); sb.Append(" ArrayArrayOfInteger: ").Append(ArrayArrayOfInteger).Append("\n"); @@ -179,13 +179,21 @@ public override int GetHashCode() { int hashCode = 41; if (this.ArrayOfString != null) - hashCode = hashCode * 59 + this.ArrayOfString.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayOfString.GetHashCode(); + } if (this.ArrayArrayOfInteger != null) - hashCode = hashCode * 59 + this.ArrayArrayOfInteger.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayArrayOfInteger.GetHashCode(); + } if (this.ArrayArrayOfModel != null) - hashCode = hashCode * 59 + this.ArrayArrayOfModel.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayArrayOfModel.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Banana.cs index 46b952e9a18a..3bdc27063272 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Banana.cs @@ -78,7 +78,7 @@ public bool ShouldSerializeLengthCm() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Banana {\n"); sb.Append(" LengthCm: ").Append(LengthCm).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -124,9 +124,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.LengthCm.GetHashCode(); + hashCode = (hashCode * 59) + this.LengthCm.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/BananaReq.cs index adfa4cb5164c..e7289cd6f3e2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/BananaReq.cs @@ -102,7 +102,7 @@ public bool ShouldSerializeSweet() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class BananaReq {\n"); sb.Append(" LengthCm: ").Append(LengthCm).Append("\n"); sb.Append(" Sweet: ").Append(Sweet).Append("\n"); @@ -148,8 +148,8 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.LengthCm.GetHashCode(); - hashCode = hashCode * 59 + this.Sweet.GetHashCode(); + hashCode = (hashCode * 59) + this.LengthCm.GetHashCode(); + hashCode = (hashCode * 59) + this.Sweet.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/BasquePig.cs index c745514a4ee5..0ba9ff1eedfc 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/BasquePig.cs @@ -90,7 +90,7 @@ public bool ShouldSerializeClassName() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class BasquePig {\n"); sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -137,9 +137,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ClassName != null) - hashCode = hashCode * 59 + this.ClassName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Capitalization.cs index 428a0ad66727..1cee58da84bd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Capitalization.cs @@ -209,7 +209,7 @@ public bool ShouldSerializeATT_NAME() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Capitalization {\n"); sb.Append(" SmallCamel: ").Append(SmallCamel).Append("\n"); sb.Append(" CapitalCamel: ").Append(CapitalCamel).Append("\n"); @@ -261,19 +261,33 @@ public override int GetHashCode() { int hashCode = 41; if (this.SmallCamel != null) - hashCode = hashCode * 59 + this.SmallCamel.GetHashCode(); + { + hashCode = (hashCode * 59) + this.SmallCamel.GetHashCode(); + } if (this.CapitalCamel != null) - hashCode = hashCode * 59 + this.CapitalCamel.GetHashCode(); + { + hashCode = (hashCode * 59) + this.CapitalCamel.GetHashCode(); + } if (this.SmallSnake != null) - hashCode = hashCode * 59 + this.SmallSnake.GetHashCode(); + { + hashCode = (hashCode * 59) + this.SmallSnake.GetHashCode(); + } if (this.CapitalSnake != null) - hashCode = hashCode * 59 + this.CapitalSnake.GetHashCode(); + { + hashCode = (hashCode * 59) + this.CapitalSnake.GetHashCode(); + } if (this.SCAETHFlowPoints != null) - hashCode = hashCode * 59 + this.SCAETHFlowPoints.GetHashCode(); + { + hashCode = (hashCode * 59) + this.SCAETHFlowPoints.GetHashCode(); + } if (this.ATT_NAME != null) - hashCode = hashCode * 59 + this.ATT_NAME.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ATT_NAME.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Cat.cs index acc5f870fcd9..a07eac2b8ee0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Cat.cs @@ -90,7 +90,7 @@ public bool ShouldSerializeDeclawed() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Cat {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" Declawed: ").Append(Declawed).Append("\n"); @@ -137,9 +137,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = base.GetHashCode(); - hashCode = hashCode * 59 + this.Declawed.GetHashCode(); + hashCode = (hashCode * 59) + this.Declawed.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } @@ -161,7 +163,10 @@ public override int GetHashCode() /// Validation Result protected IEnumerable BaseValidate(ValidationContext validationContext) { - foreach(var x in BaseValidate(validationContext)) yield return x; + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } yield break; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/CatAllOf.cs index 113357ddf91d..e31e45a795fd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/CatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -78,7 +78,7 @@ public bool ShouldSerializeDeclawed() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class CatAllOf {\n"); sb.Append(" Declawed: ").Append(Declawed).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -124,9 +124,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Declawed.GetHashCode(); + hashCode = (hashCode * 59) + this.Declawed.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Category.cs index 7bb04693da09..621dff0ce0a7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Category.cs @@ -116,7 +116,7 @@ public bool ShouldSerializeName() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Category {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); @@ -163,11 +163,15 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ChildCat.cs index 495e9d6c568b..bdef892ab86d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ChildCat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ChildCat.cs @@ -130,7 +130,7 @@ public bool ShouldSerializeName() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ChildCat {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); @@ -179,10 +179,14 @@ public override int GetHashCode() { int hashCode = base.GetHashCode(); if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); - hashCode = hashCode * 59 + this.PetType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + hashCode = (hashCode * 59) + this.PetType.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } @@ -204,7 +208,10 @@ public override int GetHashCode() /// Validation Result protected IEnumerable BaseValidate(ValidationContext validationContext) { - foreach(var x in BaseValidate(validationContext)) yield return x; + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } yield break; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ChildCatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ChildCatAllOf.cs index 61ca1419437f..7c39109418ee 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ChildCatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ChildCatAllOf.cs @@ -119,7 +119,7 @@ public bool ShouldSerializeName() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ChildCatAllOf {\n"); sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" PetType: ").Append(PetType).Append("\n"); @@ -167,10 +167,14 @@ public override int GetHashCode() { int hashCode = 41; if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); - hashCode = hashCode * 59 + this.PetType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + hashCode = (hashCode * 59) + this.PetType.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ClassModel.cs index 72483a012c6e..f223ab882b49 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ClassModel.cs @@ -78,7 +78,7 @@ public bool ShouldSerializeClass() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ClassModel {\n"); sb.Append(" Class: ").Append(Class).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -125,9 +125,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.Class != null) - hashCode = hashCode * 59 + this.Class.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Class.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index 9d1d32cd9dba..7288bffb3957 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -120,7 +120,7 @@ public bool ShouldSerializeQuadrilateralType() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ComplexQuadrilateral {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); @@ -168,11 +168,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } if (this.QuadrilateralType != null) - hashCode = hashCode * 59 + this.QuadrilateralType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.QuadrilateralType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/DanishPig.cs index 7adee34852a8..1955404a4584 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/DanishPig.cs @@ -90,7 +90,7 @@ public bool ShouldSerializeClassName() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class DanishPig {\n"); sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -137,9 +137,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ClassName != null) - hashCode = hashCode * 59 + this.ClassName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/DeprecatedObject.cs index 4ef628eca2bb..b2aeb2111634 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/DeprecatedObject.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -78,7 +78,7 @@ public bool ShouldSerializeName() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class DeprecatedObject {\n"); sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -125,9 +125,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Dog.cs index e876d8dc964a..b3709a99dd91 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Dog.cs @@ -90,7 +90,7 @@ public bool ShouldSerializeBreed() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Dog {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" Breed: ").Append(Breed).Append("\n"); @@ -138,9 +138,13 @@ public override int GetHashCode() { int hashCode = base.GetHashCode(); if (this.Breed != null) - hashCode = hashCode * 59 + this.Breed.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Breed.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } @@ -162,7 +166,10 @@ public override int GetHashCode() /// Validation Result protected IEnumerable BaseValidate(ValidationContext validationContext) { - foreach(var x in BaseValidate(validationContext)) yield return x; + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } yield break; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/DogAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/DogAllOf.cs index 84518fadc2cd..40e42a0bf829 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/DogAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/DogAllOf.cs @@ -78,7 +78,7 @@ public bool ShouldSerializeBreed() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class DogAllOf {\n"); sb.Append(" Breed: ").Append(Breed).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -125,9 +125,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.Breed != null) - hashCode = hashCode * 59 + this.Breed.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Breed.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Drawing.cs index 5e47d778777e..a7ab7daa3b20 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Drawing.cs @@ -149,7 +149,7 @@ public bool ShouldSerializeShapes() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Drawing {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" MainShape: ").Append(MainShape).Append("\n"); @@ -199,13 +199,21 @@ public override int GetHashCode() { int hashCode = base.GetHashCode(); if (this.MainShape != null) - hashCode = hashCode * 59 + this.MainShape.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MainShape.GetHashCode(); + } if (this.ShapeOrNull != null) - hashCode = hashCode * 59 + this.ShapeOrNull.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeOrNull.GetHashCode(); + } if (this.NullableShape != null) - hashCode = hashCode * 59 + this.NullableShape.GetHashCode(); + { + hashCode = (hashCode * 59) + this.NullableShape.GetHashCode(); + } if (this.Shapes != null) - hashCode = hashCode * 59 + this.Shapes.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Shapes.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/EnumArrays.cs index 304ec4c234c4..d4cc2bbcf318 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -149,7 +149,7 @@ public bool ShouldSerializeArrayEnum() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class EnumArrays {\n"); sb.Append(" JustSymbol: ").Append(JustSymbol).Append("\n"); sb.Append(" ArrayEnum: ").Append(ArrayEnum).Append("\n"); @@ -196,10 +196,12 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.JustSymbol.GetHashCode(); - hashCode = hashCode * 59 + this.ArrayEnum.GetHashCode(); + hashCode = (hashCode * 59) + this.JustSymbol.GetHashCode(); + hashCode = (hashCode * 59) + this.ArrayEnum.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/EnumTest.cs index 914428919ac7..605274f7c1c8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/EnumTest.cs @@ -418,7 +418,7 @@ protected EnumTest() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class EnumTest {\n"); sb.Append(" EnumString: ").Append(EnumString).Append("\n"); sb.Append(" EnumStringRequired: ").Append(EnumStringRequired).Append("\n"); @@ -472,17 +472,19 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.EnumString.GetHashCode(); - hashCode = hashCode * 59 + this.EnumStringRequired.GetHashCode(); - hashCode = hashCode * 59 + this.EnumInteger.GetHashCode(); - hashCode = hashCode * 59 + this.EnumIntegerOnly.GetHashCode(); - hashCode = hashCode * 59 + this.EnumNumber.GetHashCode(); - hashCode = hashCode * 59 + this.OuterEnum.GetHashCode(); - hashCode = hashCode * 59 + this.OuterEnumInteger.GetHashCode(); - hashCode = hashCode * 59 + this.OuterEnumDefaultValue.GetHashCode(); - hashCode = hashCode * 59 + this.OuterEnumIntegerDefaultValue.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumString.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumStringRequired.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumInteger.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumIntegerOnly.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumNumber.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnum.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnumInteger.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnumDefaultValue.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnumIntegerDefaultValue.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index 21fe08e74369..3029945d8a32 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -120,7 +120,7 @@ public bool ShouldSerializeTriangleType() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class EquilateralTriangle {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); @@ -168,11 +168,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } if (this.TriangleType != null) - hashCode = hashCode * 59 + this.TriangleType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/File.cs index 4316936a2b14..521cf9bf4d4b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/File.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/File.cs @@ -79,7 +79,7 @@ public bool ShouldSerializeSourceURI() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class File {\n"); sb.Append(" SourceURI: ").Append(SourceURI).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -126,9 +126,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.SourceURI != null) - hashCode = hashCode * 59 + this.SourceURI.GetHashCode(); + { + hashCode = (hashCode * 59) + this.SourceURI.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index c6759aa24906..841cb56f6493 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -104,7 +104,7 @@ public bool ShouldSerializeFiles() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class FileSchemaTestClass {\n"); sb.Append(" File: ").Append(File).Append("\n"); sb.Append(" Files: ").Append(Files).Append("\n"); @@ -152,11 +152,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.File != null) - hashCode = hashCode * 59 + this.File.GetHashCode(); + { + hashCode = (hashCode * 59) + this.File.GetHashCode(); + } if (this.Files != null) - hashCode = hashCode * 59 + this.Files.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Files.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Foo.cs index 1e78c6575e09..dcbf11435348 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Foo.cs @@ -77,7 +77,7 @@ public bool ShouldSerializeBar() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Foo {\n"); sb.Append(" Bar: ").Append(Bar).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -124,9 +124,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.Bar != null) - hashCode = hashCode * 59 + this.Bar.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Bar.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/FormatTest.cs index 80c359e71b40..ef25bf8889de 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/FormatTest.cs @@ -487,7 +487,7 @@ public bool ShouldSerializePatternWithDigitsAndDelimiter() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class FormatTest {\n"); sb.Append(" Integer: ").Append(Integer).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); @@ -548,33 +548,53 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Integer.GetHashCode(); - hashCode = hashCode * 59 + this.Int32.GetHashCode(); - hashCode = hashCode * 59 + this.Int64.GetHashCode(); - hashCode = hashCode * 59 + this.Number.GetHashCode(); - hashCode = hashCode * 59 + this.Float.GetHashCode(); - hashCode = hashCode * 59 + this.Double.GetHashCode(); - hashCode = hashCode * 59 + this.Decimal.GetHashCode(); + hashCode = (hashCode * 59) + this.Integer.GetHashCode(); + hashCode = (hashCode * 59) + this.Int32.GetHashCode(); + hashCode = (hashCode * 59) + this.Int64.GetHashCode(); + hashCode = (hashCode * 59) + this.Number.GetHashCode(); + hashCode = (hashCode * 59) + this.Float.GetHashCode(); + hashCode = (hashCode * 59) + this.Double.GetHashCode(); + hashCode = (hashCode * 59) + this.Decimal.GetHashCode(); if (this.String != null) - hashCode = hashCode * 59 + this.String.GetHashCode(); + { + hashCode = (hashCode * 59) + this.String.GetHashCode(); + } if (this.Byte != null) - hashCode = hashCode * 59 + this.Byte.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Byte.GetHashCode(); + } if (this.Binary != null) - hashCode = hashCode * 59 + this.Binary.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Binary.GetHashCode(); + } if (this.Date != null) - hashCode = hashCode * 59 + this.Date.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Date.GetHashCode(); + } if (this.DateTime != null) - hashCode = hashCode * 59 + this.DateTime.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DateTime.GetHashCode(); + } if (this.Uuid != null) - hashCode = hashCode * 59 + this.Uuid.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); + } if (this.Password != null) - hashCode = hashCode * 59 + this.Password.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Password.GetHashCode(); + } if (this.PatternWithDigits != null) - hashCode = hashCode * 59 + this.PatternWithDigits.GetHashCode(); + { + hashCode = (hashCode * 59) + this.PatternWithDigits.GetHashCode(); + } if (this.PatternWithDigitsAndDelimiter != null) - hashCode = hashCode * 59 + this.PatternWithDigitsAndDelimiter.GetHashCode(); + { + hashCode = (hashCode * 59) + this.PatternWithDigitsAndDelimiter.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } @@ -587,61 +607,61 @@ public override int GetHashCode() public IEnumerable Validate(ValidationContext validationContext) { // Integer (int) maximum - if(this.Integer > (int)100) + if (this.Integer > (int)100) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); } // Integer (int) minimum - if(this.Integer < (int)10) + if (this.Integer < (int)10) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); } // Int32 (int) maximum - if(this.Int32 > (int)200) + if (this.Int32 > (int)200) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); } // Int32 (int) minimum - if(this.Int32 < (int)20) + if (this.Int32 < (int)20) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } // Number (decimal) maximum - if(this.Number > (decimal)543.2) + if (this.Number > (decimal)543.2) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); } // Number (decimal) minimum - if(this.Number < (decimal)32.1) + if (this.Number < (decimal)32.1) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); } // Float (float) maximum - if(this.Float > (float)987.6) + if (this.Float > (float)987.6) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); } // Float (float) minimum - if(this.Float < (float)54.3) + if (this.Float < (float)54.3) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); } // Double (double) maximum - if(this.Double > (double)123.4) + if (this.Double > (double)123.4) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); } // Double (double) minimum - if(this.Double < (double)67.8) + if (this.Double < (double)67.8) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); } @@ -654,13 +674,13 @@ public override int GetHashCode() } // Password (string) maxLength - if(this.Password != null && this.Password.Length > 64) + if (this.Password != null && this.Password.Length > 64) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); } // Password (string) minLength - if(this.Password != null && this.Password.Length < 10) + if (this.Password != null && this.Password.Length < 10) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index 6ca684a89b19..f26d700c2072 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -94,7 +94,7 @@ public bool ShouldSerializePetType() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class GrandparentAnimal {\n"); sb.Append(" PetType: ").Append(PetType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -141,9 +141,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.PetType != null) - hashCode = hashCode * 59 + this.PetType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.PetType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index f6219182b296..52099a7095e1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -81,7 +81,7 @@ public bool ShouldSerializeFoo() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class HasOnlyReadOnly {\n"); sb.Append(" Bar: ").Append(Bar).Append("\n"); sb.Append(" Foo: ").Append(Foo).Append("\n"); @@ -129,11 +129,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.Bar != null) - hashCode = hashCode * 59 + this.Bar.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Bar.GetHashCode(); + } if (this.Foo != null) - hashCode = hashCode * 59 + this.Foo.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Foo.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/HealthCheckResult.cs index 80aa2e7327ee..aa33b076d06c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/HealthCheckResult.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -78,7 +78,7 @@ public bool ShouldSerializeNullableMessage() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class HealthCheckResult {\n"); sb.Append(" NullableMessage: ").Append(NullableMessage).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -125,9 +125,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.NullableMessage != null) - hashCode = hashCode * 59 + this.NullableMessage.GetHashCode(); + { + hashCode = (hashCode * 59) + this.NullableMessage.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/InlineResponseDefault.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/InlineResponseDefault.cs index 23083ccef401..909c34c2cefd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/InlineResponseDefault.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/InlineResponseDefault.cs @@ -78,7 +78,7 @@ public bool ShouldSerializeString() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class InlineResponseDefault {\n"); sb.Append(" String: ").Append(String).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -125,9 +125,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.String != null) - hashCode = hashCode * 59 + this.String.GetHashCode(); + { + hashCode = (hashCode * 59) + this.String.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index 6fa6aec800f9..ca9a10e5f9ef 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -110,7 +110,7 @@ public bool ShouldSerializeTriangleType() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class IsoscelesTriangle {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); @@ -157,9 +157,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } if (this.TriangleType != null) - hashCode = hashCode * 59 + this.TriangleType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/List.cs index 7b26a68a1734..a55d149d4af5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/List.cs @@ -78,7 +78,7 @@ public bool ShouldSerialize_123List() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class List {\n"); sb.Append(" _123List: ").Append(_123List).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -125,9 +125,13 @@ public override int GetHashCode() { int hashCode = 41; if (this._123List != null) - hashCode = hashCode * 59 + this._123List.GetHashCode(); + { + hashCode = (hashCode * 59) + this._123List.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/MapTest.cs index 80b9989b72c8..fa45d1411a34 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/MapTest.cs @@ -179,7 +179,7 @@ public bool ShouldSerializeIndirectMap() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class MapTest {\n"); sb.Append(" MapMapOfString: ").Append(MapMapOfString).Append("\n"); sb.Append(" MapOfEnumString: ").Append(MapOfEnumString).Append("\n"); @@ -229,14 +229,22 @@ public override int GetHashCode() { int hashCode = 41; if (this.MapMapOfString != null) - hashCode = hashCode * 59 + this.MapMapOfString.GetHashCode(); - hashCode = hashCode * 59 + this.MapOfEnumString.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapMapOfString.GetHashCode(); + } + hashCode = (hashCode * 59) + this.MapOfEnumString.GetHashCode(); if (this.DirectMap != null) - hashCode = hashCode * 59 + this.DirectMap.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DirectMap.GetHashCode(); + } if (this.IndirectMap != null) - hashCode = hashCode * 59 + this.IndirectMap.GetHashCode(); + { + hashCode = (hashCode * 59) + this.IndirectMap.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 920ac9737158..7eabc6242c8f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -130,7 +130,7 @@ public bool ShouldSerializeMap() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); @@ -179,13 +179,21 @@ public override int GetHashCode() { int hashCode = 41; if (this.Uuid != null) - hashCode = hashCode * 59 + this.Uuid.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); + } if (this.DateTime != null) - hashCode = hashCode * 59 + this.DateTime.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DateTime.GetHashCode(); + } if (this.Map != null) - hashCode = hashCode * 59 + this.Map.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Map.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Model200Response.cs index 4d75dd7b30a1..c1c8a3890632 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Model200Response.cs @@ -104,7 +104,7 @@ public bool ShouldSerializeClass() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Model200Response {\n"); sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" Class: ").Append(Class).Append("\n"); @@ -151,11 +151,15 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Name.GetHashCode(); + hashCode = (hashCode * 59) + this.Name.GetHashCode(); if (this.Class != null) - hashCode = hashCode * 59 + this.Class.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Class.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ModelClient.cs index e7f52aeba3cc..d9a2d7b846c1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ModelClient.cs @@ -78,7 +78,7 @@ public bool ShouldSerialize_Client() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ModelClient {\n"); sb.Append(" _Client: ").Append(_Client).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -125,9 +125,13 @@ public override int GetHashCode() { int hashCode = 41; if (this._Client != null) - hashCode = hashCode * 59 + this._Client.GetHashCode(); + { + hashCode = (hashCode * 59) + this._Client.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Name.cs index a613b9d82a95..dd8a2a2aed9c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Name.cs @@ -140,7 +140,7 @@ public bool ShouldSerialize_123Number() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Name {\n"); sb.Append(" _Name: ").Append(_Name).Append("\n"); sb.Append(" SnakeCase: ").Append(SnakeCase).Append("\n"); @@ -189,13 +189,17 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this._Name.GetHashCode(); - hashCode = hashCode * 59 + this.SnakeCase.GetHashCode(); + hashCode = (hashCode * 59) + this._Name.GetHashCode(); + hashCode = (hashCode * 59) + this.SnakeCase.GetHashCode(); if (this.Property != null) - hashCode = hashCode * 59 + this.Property.GetHashCode(); - hashCode = hashCode * 59 + this._123Number.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Property.GetHashCode(); + } + hashCode = (hashCode * 59) + this._123Number.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/NullableClass.cs index 31135c0c65db..428f7c3deef9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/NullableClass.cs @@ -358,7 +358,7 @@ public bool ShouldSerializeObjectItemsNullable() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class NullableClass {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" IntegerProp: ").Append(IntegerProp).Append("\n"); @@ -416,29 +416,53 @@ public override int GetHashCode() { int hashCode = base.GetHashCode(); if (this.IntegerProp != null) - hashCode = hashCode * 59 + this.IntegerProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.IntegerProp.GetHashCode(); + } if (this.NumberProp != null) - hashCode = hashCode * 59 + this.NumberProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.NumberProp.GetHashCode(); + } if (this.BooleanProp != null) - hashCode = hashCode * 59 + this.BooleanProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.BooleanProp.GetHashCode(); + } if (this.StringProp != null) - hashCode = hashCode * 59 + this.StringProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.StringProp.GetHashCode(); + } if (this.DateProp != null) - hashCode = hashCode * 59 + this.DateProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DateProp.GetHashCode(); + } if (this.DatetimeProp != null) - hashCode = hashCode * 59 + this.DatetimeProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DatetimeProp.GetHashCode(); + } if (this.ArrayNullableProp != null) - hashCode = hashCode * 59 + this.ArrayNullableProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayNullableProp.GetHashCode(); + } if (this.ArrayAndItemsNullableProp != null) - hashCode = hashCode * 59 + this.ArrayAndItemsNullableProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayAndItemsNullableProp.GetHashCode(); + } if (this.ArrayItemsNullable != null) - hashCode = hashCode * 59 + this.ArrayItemsNullable.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayItemsNullable.GetHashCode(); + } if (this.ObjectNullableProp != null) - hashCode = hashCode * 59 + this.ObjectNullableProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ObjectNullableProp.GetHashCode(); + } if (this.ObjectAndItemsNullableProp != null) - hashCode = hashCode * 59 + this.ObjectAndItemsNullableProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ObjectAndItemsNullableProp.GetHashCode(); + } if (this.ObjectItemsNullable != null) - hashCode = hashCode * 59 + this.ObjectItemsNullable.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/NumberOnly.cs index c2f0ec4d5ec6..4e5425354515 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -78,7 +78,7 @@ public bool ShouldSerializeJustNumber() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class NumberOnly {\n"); sb.Append(" JustNumber: ").Append(JustNumber).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -124,9 +124,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.JustNumber.GetHashCode(); + hashCode = (hashCode * 59) + this.JustNumber.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 4362fdb9329c..3d6d12d562bf 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -159,7 +159,7 @@ public bool ShouldSerializeBars() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ObjectWithDeprecatedFields {\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); sb.Append(" Id: ").Append(Id).Append("\n"); @@ -209,14 +209,22 @@ public override int GetHashCode() { int hashCode = 41; if (this.Uuid != null) - hashCode = hashCode * 59 + this.Uuid.GetHashCode(); - hashCode = hashCode * 59 + this.Id.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.DeprecatedRef != null) - hashCode = hashCode * 59 + this.DeprecatedRef.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DeprecatedRef.GetHashCode(); + } if (this.Bars != null) - hashCode = hashCode * 59 + this.Bars.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Bars.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Order.cs index 22b3dd19d6c6..21fb784543be 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Order.cs @@ -237,7 +237,7 @@ public bool ShouldSerializeComplete() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Order {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" PetId: ").Append(PetId).Append("\n"); @@ -288,15 +288,19 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Id.GetHashCode(); - hashCode = hashCode * 59 + this.PetId.GetHashCode(); - hashCode = hashCode * 59 + this.Quantity.GetHashCode(); + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.PetId.GetHashCode(); + hashCode = (hashCode * 59) + this.Quantity.GetHashCode(); if (this.ShipDate != null) - hashCode = hashCode * 59 + this.ShipDate.GetHashCode(); - hashCode = hashCode * 59 + this.Status.GetHashCode(); - hashCode = hashCode * 59 + this.Complete.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShipDate.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); + hashCode = (hashCode * 59) + this.Complete.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/OuterComposite.cs index 634161d1bf5b..8521e32d470c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -130,7 +130,7 @@ public bool ShouldSerializeMyBoolean() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class OuterComposite {\n"); sb.Append(" MyNumber: ").Append(MyNumber).Append("\n"); sb.Append(" MyString: ").Append(MyString).Append("\n"); @@ -178,12 +178,16 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.MyNumber.GetHashCode(); + hashCode = (hashCode * 59) + this.MyNumber.GetHashCode(); if (this.MyString != null) - hashCode = hashCode * 59 + this.MyString.GetHashCode(); - hashCode = hashCode * 59 + this.MyBoolean.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MyString.GetHashCode(); + } + hashCode = (hashCode * 59) + this.MyBoolean.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ParentPet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ParentPet.cs index 899984fcc5bc..ac986b555efd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ParentPet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ParentPet.cs @@ -64,7 +64,7 @@ public ParentPet(string petType = "ParentPet") : base(petType) /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ParentPet {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -111,7 +111,9 @@ public override int GetHashCode() { int hashCode = base.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } @@ -133,7 +135,10 @@ public override int GetHashCode() /// Validation Result protected IEnumerable BaseValidate(ValidationContext validationContext) { - foreach(var x in BaseValidate(validationContext)) yield return x; + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } yield break; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Pet.cs index 39c8380ae87f..4737a5b7aee6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Pet.cs @@ -254,7 +254,7 @@ public bool ShouldSerializeTags() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Pet {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Category: ").Append(Category).Append("\n"); @@ -305,18 +305,28 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.Category != null) - hashCode = hashCode * 59 + this.Category.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Category.GetHashCode(); + } if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } if (this.PhotoUrls != null) - hashCode = hashCode * 59 + this.PhotoUrls.GetHashCode(); + { + hashCode = (hashCode * 59) + this.PhotoUrls.GetHashCode(); + } if (this.Tags != null) - hashCode = hashCode * 59 + this.Tags.GetHashCode(); - hashCode = hashCode * 59 + this.Status.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Tags.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index 983dfc4be994..75fa6ad72717 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -90,7 +90,7 @@ public bool ShouldSerializeQuadrilateralType() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class QuadrilateralInterface {\n"); sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -137,9 +137,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.QuadrilateralType != null) - hashCode = hashCode * 59 + this.QuadrilateralType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.QuadrilateralType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index fc5e685f9c98..4152b8eaa2d8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -92,7 +92,7 @@ public bool ShouldSerializeBaz() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ReadOnlyFirst {\n"); sb.Append(" Bar: ").Append(Bar).Append("\n"); sb.Append(" Baz: ").Append(Baz).Append("\n"); @@ -140,11 +140,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.Bar != null) - hashCode = hashCode * 59 + this.Bar.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Bar.GetHashCode(); + } if (this.Baz != null) - hashCode = hashCode * 59 + this.Baz.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Baz.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Return.cs index b3c35543c156..b9681ebec3c4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Return.cs @@ -78,7 +78,7 @@ public bool ShouldSerialize_Return() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Return {\n"); sb.Append(" _Return: ").Append(_Return).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -124,9 +124,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this._Return.GetHashCode(); + hashCode = (hashCode * 59) + this._Return.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index 7a98eae2dd46..a0c0e1da8b15 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -120,7 +120,7 @@ public bool ShouldSerializeTriangleType() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ScaleneTriangle {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); @@ -168,11 +168,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } if (this.TriangleType != null) - hashCode = hashCode * 59 + this.TriangleType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ShapeInterface.cs index edd12424c1d2..619a80986647 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -90,7 +90,7 @@ public bool ShouldSerializeShapeType() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ShapeInterface {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -137,9 +137,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index 94b69ee95eeb..0c3d83f8e66d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -120,7 +120,7 @@ public bool ShouldSerializeQuadrilateralType() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class SimpleQuadrilateral {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); @@ -168,11 +168,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } if (this.QuadrilateralType != null) - hashCode = hashCode * 59 + this.QuadrilateralType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.QuadrilateralType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/SpecialModelName.cs index 6594fe5bf7ed..647b87399fda 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -104,7 +104,7 @@ public bool ShouldSerialize_SpecialModelName() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class SpecialModelName {\n"); sb.Append(" SpecialPropertyName: ").Append(SpecialPropertyName).Append("\n"); sb.Append(" _SpecialModelName: ").Append(_SpecialModelName).Append("\n"); @@ -151,11 +151,15 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.SpecialPropertyName.GetHashCode(); + hashCode = (hashCode * 59) + this.SpecialPropertyName.GetHashCode(); if (this._SpecialModelName != null) - hashCode = hashCode * 59 + this._SpecialModelName.GetHashCode(); + { + hashCode = (hashCode * 59) + this._SpecialModelName.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Tag.cs index b50f051e43bc..93d34bef1a12 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Tag.cs @@ -104,7 +104,7 @@ public bool ShouldSerializeName() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Tag {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); @@ -151,11 +151,15 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/TriangleInterface.cs index 78993edeee23..183b3be09fbc 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -90,7 +90,7 @@ public bool ShouldSerializeTriangleType() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class TriangleInterface {\n"); sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -137,9 +137,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.TriangleType != null) - hashCode = hashCode * 59 + this.TriangleType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/User.cs index 9d63f0298339..9309128511c3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/User.cs @@ -369,7 +369,7 @@ public bool ShouldSerializeAnyTypePropNullable() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class User {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Username: ").Append(Username).Append("\n"); @@ -426,30 +426,52 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.Username != null) - hashCode = hashCode * 59 + this.Username.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Username.GetHashCode(); + } if (this.FirstName != null) - hashCode = hashCode * 59 + this.FirstName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.FirstName.GetHashCode(); + } if (this.LastName != null) - hashCode = hashCode * 59 + this.LastName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.LastName.GetHashCode(); + } if (this.Email != null) - hashCode = hashCode * 59 + this.Email.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Email.GetHashCode(); + } if (this.Password != null) - hashCode = hashCode * 59 + this.Password.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Password.GetHashCode(); + } if (this.Phone != null) - hashCode = hashCode * 59 + this.Phone.GetHashCode(); - hashCode = hashCode * 59 + this.UserStatus.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Phone.GetHashCode(); + } + hashCode = (hashCode * 59) + this.UserStatus.GetHashCode(); if (this.ObjectWithNoDeclaredProps != null) - hashCode = hashCode * 59 + this.ObjectWithNoDeclaredProps.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ObjectWithNoDeclaredProps.GetHashCode(); + } if (this.ObjectWithNoDeclaredPropsNullable != null) - hashCode = hashCode * 59 + this.ObjectWithNoDeclaredPropsNullable.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ObjectWithNoDeclaredPropsNullable.GetHashCode(); + } if (this.AnyTypeProp != null) - hashCode = hashCode * 59 + this.AnyTypeProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AnyTypeProp.GetHashCode(); + } if (this.AnyTypePropNullable != null) - hashCode = hashCode * 59 + this.AnyTypePropNullable.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AnyTypePropNullable.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Whale.cs index 00a9182cc197..31f06658f01b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Whale.cs @@ -142,7 +142,7 @@ public bool ShouldSerializeClassName() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Whale {\n"); sb.Append(" HasBaleen: ").Append(HasBaleen).Append("\n"); sb.Append(" HasTeeth: ").Append(HasTeeth).Append("\n"); @@ -190,12 +190,16 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.HasBaleen.GetHashCode(); - hashCode = hashCode * 59 + this.HasTeeth.GetHashCode(); + hashCode = (hashCode * 59) + this.HasBaleen.GetHashCode(); + hashCode = (hashCode * 59) + this.HasTeeth.GetHashCode(); if (this.ClassName != null) - hashCode = hashCode * 59 + this.ClassName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Zebra.cs index bce8a5f35c7f..f4bf84c86474 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Zebra.cs @@ -144,7 +144,7 @@ public bool ShouldSerializeClassName() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Zebra {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); @@ -192,11 +192,15 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = base.GetHashCode(); - hashCode = hashCode * 59 + this.Type.GetHashCode(); + hashCode = (hashCode * 59) + this.Type.GetHashCode(); if (this.ClassName != null) - hashCode = hashCode * 59 + this.ClassName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index 9fa7018dde78..fb0eca6557b9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -118,7 +118,7 @@ public partial class AdditionalPropertiesClass : IEquatableString presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class AdditionalPropertiesClass {\n"); sb.Append(" MapProperty: ").Append(MapProperty).Append("\n"); sb.Append(" MapOfMapProperty: ").Append(MapOfMapProperty).Append("\n"); @@ -172,23 +172,41 @@ public override int GetHashCode() { int hashCode = 41; if (this.MapProperty != null) - hashCode = hashCode * 59 + this.MapProperty.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapProperty.GetHashCode(); + } if (this.MapOfMapProperty != null) - hashCode = hashCode * 59 + this.MapOfMapProperty.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapOfMapProperty.GetHashCode(); + } if (this.Anytype1 != null) - hashCode = hashCode * 59 + this.Anytype1.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Anytype1.GetHashCode(); + } if (this.MapWithUndeclaredPropertiesAnytype1 != null) - hashCode = hashCode * 59 + this.MapWithUndeclaredPropertiesAnytype1.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesAnytype1.GetHashCode(); + } if (this.MapWithUndeclaredPropertiesAnytype2 != null) - hashCode = hashCode * 59 + this.MapWithUndeclaredPropertiesAnytype2.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesAnytype2.GetHashCode(); + } if (this.MapWithUndeclaredPropertiesAnytype3 != null) - hashCode = hashCode * 59 + this.MapWithUndeclaredPropertiesAnytype3.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesAnytype3.GetHashCode(); + } if (this.EmptyMap != null) - hashCode = hashCode * 59 + this.EmptyMap.GetHashCode(); + { + hashCode = (hashCode * 59) + this.EmptyMap.GetHashCode(); + } if (this.MapWithUndeclaredPropertiesString != null) - hashCode = hashCode * 59 + this.MapWithUndeclaredPropertiesString.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesString.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Animal.cs index 743dedc1acd4..4363ebe1138c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Animal.cs @@ -86,7 +86,7 @@ protected Animal() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Animal {\n"); sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" Color: ").Append(Color).Append("\n"); @@ -134,11 +134,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.ClassName != null) - hashCode = hashCode * 59 + this.ClassName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } if (this.Color != null) - hashCode = hashCode * 59 + this.Color.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Color.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ApiResponse.cs index 53bf2456b0c1..0bf23edced75 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -77,7 +77,7 @@ public partial class ApiResponse : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ApiResponse {\n"); sb.Append(" Code: ").Append(Code).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); @@ -125,13 +125,19 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Code.GetHashCode(); + hashCode = (hashCode * 59) + this.Code.GetHashCode(); if (this.Type != null) - hashCode = hashCode * 59 + this.Type.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + } if (this.Message != null) - hashCode = hashCode * 59 + this.Message.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Message.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Apple.cs index 1e4f098f6e89..26fb7d71d1c8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Apple.cs @@ -69,7 +69,7 @@ public partial class Apple : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Apple {\n"); sb.Append(" Cultivar: ").Append(Cultivar).Append("\n"); sb.Append(" Origin: ").Append(Origin).Append("\n"); @@ -117,11 +117,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.Cultivar != null) - hashCode = hashCode * 59 + this.Cultivar.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Cultivar.GetHashCode(); + } if (this.Origin != null) - hashCode = hashCode * 59 + this.Origin.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Origin.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/AppleReq.cs index beaf04983f90..33fca86a4116 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/AppleReq.cs @@ -71,7 +71,7 @@ protected AppleReq() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class AppleReq {\n"); sb.Append(" Cultivar: ").Append(Cultivar).Append("\n"); sb.Append(" Mealy: ").Append(Mealy).Append("\n"); @@ -118,8 +118,10 @@ public override int GetHashCode() { int hashCode = 41; if (this.Cultivar != null) - hashCode = hashCode * 59 + this.Cultivar.GetHashCode(); - hashCode = hashCode * 59 + this.Mealy.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Cultivar.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Mealy.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index ff179798aec3..3de85f7f6499 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -61,7 +61,7 @@ public partial class ArrayOfArrayOfNumberOnly : IEquatableString presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ArrayOfArrayOfNumberOnly {\n"); sb.Append(" ArrayArrayNumber: ").Append(ArrayArrayNumber).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -108,9 +108,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ArrayArrayNumber != null) - hashCode = hashCode * 59 + this.ArrayArrayNumber.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayArrayNumber.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index ec3092c1a7c3..8fad145c570e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -61,7 +61,7 @@ public partial class ArrayOfNumberOnly : IEquatable, IValidat /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ArrayOfNumberOnly {\n"); sb.Append(" ArrayNumber: ").Append(ArrayNumber).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -108,9 +108,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ArrayNumber != null) - hashCode = hashCode * 59 + this.ArrayNumber.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayNumber.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ArrayTest.cs index 37d45ae2ddaf..7c9c235507ab 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -77,7 +77,7 @@ public partial class ArrayTest : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ArrayTest {\n"); sb.Append(" ArrayOfString: ").Append(ArrayOfString).Append("\n"); sb.Append(" ArrayArrayOfInteger: ").Append(ArrayArrayOfInteger).Append("\n"); @@ -126,13 +126,21 @@ public override int GetHashCode() { int hashCode = 41; if (this.ArrayOfString != null) - hashCode = hashCode * 59 + this.ArrayOfString.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayOfString.GetHashCode(); + } if (this.ArrayArrayOfInteger != null) - hashCode = hashCode * 59 + this.ArrayArrayOfInteger.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayArrayOfInteger.GetHashCode(); + } if (this.ArrayArrayOfModel != null) - hashCode = hashCode * 59 + this.ArrayArrayOfModel.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayArrayOfModel.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Banana.cs index 81074ebe6eab..8b340fae0311 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Banana.cs @@ -61,7 +61,7 @@ public partial class Banana : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Banana {\n"); sb.Append(" LengthCm: ").Append(LengthCm).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -107,9 +107,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.LengthCm.GetHashCode(); + hashCode = (hashCode * 59) + this.LengthCm.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/BananaReq.cs index 01df9fc32882..0bb74117eec2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/BananaReq.cs @@ -67,7 +67,7 @@ protected BananaReq() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class BananaReq {\n"); sb.Append(" LengthCm: ").Append(LengthCm).Append("\n"); sb.Append(" Sweet: ").Append(Sweet).Append("\n"); @@ -113,8 +113,8 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.LengthCm.GetHashCode(); - hashCode = hashCode * 59 + this.Sweet.GetHashCode(); + hashCode = (hashCode * 59) + this.LengthCm.GetHashCode(); + hashCode = (hashCode * 59) + this.Sweet.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/BasquePig.cs index a72f3c5a21fb..56ee53e80a85 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/BasquePig.cs @@ -73,7 +73,7 @@ protected BasquePig() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class BasquePig {\n"); sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -120,9 +120,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ClassName != null) - hashCode = hashCode * 59 + this.ClassName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Capitalization.cs index 63ae477d6716..463d63a939f3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Capitalization.cs @@ -102,7 +102,7 @@ public partial class Capitalization : IEquatable, IValidatableOb /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Capitalization {\n"); sb.Append(" SmallCamel: ").Append(SmallCamel).Append("\n"); sb.Append(" CapitalCamel: ").Append(CapitalCamel).Append("\n"); @@ -154,19 +154,33 @@ public override int GetHashCode() { int hashCode = 41; if (this.SmallCamel != null) - hashCode = hashCode * 59 + this.SmallCamel.GetHashCode(); + { + hashCode = (hashCode * 59) + this.SmallCamel.GetHashCode(); + } if (this.CapitalCamel != null) - hashCode = hashCode * 59 + this.CapitalCamel.GetHashCode(); + { + hashCode = (hashCode * 59) + this.CapitalCamel.GetHashCode(); + } if (this.SmallSnake != null) - hashCode = hashCode * 59 + this.SmallSnake.GetHashCode(); + { + hashCode = (hashCode * 59) + this.SmallSnake.GetHashCode(); + } if (this.CapitalSnake != null) - hashCode = hashCode * 59 + this.CapitalSnake.GetHashCode(); + { + hashCode = (hashCode * 59) + this.CapitalSnake.GetHashCode(); + } if (this.SCAETHFlowPoints != null) - hashCode = hashCode * 59 + this.SCAETHFlowPoints.GetHashCode(); + { + hashCode = (hashCode * 59) + this.SCAETHFlowPoints.GetHashCode(); + } if (this.ATT_NAME != null) - hashCode = hashCode * 59 + this.ATT_NAME.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ATT_NAME.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Cat.cs index 84875a42d1b2..a4913aebad77 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Cat.cs @@ -73,7 +73,7 @@ protected Cat() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Cat {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" Declawed: ").Append(Declawed).Append("\n"); @@ -120,9 +120,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = base.GetHashCode(); - hashCode = hashCode * 59 + this.Declawed.GetHashCode(); + hashCode = (hashCode * 59) + this.Declawed.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } @@ -144,7 +146,10 @@ public override int GetHashCode() /// Validation Result protected IEnumerable BaseValidate(ValidationContext validationContext) { - foreach(var x in BaseValidate(validationContext)) yield return x; + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } yield break; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/CatAllOf.cs index 216ac7a7b02a..d126477f7364 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/CatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -61,7 +61,7 @@ public partial class CatAllOf : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class CatAllOf {\n"); sb.Append(" Declawed: ").Append(Declawed).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -107,9 +107,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Declawed.GetHashCode(); + hashCode = (hashCode * 59) + this.Declawed.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Category.cs index 67a5c3ee748d..59a4fbad51bd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Category.cs @@ -81,7 +81,7 @@ protected Category() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Category {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); @@ -128,11 +128,15 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ChildCat.cs index 9031f6011659..a6603b7cb858 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ChildCat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ChildCat.cs @@ -93,7 +93,7 @@ protected ChildCat() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ChildCat {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); @@ -142,10 +142,14 @@ public override int GetHashCode() { int hashCode = base.GetHashCode(); if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); - hashCode = hashCode * 59 + this.PetType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + hashCode = (hashCode * 59) + this.PetType.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } @@ -167,7 +171,10 @@ public override int GetHashCode() /// Validation Result protected IEnumerable BaseValidate(ValidationContext validationContext) { - foreach(var x in BaseValidate(validationContext)) yield return x; + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } yield break; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ChildCatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ChildCatAllOf.cs index f7e9e82de3e8..f2ae1bcb0540 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ChildCatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ChildCatAllOf.cs @@ -83,7 +83,7 @@ public enum PetTypeEnum /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ChildCatAllOf {\n"); sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" PetType: ").Append(PetType).Append("\n"); @@ -131,10 +131,14 @@ public override int GetHashCode() { int hashCode = 41; if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); - hashCode = hashCode * 59 + this.PetType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + hashCode = (hashCode * 59) + this.PetType.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ClassModel.cs index 26ad94fcb395..66db9245d6bb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ClassModel.cs @@ -61,7 +61,7 @@ public partial class ClassModel : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ClassModel {\n"); sb.Append(" Class: ").Append(Class).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -108,9 +108,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.Class != null) - hashCode = hashCode * 59 + this.Class.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Class.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index 466fda94d019..98f8f19c014a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -85,7 +85,7 @@ protected ComplexQuadrilateral() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ComplexQuadrilateral {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); @@ -133,11 +133,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } if (this.QuadrilateralType != null) - hashCode = hashCode * 59 + this.QuadrilateralType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.QuadrilateralType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/DanishPig.cs index ae07caed6f9c..08cc2665dde0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/DanishPig.cs @@ -73,7 +73,7 @@ protected DanishPig() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class DanishPig {\n"); sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -120,9 +120,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ClassName != null) - hashCode = hashCode * 59 + this.ClassName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/DeprecatedObject.cs index 804b8b4fafa8..afd969168883 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/DeprecatedObject.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -61,7 +61,7 @@ public partial class DeprecatedObject : IEquatable, IValidatab /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class DeprecatedObject {\n"); sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -108,9 +108,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Dog.cs index e15631d34152..190866102def 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Dog.cs @@ -73,7 +73,7 @@ protected Dog() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Dog {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" Breed: ").Append(Breed).Append("\n"); @@ -121,9 +121,13 @@ public override int GetHashCode() { int hashCode = base.GetHashCode(); if (this.Breed != null) - hashCode = hashCode * 59 + this.Breed.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Breed.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } @@ -145,7 +149,10 @@ public override int GetHashCode() /// Validation Result protected IEnumerable BaseValidate(ValidationContext validationContext) { - foreach(var x in BaseValidate(validationContext)) yield return x; + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } yield break; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/DogAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/DogAllOf.cs index eacfb595623d..7d6c49788a0c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/DogAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/DogAllOf.cs @@ -61,7 +61,7 @@ public partial class DogAllOf : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class DogAllOf {\n"); sb.Append(" Breed: ").Append(Breed).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -108,9 +108,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.Breed != null) - hashCode = hashCode * 59 + this.Breed.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Breed.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Drawing.cs index b24289870b9e..7610f5c3bc18 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Drawing.cs @@ -78,7 +78,7 @@ public partial class Drawing : Dictionary, IEquatable, I /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Drawing {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" MainShape: ").Append(MainShape).Append("\n"); @@ -128,13 +128,21 @@ public override int GetHashCode() { int hashCode = base.GetHashCode(); if (this.MainShape != null) - hashCode = hashCode * 59 + this.MainShape.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MainShape.GetHashCode(); + } if (this.ShapeOrNull != null) - hashCode = hashCode * 59 + this.ShapeOrNull.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeOrNull.GetHashCode(); + } if (this.NullableShape != null) - hashCode = hashCode * 59 + this.NullableShape.GetHashCode(); + { + hashCode = (hashCode * 59) + this.NullableShape.GetHashCode(); + } if (this.Shapes != null) - hashCode = hashCode * 59 + this.Shapes.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Shapes.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/EnumArrays.cs index 8bb69d7fd90f..7e5d509dd8b3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -110,7 +110,7 @@ public enum ArrayEnumEnum /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class EnumArrays {\n"); sb.Append(" JustSymbol: ").Append(JustSymbol).Append("\n"); sb.Append(" ArrayEnum: ").Append(ArrayEnum).Append("\n"); @@ -157,10 +157,12 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.JustSymbol.GetHashCode(); - hashCode = hashCode * 59 + this.ArrayEnum.GetHashCode(); + hashCode = (hashCode * 59) + this.JustSymbol.GetHashCode(); + hashCode = (hashCode * 59) + this.ArrayEnum.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/EnumTest.cs index 14ae48281f0c..a5a0c32d3a3f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/EnumTest.cs @@ -239,7 +239,7 @@ protected EnumTest() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class EnumTest {\n"); sb.Append(" EnumString: ").Append(EnumString).Append("\n"); sb.Append(" EnumStringRequired: ").Append(EnumStringRequired).Append("\n"); @@ -293,17 +293,19 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.EnumString.GetHashCode(); - hashCode = hashCode * 59 + this.EnumStringRequired.GetHashCode(); - hashCode = hashCode * 59 + this.EnumInteger.GetHashCode(); - hashCode = hashCode * 59 + this.EnumIntegerOnly.GetHashCode(); - hashCode = hashCode * 59 + this.EnumNumber.GetHashCode(); - hashCode = hashCode * 59 + this.OuterEnum.GetHashCode(); - hashCode = hashCode * 59 + this.OuterEnumInteger.GetHashCode(); - hashCode = hashCode * 59 + this.OuterEnumDefaultValue.GetHashCode(); - hashCode = hashCode * 59 + this.OuterEnumIntegerDefaultValue.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumString.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumStringRequired.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumInteger.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumIntegerOnly.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumNumber.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnum.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnumInteger.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnumDefaultValue.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnumIntegerDefaultValue.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index 7b7ae970ad2f..c76a4adf9c09 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -85,7 +85,7 @@ protected EquilateralTriangle() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class EquilateralTriangle {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); @@ -133,11 +133,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } if (this.TriangleType != null) - hashCode = hashCode * 59 + this.TriangleType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/File.cs index 55c558f7ccf2..36418ba16769 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/File.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/File.cs @@ -62,7 +62,7 @@ public partial class File : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class File {\n"); sb.Append(" SourceURI: ").Append(SourceURI).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -109,9 +109,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.SourceURI != null) - hashCode = hashCode * 59 + this.SourceURI.GetHashCode(); + { + hashCode = (hashCode * 59) + this.SourceURI.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index 0a0e64cae8a5..13d9f45e3f2e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -69,7 +69,7 @@ public partial class FileSchemaTestClass : IEquatable, IVal /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class FileSchemaTestClass {\n"); sb.Append(" File: ").Append(File).Append("\n"); sb.Append(" Files: ").Append(Files).Append("\n"); @@ -117,11 +117,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.File != null) - hashCode = hashCode * 59 + this.File.GetHashCode(); + { + hashCode = (hashCode * 59) + this.File.GetHashCode(); + } if (this.Files != null) - hashCode = hashCode * 59 + this.Files.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Files.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Foo.cs index 3db81e42d4c7..c42991826b1b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Foo.cs @@ -62,7 +62,7 @@ public Foo(string bar = "bar") /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Foo {\n"); sb.Append(" Bar: ").Append(Bar).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -109,9 +109,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.Bar != null) - hashCode = hashCode * 59 + this.Bar.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Bar.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/FormatTest.cs index cdb7b684a77a..6b2fa36ee3d7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/FormatTest.cs @@ -200,7 +200,7 @@ protected FormatTest() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class FormatTest {\n"); sb.Append(" Integer: ").Append(Integer).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); @@ -261,33 +261,53 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Integer.GetHashCode(); - hashCode = hashCode * 59 + this.Int32.GetHashCode(); - hashCode = hashCode * 59 + this.Int64.GetHashCode(); - hashCode = hashCode * 59 + this.Number.GetHashCode(); - hashCode = hashCode * 59 + this.Float.GetHashCode(); - hashCode = hashCode * 59 + this.Double.GetHashCode(); - hashCode = hashCode * 59 + this.Decimal.GetHashCode(); + hashCode = (hashCode * 59) + this.Integer.GetHashCode(); + hashCode = (hashCode * 59) + this.Int32.GetHashCode(); + hashCode = (hashCode * 59) + this.Int64.GetHashCode(); + hashCode = (hashCode * 59) + this.Number.GetHashCode(); + hashCode = (hashCode * 59) + this.Float.GetHashCode(); + hashCode = (hashCode * 59) + this.Double.GetHashCode(); + hashCode = (hashCode * 59) + this.Decimal.GetHashCode(); if (this.String != null) - hashCode = hashCode * 59 + this.String.GetHashCode(); + { + hashCode = (hashCode * 59) + this.String.GetHashCode(); + } if (this.Byte != null) - hashCode = hashCode * 59 + this.Byte.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Byte.GetHashCode(); + } if (this.Binary != null) - hashCode = hashCode * 59 + this.Binary.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Binary.GetHashCode(); + } if (this.Date != null) - hashCode = hashCode * 59 + this.Date.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Date.GetHashCode(); + } if (this.DateTime != null) - hashCode = hashCode * 59 + this.DateTime.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DateTime.GetHashCode(); + } if (this.Uuid != null) - hashCode = hashCode * 59 + this.Uuid.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); + } if (this.Password != null) - hashCode = hashCode * 59 + this.Password.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Password.GetHashCode(); + } if (this.PatternWithDigits != null) - hashCode = hashCode * 59 + this.PatternWithDigits.GetHashCode(); + { + hashCode = (hashCode * 59) + this.PatternWithDigits.GetHashCode(); + } if (this.PatternWithDigitsAndDelimiter != null) - hashCode = hashCode * 59 + this.PatternWithDigitsAndDelimiter.GetHashCode(); + { + hashCode = (hashCode * 59) + this.PatternWithDigitsAndDelimiter.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } @@ -300,61 +320,61 @@ public override int GetHashCode() public IEnumerable Validate(ValidationContext validationContext) { // Integer (int) maximum - if(this.Integer > (int)100) + if (this.Integer > (int)100) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); } // Integer (int) minimum - if(this.Integer < (int)10) + if (this.Integer < (int)10) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); } // Int32 (int) maximum - if(this.Int32 > (int)200) + if (this.Int32 > (int)200) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); } // Int32 (int) minimum - if(this.Int32 < (int)20) + if (this.Int32 < (int)20) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } // Number (decimal) maximum - if(this.Number > (decimal)543.2) + if (this.Number > (decimal)543.2) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); } // Number (decimal) minimum - if(this.Number < (decimal)32.1) + if (this.Number < (decimal)32.1) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); } // Float (float) maximum - if(this.Float > (float)987.6) + if (this.Float > (float)987.6) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); } // Float (float) minimum - if(this.Float < (float)54.3) + if (this.Float < (float)54.3) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); } // Double (double) maximum - if(this.Double > (double)123.4) + if (this.Double > (double)123.4) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); } // Double (double) minimum - if(this.Double < (double)67.8) + if (this.Double < (double)67.8) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); } @@ -367,13 +387,13 @@ public override int GetHashCode() } // Password (string) maxLength - if(this.Password != null && this.Password.Length > 64) + if (this.Password != null && this.Password.Length > 64) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); } // Password (string) minLength - if(this.Password != null && this.Password.Length < 10) + if (this.Password != null && this.Password.Length < 10) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index 269d213d3d07..7b1b41d58afb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -77,7 +77,7 @@ protected GrandparentAnimal() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class GrandparentAnimal {\n"); sb.Append(" PetType: ").Append(PetType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -124,9 +124,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.PetType != null) - hashCode = hashCode * 59 + this.PetType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.PetType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index 37696997d073..18b308519560 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -82,7 +82,7 @@ public bool ShouldSerializeFoo() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class HasOnlyReadOnly {\n"); sb.Append(" Bar: ").Append(Bar).Append("\n"); sb.Append(" Foo: ").Append(Foo).Append("\n"); @@ -130,11 +130,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.Bar != null) - hashCode = hashCode * 59 + this.Bar.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Bar.GetHashCode(); + } if (this.Foo != null) - hashCode = hashCode * 59 + this.Foo.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Foo.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/HealthCheckResult.cs index 11fcc6f7e256..0764cab0edfa 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/HealthCheckResult.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -61,7 +61,7 @@ public partial class HealthCheckResult : IEquatable, IValidat /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class HealthCheckResult {\n"); sb.Append(" NullableMessage: ").Append(NullableMessage).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -108,9 +108,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.NullableMessage != null) - hashCode = hashCode * 59 + this.NullableMessage.GetHashCode(); + { + hashCode = (hashCode * 59) + this.NullableMessage.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/InlineResponseDefault.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/InlineResponseDefault.cs index 38d0ec6ca651..6e0c37e257a3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/InlineResponseDefault.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/InlineResponseDefault.cs @@ -61,7 +61,7 @@ public partial class InlineResponseDefault : IEquatable, /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class InlineResponseDefault {\n"); sb.Append(" String: ").Append(String).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -108,9 +108,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.String != null) - hashCode = hashCode * 59 + this.String.GetHashCode(); + { + hashCode = (hashCode * 59) + this.String.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index 30d639d57b60..2f93e58d26d0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -75,7 +75,7 @@ protected IsoscelesTriangle() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class IsoscelesTriangle {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); @@ -122,9 +122,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } if (this.TriangleType != null) - hashCode = hashCode * 59 + this.TriangleType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/List.cs index dbbac7eb34cf..9610ab8c2728 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/List.cs @@ -61,7 +61,7 @@ public partial class List : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class List {\n"); sb.Append(" _123List: ").Append(_123List).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -108,9 +108,13 @@ public override int GetHashCode() { int hashCode = 41; if (this._123List != null) - hashCode = hashCode * 59 + this._123List.GetHashCode(); + { + hashCode = (hashCode * 59) + this._123List.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/MapTest.cs index 9116d8998c74..9a7ca84088ed 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/MapTest.cs @@ -106,7 +106,7 @@ public enum InnerEnum /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class MapTest {\n"); sb.Append(" MapMapOfString: ").Append(MapMapOfString).Append("\n"); sb.Append(" MapOfEnumString: ").Append(MapOfEnumString).Append("\n"); @@ -156,14 +156,22 @@ public override int GetHashCode() { int hashCode = 41; if (this.MapMapOfString != null) - hashCode = hashCode * 59 + this.MapMapOfString.GetHashCode(); - hashCode = hashCode * 59 + this.MapOfEnumString.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapMapOfString.GetHashCode(); + } + hashCode = (hashCode * 59) + this.MapOfEnumString.GetHashCode(); if (this.DirectMap != null) - hashCode = hashCode * 59 + this.DirectMap.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DirectMap.GetHashCode(); + } if (this.IndirectMap != null) - hashCode = hashCode * 59 + this.IndirectMap.GetHashCode(); + { + hashCode = (hashCode * 59) + this.IndirectMap.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index f1e770c39d3e..22690e540910 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -77,7 +77,7 @@ public partial class MixedPropertiesAndAdditionalPropertiesClass : IEquatableString presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); @@ -126,13 +126,21 @@ public override int GetHashCode() { int hashCode = 41; if (this.Uuid != null) - hashCode = hashCode * 59 + this.Uuid.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); + } if (this.DateTime != null) - hashCode = hashCode * 59 + this.DateTime.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DateTime.GetHashCode(); + } if (this.Map != null) - hashCode = hashCode * 59 + this.Map.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Map.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Model200Response.cs index 55cc5b17abde..1f636909766b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Model200Response.cs @@ -69,7 +69,7 @@ public partial class Model200Response : IEquatable, IValidatab /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Model200Response {\n"); sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" Class: ").Append(Class).Append("\n"); @@ -116,11 +116,15 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Name.GetHashCode(); + hashCode = (hashCode * 59) + this.Name.GetHashCode(); if (this.Class != null) - hashCode = hashCode * 59 + this.Class.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Class.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ModelClient.cs index d77e05d93a91..564fedf5ae4f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ModelClient.cs @@ -61,7 +61,7 @@ public partial class ModelClient : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ModelClient {\n"); sb.Append(" _Client: ").Append(_Client).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -108,9 +108,13 @@ public override int GetHashCode() { int hashCode = 41; if (this._Client != null) - hashCode = hashCode * 59 + this._Client.GetHashCode(); + { + hashCode = (hashCode * 59) + this._Client.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Name.cs index 30c4db076e3a..47c53759a055 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Name.cs @@ -105,7 +105,7 @@ public bool ShouldSerialize_123Number() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Name {\n"); sb.Append(" _Name: ").Append(_Name).Append("\n"); sb.Append(" SnakeCase: ").Append(SnakeCase).Append("\n"); @@ -154,13 +154,17 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this._Name.GetHashCode(); - hashCode = hashCode * 59 + this.SnakeCase.GetHashCode(); + hashCode = (hashCode * 59) + this._Name.GetHashCode(); + hashCode = (hashCode * 59) + this.SnakeCase.GetHashCode(); if (this.Property != null) - hashCode = hashCode * 59 + this.Property.GetHashCode(); - hashCode = hashCode * 59 + this._123Number.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Property.GetHashCode(); + } + hashCode = (hashCode * 59) + this._123Number.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/NullableClass.cs index d7dedf8a3911..0b61fdc69e66 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/NullableClass.cs @@ -143,7 +143,7 @@ public partial class NullableClass : Dictionary, IEquatableString presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class NullableClass {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" IntegerProp: ").Append(IntegerProp).Append("\n"); @@ -201,29 +201,53 @@ public override int GetHashCode() { int hashCode = base.GetHashCode(); if (this.IntegerProp != null) - hashCode = hashCode * 59 + this.IntegerProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.IntegerProp.GetHashCode(); + } if (this.NumberProp != null) - hashCode = hashCode * 59 + this.NumberProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.NumberProp.GetHashCode(); + } if (this.BooleanProp != null) - hashCode = hashCode * 59 + this.BooleanProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.BooleanProp.GetHashCode(); + } if (this.StringProp != null) - hashCode = hashCode * 59 + this.StringProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.StringProp.GetHashCode(); + } if (this.DateProp != null) - hashCode = hashCode * 59 + this.DateProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DateProp.GetHashCode(); + } if (this.DatetimeProp != null) - hashCode = hashCode * 59 + this.DatetimeProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DatetimeProp.GetHashCode(); + } if (this.ArrayNullableProp != null) - hashCode = hashCode * 59 + this.ArrayNullableProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayNullableProp.GetHashCode(); + } if (this.ArrayAndItemsNullableProp != null) - hashCode = hashCode * 59 + this.ArrayAndItemsNullableProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayAndItemsNullableProp.GetHashCode(); + } if (this.ArrayItemsNullable != null) - hashCode = hashCode * 59 + this.ArrayItemsNullable.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayItemsNullable.GetHashCode(); + } if (this.ObjectNullableProp != null) - hashCode = hashCode * 59 + this.ObjectNullableProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ObjectNullableProp.GetHashCode(); + } if (this.ObjectAndItemsNullableProp != null) - hashCode = hashCode * 59 + this.ObjectAndItemsNullableProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ObjectAndItemsNullableProp.GetHashCode(); + } if (this.ObjectItemsNullable != null) - hashCode = hashCode * 59 + this.ObjectItemsNullable.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/NumberOnly.cs index 54a8fa8e9fad..15281d72033c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -61,7 +61,7 @@ public partial class NumberOnly : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class NumberOnly {\n"); sb.Append(" JustNumber: ").Append(JustNumber).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -107,9 +107,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.JustNumber.GetHashCode(); + hashCode = (hashCode * 59) + this.JustNumber.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 2a33350b2837..c313e46180f1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -88,7 +88,7 @@ public partial class ObjectWithDeprecatedFields : IEquatableString presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ObjectWithDeprecatedFields {\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); sb.Append(" Id: ").Append(Id).Append("\n"); @@ -138,14 +138,22 @@ public override int GetHashCode() { int hashCode = 41; if (this.Uuid != null) - hashCode = hashCode * 59 + this.Uuid.GetHashCode(); - hashCode = hashCode * 59 + this.Id.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.DeprecatedRef != null) - hashCode = hashCode * 59 + this.DeprecatedRef.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DeprecatedRef.GetHashCode(); + } if (this.Bars != null) - hashCode = hashCode * 59 + this.Bars.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Bars.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Order.cs index c4c2bd17ccaf..5dbf90d5ef3e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Order.cs @@ -129,7 +129,7 @@ public enum StatusEnum /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Order {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" PetId: ").Append(PetId).Append("\n"); @@ -180,15 +180,19 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Id.GetHashCode(); - hashCode = hashCode * 59 + this.PetId.GetHashCode(); - hashCode = hashCode * 59 + this.Quantity.GetHashCode(); + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.PetId.GetHashCode(); + hashCode = (hashCode * 59) + this.Quantity.GetHashCode(); if (this.ShipDate != null) - hashCode = hashCode * 59 + this.ShipDate.GetHashCode(); - hashCode = hashCode * 59 + this.Status.GetHashCode(); - hashCode = hashCode * 59 + this.Complete.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShipDate.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); + hashCode = (hashCode * 59) + this.Complete.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/OuterComposite.cs index 00fd62fb3a0f..2351bbd1e533 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -77,7 +77,7 @@ public partial class OuterComposite : IEquatable, IValidatableOb /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class OuterComposite {\n"); sb.Append(" MyNumber: ").Append(MyNumber).Append("\n"); sb.Append(" MyString: ").Append(MyString).Append("\n"); @@ -125,12 +125,16 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.MyNumber.GetHashCode(); + hashCode = (hashCode * 59) + this.MyNumber.GetHashCode(); if (this.MyString != null) - hashCode = hashCode * 59 + this.MyString.GetHashCode(); - hashCode = hashCode * 59 + this.MyBoolean.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MyString.GetHashCode(); + } + hashCode = (hashCode * 59) + this.MyBoolean.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ParentPet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ParentPet.cs index ff03e56a6f40..423c6e4e4085 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ParentPet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ParentPet.cs @@ -65,7 +65,7 @@ public ParentPet(string petType = "ParentPet") : base(petType) /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ParentPet {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -112,7 +112,9 @@ public override int GetHashCode() { int hashCode = base.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } @@ -134,7 +136,10 @@ public override int GetHashCode() /// Validation Result protected IEnumerable BaseValidate(ValidationContext validationContext) { - foreach(var x in BaseValidate(validationContext)) yield return x; + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } yield break; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Pet.cs index 0e5cc36e69cd..8df973cda4e1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Pet.cs @@ -145,7 +145,7 @@ protected Pet() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Pet {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Category: ").Append(Category).Append("\n"); @@ -196,18 +196,28 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.Category != null) - hashCode = hashCode * 59 + this.Category.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Category.GetHashCode(); + } if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } if (this.PhotoUrls != null) - hashCode = hashCode * 59 + this.PhotoUrls.GetHashCode(); + { + hashCode = (hashCode * 59) + this.PhotoUrls.GetHashCode(); + } if (this.Tags != null) - hashCode = hashCode * 59 + this.Tags.GetHashCode(); - hashCode = hashCode * 59 + this.Status.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Tags.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index 2b4c27fafe8a..c9f98c3a79f0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -73,7 +73,7 @@ protected QuadrilateralInterface() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class QuadrilateralInterface {\n"); sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -120,9 +120,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.QuadrilateralType != null) - hashCode = hashCode * 59 + this.QuadrilateralType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.QuadrilateralType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index 8dd9ba191faa..81adfe7489b7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -75,7 +75,7 @@ public bool ShouldSerializeBar() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ReadOnlyFirst {\n"); sb.Append(" Bar: ").Append(Bar).Append("\n"); sb.Append(" Baz: ").Append(Baz).Append("\n"); @@ -123,11 +123,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.Bar != null) - hashCode = hashCode * 59 + this.Bar.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Bar.GetHashCode(); + } if (this.Baz != null) - hashCode = hashCode * 59 + this.Baz.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Baz.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Return.cs index cac3f1b9b3d2..b08ff8117053 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Return.cs @@ -61,7 +61,7 @@ public partial class Return : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Return {\n"); sb.Append(" _Return: ").Append(_Return).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -107,9 +107,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this._Return.GetHashCode(); + hashCode = (hashCode * 59) + this._Return.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index 94d6c80d998d..5ae953e4f60e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -85,7 +85,7 @@ protected ScaleneTriangle() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ScaleneTriangle {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); @@ -133,11 +133,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } if (this.TriangleType != null) - hashCode = hashCode * 59 + this.TriangleType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ShapeInterface.cs index b6307c94ddcd..a723696e0aae 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -73,7 +73,7 @@ protected ShapeInterface() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ShapeInterface {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -120,9 +120,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index 2d0d58b4a08e..b706f718758b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -85,7 +85,7 @@ protected SimpleQuadrilateral() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class SimpleQuadrilateral {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); @@ -133,11 +133,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } if (this.QuadrilateralType != null) - hashCode = hashCode * 59 + this.QuadrilateralType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.QuadrilateralType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/SpecialModelName.cs index 87f4023d689b..d35b2d2d2983 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -69,7 +69,7 @@ public partial class SpecialModelName : IEquatable, IValidatab /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class SpecialModelName {\n"); sb.Append(" SpecialPropertyName: ").Append(SpecialPropertyName).Append("\n"); sb.Append(" _SpecialModelName: ").Append(_SpecialModelName).Append("\n"); @@ -116,11 +116,15 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.SpecialPropertyName.GetHashCode(); + hashCode = (hashCode * 59) + this.SpecialPropertyName.GetHashCode(); if (this._SpecialModelName != null) - hashCode = hashCode * 59 + this._SpecialModelName.GetHashCode(); + { + hashCode = (hashCode * 59) + this._SpecialModelName.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Tag.cs index 59f153e70960..3323ce57e280 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Tag.cs @@ -69,7 +69,7 @@ public partial class Tag : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Tag {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); @@ -116,11 +116,15 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/TriangleInterface.cs index 43ca1ed79798..3438ca5aabb2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -73,7 +73,7 @@ protected TriangleInterface() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class TriangleInterface {\n"); sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -120,9 +120,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.TriangleType != null) - hashCode = hashCode * 59 + this.TriangleType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/User.cs index 5edf8bc42bcf..d099e4690955 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/User.cs @@ -154,7 +154,7 @@ public partial class User : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class User {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Username: ").Append(Username).Append("\n"); @@ -211,30 +211,52 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.Username != null) - hashCode = hashCode * 59 + this.Username.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Username.GetHashCode(); + } if (this.FirstName != null) - hashCode = hashCode * 59 + this.FirstName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.FirstName.GetHashCode(); + } if (this.LastName != null) - hashCode = hashCode * 59 + this.LastName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.LastName.GetHashCode(); + } if (this.Email != null) - hashCode = hashCode * 59 + this.Email.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Email.GetHashCode(); + } if (this.Password != null) - hashCode = hashCode * 59 + this.Password.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Password.GetHashCode(); + } if (this.Phone != null) - hashCode = hashCode * 59 + this.Phone.GetHashCode(); - hashCode = hashCode * 59 + this.UserStatus.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Phone.GetHashCode(); + } + hashCode = (hashCode * 59) + this.UserStatus.GetHashCode(); if (this.ObjectWithNoDeclaredProps != null) - hashCode = hashCode * 59 + this.ObjectWithNoDeclaredProps.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ObjectWithNoDeclaredProps.GetHashCode(); + } if (this.ObjectWithNoDeclaredPropsNullable != null) - hashCode = hashCode * 59 + this.ObjectWithNoDeclaredPropsNullable.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ObjectWithNoDeclaredPropsNullable.GetHashCode(); + } if (this.AnyTypeProp != null) - hashCode = hashCode * 59 + this.AnyTypeProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AnyTypeProp.GetHashCode(); + } if (this.AnyTypePropNullable != null) - hashCode = hashCode * 59 + this.AnyTypePropNullable.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AnyTypePropNullable.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Whale.cs index 1a2f7783d7c6..2c77472b9d2c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Whale.cs @@ -89,7 +89,7 @@ protected Whale() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Whale {\n"); sb.Append(" HasBaleen: ").Append(HasBaleen).Append("\n"); sb.Append(" HasTeeth: ").Append(HasTeeth).Append("\n"); @@ -137,12 +137,16 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.HasBaleen.GetHashCode(); - hashCode = hashCode * 59 + this.HasTeeth.GetHashCode(); + hashCode = (hashCode * 59) + this.HasBaleen.GetHashCode(); + hashCode = (hashCode * 59) + this.HasTeeth.GetHashCode(); if (this.ClassName != null) - hashCode = hashCode * 59 + this.ClassName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Zebra.cs index 74c97732f6d6..7ab15adf8802 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/Zebra.cs @@ -107,7 +107,7 @@ protected Zebra() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Zebra {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); @@ -155,11 +155,15 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = base.GetHashCode(); - hashCode = hashCode * 59 + this.Type.GetHashCode(); + hashCode = (hashCode * 59) + this.Type.GetHashCode(); if (this.ClassName != null) - hashCode = hashCode * 59 + this.ClassName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index ad48306e00ce..ac8fbdcdc946 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -221,7 +221,9 @@ public Org.OpenAPITools.Client.ApiResponse Call123TestSpecialTagsWi { // verify the required parameter 'modelClient' is set if (modelClient == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling AnotherFakeApi->Call123TestSpecialTags"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -235,21 +237,29 @@ public Org.OpenAPITools.Client.ApiResponse Call123TestSpecialTagsWi }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = modelClient; // make the HTTP request var localVarResponse = this.Client.Patch("/another-fake/dummy", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("Call123TestSpecialTags", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -279,7 +289,9 @@ public Org.OpenAPITools.Client.ApiResponse Call123TestSpecialTagsWi { // verify the required parameter 'modelClient' is set if (modelClient == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling AnotherFakeApi->Call123TestSpecialTags"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -293,24 +305,31 @@ public Org.OpenAPITools.Client.ApiResponse Call123TestSpecialTagsWi "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = modelClient; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PatchAsync("/another-fake/dummy", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("Call123TestSpecialTags", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/DefaultApi.cs index 8844aca4ab73..a9e5cfb9c4d2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -221,20 +221,28 @@ public Org.OpenAPITools.Client.ApiResponse FooGetWithHttp }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request var localVarResponse = this.Client.Get("/foo", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FooGet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -271,23 +279,30 @@ public Org.OpenAPITools.Client.ApiResponse FooGetWithHttp "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/foo", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FooGet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/FakeApi.cs index dab406002f81..57a99469634f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/FakeApi.cs @@ -945,20 +945,28 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request var localVarResponse = this.Client.Get("/fake/health", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeHealthGet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -995,23 +1003,30 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/fake/health", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeHealthGet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1049,21 +1064,29 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = body; // make the HTTP request var localVarResponse = this.Client.Post("/fake/outer/boolean", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterBooleanSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1103,24 +1126,31 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH "*/*" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = body; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/boolean", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterBooleanSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1158,21 +1188,29 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = outerComposite; // make the HTTP request var localVarResponse = this.Client.Post("/fake/outer/composite", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterCompositeSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1212,24 +1250,31 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH "*/*" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = outerComposite; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/composite", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterCompositeSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1267,21 +1312,29 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = body; // make the HTTP request var localVarResponse = this.Client.Post("/fake/outer/number", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterNumberSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1321,24 +1374,31 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH "*/*" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = body; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/number", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterNumberSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1376,21 +1436,29 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = body; // make the HTTP request var localVarResponse = this.Client.Post("/fake/outer/string", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterStringSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1430,24 +1498,31 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH "*/*" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = body; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/string", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterStringSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1482,20 +1557,28 @@ public Org.OpenAPITools.Client.ApiResponse> GetArrayOfEnumsWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request var localVarResponse = this.Client.Get>("/fake/array-of-enums", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetArrayOfEnums", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1532,23 +1615,30 @@ public Org.OpenAPITools.Client.ApiResponse> GetArrayOfEnumsWithH "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync>("/fake/array-of-enums", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetArrayOfEnums", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1575,7 +1665,9 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithFileSchemaWithHtt { // verify the required parameter 'fileSchemaTestClass' is set if (fileSchemaTestClass == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'fileSchemaTestClass' when calling FakeApi->TestBodyWithFileSchema"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1588,21 +1680,29 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithFileSchemaWithHtt }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = fileSchemaTestClass; // make the HTTP request var localVarResponse = this.Client.Put("/fake/body-with-file-schema", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestBodyWithFileSchema", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1631,7 +1731,9 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithFileSchemaWithHtt { // verify the required parameter 'fileSchemaTestClass' is set if (fileSchemaTestClass == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'fileSchemaTestClass' when calling FakeApi->TestBodyWithFileSchema"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1644,24 +1746,31 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithFileSchemaWithHtt string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = fileSchemaTestClass; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/body-with-file-schema", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestBodyWithFileSchema", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1690,11 +1799,15 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithQueryParamsWithHt { // verify the required parameter 'query' is set if (query == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'query' when calling FakeApi->TestBodyWithQueryParams"); + } // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling FakeApi->TestBodyWithQueryParams"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1707,10 +1820,16 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithQueryParamsWithHt }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "query", query)); localVarRequestOptions.Data = user; @@ -1718,11 +1837,13 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithQueryParamsWithHt // make the HTTP request var localVarResponse = this.Client.Put("/fake/body-with-query-params", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestBodyWithQueryParams", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1753,11 +1874,15 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithQueryParamsWithHt { // verify the required parameter 'query' is set if (query == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'query' when calling FakeApi->TestBodyWithQueryParams"); + } // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling FakeApi->TestBodyWithQueryParams"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1770,25 +1895,32 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithQueryParamsWithHt string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "query", query)); localVarRequestOptions.Data = user; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/body-with-query-params", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestBodyWithQueryParams", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1816,7 +1948,9 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI { // verify the required parameter 'modelClient' is set if (modelClient == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling FakeApi->TestClientModel"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1830,21 +1964,29 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = modelClient; // make the HTTP request var localVarResponse = this.Client.Patch("/fake", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestClientModel", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1874,7 +2016,9 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI { // verify the required parameter 'modelClient' is set if (modelClient == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling FakeApi->TestClientModel"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1888,24 +2032,31 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = modelClient; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PatchAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestClientModel", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1958,11 +2109,15 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI { // verify the required parameter 'patternWithoutDelimiter' is set if (patternWithoutDelimiter == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'patternWithoutDelimiter' when calling FakeApi->TestEndpointParameters"); + } // verify the required parameter '_byte' is set if (_byte == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter '_byte' when calling FakeApi->TestEndpointParameters"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1975,10 +2130,16 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } if (integer != null) { @@ -2034,11 +2195,13 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI // make the HTTP request var localVarResponse = this.Client.Post("/fake", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestEndpointParameters", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2093,11 +2256,15 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI { // verify the required parameter 'patternWithoutDelimiter' is set if (patternWithoutDelimiter == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'patternWithoutDelimiter' when calling FakeApi->TestEndpointParameters"); + } // verify the required parameter '_byte' is set if (_byte == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter '_byte' when calling FakeApi->TestEndpointParameters"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2110,12 +2277,17 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } if (integer != null) { @@ -2170,13 +2342,15 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestEndpointParameters", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2226,10 +2400,16 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } if (enumQueryStringArray != null) { @@ -2267,11 +2447,13 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI // make the HTTP request var localVarResponse = this.Client.Get("/fake", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestEnumParameters", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2323,12 +2505,17 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } if (enumQueryStringArray != null) { @@ -2365,13 +2552,15 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestEnumParameters", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2416,10 +2605,16 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group)); @@ -2446,11 +2641,13 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI // make the HTTP request var localVarResponse = this.Client.Delete("/fake", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestGroupParameters", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2497,12 +2694,17 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group)); @@ -2528,13 +2730,15 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestGroupParameters", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2561,7 +2765,9 @@ public Org.OpenAPITools.Client.ApiResponse TestInlineAdditionalPropertie { // verify the required parameter 'requestBody' is set if (requestBody == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestInlineAdditionalProperties"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2574,21 +2780,29 @@ public Org.OpenAPITools.Client.ApiResponse TestInlineAdditionalPropertie }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = requestBody; // make the HTTP request var localVarResponse = this.Client.Post("/fake/inline-additionalProperties", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestInlineAdditionalProperties", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2617,7 +2831,9 @@ public Org.OpenAPITools.Client.ApiResponse TestInlineAdditionalPropertie { // verify the required parameter 'requestBody' is set if (requestBody == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestInlineAdditionalProperties"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2630,24 +2846,31 @@ public Org.OpenAPITools.Client.ApiResponse TestInlineAdditionalPropertie string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = requestBody; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/inline-additionalProperties", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestInlineAdditionalProperties", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2676,11 +2899,15 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo( { // verify the required parameter 'param' is set if (param == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestJsonFormData"); + } // verify the required parameter 'param2' is set if (param2 == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'param2' when calling FakeApi->TestJsonFormData"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2693,10 +2920,16 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo( }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.FormParameters.Add("param", Org.OpenAPITools.Client.ClientUtils.ParameterToString(param)); // form parameter localVarRequestOptions.FormParameters.Add("param2", Org.OpenAPITools.Client.ClientUtils.ParameterToString(param2)); // form parameter @@ -2704,11 +2937,13 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo( // make the HTTP request var localVarResponse = this.Client.Get("/fake/jsonFormData", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestJsonFormData", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2739,11 +2974,15 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo( { // verify the required parameter 'param' is set if (param == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestJsonFormData"); + } // verify the required parameter 'param2' is set if (param2 == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'param2' when calling FakeApi->TestJsonFormData"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2756,25 +2995,32 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo( string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.FormParameters.Add("param", Org.OpenAPITools.Client.ClientUtils.ParameterToString(param)); // form parameter localVarRequestOptions.FormParameters.Add("param2", Org.OpenAPITools.Client.ClientUtils.ParameterToString(param2)); // form parameter // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/fake/jsonFormData", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestJsonFormData", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2809,23 +3055,33 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF { // verify the required parameter 'pipe' is set if (pipe == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pipe' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'ioutil' is set if (ioutil == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'ioutil' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'http' is set if (http == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'http' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'url' is set if (url == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'url' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'context' is set if (context == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'context' when calling FakeApi->TestQueryParameterCollectionFormat"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2837,10 +3093,16 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "pipe", pipe)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil)); @@ -2851,11 +3113,13 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF // make the HTTP request var localVarResponse = this.Client.Put("/fake/test-query-parameters", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestQueryParameterCollectionFormat", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2892,23 +3156,33 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF { // verify the required parameter 'pipe' is set if (pipe == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pipe' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'ioutil' is set if (ioutil == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'ioutil' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'http' is set if (http == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'http' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'url' is set if (url == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'url' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'context' is set if (context == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'context' when calling FakeApi->TestQueryParameterCollectionFormat"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2920,12 +3194,17 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "pipe", pipe)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil)); @@ -2935,13 +3214,15 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/test-query-parameters", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestQueryParameterCollectionFormat", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index d4fbb5868adb..c2852b36a44b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -221,7 +221,9 @@ public Org.OpenAPITools.Client.ApiResponse TestClassnameWithHttpInf { // verify the required parameter 'modelClient' is set if (modelClient == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling FakeClassnameTags123Api->TestClassname"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -235,10 +237,16 @@ public Org.OpenAPITools.Client.ApiResponse TestClassnameWithHttpInf }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = modelClient; @@ -250,11 +258,13 @@ public Org.OpenAPITools.Client.ApiResponse TestClassnameWithHttpInf // make the HTTP request var localVarResponse = this.Client.Patch("/fake_classname_test", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestClassname", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -284,7 +294,9 @@ public Org.OpenAPITools.Client.ApiResponse TestClassnameWithHttpInf { // verify the required parameter 'modelClient' is set if (modelClient == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling FakeClassnameTags123Api->TestClassname"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -298,12 +310,17 @@ public Org.OpenAPITools.Client.ApiResponse TestClassnameWithHttpInf "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = modelClient; @@ -314,13 +331,15 @@ public Org.OpenAPITools.Client.ApiResponse TestClassnameWithHttpInf } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PatchAsync("/fake_classname_test", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestClassname", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/PetApi.cs index d73282dfca5f..39d2e425e630 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/PetApi.cs @@ -586,7 +586,9 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) { // verify the required parameter 'pet' is set if (pet == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->AddPet"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -600,10 +602,16 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = pet; @@ -632,11 +640,13 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) // make the HTTP request var localVarResponse = this.Client.Post("/pet", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("AddPet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -665,7 +675,9 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) { // verify the required parameter 'pet' is set if (pet == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->AddPet"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -679,12 +691,17 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = pet; @@ -712,13 +729,15 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/pet", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("AddPet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -755,10 +774,16 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (apiKey != null) @@ -775,11 +800,13 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) // make the HTTP request var localVarResponse = this.Client.Delete("/pet/{petId}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeletePet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -818,12 +845,17 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (apiKey != null) @@ -839,13 +871,15 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeletePet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -873,7 +907,9 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn { // verify the required parameter 'status' is set if (status == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'status' when calling PetApi->FindPetsByStatus"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -887,10 +923,16 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "status", status)); @@ -919,11 +961,13 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn // make the HTTP request var localVarResponse = this.Client.Get>("/pet/findByStatus", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FindPetsByStatus", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -953,7 +997,9 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn { // verify the required parameter 'status' is set if (status == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'status' when calling PetApi->FindPetsByStatus"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -967,12 +1013,17 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "status", status)); @@ -1000,13 +1051,15 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync>("/pet/findByStatus", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FindPetsByStatus", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1036,7 +1089,9 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo { // verify the required parameter 'tags' is set if (tags == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'tags' when calling PetApi->FindPetsByTags"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1050,10 +1105,16 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "tags", tags)); @@ -1082,11 +1143,13 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo // make the HTTP request var localVarResponse = this.Client.Get>("/pet/findByTags", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FindPetsByTags", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1118,7 +1181,9 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo { // verify the required parameter 'tags' is set if (tags == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'tags' when calling PetApi->FindPetsByTags"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1132,12 +1197,17 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "tags", tags)); @@ -1165,13 +1235,15 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync>("/pet/findByTags", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FindPetsByTags", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1209,10 +1281,16 @@ public Org.OpenAPITools.Client.ApiResponse GetPetByIdWithHttpInfo(long petI }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter @@ -1224,11 +1302,13 @@ public Org.OpenAPITools.Client.ApiResponse GetPetByIdWithHttpInfo(long petI // make the HTTP request var localVarResponse = this.Client.Get("/pet/{petId}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetPetById", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1268,12 +1348,17 @@ public Org.OpenAPITools.Client.ApiResponse GetPetByIdWithHttpInfo(long petI "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter @@ -1284,13 +1369,15 @@ public Org.OpenAPITools.Client.ApiResponse GetPetByIdWithHttpInfo(long petI } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetPetById", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1317,7 +1404,9 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet { // verify the required parameter 'pet' is set if (pet == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->UpdatePet"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1331,10 +1420,16 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = pet; @@ -1363,11 +1458,13 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet // make the HTTP request var localVarResponse = this.Client.Put("/pet", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdatePet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1396,7 +1493,9 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet { // verify the required parameter 'pet' is set if (pet == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->UpdatePet"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1410,12 +1509,17 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = pet; @@ -1443,13 +1547,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/pet", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdatePet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1489,10 +1595,16 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (name != null) @@ -1513,11 +1625,13 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet // make the HTTP request var localVarResponse = this.Client.Post("/pet/{petId}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdatePetWithForm", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1559,12 +1673,17 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (name != null) @@ -1584,13 +1703,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdatePetWithForm", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1632,10 +1753,16 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (additionalMetadata != null) @@ -1656,11 +1783,13 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet // make the HTTP request var localVarResponse = this.Client.Post("/pet/{petId}/uploadImage", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UploadFile", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1704,12 +1833,17 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (additionalMetadata != null) @@ -1729,13 +1863,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/pet/{petId}/uploadImage", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UploadFile", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1767,7 +1903,9 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet { // verify the required parameter 'requiredFile' is set if (requiredFile == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredFile' when calling PetApi->UploadFileWithRequiredFile"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1781,10 +1919,16 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (additionalMetadata != null) @@ -1802,11 +1946,13 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet // make the HTTP request var localVarResponse = this.Client.Post("/fake/{petId}/uploadImageWithRequiredFile", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UploadFileWithRequiredFile", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1840,7 +1986,9 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet { // verify the required parameter 'requiredFile' is set if (requiredFile == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredFile' when calling PetApi->UploadFileWithRequiredFile"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1854,12 +2002,17 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (additionalMetadata != null) @@ -1876,13 +2029,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/{petId}/uploadImageWithRequiredFile", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UploadFileWithRequiredFile", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/StoreApi.cs index ad7387db7057..7cda385b3b40 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/StoreApi.cs @@ -345,7 +345,9 @@ public Org.OpenAPITools.Client.ApiResponse DeleteOrderWithHttpInfo(strin { // verify the required parameter 'orderId' is set if (orderId == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -357,21 +359,29 @@ public Org.OpenAPITools.Client.ApiResponse DeleteOrderWithHttpInfo(strin }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter // make the HTTP request var localVarResponse = this.Client.Delete("/store/order/{order_id}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeleteOrder", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -400,7 +410,9 @@ public Org.OpenAPITools.Client.ApiResponse DeleteOrderWithHttpInfo(strin { // verify the required parameter 'orderId' is set if (orderId == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -412,24 +424,31 @@ public Org.OpenAPITools.Client.ApiResponse DeleteOrderWithHttpInfo(strin string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/store/order/{order_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeleteOrder", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -464,10 +483,16 @@ public Org.OpenAPITools.Client.ApiResponse> GetInventory }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // authentication (api_key) required @@ -478,11 +503,13 @@ public Org.OpenAPITools.Client.ApiResponse> GetInventory // make the HTTP request var localVarResponse = this.Client.Get>("/store/inventory", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetInventory", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -519,12 +546,17 @@ public Org.OpenAPITools.Client.ApiResponse> GetInventory "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // authentication (api_key) required @@ -534,13 +566,15 @@ public Org.OpenAPITools.Client.ApiResponse> GetInventory } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync>("/store/inventory", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetInventory", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -578,21 +612,29 @@ public Org.OpenAPITools.Client.ApiResponse GetOrderByIdWithHttpInfo(long }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter // make the HTTP request var localVarResponse = this.Client.Get("/store/order/{order_id}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetOrderById", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -632,24 +674,31 @@ public Org.OpenAPITools.Client.ApiResponse GetOrderByIdWithHttpInfo(long "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/store/order/{order_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetOrderById", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -677,7 +726,9 @@ public Org.OpenAPITools.Client.ApiResponse PlaceOrderWithHttpInfo(Order o { // verify the required parameter 'order' is set if (order == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'order' when calling StoreApi->PlaceOrder"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -692,21 +743,29 @@ public Org.OpenAPITools.Client.ApiResponse PlaceOrderWithHttpInfo(Order o }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = order; // make the HTTP request var localVarResponse = this.Client.Post("/store/order", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("PlaceOrder", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -736,7 +795,9 @@ public Org.OpenAPITools.Client.ApiResponse PlaceOrderWithHttpInfo(Order o { // verify the required parameter 'order' is set if (order == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'order' when calling StoreApi->PlaceOrder"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -751,24 +812,31 @@ public Org.OpenAPITools.Client.ApiResponse PlaceOrderWithHttpInfo(Order o "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = order; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/store/order", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("PlaceOrder", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/UserApi.cs index a2f2598c8acd..a1716303f6f3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/UserApi.cs @@ -517,7 +517,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUserWithHttpInfo(User u { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -530,21 +532,29 @@ public Org.OpenAPITools.Client.ApiResponse CreateUserWithHttpInfo(User u }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; // make the HTTP request var localVarResponse = this.Client.Post("/user", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -573,7 +583,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUserWithHttpInfo(User u { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -586,24 +598,31 @@ public Org.OpenAPITools.Client.ApiResponse CreateUserWithHttpInfo(User u string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/user", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -630,7 +649,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithArrayInputWith { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithArrayInput"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -643,21 +664,29 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithArrayInputWith }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; // make the HTTP request var localVarResponse = this.Client.Post("/user/createWithArray", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUsersWithArrayInput", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -686,7 +715,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithArrayInputWith { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithArrayInput"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -699,24 +730,31 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithArrayInputWith string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/user/createWithArray", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUsersWithArrayInput", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -743,7 +781,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithListInputWithH { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithListInput"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -756,21 +796,29 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithListInputWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; // make the HTTP request var localVarResponse = this.Client.Post("/user/createWithList", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUsersWithListInput", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -799,7 +847,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithListInputWithH { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithListInput"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -812,24 +862,31 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithListInputWithH string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/user/createWithList", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUsersWithListInput", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -856,7 +913,9 @@ public Org.OpenAPITools.Client.ApiResponse DeleteUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->DeleteUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -868,21 +927,29 @@ public Org.OpenAPITools.Client.ApiResponse DeleteUserWithHttpInfo(string }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter // make the HTTP request var localVarResponse = this.Client.Delete("/user/{username}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeleteUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -911,7 +978,9 @@ public Org.OpenAPITools.Client.ApiResponse DeleteUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->DeleteUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -923,24 +992,31 @@ public Org.OpenAPITools.Client.ApiResponse DeleteUserWithHttpInfo(string string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeleteUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -968,7 +1044,9 @@ public Org.OpenAPITools.Client.ApiResponse GetUserByNameWithHttpInfo(strin { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->GetUserByName"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -982,21 +1060,29 @@ public Org.OpenAPITools.Client.ApiResponse GetUserByNameWithHttpInfo(strin }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter // make the HTTP request var localVarResponse = this.Client.Get("/user/{username}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetUserByName", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1026,7 +1112,9 @@ public Org.OpenAPITools.Client.ApiResponse GetUserByNameWithHttpInfo(strin { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->GetUserByName"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1040,24 +1128,31 @@ public Org.OpenAPITools.Client.ApiResponse GetUserByNameWithHttpInfo(strin "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetUserByName", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1087,11 +1182,15 @@ public Org.OpenAPITools.Client.ApiResponse LoginUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->LoginUser"); + } // verify the required parameter 'password' is set if (password == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'password' when calling UserApi->LoginUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1105,10 +1204,16 @@ public Org.OpenAPITools.Client.ApiResponse LoginUserWithHttpInfo(string }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "username", username)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "password", password)); @@ -1116,11 +1221,13 @@ public Org.OpenAPITools.Client.ApiResponse LoginUserWithHttpInfo(string // make the HTTP request var localVarResponse = this.Client.Get("/user/login", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("LoginUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1152,11 +1259,15 @@ public Org.OpenAPITools.Client.ApiResponse LoginUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->LoginUser"); + } // verify the required parameter 'password' is set if (password == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'password' when calling UserApi->LoginUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1170,25 +1281,32 @@ public Org.OpenAPITools.Client.ApiResponse LoginUserWithHttpInfo(string "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "username", username)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "password", password)); // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/user/login", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("LoginUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1221,20 +1339,28 @@ public Org.OpenAPITools.Client.ApiResponse LogoutUserWithHttpInfo() }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request var localVarResponse = this.Client.Get("/user/logout", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("LogoutUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1269,23 +1395,30 @@ public Org.OpenAPITools.Client.ApiResponse LogoutUserWithHttpInfo() string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/user/logout", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("LogoutUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1314,11 +1447,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); + } // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->UpdateUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1331,10 +1468,16 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo(string }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter localVarRequestOptions.Data = user; @@ -1342,11 +1485,13 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo(string // make the HTTP request var localVarResponse = this.Client.Put("/user/{username}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdateUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1377,11 +1522,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); + } // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->UpdateUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1394,25 +1543,32 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo(string string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter localVarRequestOptions.Data = user; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdateUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index 9d6d049ded8a..b3ddad35a07d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -117,7 +117,7 @@ public partial class AdditionalPropertiesClass : IEquatableString presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class AdditionalPropertiesClass {\n"); sb.Append(" MapProperty: ").Append(MapProperty).Append("\n"); sb.Append(" MapOfMapProperty: ").Append(MapOfMapProperty).Append("\n"); @@ -171,23 +171,41 @@ public override int GetHashCode() { int hashCode = 41; if (this.MapProperty != null) - hashCode = hashCode * 59 + this.MapProperty.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapProperty.GetHashCode(); + } if (this.MapOfMapProperty != null) - hashCode = hashCode * 59 + this.MapOfMapProperty.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapOfMapProperty.GetHashCode(); + } if (this.Anytype1 != null) - hashCode = hashCode * 59 + this.Anytype1.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Anytype1.GetHashCode(); + } if (this.MapWithUndeclaredPropertiesAnytype1 != null) - hashCode = hashCode * 59 + this.MapWithUndeclaredPropertiesAnytype1.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesAnytype1.GetHashCode(); + } if (this.MapWithUndeclaredPropertiesAnytype2 != null) - hashCode = hashCode * 59 + this.MapWithUndeclaredPropertiesAnytype2.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesAnytype2.GetHashCode(); + } if (this.MapWithUndeclaredPropertiesAnytype3 != null) - hashCode = hashCode * 59 + this.MapWithUndeclaredPropertiesAnytype3.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesAnytype3.GetHashCode(); + } if (this.EmptyMap != null) - hashCode = hashCode * 59 + this.EmptyMap.GetHashCode(); + { + hashCode = (hashCode * 59) + this.EmptyMap.GetHashCode(); + } if (this.MapWithUndeclaredPropertiesString != null) - hashCode = hashCode * 59 + this.MapWithUndeclaredPropertiesString.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesString.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Animal.cs index fd7599d09ca5..e8ea00bb46a8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Animal.cs @@ -85,7 +85,7 @@ protected Animal() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Animal {\n"); sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" Color: ").Append(Color).Append("\n"); @@ -133,11 +133,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.ClassName != null) - hashCode = hashCode * 59 + this.ClassName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } if (this.Color != null) - hashCode = hashCode * 59 + this.Color.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Color.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ApiResponse.cs index ff7d757270f2..79873f4ddfed 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -76,7 +76,7 @@ public partial class ApiResponse : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ApiResponse {\n"); sb.Append(" Code: ").Append(Code).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); @@ -124,13 +124,19 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Code.GetHashCode(); + hashCode = (hashCode * 59) + this.Code.GetHashCode(); if (this.Type != null) - hashCode = hashCode * 59 + this.Type.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + } if (this.Message != null) - hashCode = hashCode * 59 + this.Message.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Message.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Apple.cs index a702a9ca79f1..8b1f87d1aa9a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Apple.cs @@ -68,7 +68,7 @@ public partial class Apple : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Apple {\n"); sb.Append(" Cultivar: ").Append(Cultivar).Append("\n"); sb.Append(" Origin: ").Append(Origin).Append("\n"); @@ -116,11 +116,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.Cultivar != null) - hashCode = hashCode * 59 + this.Cultivar.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Cultivar.GetHashCode(); + } if (this.Origin != null) - hashCode = hashCode * 59 + this.Origin.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Origin.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/AppleReq.cs index 91a8d5c3aeb9..1d6d42dc9b3a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/AppleReq.cs @@ -70,7 +70,7 @@ protected AppleReq() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class AppleReq {\n"); sb.Append(" Cultivar: ").Append(Cultivar).Append("\n"); sb.Append(" Mealy: ").Append(Mealy).Append("\n"); @@ -117,8 +117,10 @@ public override int GetHashCode() { int hashCode = 41; if (this.Cultivar != null) - hashCode = hashCode * 59 + this.Cultivar.GetHashCode(); - hashCode = hashCode * 59 + this.Mealy.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Cultivar.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Mealy.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index e96382b222d1..30bf57ef0f52 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -60,7 +60,7 @@ public partial class ArrayOfArrayOfNumberOnly : IEquatableString presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ArrayOfArrayOfNumberOnly {\n"); sb.Append(" ArrayArrayNumber: ").Append(ArrayArrayNumber).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -107,9 +107,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ArrayArrayNumber != null) - hashCode = hashCode * 59 + this.ArrayArrayNumber.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayArrayNumber.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index 60c5a8576561..8a215aad133b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -60,7 +60,7 @@ public partial class ArrayOfNumberOnly : IEquatable, IValidat /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ArrayOfNumberOnly {\n"); sb.Append(" ArrayNumber: ").Append(ArrayNumber).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -107,9 +107,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ArrayNumber != null) - hashCode = hashCode * 59 + this.ArrayNumber.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayNumber.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ArrayTest.cs index 290926768d2f..1a879a1d9ca2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -76,7 +76,7 @@ public partial class ArrayTest : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ArrayTest {\n"); sb.Append(" ArrayOfString: ").Append(ArrayOfString).Append("\n"); sb.Append(" ArrayArrayOfInteger: ").Append(ArrayArrayOfInteger).Append("\n"); @@ -125,13 +125,21 @@ public override int GetHashCode() { int hashCode = 41; if (this.ArrayOfString != null) - hashCode = hashCode * 59 + this.ArrayOfString.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayOfString.GetHashCode(); + } if (this.ArrayArrayOfInteger != null) - hashCode = hashCode * 59 + this.ArrayArrayOfInteger.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayArrayOfInteger.GetHashCode(); + } if (this.ArrayArrayOfModel != null) - hashCode = hashCode * 59 + this.ArrayArrayOfModel.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayArrayOfModel.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Banana.cs index dc0e10d46867..97939597ede8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Banana.cs @@ -60,7 +60,7 @@ public partial class Banana : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Banana {\n"); sb.Append(" LengthCm: ").Append(LengthCm).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -106,9 +106,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.LengthCm.GetHashCode(); + hashCode = (hashCode * 59) + this.LengthCm.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/BananaReq.cs index ea57bb4f0cce..fdd36929d13c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/BananaReq.cs @@ -66,7 +66,7 @@ protected BananaReq() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class BananaReq {\n"); sb.Append(" LengthCm: ").Append(LengthCm).Append("\n"); sb.Append(" Sweet: ").Append(Sweet).Append("\n"); @@ -112,8 +112,8 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.LengthCm.GetHashCode(); - hashCode = hashCode * 59 + this.Sweet.GetHashCode(); + hashCode = (hashCode * 59) + this.LengthCm.GetHashCode(); + hashCode = (hashCode * 59) + this.Sweet.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/BasquePig.cs index f9074c95c04c..ea4ff737c89a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/BasquePig.cs @@ -72,7 +72,7 @@ protected BasquePig() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class BasquePig {\n"); sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -119,9 +119,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ClassName != null) - hashCode = hashCode * 59 + this.ClassName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Capitalization.cs index 3a989f765f9e..be68a50a116a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Capitalization.cs @@ -101,7 +101,7 @@ public partial class Capitalization : IEquatable, IValidatableOb /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Capitalization {\n"); sb.Append(" SmallCamel: ").Append(SmallCamel).Append("\n"); sb.Append(" CapitalCamel: ").Append(CapitalCamel).Append("\n"); @@ -153,19 +153,33 @@ public override int GetHashCode() { int hashCode = 41; if (this.SmallCamel != null) - hashCode = hashCode * 59 + this.SmallCamel.GetHashCode(); + { + hashCode = (hashCode * 59) + this.SmallCamel.GetHashCode(); + } if (this.CapitalCamel != null) - hashCode = hashCode * 59 + this.CapitalCamel.GetHashCode(); + { + hashCode = (hashCode * 59) + this.CapitalCamel.GetHashCode(); + } if (this.SmallSnake != null) - hashCode = hashCode * 59 + this.SmallSnake.GetHashCode(); + { + hashCode = (hashCode * 59) + this.SmallSnake.GetHashCode(); + } if (this.CapitalSnake != null) - hashCode = hashCode * 59 + this.CapitalSnake.GetHashCode(); + { + hashCode = (hashCode * 59) + this.CapitalSnake.GetHashCode(); + } if (this.SCAETHFlowPoints != null) - hashCode = hashCode * 59 + this.SCAETHFlowPoints.GetHashCode(); + { + hashCode = (hashCode * 59) + this.SCAETHFlowPoints.GetHashCode(); + } if (this.ATT_NAME != null) - hashCode = hashCode * 59 + this.ATT_NAME.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ATT_NAME.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Cat.cs index be96bae85eb1..2bc55707da95 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Cat.cs @@ -72,7 +72,7 @@ protected Cat() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Cat {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" Declawed: ").Append(Declawed).Append("\n"); @@ -119,9 +119,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = base.GetHashCode(); - hashCode = hashCode * 59 + this.Declawed.GetHashCode(); + hashCode = (hashCode * 59) + this.Declawed.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } @@ -143,7 +145,10 @@ public override int GetHashCode() /// Validation Result protected IEnumerable BaseValidate(ValidationContext validationContext) { - foreach(var x in BaseValidate(validationContext)) yield return x; + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } yield break; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/CatAllOf.cs index 8cb5bfc3ef64..3a960e9925e3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/CatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -60,7 +60,7 @@ public partial class CatAllOf : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class CatAllOf {\n"); sb.Append(" Declawed: ").Append(Declawed).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -106,9 +106,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Declawed.GetHashCode(); + hashCode = (hashCode * 59) + this.Declawed.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Category.cs index 6b0b74ca5219..0cc23f5f6c23 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Category.cs @@ -80,7 +80,7 @@ protected Category() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Category {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); @@ -127,11 +127,15 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ChildCat.cs index 90545c4d99af..7a15a5297df2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ChildCat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ChildCat.cs @@ -92,7 +92,7 @@ protected ChildCat() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ChildCat {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); @@ -141,10 +141,14 @@ public override int GetHashCode() { int hashCode = base.GetHashCode(); if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); - hashCode = hashCode * 59 + this.PetType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + hashCode = (hashCode * 59) + this.PetType.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } @@ -166,7 +170,10 @@ public override int GetHashCode() /// Validation Result protected IEnumerable BaseValidate(ValidationContext validationContext) { - foreach(var x in BaseValidate(validationContext)) yield return x; + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } yield break; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ChildCatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ChildCatAllOf.cs index b5d479e17428..a353ad7ffd71 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ChildCatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ChildCatAllOf.cs @@ -82,7 +82,7 @@ public enum PetTypeEnum /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ChildCatAllOf {\n"); sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" PetType: ").Append(PetType).Append("\n"); @@ -130,10 +130,14 @@ public override int GetHashCode() { int hashCode = 41; if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); - hashCode = hashCode * 59 + this.PetType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + hashCode = (hashCode * 59) + this.PetType.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ClassModel.cs index 80c863484cc7..7177e9bf0b6c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ClassModel.cs @@ -60,7 +60,7 @@ public partial class ClassModel : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ClassModel {\n"); sb.Append(" Class: ").Append(Class).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -107,9 +107,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.Class != null) - hashCode = hashCode * 59 + this.Class.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Class.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index f3afcc2a7341..807f0eb26bf8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -84,7 +84,7 @@ protected ComplexQuadrilateral() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ComplexQuadrilateral {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); @@ -132,11 +132,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } if (this.QuadrilateralType != null) - hashCode = hashCode * 59 + this.QuadrilateralType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.QuadrilateralType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/DanishPig.cs index 59afe7580d04..a27b1db39297 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/DanishPig.cs @@ -72,7 +72,7 @@ protected DanishPig() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class DanishPig {\n"); sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -119,9 +119,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ClassName != null) - hashCode = hashCode * 59 + this.ClassName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/DeprecatedObject.cs index bd3d97b081db..1928b236bf66 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/DeprecatedObject.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -60,7 +60,7 @@ public partial class DeprecatedObject : IEquatable, IValidatab /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class DeprecatedObject {\n"); sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -107,9 +107,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Dog.cs index f20af26112cb..9cd520deaf82 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Dog.cs @@ -72,7 +72,7 @@ protected Dog() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Dog {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" Breed: ").Append(Breed).Append("\n"); @@ -120,9 +120,13 @@ public override int GetHashCode() { int hashCode = base.GetHashCode(); if (this.Breed != null) - hashCode = hashCode * 59 + this.Breed.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Breed.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } @@ -144,7 +148,10 @@ public override int GetHashCode() /// Validation Result protected IEnumerable BaseValidate(ValidationContext validationContext) { - foreach(var x in BaseValidate(validationContext)) yield return x; + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } yield break; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/DogAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/DogAllOf.cs index 3588b02b020d..7b026acbf1e5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/DogAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/DogAllOf.cs @@ -60,7 +60,7 @@ public partial class DogAllOf : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class DogAllOf {\n"); sb.Append(" Breed: ").Append(Breed).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -107,9 +107,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.Breed != null) - hashCode = hashCode * 59 + this.Breed.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Breed.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Drawing.cs index f7e6702be596..d8cd2a70ef61 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Drawing.cs @@ -77,7 +77,7 @@ public partial class Drawing : Dictionary, IEquatable, I /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Drawing {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" MainShape: ").Append(MainShape).Append("\n"); @@ -127,13 +127,21 @@ public override int GetHashCode() { int hashCode = base.GetHashCode(); if (this.MainShape != null) - hashCode = hashCode * 59 + this.MainShape.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MainShape.GetHashCode(); + } if (this.ShapeOrNull != null) - hashCode = hashCode * 59 + this.ShapeOrNull.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeOrNull.GetHashCode(); + } if (this.NullableShape != null) - hashCode = hashCode * 59 + this.NullableShape.GetHashCode(); + { + hashCode = (hashCode * 59) + this.NullableShape.GetHashCode(); + } if (this.Shapes != null) - hashCode = hashCode * 59 + this.Shapes.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Shapes.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/EnumArrays.cs index f4138fce032d..6d7830c0e8ba 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -109,7 +109,7 @@ public enum ArrayEnumEnum /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class EnumArrays {\n"); sb.Append(" JustSymbol: ").Append(JustSymbol).Append("\n"); sb.Append(" ArrayEnum: ").Append(ArrayEnum).Append("\n"); @@ -156,10 +156,12 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.JustSymbol.GetHashCode(); - hashCode = hashCode * 59 + this.ArrayEnum.GetHashCode(); + hashCode = (hashCode * 59) + this.JustSymbol.GetHashCode(); + hashCode = (hashCode * 59) + this.ArrayEnum.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/EnumTest.cs index 178d540314d0..6f3d2272c5c3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/EnumTest.cs @@ -238,7 +238,7 @@ protected EnumTest() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class EnumTest {\n"); sb.Append(" EnumString: ").Append(EnumString).Append("\n"); sb.Append(" EnumStringRequired: ").Append(EnumStringRequired).Append("\n"); @@ -292,17 +292,19 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.EnumString.GetHashCode(); - hashCode = hashCode * 59 + this.EnumStringRequired.GetHashCode(); - hashCode = hashCode * 59 + this.EnumInteger.GetHashCode(); - hashCode = hashCode * 59 + this.EnumIntegerOnly.GetHashCode(); - hashCode = hashCode * 59 + this.EnumNumber.GetHashCode(); - hashCode = hashCode * 59 + this.OuterEnum.GetHashCode(); - hashCode = hashCode * 59 + this.OuterEnumInteger.GetHashCode(); - hashCode = hashCode * 59 + this.OuterEnumDefaultValue.GetHashCode(); - hashCode = hashCode * 59 + this.OuterEnumIntegerDefaultValue.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumString.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumStringRequired.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumInteger.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumIntegerOnly.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumNumber.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnum.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnumInteger.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnumDefaultValue.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnumIntegerDefaultValue.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index 2e8e4d0c17d9..a931c0d6327a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -84,7 +84,7 @@ protected EquilateralTriangle() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class EquilateralTriangle {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); @@ -132,11 +132,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } if (this.TriangleType != null) - hashCode = hashCode * 59 + this.TriangleType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/File.cs index 1e859462b140..e77d15e06bce 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/File.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/File.cs @@ -61,7 +61,7 @@ public partial class File : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class File {\n"); sb.Append(" SourceURI: ").Append(SourceURI).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -108,9 +108,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.SourceURI != null) - hashCode = hashCode * 59 + this.SourceURI.GetHashCode(); + { + hashCode = (hashCode * 59) + this.SourceURI.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index b996e287ea70..6808978c49f8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -68,7 +68,7 @@ public partial class FileSchemaTestClass : IEquatable, IVal /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class FileSchemaTestClass {\n"); sb.Append(" File: ").Append(File).Append("\n"); sb.Append(" Files: ").Append(Files).Append("\n"); @@ -116,11 +116,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.File != null) - hashCode = hashCode * 59 + this.File.GetHashCode(); + { + hashCode = (hashCode * 59) + this.File.GetHashCode(); + } if (this.Files != null) - hashCode = hashCode * 59 + this.Files.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Files.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Foo.cs index a5aabbae4f3d..e64aac7b6317 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Foo.cs @@ -61,7 +61,7 @@ public Foo(string bar = "bar") /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Foo {\n"); sb.Append(" Bar: ").Append(Bar).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -108,9 +108,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.Bar != null) - hashCode = hashCode * 59 + this.Bar.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Bar.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/FormatTest.cs index ef60b6bb9fea..eb38d586bbb7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/FormatTest.cs @@ -199,7 +199,7 @@ protected FormatTest() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class FormatTest {\n"); sb.Append(" Integer: ").Append(Integer).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); @@ -260,33 +260,53 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Integer.GetHashCode(); - hashCode = hashCode * 59 + this.Int32.GetHashCode(); - hashCode = hashCode * 59 + this.Int64.GetHashCode(); - hashCode = hashCode * 59 + this.Number.GetHashCode(); - hashCode = hashCode * 59 + this.Float.GetHashCode(); - hashCode = hashCode * 59 + this.Double.GetHashCode(); - hashCode = hashCode * 59 + this.Decimal.GetHashCode(); + hashCode = (hashCode * 59) + this.Integer.GetHashCode(); + hashCode = (hashCode * 59) + this.Int32.GetHashCode(); + hashCode = (hashCode * 59) + this.Int64.GetHashCode(); + hashCode = (hashCode * 59) + this.Number.GetHashCode(); + hashCode = (hashCode * 59) + this.Float.GetHashCode(); + hashCode = (hashCode * 59) + this.Double.GetHashCode(); + hashCode = (hashCode * 59) + this.Decimal.GetHashCode(); if (this.String != null) - hashCode = hashCode * 59 + this.String.GetHashCode(); + { + hashCode = (hashCode * 59) + this.String.GetHashCode(); + } if (this.Byte != null) - hashCode = hashCode * 59 + this.Byte.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Byte.GetHashCode(); + } if (this.Binary != null) - hashCode = hashCode * 59 + this.Binary.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Binary.GetHashCode(); + } if (this.Date != null) - hashCode = hashCode * 59 + this.Date.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Date.GetHashCode(); + } if (this.DateTime != null) - hashCode = hashCode * 59 + this.DateTime.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DateTime.GetHashCode(); + } if (this.Uuid != null) - hashCode = hashCode * 59 + this.Uuid.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); + } if (this.Password != null) - hashCode = hashCode * 59 + this.Password.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Password.GetHashCode(); + } if (this.PatternWithDigits != null) - hashCode = hashCode * 59 + this.PatternWithDigits.GetHashCode(); + { + hashCode = (hashCode * 59) + this.PatternWithDigits.GetHashCode(); + } if (this.PatternWithDigitsAndDelimiter != null) - hashCode = hashCode * 59 + this.PatternWithDigitsAndDelimiter.GetHashCode(); + { + hashCode = (hashCode * 59) + this.PatternWithDigitsAndDelimiter.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } @@ -299,61 +319,61 @@ public override int GetHashCode() public IEnumerable Validate(ValidationContext validationContext) { // Integer (int) maximum - if(this.Integer > (int)100) + if (this.Integer > (int)100) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); } // Integer (int) minimum - if(this.Integer < (int)10) + if (this.Integer < (int)10) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); } // Int32 (int) maximum - if(this.Int32 > (int)200) + if (this.Int32 > (int)200) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); } // Int32 (int) minimum - if(this.Int32 < (int)20) + if (this.Int32 < (int)20) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } // Number (decimal) maximum - if(this.Number > (decimal)543.2) + if (this.Number > (decimal)543.2) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); } // Number (decimal) minimum - if(this.Number < (decimal)32.1) + if (this.Number < (decimal)32.1) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); } // Float (float) maximum - if(this.Float > (float)987.6) + if (this.Float > (float)987.6) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); } // Float (float) minimum - if(this.Float < (float)54.3) + if (this.Float < (float)54.3) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); } // Double (double) maximum - if(this.Double > (double)123.4) + if (this.Double > (double)123.4) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); } // Double (double) minimum - if(this.Double < (double)67.8) + if (this.Double < (double)67.8) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); } @@ -366,13 +386,13 @@ public override int GetHashCode() } // Password (string) maxLength - if(this.Password != null && this.Password.Length > 64) + if (this.Password != null && this.Password.Length > 64) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); } // Password (string) minLength - if(this.Password != null && this.Password.Length < 10) + if (this.Password != null && this.Password.Length < 10) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index 9edacb3815a8..cee75f3f8157 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -76,7 +76,7 @@ protected GrandparentAnimal() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class GrandparentAnimal {\n"); sb.Append(" PetType: ").Append(PetType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -123,9 +123,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.PetType != null) - hashCode = hashCode * 59 + this.PetType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.PetType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index f6219182b296..52099a7095e1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -81,7 +81,7 @@ public bool ShouldSerializeFoo() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class HasOnlyReadOnly {\n"); sb.Append(" Bar: ").Append(Bar).Append("\n"); sb.Append(" Foo: ").Append(Foo).Append("\n"); @@ -129,11 +129,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.Bar != null) - hashCode = hashCode * 59 + this.Bar.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Bar.GetHashCode(); + } if (this.Foo != null) - hashCode = hashCode * 59 + this.Foo.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Foo.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/HealthCheckResult.cs index c7c342d258a9..e8cbb68e2e4c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/HealthCheckResult.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -60,7 +60,7 @@ public partial class HealthCheckResult : IEquatable, IValidat /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class HealthCheckResult {\n"); sb.Append(" NullableMessage: ").Append(NullableMessage).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -107,9 +107,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.NullableMessage != null) - hashCode = hashCode * 59 + this.NullableMessage.GetHashCode(); + { + hashCode = (hashCode * 59) + this.NullableMessage.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/InlineResponseDefault.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/InlineResponseDefault.cs index e492ade1fc6d..ae46f1f0098f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/InlineResponseDefault.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/InlineResponseDefault.cs @@ -60,7 +60,7 @@ public partial class InlineResponseDefault : IEquatable, /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class InlineResponseDefault {\n"); sb.Append(" String: ").Append(String).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -107,9 +107,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.String != null) - hashCode = hashCode * 59 + this.String.GetHashCode(); + { + hashCode = (hashCode * 59) + this.String.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index 8d02354be3f6..50e7ce4aaa8d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -74,7 +74,7 @@ protected IsoscelesTriangle() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class IsoscelesTriangle {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); @@ -121,9 +121,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } if (this.TriangleType != null) - hashCode = hashCode * 59 + this.TriangleType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/List.cs index 5f3483a6e308..00814d110694 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/List.cs @@ -60,7 +60,7 @@ public partial class List : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class List {\n"); sb.Append(" _123List: ").Append(_123List).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -107,9 +107,13 @@ public override int GetHashCode() { int hashCode = 41; if (this._123List != null) - hashCode = hashCode * 59 + this._123List.GetHashCode(); + { + hashCode = (hashCode * 59) + this._123List.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/MapTest.cs index fa93bf24ec05..8b5a73e77365 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/MapTest.cs @@ -105,7 +105,7 @@ public enum InnerEnum /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class MapTest {\n"); sb.Append(" MapMapOfString: ").Append(MapMapOfString).Append("\n"); sb.Append(" MapOfEnumString: ").Append(MapOfEnumString).Append("\n"); @@ -155,14 +155,22 @@ public override int GetHashCode() { int hashCode = 41; if (this.MapMapOfString != null) - hashCode = hashCode * 59 + this.MapMapOfString.GetHashCode(); - hashCode = hashCode * 59 + this.MapOfEnumString.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapMapOfString.GetHashCode(); + } + hashCode = (hashCode * 59) + this.MapOfEnumString.GetHashCode(); if (this.DirectMap != null) - hashCode = hashCode * 59 + this.DirectMap.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DirectMap.GetHashCode(); + } if (this.IndirectMap != null) - hashCode = hashCode * 59 + this.IndirectMap.GetHashCode(); + { + hashCode = (hashCode * 59) + this.IndirectMap.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 8853f837f9e4..3225727af37b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -76,7 +76,7 @@ public partial class MixedPropertiesAndAdditionalPropertiesClass : IEquatableString presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); @@ -125,13 +125,21 @@ public override int GetHashCode() { int hashCode = 41; if (this.Uuid != null) - hashCode = hashCode * 59 + this.Uuid.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); + } if (this.DateTime != null) - hashCode = hashCode * 59 + this.DateTime.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DateTime.GetHashCode(); + } if (this.Map != null) - hashCode = hashCode * 59 + this.Map.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Map.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Model200Response.cs index 629a1fde7fb1..79a49ef91d28 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Model200Response.cs @@ -68,7 +68,7 @@ public partial class Model200Response : IEquatable, IValidatab /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Model200Response {\n"); sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" Class: ").Append(Class).Append("\n"); @@ -115,11 +115,15 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Name.GetHashCode(); + hashCode = (hashCode * 59) + this.Name.GetHashCode(); if (this.Class != null) - hashCode = hashCode * 59 + this.Class.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Class.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ModelClient.cs index e28bc67d630f..1995ec4b1692 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ModelClient.cs @@ -60,7 +60,7 @@ public partial class ModelClient : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ModelClient {\n"); sb.Append(" _Client: ").Append(_Client).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -107,9 +107,13 @@ public override int GetHashCode() { int hashCode = 41; if (this._Client != null) - hashCode = hashCode * 59 + this._Client.GetHashCode(); + { + hashCode = (hashCode * 59) + this._Client.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Name.cs index 462b3458215a..0dc21bb656f0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Name.cs @@ -104,7 +104,7 @@ public bool ShouldSerialize_123Number() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Name {\n"); sb.Append(" _Name: ").Append(_Name).Append("\n"); sb.Append(" SnakeCase: ").Append(SnakeCase).Append("\n"); @@ -153,13 +153,17 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this._Name.GetHashCode(); - hashCode = hashCode * 59 + this.SnakeCase.GetHashCode(); + hashCode = (hashCode * 59) + this._Name.GetHashCode(); + hashCode = (hashCode * 59) + this.SnakeCase.GetHashCode(); if (this.Property != null) - hashCode = hashCode * 59 + this.Property.GetHashCode(); - hashCode = hashCode * 59 + this._123Number.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Property.GetHashCode(); + } + hashCode = (hashCode * 59) + this._123Number.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/NullableClass.cs index 3a34e8cc1288..57555c376785 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/NullableClass.cs @@ -142,7 +142,7 @@ public partial class NullableClass : Dictionary, IEquatableString presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class NullableClass {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" IntegerProp: ").Append(IntegerProp).Append("\n"); @@ -200,29 +200,53 @@ public override int GetHashCode() { int hashCode = base.GetHashCode(); if (this.IntegerProp != null) - hashCode = hashCode * 59 + this.IntegerProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.IntegerProp.GetHashCode(); + } if (this.NumberProp != null) - hashCode = hashCode * 59 + this.NumberProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.NumberProp.GetHashCode(); + } if (this.BooleanProp != null) - hashCode = hashCode * 59 + this.BooleanProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.BooleanProp.GetHashCode(); + } if (this.StringProp != null) - hashCode = hashCode * 59 + this.StringProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.StringProp.GetHashCode(); + } if (this.DateProp != null) - hashCode = hashCode * 59 + this.DateProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DateProp.GetHashCode(); + } if (this.DatetimeProp != null) - hashCode = hashCode * 59 + this.DatetimeProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DatetimeProp.GetHashCode(); + } if (this.ArrayNullableProp != null) - hashCode = hashCode * 59 + this.ArrayNullableProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayNullableProp.GetHashCode(); + } if (this.ArrayAndItemsNullableProp != null) - hashCode = hashCode * 59 + this.ArrayAndItemsNullableProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayAndItemsNullableProp.GetHashCode(); + } if (this.ArrayItemsNullable != null) - hashCode = hashCode * 59 + this.ArrayItemsNullable.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayItemsNullable.GetHashCode(); + } if (this.ObjectNullableProp != null) - hashCode = hashCode * 59 + this.ObjectNullableProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ObjectNullableProp.GetHashCode(); + } if (this.ObjectAndItemsNullableProp != null) - hashCode = hashCode * 59 + this.ObjectAndItemsNullableProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ObjectAndItemsNullableProp.GetHashCode(); + } if (this.ObjectItemsNullable != null) - hashCode = hashCode * 59 + this.ObjectItemsNullable.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/NumberOnly.cs index 34abb32eabd7..97f869b0ebc1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -60,7 +60,7 @@ public partial class NumberOnly : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class NumberOnly {\n"); sb.Append(" JustNumber: ").Append(JustNumber).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -106,9 +106,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.JustNumber.GetHashCode(); + hashCode = (hashCode * 59) + this.JustNumber.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 021bfe71e02b..86ea32998f8c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -87,7 +87,7 @@ public partial class ObjectWithDeprecatedFields : IEquatableString presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ObjectWithDeprecatedFields {\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); sb.Append(" Id: ").Append(Id).Append("\n"); @@ -137,14 +137,22 @@ public override int GetHashCode() { int hashCode = 41; if (this.Uuid != null) - hashCode = hashCode * 59 + this.Uuid.GetHashCode(); - hashCode = hashCode * 59 + this.Id.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.DeprecatedRef != null) - hashCode = hashCode * 59 + this.DeprecatedRef.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DeprecatedRef.GetHashCode(); + } if (this.Bars != null) - hashCode = hashCode * 59 + this.Bars.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Bars.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Order.cs index e1abd07a05c4..5c52482e79b9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Order.cs @@ -128,7 +128,7 @@ public enum StatusEnum /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Order {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" PetId: ").Append(PetId).Append("\n"); @@ -179,15 +179,19 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Id.GetHashCode(); - hashCode = hashCode * 59 + this.PetId.GetHashCode(); - hashCode = hashCode * 59 + this.Quantity.GetHashCode(); + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.PetId.GetHashCode(); + hashCode = (hashCode * 59) + this.Quantity.GetHashCode(); if (this.ShipDate != null) - hashCode = hashCode * 59 + this.ShipDate.GetHashCode(); - hashCode = hashCode * 59 + this.Status.GetHashCode(); - hashCode = hashCode * 59 + this.Complete.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShipDate.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); + hashCode = (hashCode * 59) + this.Complete.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/OuterComposite.cs index 88449a1c8430..3209f6d6244e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -76,7 +76,7 @@ public partial class OuterComposite : IEquatable, IValidatableOb /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class OuterComposite {\n"); sb.Append(" MyNumber: ").Append(MyNumber).Append("\n"); sb.Append(" MyString: ").Append(MyString).Append("\n"); @@ -124,12 +124,16 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.MyNumber.GetHashCode(); + hashCode = (hashCode * 59) + this.MyNumber.GetHashCode(); if (this.MyString != null) - hashCode = hashCode * 59 + this.MyString.GetHashCode(); - hashCode = hashCode * 59 + this.MyBoolean.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MyString.GetHashCode(); + } + hashCode = (hashCode * 59) + this.MyBoolean.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ParentPet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ParentPet.cs index 899984fcc5bc..ac986b555efd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ParentPet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ParentPet.cs @@ -64,7 +64,7 @@ public ParentPet(string petType = "ParentPet") : base(petType) /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ParentPet {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -111,7 +111,9 @@ public override int GetHashCode() { int hashCode = base.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } @@ -133,7 +135,10 @@ public override int GetHashCode() /// Validation Result protected IEnumerable BaseValidate(ValidationContext validationContext) { - foreach(var x in BaseValidate(validationContext)) yield return x; + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } yield break; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Pet.cs index 8b3b614493f1..31fd118f4f68 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Pet.cs @@ -144,7 +144,7 @@ protected Pet() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Pet {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Category: ").Append(Category).Append("\n"); @@ -195,18 +195,28 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.Category != null) - hashCode = hashCode * 59 + this.Category.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Category.GetHashCode(); + } if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } if (this.PhotoUrls != null) - hashCode = hashCode * 59 + this.PhotoUrls.GetHashCode(); + { + hashCode = (hashCode * 59) + this.PhotoUrls.GetHashCode(); + } if (this.Tags != null) - hashCode = hashCode * 59 + this.Tags.GetHashCode(); - hashCode = hashCode * 59 + this.Status.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Tags.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index de200d38d54a..4d7c39c4364d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -72,7 +72,7 @@ protected QuadrilateralInterface() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class QuadrilateralInterface {\n"); sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -119,9 +119,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.QuadrilateralType != null) - hashCode = hashCode * 59 + this.QuadrilateralType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.QuadrilateralType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index 08a294a22903..ad59ca832864 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -74,7 +74,7 @@ public bool ShouldSerializeBar() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ReadOnlyFirst {\n"); sb.Append(" Bar: ").Append(Bar).Append("\n"); sb.Append(" Baz: ").Append(Baz).Append("\n"); @@ -122,11 +122,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.Bar != null) - hashCode = hashCode * 59 + this.Bar.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Bar.GetHashCode(); + } if (this.Baz != null) - hashCode = hashCode * 59 + this.Baz.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Baz.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Return.cs index 74317fbbfec5..e702e0157030 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Return.cs @@ -60,7 +60,7 @@ public partial class Return : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Return {\n"); sb.Append(" _Return: ").Append(_Return).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -106,9 +106,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this._Return.GetHashCode(); + hashCode = (hashCode * 59) + this._Return.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index 6b4869ce8392..236839471475 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -84,7 +84,7 @@ protected ScaleneTriangle() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ScaleneTriangle {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); @@ -132,11 +132,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } if (this.TriangleType != null) - hashCode = hashCode * 59 + this.TriangleType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ShapeInterface.cs index ccd305b45098..92774561aaa5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -72,7 +72,7 @@ protected ShapeInterface() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ShapeInterface {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -119,9 +119,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index d698a788f8ea..fc9b37ce01fb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -84,7 +84,7 @@ protected SimpleQuadrilateral() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class SimpleQuadrilateral {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); @@ -132,11 +132,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } if (this.QuadrilateralType != null) - hashCode = hashCode * 59 + this.QuadrilateralType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.QuadrilateralType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/SpecialModelName.cs index 1d6445d4d624..7800467822ea 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -68,7 +68,7 @@ public partial class SpecialModelName : IEquatable, IValidatab /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class SpecialModelName {\n"); sb.Append(" SpecialPropertyName: ").Append(SpecialPropertyName).Append("\n"); sb.Append(" _SpecialModelName: ").Append(_SpecialModelName).Append("\n"); @@ -115,11 +115,15 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.SpecialPropertyName.GetHashCode(); + hashCode = (hashCode * 59) + this.SpecialPropertyName.GetHashCode(); if (this._SpecialModelName != null) - hashCode = hashCode * 59 + this._SpecialModelName.GetHashCode(); + { + hashCode = (hashCode * 59) + this._SpecialModelName.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Tag.cs index 2635acce4e4e..3df2c02e2cef 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Tag.cs @@ -68,7 +68,7 @@ public partial class Tag : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Tag {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); @@ -115,11 +115,15 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/TriangleInterface.cs index 14bd3a6724cf..7f7abb5bc85b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -72,7 +72,7 @@ protected TriangleInterface() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class TriangleInterface {\n"); sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -119,9 +119,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.TriangleType != null) - hashCode = hashCode * 59 + this.TriangleType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/User.cs index ebd632a90ac4..5f2a3020c3dd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/User.cs @@ -153,7 +153,7 @@ public partial class User : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class User {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Username: ").Append(Username).Append("\n"); @@ -210,30 +210,52 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.Username != null) - hashCode = hashCode * 59 + this.Username.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Username.GetHashCode(); + } if (this.FirstName != null) - hashCode = hashCode * 59 + this.FirstName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.FirstName.GetHashCode(); + } if (this.LastName != null) - hashCode = hashCode * 59 + this.LastName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.LastName.GetHashCode(); + } if (this.Email != null) - hashCode = hashCode * 59 + this.Email.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Email.GetHashCode(); + } if (this.Password != null) - hashCode = hashCode * 59 + this.Password.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Password.GetHashCode(); + } if (this.Phone != null) - hashCode = hashCode * 59 + this.Phone.GetHashCode(); - hashCode = hashCode * 59 + this.UserStatus.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Phone.GetHashCode(); + } + hashCode = (hashCode * 59) + this.UserStatus.GetHashCode(); if (this.ObjectWithNoDeclaredProps != null) - hashCode = hashCode * 59 + this.ObjectWithNoDeclaredProps.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ObjectWithNoDeclaredProps.GetHashCode(); + } if (this.ObjectWithNoDeclaredPropsNullable != null) - hashCode = hashCode * 59 + this.ObjectWithNoDeclaredPropsNullable.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ObjectWithNoDeclaredPropsNullable.GetHashCode(); + } if (this.AnyTypeProp != null) - hashCode = hashCode * 59 + this.AnyTypeProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AnyTypeProp.GetHashCode(); + } if (this.AnyTypePropNullable != null) - hashCode = hashCode * 59 + this.AnyTypePropNullable.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AnyTypePropNullable.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Whale.cs index 57ef3850e979..c30b6dbfabed 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Whale.cs @@ -88,7 +88,7 @@ protected Whale() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Whale {\n"); sb.Append(" HasBaleen: ").Append(HasBaleen).Append("\n"); sb.Append(" HasTeeth: ").Append(HasTeeth).Append("\n"); @@ -136,12 +136,16 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.HasBaleen.GetHashCode(); - hashCode = hashCode * 59 + this.HasTeeth.GetHashCode(); + hashCode = (hashCode * 59) + this.HasBaleen.GetHashCode(); + hashCode = (hashCode * 59) + this.HasTeeth.GetHashCode(); if (this.ClassName != null) - hashCode = hashCode * 59 + this.ClassName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Zebra.cs index bf9735fb37ed..4fb60ed8ddf2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/Zebra.cs @@ -106,7 +106,7 @@ protected Zebra() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Zebra {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); @@ -154,11 +154,15 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = base.GetHashCode(); - hashCode = hashCode * 59 + this.Type.GetHashCode(); + hashCode = (hashCode * 59) + this.Type.GetHashCode(); if (this.ClassName != null) - hashCode = hashCode * 59 + this.ClassName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index ad48306e00ce..ac8fbdcdc946 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -221,7 +221,9 @@ public Org.OpenAPITools.Client.ApiResponse Call123TestSpecialTagsWi { // verify the required parameter 'modelClient' is set if (modelClient == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling AnotherFakeApi->Call123TestSpecialTags"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -235,21 +237,29 @@ public Org.OpenAPITools.Client.ApiResponse Call123TestSpecialTagsWi }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = modelClient; // make the HTTP request var localVarResponse = this.Client.Patch("/another-fake/dummy", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("Call123TestSpecialTags", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -279,7 +289,9 @@ public Org.OpenAPITools.Client.ApiResponse Call123TestSpecialTagsWi { // verify the required parameter 'modelClient' is set if (modelClient == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling AnotherFakeApi->Call123TestSpecialTags"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -293,24 +305,31 @@ public Org.OpenAPITools.Client.ApiResponse Call123TestSpecialTagsWi "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = modelClient; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PatchAsync("/another-fake/dummy", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("Call123TestSpecialTags", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/DefaultApi.cs index 8844aca4ab73..a9e5cfb9c4d2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -221,20 +221,28 @@ public Org.OpenAPITools.Client.ApiResponse FooGetWithHttp }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request var localVarResponse = this.Client.Get("/foo", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FooGet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -271,23 +279,30 @@ public Org.OpenAPITools.Client.ApiResponse FooGetWithHttp "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/foo", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FooGet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/FakeApi.cs index dab406002f81..57a99469634f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/FakeApi.cs @@ -945,20 +945,28 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request var localVarResponse = this.Client.Get("/fake/health", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeHealthGet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -995,23 +1003,30 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/fake/health", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeHealthGet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1049,21 +1064,29 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = body; // make the HTTP request var localVarResponse = this.Client.Post("/fake/outer/boolean", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterBooleanSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1103,24 +1126,31 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH "*/*" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = body; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/boolean", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterBooleanSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1158,21 +1188,29 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = outerComposite; // make the HTTP request var localVarResponse = this.Client.Post("/fake/outer/composite", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterCompositeSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1212,24 +1250,31 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH "*/*" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = outerComposite; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/composite", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterCompositeSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1267,21 +1312,29 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = body; // make the HTTP request var localVarResponse = this.Client.Post("/fake/outer/number", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterNumberSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1321,24 +1374,31 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH "*/*" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = body; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/number", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterNumberSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1376,21 +1436,29 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = body; // make the HTTP request var localVarResponse = this.Client.Post("/fake/outer/string", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterStringSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1430,24 +1498,31 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH "*/*" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = body; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/string", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterStringSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1482,20 +1557,28 @@ public Org.OpenAPITools.Client.ApiResponse> GetArrayOfEnumsWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request var localVarResponse = this.Client.Get>("/fake/array-of-enums", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetArrayOfEnums", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1532,23 +1615,30 @@ public Org.OpenAPITools.Client.ApiResponse> GetArrayOfEnumsWithH "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync>("/fake/array-of-enums", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetArrayOfEnums", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1575,7 +1665,9 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithFileSchemaWithHtt { // verify the required parameter 'fileSchemaTestClass' is set if (fileSchemaTestClass == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'fileSchemaTestClass' when calling FakeApi->TestBodyWithFileSchema"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1588,21 +1680,29 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithFileSchemaWithHtt }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = fileSchemaTestClass; // make the HTTP request var localVarResponse = this.Client.Put("/fake/body-with-file-schema", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestBodyWithFileSchema", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1631,7 +1731,9 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithFileSchemaWithHtt { // verify the required parameter 'fileSchemaTestClass' is set if (fileSchemaTestClass == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'fileSchemaTestClass' when calling FakeApi->TestBodyWithFileSchema"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1644,24 +1746,31 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithFileSchemaWithHtt string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = fileSchemaTestClass; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/body-with-file-schema", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestBodyWithFileSchema", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1690,11 +1799,15 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithQueryParamsWithHt { // verify the required parameter 'query' is set if (query == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'query' when calling FakeApi->TestBodyWithQueryParams"); + } // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling FakeApi->TestBodyWithQueryParams"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1707,10 +1820,16 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithQueryParamsWithHt }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "query", query)); localVarRequestOptions.Data = user; @@ -1718,11 +1837,13 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithQueryParamsWithHt // make the HTTP request var localVarResponse = this.Client.Put("/fake/body-with-query-params", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestBodyWithQueryParams", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1753,11 +1874,15 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithQueryParamsWithHt { // verify the required parameter 'query' is set if (query == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'query' when calling FakeApi->TestBodyWithQueryParams"); + } // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling FakeApi->TestBodyWithQueryParams"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1770,25 +1895,32 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithQueryParamsWithHt string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "query", query)); localVarRequestOptions.Data = user; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/body-with-query-params", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestBodyWithQueryParams", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1816,7 +1948,9 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI { // verify the required parameter 'modelClient' is set if (modelClient == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling FakeApi->TestClientModel"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1830,21 +1964,29 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = modelClient; // make the HTTP request var localVarResponse = this.Client.Patch("/fake", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestClientModel", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1874,7 +2016,9 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI { // verify the required parameter 'modelClient' is set if (modelClient == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling FakeApi->TestClientModel"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1888,24 +2032,31 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = modelClient; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PatchAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestClientModel", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1958,11 +2109,15 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI { // verify the required parameter 'patternWithoutDelimiter' is set if (patternWithoutDelimiter == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'patternWithoutDelimiter' when calling FakeApi->TestEndpointParameters"); + } // verify the required parameter '_byte' is set if (_byte == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter '_byte' when calling FakeApi->TestEndpointParameters"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1975,10 +2130,16 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } if (integer != null) { @@ -2034,11 +2195,13 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI // make the HTTP request var localVarResponse = this.Client.Post("/fake", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestEndpointParameters", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2093,11 +2256,15 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI { // verify the required parameter 'patternWithoutDelimiter' is set if (patternWithoutDelimiter == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'patternWithoutDelimiter' when calling FakeApi->TestEndpointParameters"); + } // verify the required parameter '_byte' is set if (_byte == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter '_byte' when calling FakeApi->TestEndpointParameters"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2110,12 +2277,17 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } if (integer != null) { @@ -2170,13 +2342,15 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestEndpointParameters", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2226,10 +2400,16 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } if (enumQueryStringArray != null) { @@ -2267,11 +2447,13 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI // make the HTTP request var localVarResponse = this.Client.Get("/fake", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestEnumParameters", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2323,12 +2505,17 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } if (enumQueryStringArray != null) { @@ -2365,13 +2552,15 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestEnumParameters", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2416,10 +2605,16 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group)); @@ -2446,11 +2641,13 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI // make the HTTP request var localVarResponse = this.Client.Delete("/fake", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestGroupParameters", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2497,12 +2694,17 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group)); @@ -2528,13 +2730,15 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestGroupParameters", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2561,7 +2765,9 @@ public Org.OpenAPITools.Client.ApiResponse TestInlineAdditionalPropertie { // verify the required parameter 'requestBody' is set if (requestBody == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestInlineAdditionalProperties"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2574,21 +2780,29 @@ public Org.OpenAPITools.Client.ApiResponse TestInlineAdditionalPropertie }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = requestBody; // make the HTTP request var localVarResponse = this.Client.Post("/fake/inline-additionalProperties", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestInlineAdditionalProperties", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2617,7 +2831,9 @@ public Org.OpenAPITools.Client.ApiResponse TestInlineAdditionalPropertie { // verify the required parameter 'requestBody' is set if (requestBody == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestInlineAdditionalProperties"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2630,24 +2846,31 @@ public Org.OpenAPITools.Client.ApiResponse TestInlineAdditionalPropertie string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = requestBody; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/inline-additionalProperties", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestInlineAdditionalProperties", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2676,11 +2899,15 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo( { // verify the required parameter 'param' is set if (param == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestJsonFormData"); + } // verify the required parameter 'param2' is set if (param2 == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'param2' when calling FakeApi->TestJsonFormData"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2693,10 +2920,16 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo( }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.FormParameters.Add("param", Org.OpenAPITools.Client.ClientUtils.ParameterToString(param)); // form parameter localVarRequestOptions.FormParameters.Add("param2", Org.OpenAPITools.Client.ClientUtils.ParameterToString(param2)); // form parameter @@ -2704,11 +2937,13 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo( // make the HTTP request var localVarResponse = this.Client.Get("/fake/jsonFormData", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestJsonFormData", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2739,11 +2974,15 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo( { // verify the required parameter 'param' is set if (param == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestJsonFormData"); + } // verify the required parameter 'param2' is set if (param2 == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'param2' when calling FakeApi->TestJsonFormData"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2756,25 +2995,32 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo( string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.FormParameters.Add("param", Org.OpenAPITools.Client.ClientUtils.ParameterToString(param)); // form parameter localVarRequestOptions.FormParameters.Add("param2", Org.OpenAPITools.Client.ClientUtils.ParameterToString(param2)); // form parameter // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/fake/jsonFormData", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestJsonFormData", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2809,23 +3055,33 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF { // verify the required parameter 'pipe' is set if (pipe == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pipe' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'ioutil' is set if (ioutil == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'ioutil' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'http' is set if (http == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'http' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'url' is set if (url == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'url' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'context' is set if (context == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'context' when calling FakeApi->TestQueryParameterCollectionFormat"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2837,10 +3093,16 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "pipe", pipe)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil)); @@ -2851,11 +3113,13 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF // make the HTTP request var localVarResponse = this.Client.Put("/fake/test-query-parameters", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestQueryParameterCollectionFormat", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2892,23 +3156,33 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF { // verify the required parameter 'pipe' is set if (pipe == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pipe' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'ioutil' is set if (ioutil == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'ioutil' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'http' is set if (http == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'http' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'url' is set if (url == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'url' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'context' is set if (context == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'context' when calling FakeApi->TestQueryParameterCollectionFormat"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2920,12 +3194,17 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "pipe", pipe)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil)); @@ -2935,13 +3214,15 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/test-query-parameters", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestQueryParameterCollectionFormat", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index d4fbb5868adb..c2852b36a44b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -221,7 +221,9 @@ public Org.OpenAPITools.Client.ApiResponse TestClassnameWithHttpInf { // verify the required parameter 'modelClient' is set if (modelClient == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling FakeClassnameTags123Api->TestClassname"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -235,10 +237,16 @@ public Org.OpenAPITools.Client.ApiResponse TestClassnameWithHttpInf }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = modelClient; @@ -250,11 +258,13 @@ public Org.OpenAPITools.Client.ApiResponse TestClassnameWithHttpInf // make the HTTP request var localVarResponse = this.Client.Patch("/fake_classname_test", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestClassname", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -284,7 +294,9 @@ public Org.OpenAPITools.Client.ApiResponse TestClassnameWithHttpInf { // verify the required parameter 'modelClient' is set if (modelClient == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling FakeClassnameTags123Api->TestClassname"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -298,12 +310,17 @@ public Org.OpenAPITools.Client.ApiResponse TestClassnameWithHttpInf "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = modelClient; @@ -314,13 +331,15 @@ public Org.OpenAPITools.Client.ApiResponse TestClassnameWithHttpInf } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PatchAsync("/fake_classname_test", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestClassname", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/PetApi.cs index d73282dfca5f..39d2e425e630 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/PetApi.cs @@ -586,7 +586,9 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) { // verify the required parameter 'pet' is set if (pet == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->AddPet"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -600,10 +602,16 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = pet; @@ -632,11 +640,13 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) // make the HTTP request var localVarResponse = this.Client.Post("/pet", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("AddPet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -665,7 +675,9 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) { // verify the required parameter 'pet' is set if (pet == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->AddPet"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -679,12 +691,17 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = pet; @@ -712,13 +729,15 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/pet", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("AddPet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -755,10 +774,16 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (apiKey != null) @@ -775,11 +800,13 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) // make the HTTP request var localVarResponse = this.Client.Delete("/pet/{petId}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeletePet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -818,12 +845,17 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (apiKey != null) @@ -839,13 +871,15 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeletePet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -873,7 +907,9 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn { // verify the required parameter 'status' is set if (status == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'status' when calling PetApi->FindPetsByStatus"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -887,10 +923,16 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "status", status)); @@ -919,11 +961,13 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn // make the HTTP request var localVarResponse = this.Client.Get>("/pet/findByStatus", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FindPetsByStatus", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -953,7 +997,9 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn { // verify the required parameter 'status' is set if (status == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'status' when calling PetApi->FindPetsByStatus"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -967,12 +1013,17 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "status", status)); @@ -1000,13 +1051,15 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync>("/pet/findByStatus", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FindPetsByStatus", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1036,7 +1089,9 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo { // verify the required parameter 'tags' is set if (tags == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'tags' when calling PetApi->FindPetsByTags"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1050,10 +1105,16 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "tags", tags)); @@ -1082,11 +1143,13 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo // make the HTTP request var localVarResponse = this.Client.Get>("/pet/findByTags", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FindPetsByTags", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1118,7 +1181,9 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo { // verify the required parameter 'tags' is set if (tags == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'tags' when calling PetApi->FindPetsByTags"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1132,12 +1197,17 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "tags", tags)); @@ -1165,13 +1235,15 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync>("/pet/findByTags", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FindPetsByTags", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1209,10 +1281,16 @@ public Org.OpenAPITools.Client.ApiResponse GetPetByIdWithHttpInfo(long petI }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter @@ -1224,11 +1302,13 @@ public Org.OpenAPITools.Client.ApiResponse GetPetByIdWithHttpInfo(long petI // make the HTTP request var localVarResponse = this.Client.Get("/pet/{petId}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetPetById", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1268,12 +1348,17 @@ public Org.OpenAPITools.Client.ApiResponse GetPetByIdWithHttpInfo(long petI "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter @@ -1284,13 +1369,15 @@ public Org.OpenAPITools.Client.ApiResponse GetPetByIdWithHttpInfo(long petI } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetPetById", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1317,7 +1404,9 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet { // verify the required parameter 'pet' is set if (pet == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->UpdatePet"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1331,10 +1420,16 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = pet; @@ -1363,11 +1458,13 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet // make the HTTP request var localVarResponse = this.Client.Put("/pet", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdatePet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1396,7 +1493,9 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet { // verify the required parameter 'pet' is set if (pet == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->UpdatePet"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1410,12 +1509,17 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = pet; @@ -1443,13 +1547,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/pet", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdatePet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1489,10 +1595,16 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (name != null) @@ -1513,11 +1625,13 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet // make the HTTP request var localVarResponse = this.Client.Post("/pet/{petId}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdatePetWithForm", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1559,12 +1673,17 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (name != null) @@ -1584,13 +1703,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdatePetWithForm", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1632,10 +1753,16 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (additionalMetadata != null) @@ -1656,11 +1783,13 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet // make the HTTP request var localVarResponse = this.Client.Post("/pet/{petId}/uploadImage", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UploadFile", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1704,12 +1833,17 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (additionalMetadata != null) @@ -1729,13 +1863,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/pet/{petId}/uploadImage", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UploadFile", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1767,7 +1903,9 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet { // verify the required parameter 'requiredFile' is set if (requiredFile == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredFile' when calling PetApi->UploadFileWithRequiredFile"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1781,10 +1919,16 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (additionalMetadata != null) @@ -1802,11 +1946,13 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet // make the HTTP request var localVarResponse = this.Client.Post("/fake/{petId}/uploadImageWithRequiredFile", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UploadFileWithRequiredFile", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1840,7 +1986,9 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet { // verify the required parameter 'requiredFile' is set if (requiredFile == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredFile' when calling PetApi->UploadFileWithRequiredFile"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1854,12 +2002,17 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (additionalMetadata != null) @@ -1876,13 +2029,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/{petId}/uploadImageWithRequiredFile", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UploadFileWithRequiredFile", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/StoreApi.cs index ad7387db7057..7cda385b3b40 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/StoreApi.cs @@ -345,7 +345,9 @@ public Org.OpenAPITools.Client.ApiResponse DeleteOrderWithHttpInfo(strin { // verify the required parameter 'orderId' is set if (orderId == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -357,21 +359,29 @@ public Org.OpenAPITools.Client.ApiResponse DeleteOrderWithHttpInfo(strin }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter // make the HTTP request var localVarResponse = this.Client.Delete("/store/order/{order_id}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeleteOrder", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -400,7 +410,9 @@ public Org.OpenAPITools.Client.ApiResponse DeleteOrderWithHttpInfo(strin { // verify the required parameter 'orderId' is set if (orderId == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -412,24 +424,31 @@ public Org.OpenAPITools.Client.ApiResponse DeleteOrderWithHttpInfo(strin string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/store/order/{order_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeleteOrder", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -464,10 +483,16 @@ public Org.OpenAPITools.Client.ApiResponse> GetInventory }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // authentication (api_key) required @@ -478,11 +503,13 @@ public Org.OpenAPITools.Client.ApiResponse> GetInventory // make the HTTP request var localVarResponse = this.Client.Get>("/store/inventory", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetInventory", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -519,12 +546,17 @@ public Org.OpenAPITools.Client.ApiResponse> GetInventory "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // authentication (api_key) required @@ -534,13 +566,15 @@ public Org.OpenAPITools.Client.ApiResponse> GetInventory } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync>("/store/inventory", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetInventory", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -578,21 +612,29 @@ public Org.OpenAPITools.Client.ApiResponse GetOrderByIdWithHttpInfo(long }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter // make the HTTP request var localVarResponse = this.Client.Get("/store/order/{order_id}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetOrderById", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -632,24 +674,31 @@ public Org.OpenAPITools.Client.ApiResponse GetOrderByIdWithHttpInfo(long "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/store/order/{order_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetOrderById", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -677,7 +726,9 @@ public Org.OpenAPITools.Client.ApiResponse PlaceOrderWithHttpInfo(Order o { // verify the required parameter 'order' is set if (order == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'order' when calling StoreApi->PlaceOrder"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -692,21 +743,29 @@ public Org.OpenAPITools.Client.ApiResponse PlaceOrderWithHttpInfo(Order o }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = order; // make the HTTP request var localVarResponse = this.Client.Post("/store/order", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("PlaceOrder", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -736,7 +795,9 @@ public Org.OpenAPITools.Client.ApiResponse PlaceOrderWithHttpInfo(Order o { // verify the required parameter 'order' is set if (order == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'order' when calling StoreApi->PlaceOrder"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -751,24 +812,31 @@ public Org.OpenAPITools.Client.ApiResponse PlaceOrderWithHttpInfo(Order o "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = order; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/store/order", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("PlaceOrder", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/UserApi.cs index a2f2598c8acd..a1716303f6f3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/UserApi.cs @@ -517,7 +517,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUserWithHttpInfo(User u { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -530,21 +532,29 @@ public Org.OpenAPITools.Client.ApiResponse CreateUserWithHttpInfo(User u }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; // make the HTTP request var localVarResponse = this.Client.Post("/user", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -573,7 +583,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUserWithHttpInfo(User u { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -586,24 +598,31 @@ public Org.OpenAPITools.Client.ApiResponse CreateUserWithHttpInfo(User u string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/user", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -630,7 +649,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithArrayInputWith { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithArrayInput"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -643,21 +664,29 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithArrayInputWith }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; // make the HTTP request var localVarResponse = this.Client.Post("/user/createWithArray", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUsersWithArrayInput", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -686,7 +715,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithArrayInputWith { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithArrayInput"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -699,24 +730,31 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithArrayInputWith string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/user/createWithArray", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUsersWithArrayInput", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -743,7 +781,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithListInputWithH { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithListInput"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -756,21 +796,29 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithListInputWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; // make the HTTP request var localVarResponse = this.Client.Post("/user/createWithList", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUsersWithListInput", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -799,7 +847,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithListInputWithH { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithListInput"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -812,24 +862,31 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithListInputWithH string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/user/createWithList", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUsersWithListInput", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -856,7 +913,9 @@ public Org.OpenAPITools.Client.ApiResponse DeleteUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->DeleteUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -868,21 +927,29 @@ public Org.OpenAPITools.Client.ApiResponse DeleteUserWithHttpInfo(string }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter // make the HTTP request var localVarResponse = this.Client.Delete("/user/{username}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeleteUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -911,7 +978,9 @@ public Org.OpenAPITools.Client.ApiResponse DeleteUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->DeleteUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -923,24 +992,31 @@ public Org.OpenAPITools.Client.ApiResponse DeleteUserWithHttpInfo(string string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeleteUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -968,7 +1044,9 @@ public Org.OpenAPITools.Client.ApiResponse GetUserByNameWithHttpInfo(strin { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->GetUserByName"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -982,21 +1060,29 @@ public Org.OpenAPITools.Client.ApiResponse GetUserByNameWithHttpInfo(strin }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter // make the HTTP request var localVarResponse = this.Client.Get("/user/{username}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetUserByName", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1026,7 +1112,9 @@ public Org.OpenAPITools.Client.ApiResponse GetUserByNameWithHttpInfo(strin { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->GetUserByName"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1040,24 +1128,31 @@ public Org.OpenAPITools.Client.ApiResponse GetUserByNameWithHttpInfo(strin "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetUserByName", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1087,11 +1182,15 @@ public Org.OpenAPITools.Client.ApiResponse LoginUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->LoginUser"); + } // verify the required parameter 'password' is set if (password == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'password' when calling UserApi->LoginUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1105,10 +1204,16 @@ public Org.OpenAPITools.Client.ApiResponse LoginUserWithHttpInfo(string }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "username", username)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "password", password)); @@ -1116,11 +1221,13 @@ public Org.OpenAPITools.Client.ApiResponse LoginUserWithHttpInfo(string // make the HTTP request var localVarResponse = this.Client.Get("/user/login", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("LoginUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1152,11 +1259,15 @@ public Org.OpenAPITools.Client.ApiResponse LoginUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->LoginUser"); + } // verify the required parameter 'password' is set if (password == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'password' when calling UserApi->LoginUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1170,25 +1281,32 @@ public Org.OpenAPITools.Client.ApiResponse LoginUserWithHttpInfo(string "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "username", username)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "password", password)); // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/user/login", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("LoginUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1221,20 +1339,28 @@ public Org.OpenAPITools.Client.ApiResponse LogoutUserWithHttpInfo() }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request var localVarResponse = this.Client.Get("/user/logout", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("LogoutUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1269,23 +1395,30 @@ public Org.OpenAPITools.Client.ApiResponse LogoutUserWithHttpInfo() string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/user/logout", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("LogoutUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1314,11 +1447,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); + } // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->UpdateUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1331,10 +1468,16 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo(string }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter localVarRequestOptions.Data = user; @@ -1342,11 +1485,13 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo(string // make the HTTP request var localVarResponse = this.Client.Put("/user/{username}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdateUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1377,11 +1522,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); + } // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->UpdateUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1394,25 +1543,32 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo(string string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter localVarRequestOptions.Data = user; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdateUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index 9d6d049ded8a..b3ddad35a07d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -117,7 +117,7 @@ public partial class AdditionalPropertiesClass : IEquatableString presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class AdditionalPropertiesClass {\n"); sb.Append(" MapProperty: ").Append(MapProperty).Append("\n"); sb.Append(" MapOfMapProperty: ").Append(MapOfMapProperty).Append("\n"); @@ -171,23 +171,41 @@ public override int GetHashCode() { int hashCode = 41; if (this.MapProperty != null) - hashCode = hashCode * 59 + this.MapProperty.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapProperty.GetHashCode(); + } if (this.MapOfMapProperty != null) - hashCode = hashCode * 59 + this.MapOfMapProperty.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapOfMapProperty.GetHashCode(); + } if (this.Anytype1 != null) - hashCode = hashCode * 59 + this.Anytype1.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Anytype1.GetHashCode(); + } if (this.MapWithUndeclaredPropertiesAnytype1 != null) - hashCode = hashCode * 59 + this.MapWithUndeclaredPropertiesAnytype1.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesAnytype1.GetHashCode(); + } if (this.MapWithUndeclaredPropertiesAnytype2 != null) - hashCode = hashCode * 59 + this.MapWithUndeclaredPropertiesAnytype2.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesAnytype2.GetHashCode(); + } if (this.MapWithUndeclaredPropertiesAnytype3 != null) - hashCode = hashCode * 59 + this.MapWithUndeclaredPropertiesAnytype3.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesAnytype3.GetHashCode(); + } if (this.EmptyMap != null) - hashCode = hashCode * 59 + this.EmptyMap.GetHashCode(); + { + hashCode = (hashCode * 59) + this.EmptyMap.GetHashCode(); + } if (this.MapWithUndeclaredPropertiesString != null) - hashCode = hashCode * 59 + this.MapWithUndeclaredPropertiesString.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesString.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Animal.cs index fd7599d09ca5..e8ea00bb46a8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Animal.cs @@ -85,7 +85,7 @@ protected Animal() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Animal {\n"); sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" Color: ").Append(Color).Append("\n"); @@ -133,11 +133,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.ClassName != null) - hashCode = hashCode * 59 + this.ClassName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } if (this.Color != null) - hashCode = hashCode * 59 + this.Color.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Color.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ApiResponse.cs index ff7d757270f2..79873f4ddfed 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -76,7 +76,7 @@ public partial class ApiResponse : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ApiResponse {\n"); sb.Append(" Code: ").Append(Code).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); @@ -124,13 +124,19 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Code.GetHashCode(); + hashCode = (hashCode * 59) + this.Code.GetHashCode(); if (this.Type != null) - hashCode = hashCode * 59 + this.Type.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + } if (this.Message != null) - hashCode = hashCode * 59 + this.Message.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Message.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Apple.cs index a702a9ca79f1..8b1f87d1aa9a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Apple.cs @@ -68,7 +68,7 @@ public partial class Apple : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Apple {\n"); sb.Append(" Cultivar: ").Append(Cultivar).Append("\n"); sb.Append(" Origin: ").Append(Origin).Append("\n"); @@ -116,11 +116,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.Cultivar != null) - hashCode = hashCode * 59 + this.Cultivar.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Cultivar.GetHashCode(); + } if (this.Origin != null) - hashCode = hashCode * 59 + this.Origin.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Origin.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/AppleReq.cs index 91a8d5c3aeb9..1d6d42dc9b3a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/AppleReq.cs @@ -70,7 +70,7 @@ protected AppleReq() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class AppleReq {\n"); sb.Append(" Cultivar: ").Append(Cultivar).Append("\n"); sb.Append(" Mealy: ").Append(Mealy).Append("\n"); @@ -117,8 +117,10 @@ public override int GetHashCode() { int hashCode = 41; if (this.Cultivar != null) - hashCode = hashCode * 59 + this.Cultivar.GetHashCode(); - hashCode = hashCode * 59 + this.Mealy.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Cultivar.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Mealy.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index e96382b222d1..30bf57ef0f52 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -60,7 +60,7 @@ public partial class ArrayOfArrayOfNumberOnly : IEquatableString presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ArrayOfArrayOfNumberOnly {\n"); sb.Append(" ArrayArrayNumber: ").Append(ArrayArrayNumber).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -107,9 +107,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ArrayArrayNumber != null) - hashCode = hashCode * 59 + this.ArrayArrayNumber.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayArrayNumber.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index 60c5a8576561..8a215aad133b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -60,7 +60,7 @@ public partial class ArrayOfNumberOnly : IEquatable, IValidat /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ArrayOfNumberOnly {\n"); sb.Append(" ArrayNumber: ").Append(ArrayNumber).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -107,9 +107,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ArrayNumber != null) - hashCode = hashCode * 59 + this.ArrayNumber.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayNumber.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ArrayTest.cs index 290926768d2f..1a879a1d9ca2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -76,7 +76,7 @@ public partial class ArrayTest : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ArrayTest {\n"); sb.Append(" ArrayOfString: ").Append(ArrayOfString).Append("\n"); sb.Append(" ArrayArrayOfInteger: ").Append(ArrayArrayOfInteger).Append("\n"); @@ -125,13 +125,21 @@ public override int GetHashCode() { int hashCode = 41; if (this.ArrayOfString != null) - hashCode = hashCode * 59 + this.ArrayOfString.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayOfString.GetHashCode(); + } if (this.ArrayArrayOfInteger != null) - hashCode = hashCode * 59 + this.ArrayArrayOfInteger.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayArrayOfInteger.GetHashCode(); + } if (this.ArrayArrayOfModel != null) - hashCode = hashCode * 59 + this.ArrayArrayOfModel.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayArrayOfModel.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Banana.cs index dc0e10d46867..97939597ede8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Banana.cs @@ -60,7 +60,7 @@ public partial class Banana : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Banana {\n"); sb.Append(" LengthCm: ").Append(LengthCm).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -106,9 +106,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.LengthCm.GetHashCode(); + hashCode = (hashCode * 59) + this.LengthCm.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/BananaReq.cs index ea57bb4f0cce..fdd36929d13c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/BananaReq.cs @@ -66,7 +66,7 @@ protected BananaReq() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class BananaReq {\n"); sb.Append(" LengthCm: ").Append(LengthCm).Append("\n"); sb.Append(" Sweet: ").Append(Sweet).Append("\n"); @@ -112,8 +112,8 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.LengthCm.GetHashCode(); - hashCode = hashCode * 59 + this.Sweet.GetHashCode(); + hashCode = (hashCode * 59) + this.LengthCm.GetHashCode(); + hashCode = (hashCode * 59) + this.Sweet.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/BasquePig.cs index f9074c95c04c..ea4ff737c89a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/BasquePig.cs @@ -72,7 +72,7 @@ protected BasquePig() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class BasquePig {\n"); sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -119,9 +119,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ClassName != null) - hashCode = hashCode * 59 + this.ClassName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Capitalization.cs index 3a989f765f9e..be68a50a116a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Capitalization.cs @@ -101,7 +101,7 @@ public partial class Capitalization : IEquatable, IValidatableOb /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Capitalization {\n"); sb.Append(" SmallCamel: ").Append(SmallCamel).Append("\n"); sb.Append(" CapitalCamel: ").Append(CapitalCamel).Append("\n"); @@ -153,19 +153,33 @@ public override int GetHashCode() { int hashCode = 41; if (this.SmallCamel != null) - hashCode = hashCode * 59 + this.SmallCamel.GetHashCode(); + { + hashCode = (hashCode * 59) + this.SmallCamel.GetHashCode(); + } if (this.CapitalCamel != null) - hashCode = hashCode * 59 + this.CapitalCamel.GetHashCode(); + { + hashCode = (hashCode * 59) + this.CapitalCamel.GetHashCode(); + } if (this.SmallSnake != null) - hashCode = hashCode * 59 + this.SmallSnake.GetHashCode(); + { + hashCode = (hashCode * 59) + this.SmallSnake.GetHashCode(); + } if (this.CapitalSnake != null) - hashCode = hashCode * 59 + this.CapitalSnake.GetHashCode(); + { + hashCode = (hashCode * 59) + this.CapitalSnake.GetHashCode(); + } if (this.SCAETHFlowPoints != null) - hashCode = hashCode * 59 + this.SCAETHFlowPoints.GetHashCode(); + { + hashCode = (hashCode * 59) + this.SCAETHFlowPoints.GetHashCode(); + } if (this.ATT_NAME != null) - hashCode = hashCode * 59 + this.ATT_NAME.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ATT_NAME.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Cat.cs index be96bae85eb1..2bc55707da95 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Cat.cs @@ -72,7 +72,7 @@ protected Cat() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Cat {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" Declawed: ").Append(Declawed).Append("\n"); @@ -119,9 +119,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = base.GetHashCode(); - hashCode = hashCode * 59 + this.Declawed.GetHashCode(); + hashCode = (hashCode * 59) + this.Declawed.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } @@ -143,7 +145,10 @@ public override int GetHashCode() /// Validation Result protected IEnumerable BaseValidate(ValidationContext validationContext) { - foreach(var x in BaseValidate(validationContext)) yield return x; + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } yield break; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/CatAllOf.cs index 8cb5bfc3ef64..3a960e9925e3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/CatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -60,7 +60,7 @@ public partial class CatAllOf : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class CatAllOf {\n"); sb.Append(" Declawed: ").Append(Declawed).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -106,9 +106,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Declawed.GetHashCode(); + hashCode = (hashCode * 59) + this.Declawed.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Category.cs index 6b0b74ca5219..0cc23f5f6c23 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Category.cs @@ -80,7 +80,7 @@ protected Category() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Category {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); @@ -127,11 +127,15 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ChildCat.cs index 90545c4d99af..7a15a5297df2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ChildCat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ChildCat.cs @@ -92,7 +92,7 @@ protected ChildCat() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ChildCat {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); @@ -141,10 +141,14 @@ public override int GetHashCode() { int hashCode = base.GetHashCode(); if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); - hashCode = hashCode * 59 + this.PetType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + hashCode = (hashCode * 59) + this.PetType.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } @@ -166,7 +170,10 @@ public override int GetHashCode() /// Validation Result protected IEnumerable BaseValidate(ValidationContext validationContext) { - foreach(var x in BaseValidate(validationContext)) yield return x; + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } yield break; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs index b5d479e17428..a353ad7ffd71 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs @@ -82,7 +82,7 @@ public enum PetTypeEnum /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ChildCatAllOf {\n"); sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" PetType: ").Append(PetType).Append("\n"); @@ -130,10 +130,14 @@ public override int GetHashCode() { int hashCode = 41; if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); - hashCode = hashCode * 59 + this.PetType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + hashCode = (hashCode * 59) + this.PetType.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ClassModel.cs index 80c863484cc7..7177e9bf0b6c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ClassModel.cs @@ -60,7 +60,7 @@ public partial class ClassModel : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ClassModel {\n"); sb.Append(" Class: ").Append(Class).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -107,9 +107,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.Class != null) - hashCode = hashCode * 59 + this.Class.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Class.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index f3afcc2a7341..807f0eb26bf8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -84,7 +84,7 @@ protected ComplexQuadrilateral() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ComplexQuadrilateral {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); @@ -132,11 +132,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } if (this.QuadrilateralType != null) - hashCode = hashCode * 59 + this.QuadrilateralType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.QuadrilateralType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/DanishPig.cs index 59afe7580d04..a27b1db39297 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/DanishPig.cs @@ -72,7 +72,7 @@ protected DanishPig() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class DanishPig {\n"); sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -119,9 +119,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ClassName != null) - hashCode = hashCode * 59 + this.ClassName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs index bd3d97b081db..1928b236bf66 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -60,7 +60,7 @@ public partial class DeprecatedObject : IEquatable, IValidatab /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class DeprecatedObject {\n"); sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -107,9 +107,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Dog.cs index f20af26112cb..9cd520deaf82 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Dog.cs @@ -72,7 +72,7 @@ protected Dog() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Dog {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" Breed: ").Append(Breed).Append("\n"); @@ -120,9 +120,13 @@ public override int GetHashCode() { int hashCode = base.GetHashCode(); if (this.Breed != null) - hashCode = hashCode * 59 + this.Breed.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Breed.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } @@ -144,7 +148,10 @@ public override int GetHashCode() /// Validation Result protected IEnumerable BaseValidate(ValidationContext validationContext) { - foreach(var x in BaseValidate(validationContext)) yield return x; + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } yield break; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/DogAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/DogAllOf.cs index 3588b02b020d..7b026acbf1e5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/DogAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/DogAllOf.cs @@ -60,7 +60,7 @@ public partial class DogAllOf : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class DogAllOf {\n"); sb.Append(" Breed: ").Append(Breed).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -107,9 +107,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.Breed != null) - hashCode = hashCode * 59 + this.Breed.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Breed.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Drawing.cs index f7e6702be596..d8cd2a70ef61 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Drawing.cs @@ -77,7 +77,7 @@ public partial class Drawing : Dictionary, IEquatable, I /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Drawing {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" MainShape: ").Append(MainShape).Append("\n"); @@ -127,13 +127,21 @@ public override int GetHashCode() { int hashCode = base.GetHashCode(); if (this.MainShape != null) - hashCode = hashCode * 59 + this.MainShape.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MainShape.GetHashCode(); + } if (this.ShapeOrNull != null) - hashCode = hashCode * 59 + this.ShapeOrNull.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeOrNull.GetHashCode(); + } if (this.NullableShape != null) - hashCode = hashCode * 59 + this.NullableShape.GetHashCode(); + { + hashCode = (hashCode * 59) + this.NullableShape.GetHashCode(); + } if (this.Shapes != null) - hashCode = hashCode * 59 + this.Shapes.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Shapes.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/EnumArrays.cs index f4138fce032d..6d7830c0e8ba 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -109,7 +109,7 @@ public enum ArrayEnumEnum /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class EnumArrays {\n"); sb.Append(" JustSymbol: ").Append(JustSymbol).Append("\n"); sb.Append(" ArrayEnum: ").Append(ArrayEnum).Append("\n"); @@ -156,10 +156,12 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.JustSymbol.GetHashCode(); - hashCode = hashCode * 59 + this.ArrayEnum.GetHashCode(); + hashCode = (hashCode * 59) + this.JustSymbol.GetHashCode(); + hashCode = (hashCode * 59) + this.ArrayEnum.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/EnumTest.cs index 178d540314d0..6f3d2272c5c3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/EnumTest.cs @@ -238,7 +238,7 @@ protected EnumTest() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class EnumTest {\n"); sb.Append(" EnumString: ").Append(EnumString).Append("\n"); sb.Append(" EnumStringRequired: ").Append(EnumStringRequired).Append("\n"); @@ -292,17 +292,19 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.EnumString.GetHashCode(); - hashCode = hashCode * 59 + this.EnumStringRequired.GetHashCode(); - hashCode = hashCode * 59 + this.EnumInteger.GetHashCode(); - hashCode = hashCode * 59 + this.EnumIntegerOnly.GetHashCode(); - hashCode = hashCode * 59 + this.EnumNumber.GetHashCode(); - hashCode = hashCode * 59 + this.OuterEnum.GetHashCode(); - hashCode = hashCode * 59 + this.OuterEnumInteger.GetHashCode(); - hashCode = hashCode * 59 + this.OuterEnumDefaultValue.GetHashCode(); - hashCode = hashCode * 59 + this.OuterEnumIntegerDefaultValue.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumString.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumStringRequired.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumInteger.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumIntegerOnly.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumNumber.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnum.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnumInteger.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnumDefaultValue.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnumIntegerDefaultValue.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index 2e8e4d0c17d9..a931c0d6327a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -84,7 +84,7 @@ protected EquilateralTriangle() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class EquilateralTriangle {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); @@ -132,11 +132,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } if (this.TriangleType != null) - hashCode = hashCode * 59 + this.TriangleType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/File.cs index 1e859462b140..e77d15e06bce 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/File.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/File.cs @@ -61,7 +61,7 @@ public partial class File : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class File {\n"); sb.Append(" SourceURI: ").Append(SourceURI).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -108,9 +108,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.SourceURI != null) - hashCode = hashCode * 59 + this.SourceURI.GetHashCode(); + { + hashCode = (hashCode * 59) + this.SourceURI.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index b996e287ea70..6808978c49f8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -68,7 +68,7 @@ public partial class FileSchemaTestClass : IEquatable, IVal /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class FileSchemaTestClass {\n"); sb.Append(" File: ").Append(File).Append("\n"); sb.Append(" Files: ").Append(Files).Append("\n"); @@ -116,11 +116,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.File != null) - hashCode = hashCode * 59 + this.File.GetHashCode(); + { + hashCode = (hashCode * 59) + this.File.GetHashCode(); + } if (this.Files != null) - hashCode = hashCode * 59 + this.Files.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Files.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Foo.cs index a5aabbae4f3d..e64aac7b6317 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Foo.cs @@ -61,7 +61,7 @@ public Foo(string bar = "bar") /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Foo {\n"); sb.Append(" Bar: ").Append(Bar).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -108,9 +108,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.Bar != null) - hashCode = hashCode * 59 + this.Bar.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Bar.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/FormatTest.cs index ef60b6bb9fea..eb38d586bbb7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/FormatTest.cs @@ -199,7 +199,7 @@ protected FormatTest() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class FormatTest {\n"); sb.Append(" Integer: ").Append(Integer).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); @@ -260,33 +260,53 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Integer.GetHashCode(); - hashCode = hashCode * 59 + this.Int32.GetHashCode(); - hashCode = hashCode * 59 + this.Int64.GetHashCode(); - hashCode = hashCode * 59 + this.Number.GetHashCode(); - hashCode = hashCode * 59 + this.Float.GetHashCode(); - hashCode = hashCode * 59 + this.Double.GetHashCode(); - hashCode = hashCode * 59 + this.Decimal.GetHashCode(); + hashCode = (hashCode * 59) + this.Integer.GetHashCode(); + hashCode = (hashCode * 59) + this.Int32.GetHashCode(); + hashCode = (hashCode * 59) + this.Int64.GetHashCode(); + hashCode = (hashCode * 59) + this.Number.GetHashCode(); + hashCode = (hashCode * 59) + this.Float.GetHashCode(); + hashCode = (hashCode * 59) + this.Double.GetHashCode(); + hashCode = (hashCode * 59) + this.Decimal.GetHashCode(); if (this.String != null) - hashCode = hashCode * 59 + this.String.GetHashCode(); + { + hashCode = (hashCode * 59) + this.String.GetHashCode(); + } if (this.Byte != null) - hashCode = hashCode * 59 + this.Byte.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Byte.GetHashCode(); + } if (this.Binary != null) - hashCode = hashCode * 59 + this.Binary.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Binary.GetHashCode(); + } if (this.Date != null) - hashCode = hashCode * 59 + this.Date.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Date.GetHashCode(); + } if (this.DateTime != null) - hashCode = hashCode * 59 + this.DateTime.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DateTime.GetHashCode(); + } if (this.Uuid != null) - hashCode = hashCode * 59 + this.Uuid.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); + } if (this.Password != null) - hashCode = hashCode * 59 + this.Password.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Password.GetHashCode(); + } if (this.PatternWithDigits != null) - hashCode = hashCode * 59 + this.PatternWithDigits.GetHashCode(); + { + hashCode = (hashCode * 59) + this.PatternWithDigits.GetHashCode(); + } if (this.PatternWithDigitsAndDelimiter != null) - hashCode = hashCode * 59 + this.PatternWithDigitsAndDelimiter.GetHashCode(); + { + hashCode = (hashCode * 59) + this.PatternWithDigitsAndDelimiter.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } @@ -299,61 +319,61 @@ public override int GetHashCode() public IEnumerable Validate(ValidationContext validationContext) { // Integer (int) maximum - if(this.Integer > (int)100) + if (this.Integer > (int)100) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); } // Integer (int) minimum - if(this.Integer < (int)10) + if (this.Integer < (int)10) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); } // Int32 (int) maximum - if(this.Int32 > (int)200) + if (this.Int32 > (int)200) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); } // Int32 (int) minimum - if(this.Int32 < (int)20) + if (this.Int32 < (int)20) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } // Number (decimal) maximum - if(this.Number > (decimal)543.2) + if (this.Number > (decimal)543.2) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); } // Number (decimal) minimum - if(this.Number < (decimal)32.1) + if (this.Number < (decimal)32.1) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); } // Float (float) maximum - if(this.Float > (float)987.6) + if (this.Float > (float)987.6) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); } // Float (float) minimum - if(this.Float < (float)54.3) + if (this.Float < (float)54.3) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); } // Double (double) maximum - if(this.Double > (double)123.4) + if (this.Double > (double)123.4) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); } // Double (double) minimum - if(this.Double < (double)67.8) + if (this.Double < (double)67.8) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); } @@ -366,13 +386,13 @@ public override int GetHashCode() } // Password (string) maxLength - if(this.Password != null && this.Password.Length > 64) + if (this.Password != null && this.Password.Length > 64) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); } // Password (string) minLength - if(this.Password != null && this.Password.Length < 10) + if (this.Password != null && this.Password.Length < 10) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index 9edacb3815a8..cee75f3f8157 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -76,7 +76,7 @@ protected GrandparentAnimal() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class GrandparentAnimal {\n"); sb.Append(" PetType: ").Append(PetType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -123,9 +123,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.PetType != null) - hashCode = hashCode * 59 + this.PetType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.PetType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index f6219182b296..52099a7095e1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -81,7 +81,7 @@ public bool ShouldSerializeFoo() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class HasOnlyReadOnly {\n"); sb.Append(" Bar: ").Append(Bar).Append("\n"); sb.Append(" Foo: ").Append(Foo).Append("\n"); @@ -129,11 +129,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.Bar != null) - hashCode = hashCode * 59 + this.Bar.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Bar.GetHashCode(); + } if (this.Foo != null) - hashCode = hashCode * 59 + this.Foo.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Foo.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/HealthCheckResult.cs index c7c342d258a9..e8cbb68e2e4c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/HealthCheckResult.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -60,7 +60,7 @@ public partial class HealthCheckResult : IEquatable, IValidat /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class HealthCheckResult {\n"); sb.Append(" NullableMessage: ").Append(NullableMessage).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -107,9 +107,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.NullableMessage != null) - hashCode = hashCode * 59 + this.NullableMessage.GetHashCode(); + { + hashCode = (hashCode * 59) + this.NullableMessage.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/InlineResponseDefault.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/InlineResponseDefault.cs index e492ade1fc6d..ae46f1f0098f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/InlineResponseDefault.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/InlineResponseDefault.cs @@ -60,7 +60,7 @@ public partial class InlineResponseDefault : IEquatable, /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class InlineResponseDefault {\n"); sb.Append(" String: ").Append(String).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -107,9 +107,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.String != null) - hashCode = hashCode * 59 + this.String.GetHashCode(); + { + hashCode = (hashCode * 59) + this.String.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index 8d02354be3f6..50e7ce4aaa8d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -74,7 +74,7 @@ protected IsoscelesTriangle() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class IsoscelesTriangle {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); @@ -121,9 +121,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } if (this.TriangleType != null) - hashCode = hashCode * 59 + this.TriangleType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/List.cs index 5f3483a6e308..00814d110694 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/List.cs @@ -60,7 +60,7 @@ public partial class List : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class List {\n"); sb.Append(" _123List: ").Append(_123List).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -107,9 +107,13 @@ public override int GetHashCode() { int hashCode = 41; if (this._123List != null) - hashCode = hashCode * 59 + this._123List.GetHashCode(); + { + hashCode = (hashCode * 59) + this._123List.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/MapTest.cs index fa93bf24ec05..8b5a73e77365 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/MapTest.cs @@ -105,7 +105,7 @@ public enum InnerEnum /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class MapTest {\n"); sb.Append(" MapMapOfString: ").Append(MapMapOfString).Append("\n"); sb.Append(" MapOfEnumString: ").Append(MapOfEnumString).Append("\n"); @@ -155,14 +155,22 @@ public override int GetHashCode() { int hashCode = 41; if (this.MapMapOfString != null) - hashCode = hashCode * 59 + this.MapMapOfString.GetHashCode(); - hashCode = hashCode * 59 + this.MapOfEnumString.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapMapOfString.GetHashCode(); + } + hashCode = (hashCode * 59) + this.MapOfEnumString.GetHashCode(); if (this.DirectMap != null) - hashCode = hashCode * 59 + this.DirectMap.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DirectMap.GetHashCode(); + } if (this.IndirectMap != null) - hashCode = hashCode * 59 + this.IndirectMap.GetHashCode(); + { + hashCode = (hashCode * 59) + this.IndirectMap.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 8853f837f9e4..3225727af37b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -76,7 +76,7 @@ public partial class MixedPropertiesAndAdditionalPropertiesClass : IEquatableString presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); @@ -125,13 +125,21 @@ public override int GetHashCode() { int hashCode = 41; if (this.Uuid != null) - hashCode = hashCode * 59 + this.Uuid.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); + } if (this.DateTime != null) - hashCode = hashCode * 59 + this.DateTime.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DateTime.GetHashCode(); + } if (this.Map != null) - hashCode = hashCode * 59 + this.Map.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Map.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Model200Response.cs index 629a1fde7fb1..79a49ef91d28 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Model200Response.cs @@ -68,7 +68,7 @@ public partial class Model200Response : IEquatable, IValidatab /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Model200Response {\n"); sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" Class: ").Append(Class).Append("\n"); @@ -115,11 +115,15 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Name.GetHashCode(); + hashCode = (hashCode * 59) + this.Name.GetHashCode(); if (this.Class != null) - hashCode = hashCode * 59 + this.Class.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Class.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ModelClient.cs index e28bc67d630f..1995ec4b1692 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ModelClient.cs @@ -60,7 +60,7 @@ public partial class ModelClient : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ModelClient {\n"); sb.Append(" _Client: ").Append(_Client).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -107,9 +107,13 @@ public override int GetHashCode() { int hashCode = 41; if (this._Client != null) - hashCode = hashCode * 59 + this._Client.GetHashCode(); + { + hashCode = (hashCode * 59) + this._Client.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Name.cs index 462b3458215a..0dc21bb656f0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Name.cs @@ -104,7 +104,7 @@ public bool ShouldSerialize_123Number() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Name {\n"); sb.Append(" _Name: ").Append(_Name).Append("\n"); sb.Append(" SnakeCase: ").Append(SnakeCase).Append("\n"); @@ -153,13 +153,17 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this._Name.GetHashCode(); - hashCode = hashCode * 59 + this.SnakeCase.GetHashCode(); + hashCode = (hashCode * 59) + this._Name.GetHashCode(); + hashCode = (hashCode * 59) + this.SnakeCase.GetHashCode(); if (this.Property != null) - hashCode = hashCode * 59 + this.Property.GetHashCode(); - hashCode = hashCode * 59 + this._123Number.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Property.GetHashCode(); + } + hashCode = (hashCode * 59) + this._123Number.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/NullableClass.cs index 3a34e8cc1288..57555c376785 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/NullableClass.cs @@ -142,7 +142,7 @@ public partial class NullableClass : Dictionary, IEquatableString presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class NullableClass {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" IntegerProp: ").Append(IntegerProp).Append("\n"); @@ -200,29 +200,53 @@ public override int GetHashCode() { int hashCode = base.GetHashCode(); if (this.IntegerProp != null) - hashCode = hashCode * 59 + this.IntegerProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.IntegerProp.GetHashCode(); + } if (this.NumberProp != null) - hashCode = hashCode * 59 + this.NumberProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.NumberProp.GetHashCode(); + } if (this.BooleanProp != null) - hashCode = hashCode * 59 + this.BooleanProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.BooleanProp.GetHashCode(); + } if (this.StringProp != null) - hashCode = hashCode * 59 + this.StringProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.StringProp.GetHashCode(); + } if (this.DateProp != null) - hashCode = hashCode * 59 + this.DateProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DateProp.GetHashCode(); + } if (this.DatetimeProp != null) - hashCode = hashCode * 59 + this.DatetimeProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DatetimeProp.GetHashCode(); + } if (this.ArrayNullableProp != null) - hashCode = hashCode * 59 + this.ArrayNullableProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayNullableProp.GetHashCode(); + } if (this.ArrayAndItemsNullableProp != null) - hashCode = hashCode * 59 + this.ArrayAndItemsNullableProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayAndItemsNullableProp.GetHashCode(); + } if (this.ArrayItemsNullable != null) - hashCode = hashCode * 59 + this.ArrayItemsNullable.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayItemsNullable.GetHashCode(); + } if (this.ObjectNullableProp != null) - hashCode = hashCode * 59 + this.ObjectNullableProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ObjectNullableProp.GetHashCode(); + } if (this.ObjectAndItemsNullableProp != null) - hashCode = hashCode * 59 + this.ObjectAndItemsNullableProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ObjectAndItemsNullableProp.GetHashCode(); + } if (this.ObjectItemsNullable != null) - hashCode = hashCode * 59 + this.ObjectItemsNullable.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/NumberOnly.cs index 34abb32eabd7..97f869b0ebc1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -60,7 +60,7 @@ public partial class NumberOnly : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class NumberOnly {\n"); sb.Append(" JustNumber: ").Append(JustNumber).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -106,9 +106,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.JustNumber.GetHashCode(); + hashCode = (hashCode * 59) + this.JustNumber.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 021bfe71e02b..86ea32998f8c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -87,7 +87,7 @@ public partial class ObjectWithDeprecatedFields : IEquatableString presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ObjectWithDeprecatedFields {\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); sb.Append(" Id: ").Append(Id).Append("\n"); @@ -137,14 +137,22 @@ public override int GetHashCode() { int hashCode = 41; if (this.Uuid != null) - hashCode = hashCode * 59 + this.Uuid.GetHashCode(); - hashCode = hashCode * 59 + this.Id.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.DeprecatedRef != null) - hashCode = hashCode * 59 + this.DeprecatedRef.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DeprecatedRef.GetHashCode(); + } if (this.Bars != null) - hashCode = hashCode * 59 + this.Bars.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Bars.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Order.cs index e1abd07a05c4..5c52482e79b9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Order.cs @@ -128,7 +128,7 @@ public enum StatusEnum /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Order {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" PetId: ").Append(PetId).Append("\n"); @@ -179,15 +179,19 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Id.GetHashCode(); - hashCode = hashCode * 59 + this.PetId.GetHashCode(); - hashCode = hashCode * 59 + this.Quantity.GetHashCode(); + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.PetId.GetHashCode(); + hashCode = (hashCode * 59) + this.Quantity.GetHashCode(); if (this.ShipDate != null) - hashCode = hashCode * 59 + this.ShipDate.GetHashCode(); - hashCode = hashCode * 59 + this.Status.GetHashCode(); - hashCode = hashCode * 59 + this.Complete.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShipDate.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); + hashCode = (hashCode * 59) + this.Complete.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/OuterComposite.cs index 88449a1c8430..3209f6d6244e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -76,7 +76,7 @@ public partial class OuterComposite : IEquatable, IValidatableOb /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class OuterComposite {\n"); sb.Append(" MyNumber: ").Append(MyNumber).Append("\n"); sb.Append(" MyString: ").Append(MyString).Append("\n"); @@ -124,12 +124,16 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.MyNumber.GetHashCode(); + hashCode = (hashCode * 59) + this.MyNumber.GetHashCode(); if (this.MyString != null) - hashCode = hashCode * 59 + this.MyString.GetHashCode(); - hashCode = hashCode * 59 + this.MyBoolean.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MyString.GetHashCode(); + } + hashCode = (hashCode * 59) + this.MyBoolean.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ParentPet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ParentPet.cs index 899984fcc5bc..ac986b555efd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ParentPet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ParentPet.cs @@ -64,7 +64,7 @@ public ParentPet(string petType = "ParentPet") : base(petType) /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ParentPet {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -111,7 +111,9 @@ public override int GetHashCode() { int hashCode = base.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } @@ -133,7 +135,10 @@ public override int GetHashCode() /// Validation Result protected IEnumerable BaseValidate(ValidationContext validationContext) { - foreach(var x in BaseValidate(validationContext)) yield return x; + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } yield break; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Pet.cs index 8b3b614493f1..31fd118f4f68 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Pet.cs @@ -144,7 +144,7 @@ protected Pet() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Pet {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Category: ").Append(Category).Append("\n"); @@ -195,18 +195,28 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.Category != null) - hashCode = hashCode * 59 + this.Category.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Category.GetHashCode(); + } if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } if (this.PhotoUrls != null) - hashCode = hashCode * 59 + this.PhotoUrls.GetHashCode(); + { + hashCode = (hashCode * 59) + this.PhotoUrls.GetHashCode(); + } if (this.Tags != null) - hashCode = hashCode * 59 + this.Tags.GetHashCode(); - hashCode = hashCode * 59 + this.Status.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Tags.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index de200d38d54a..4d7c39c4364d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -72,7 +72,7 @@ protected QuadrilateralInterface() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class QuadrilateralInterface {\n"); sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -119,9 +119,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.QuadrilateralType != null) - hashCode = hashCode * 59 + this.QuadrilateralType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.QuadrilateralType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index 08a294a22903..ad59ca832864 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -74,7 +74,7 @@ public bool ShouldSerializeBar() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ReadOnlyFirst {\n"); sb.Append(" Bar: ").Append(Bar).Append("\n"); sb.Append(" Baz: ").Append(Baz).Append("\n"); @@ -122,11 +122,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.Bar != null) - hashCode = hashCode * 59 + this.Bar.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Bar.GetHashCode(); + } if (this.Baz != null) - hashCode = hashCode * 59 + this.Baz.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Baz.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Return.cs index 74317fbbfec5..e702e0157030 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Return.cs @@ -60,7 +60,7 @@ public partial class Return : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Return {\n"); sb.Append(" _Return: ").Append(_Return).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -106,9 +106,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this._Return.GetHashCode(); + hashCode = (hashCode * 59) + this._Return.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index 6b4869ce8392..236839471475 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -84,7 +84,7 @@ protected ScaleneTriangle() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ScaleneTriangle {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); @@ -132,11 +132,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } if (this.TriangleType != null) - hashCode = hashCode * 59 + this.TriangleType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ShapeInterface.cs index ccd305b45098..92774561aaa5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -72,7 +72,7 @@ protected ShapeInterface() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ShapeInterface {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -119,9 +119,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index d698a788f8ea..fc9b37ce01fb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -84,7 +84,7 @@ protected SimpleQuadrilateral() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class SimpleQuadrilateral {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); @@ -132,11 +132,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } if (this.QuadrilateralType != null) - hashCode = hashCode * 59 + this.QuadrilateralType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.QuadrilateralType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/SpecialModelName.cs index 1d6445d4d624..7800467822ea 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -68,7 +68,7 @@ public partial class SpecialModelName : IEquatable, IValidatab /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class SpecialModelName {\n"); sb.Append(" SpecialPropertyName: ").Append(SpecialPropertyName).Append("\n"); sb.Append(" _SpecialModelName: ").Append(_SpecialModelName).Append("\n"); @@ -115,11 +115,15 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.SpecialPropertyName.GetHashCode(); + hashCode = (hashCode * 59) + this.SpecialPropertyName.GetHashCode(); if (this._SpecialModelName != null) - hashCode = hashCode * 59 + this._SpecialModelName.GetHashCode(); + { + hashCode = (hashCode * 59) + this._SpecialModelName.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Tag.cs index 2635acce4e4e..3df2c02e2cef 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Tag.cs @@ -68,7 +68,7 @@ public partial class Tag : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Tag {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); @@ -115,11 +115,15 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/TriangleInterface.cs index 14bd3a6724cf..7f7abb5bc85b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -72,7 +72,7 @@ protected TriangleInterface() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class TriangleInterface {\n"); sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -119,9 +119,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.TriangleType != null) - hashCode = hashCode * 59 + this.TriangleType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/User.cs index ebd632a90ac4..5f2a3020c3dd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/User.cs @@ -153,7 +153,7 @@ public partial class User : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class User {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Username: ").Append(Username).Append("\n"); @@ -210,30 +210,52 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.Username != null) - hashCode = hashCode * 59 + this.Username.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Username.GetHashCode(); + } if (this.FirstName != null) - hashCode = hashCode * 59 + this.FirstName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.FirstName.GetHashCode(); + } if (this.LastName != null) - hashCode = hashCode * 59 + this.LastName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.LastName.GetHashCode(); + } if (this.Email != null) - hashCode = hashCode * 59 + this.Email.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Email.GetHashCode(); + } if (this.Password != null) - hashCode = hashCode * 59 + this.Password.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Password.GetHashCode(); + } if (this.Phone != null) - hashCode = hashCode * 59 + this.Phone.GetHashCode(); - hashCode = hashCode * 59 + this.UserStatus.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Phone.GetHashCode(); + } + hashCode = (hashCode * 59) + this.UserStatus.GetHashCode(); if (this.ObjectWithNoDeclaredProps != null) - hashCode = hashCode * 59 + this.ObjectWithNoDeclaredProps.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ObjectWithNoDeclaredProps.GetHashCode(); + } if (this.ObjectWithNoDeclaredPropsNullable != null) - hashCode = hashCode * 59 + this.ObjectWithNoDeclaredPropsNullable.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ObjectWithNoDeclaredPropsNullable.GetHashCode(); + } if (this.AnyTypeProp != null) - hashCode = hashCode * 59 + this.AnyTypeProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AnyTypeProp.GetHashCode(); + } if (this.AnyTypePropNullable != null) - hashCode = hashCode * 59 + this.AnyTypePropNullable.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AnyTypePropNullable.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Whale.cs index 57ef3850e979..c30b6dbfabed 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Whale.cs @@ -88,7 +88,7 @@ protected Whale() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Whale {\n"); sb.Append(" HasBaleen: ").Append(HasBaleen).Append("\n"); sb.Append(" HasTeeth: ").Append(HasTeeth).Append("\n"); @@ -136,12 +136,16 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.HasBaleen.GetHashCode(); - hashCode = hashCode * 59 + this.HasTeeth.GetHashCode(); + hashCode = (hashCode * 59) + this.HasBaleen.GetHashCode(); + hashCode = (hashCode * 59) + this.HasTeeth.GetHashCode(); if (this.ClassName != null) - hashCode = hashCode * 59 + this.ClassName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Zebra.cs index bf9735fb37ed..4fb60ed8ddf2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/Zebra.cs @@ -106,7 +106,7 @@ protected Zebra() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Zebra {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); @@ -154,11 +154,15 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = base.GetHashCode(); - hashCode = hashCode * 59 + this.Type.GetHashCode(); + hashCode = (hashCode * 59) + this.Type.GetHashCode(); if (this.ClassName != null) - hashCode = hashCode * 59 + this.ClassName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index ad48306e00ce..ac8fbdcdc946 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -221,7 +221,9 @@ public Org.OpenAPITools.Client.ApiResponse Call123TestSpecialTagsWi { // verify the required parameter 'modelClient' is set if (modelClient == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling AnotherFakeApi->Call123TestSpecialTags"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -235,21 +237,29 @@ public Org.OpenAPITools.Client.ApiResponse Call123TestSpecialTagsWi }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = modelClient; // make the HTTP request var localVarResponse = this.Client.Patch("/another-fake/dummy", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("Call123TestSpecialTags", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -279,7 +289,9 @@ public Org.OpenAPITools.Client.ApiResponse Call123TestSpecialTagsWi { // verify the required parameter 'modelClient' is set if (modelClient == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling AnotherFakeApi->Call123TestSpecialTags"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -293,24 +305,31 @@ public Org.OpenAPITools.Client.ApiResponse Call123TestSpecialTagsWi "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = modelClient; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PatchAsync("/another-fake/dummy", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("Call123TestSpecialTags", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/DefaultApi.cs index 8844aca4ab73..a9e5cfb9c4d2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -221,20 +221,28 @@ public Org.OpenAPITools.Client.ApiResponse FooGetWithHttp }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request var localVarResponse = this.Client.Get("/foo", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FooGet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -271,23 +279,30 @@ public Org.OpenAPITools.Client.ApiResponse FooGetWithHttp "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/foo", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FooGet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; 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 dab406002f81..57a99469634f 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 @@ -945,20 +945,28 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request var localVarResponse = this.Client.Get("/fake/health", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeHealthGet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -995,23 +1003,30 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/fake/health", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeHealthGet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1049,21 +1064,29 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = body; // make the HTTP request var localVarResponse = this.Client.Post("/fake/outer/boolean", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterBooleanSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1103,24 +1126,31 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH "*/*" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = body; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/boolean", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterBooleanSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1158,21 +1188,29 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = outerComposite; // make the HTTP request var localVarResponse = this.Client.Post("/fake/outer/composite", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterCompositeSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1212,24 +1250,31 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH "*/*" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = outerComposite; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/composite", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterCompositeSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1267,21 +1312,29 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = body; // make the HTTP request var localVarResponse = this.Client.Post("/fake/outer/number", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterNumberSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1321,24 +1374,31 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH "*/*" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = body; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/number", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterNumberSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1376,21 +1436,29 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = body; // make the HTTP request var localVarResponse = this.Client.Post("/fake/outer/string", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterStringSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1430,24 +1498,31 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH "*/*" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = body; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/string", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterStringSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1482,20 +1557,28 @@ public Org.OpenAPITools.Client.ApiResponse> GetArrayOfEnumsWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request var localVarResponse = this.Client.Get>("/fake/array-of-enums", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetArrayOfEnums", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1532,23 +1615,30 @@ public Org.OpenAPITools.Client.ApiResponse> GetArrayOfEnumsWithH "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync>("/fake/array-of-enums", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetArrayOfEnums", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1575,7 +1665,9 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithFileSchemaWithHtt { // verify the required parameter 'fileSchemaTestClass' is set if (fileSchemaTestClass == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'fileSchemaTestClass' when calling FakeApi->TestBodyWithFileSchema"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1588,21 +1680,29 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithFileSchemaWithHtt }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = fileSchemaTestClass; // make the HTTP request var localVarResponse = this.Client.Put("/fake/body-with-file-schema", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestBodyWithFileSchema", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1631,7 +1731,9 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithFileSchemaWithHtt { // verify the required parameter 'fileSchemaTestClass' is set if (fileSchemaTestClass == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'fileSchemaTestClass' when calling FakeApi->TestBodyWithFileSchema"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1644,24 +1746,31 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithFileSchemaWithHtt string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = fileSchemaTestClass; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/body-with-file-schema", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestBodyWithFileSchema", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1690,11 +1799,15 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithQueryParamsWithHt { // verify the required parameter 'query' is set if (query == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'query' when calling FakeApi->TestBodyWithQueryParams"); + } // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling FakeApi->TestBodyWithQueryParams"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1707,10 +1820,16 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithQueryParamsWithHt }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "query", query)); localVarRequestOptions.Data = user; @@ -1718,11 +1837,13 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithQueryParamsWithHt // make the HTTP request var localVarResponse = this.Client.Put("/fake/body-with-query-params", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestBodyWithQueryParams", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1753,11 +1874,15 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithQueryParamsWithHt { // verify the required parameter 'query' is set if (query == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'query' when calling FakeApi->TestBodyWithQueryParams"); + } // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling FakeApi->TestBodyWithQueryParams"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1770,25 +1895,32 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithQueryParamsWithHt string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "query", query)); localVarRequestOptions.Data = user; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/body-with-query-params", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestBodyWithQueryParams", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1816,7 +1948,9 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI { // verify the required parameter 'modelClient' is set if (modelClient == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling FakeApi->TestClientModel"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1830,21 +1964,29 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = modelClient; // make the HTTP request var localVarResponse = this.Client.Patch("/fake", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestClientModel", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1874,7 +2016,9 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI { // verify the required parameter 'modelClient' is set if (modelClient == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling FakeApi->TestClientModel"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1888,24 +2032,31 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = modelClient; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PatchAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestClientModel", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1958,11 +2109,15 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI { // verify the required parameter 'patternWithoutDelimiter' is set if (patternWithoutDelimiter == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'patternWithoutDelimiter' when calling FakeApi->TestEndpointParameters"); + } // verify the required parameter '_byte' is set if (_byte == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter '_byte' when calling FakeApi->TestEndpointParameters"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1975,10 +2130,16 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } if (integer != null) { @@ -2034,11 +2195,13 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI // make the HTTP request var localVarResponse = this.Client.Post("/fake", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestEndpointParameters", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2093,11 +2256,15 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI { // verify the required parameter 'patternWithoutDelimiter' is set if (patternWithoutDelimiter == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'patternWithoutDelimiter' when calling FakeApi->TestEndpointParameters"); + } // verify the required parameter '_byte' is set if (_byte == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter '_byte' when calling FakeApi->TestEndpointParameters"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2110,12 +2277,17 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } if (integer != null) { @@ -2170,13 +2342,15 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestEndpointParameters", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2226,10 +2400,16 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } if (enumQueryStringArray != null) { @@ -2267,11 +2447,13 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI // make the HTTP request var localVarResponse = this.Client.Get("/fake", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestEnumParameters", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2323,12 +2505,17 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } if (enumQueryStringArray != null) { @@ -2365,13 +2552,15 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestEnumParameters", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2416,10 +2605,16 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group)); @@ -2446,11 +2641,13 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI // make the HTTP request var localVarResponse = this.Client.Delete("/fake", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestGroupParameters", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2497,12 +2694,17 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group)); @@ -2528,13 +2730,15 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestGroupParameters", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2561,7 +2765,9 @@ public Org.OpenAPITools.Client.ApiResponse TestInlineAdditionalPropertie { // verify the required parameter 'requestBody' is set if (requestBody == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestInlineAdditionalProperties"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2574,21 +2780,29 @@ public Org.OpenAPITools.Client.ApiResponse TestInlineAdditionalPropertie }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = requestBody; // make the HTTP request var localVarResponse = this.Client.Post("/fake/inline-additionalProperties", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestInlineAdditionalProperties", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2617,7 +2831,9 @@ public Org.OpenAPITools.Client.ApiResponse TestInlineAdditionalPropertie { // verify the required parameter 'requestBody' is set if (requestBody == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestInlineAdditionalProperties"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2630,24 +2846,31 @@ public Org.OpenAPITools.Client.ApiResponse TestInlineAdditionalPropertie string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = requestBody; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/inline-additionalProperties", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestInlineAdditionalProperties", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2676,11 +2899,15 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo( { // verify the required parameter 'param' is set if (param == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestJsonFormData"); + } // verify the required parameter 'param2' is set if (param2 == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'param2' when calling FakeApi->TestJsonFormData"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2693,10 +2920,16 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo( }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.FormParameters.Add("param", Org.OpenAPITools.Client.ClientUtils.ParameterToString(param)); // form parameter localVarRequestOptions.FormParameters.Add("param2", Org.OpenAPITools.Client.ClientUtils.ParameterToString(param2)); // form parameter @@ -2704,11 +2937,13 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo( // make the HTTP request var localVarResponse = this.Client.Get("/fake/jsonFormData", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestJsonFormData", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2739,11 +2974,15 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo( { // verify the required parameter 'param' is set if (param == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestJsonFormData"); + } // verify the required parameter 'param2' is set if (param2 == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'param2' when calling FakeApi->TestJsonFormData"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2756,25 +2995,32 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo( string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.FormParameters.Add("param", Org.OpenAPITools.Client.ClientUtils.ParameterToString(param)); // form parameter localVarRequestOptions.FormParameters.Add("param2", Org.OpenAPITools.Client.ClientUtils.ParameterToString(param2)); // form parameter // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/fake/jsonFormData", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestJsonFormData", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2809,23 +3055,33 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF { // verify the required parameter 'pipe' is set if (pipe == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pipe' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'ioutil' is set if (ioutil == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'ioutil' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'http' is set if (http == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'http' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'url' is set if (url == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'url' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'context' is set if (context == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'context' when calling FakeApi->TestQueryParameterCollectionFormat"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2837,10 +3093,16 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "pipe", pipe)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil)); @@ -2851,11 +3113,13 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF // make the HTTP request var localVarResponse = this.Client.Put("/fake/test-query-parameters", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestQueryParameterCollectionFormat", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2892,23 +3156,33 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF { // verify the required parameter 'pipe' is set if (pipe == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pipe' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'ioutil' is set if (ioutil == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'ioutil' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'http' is set if (http == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'http' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'url' is set if (url == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'url' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'context' is set if (context == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'context' when calling FakeApi->TestQueryParameterCollectionFormat"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2920,12 +3194,17 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "pipe", pipe)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil)); @@ -2935,13 +3214,15 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/test-query-parameters", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestQueryParameterCollectionFormat", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index d4fbb5868adb..c2852b36a44b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -221,7 +221,9 @@ public Org.OpenAPITools.Client.ApiResponse TestClassnameWithHttpInf { // verify the required parameter 'modelClient' is set if (modelClient == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling FakeClassnameTags123Api->TestClassname"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -235,10 +237,16 @@ public Org.OpenAPITools.Client.ApiResponse TestClassnameWithHttpInf }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = modelClient; @@ -250,11 +258,13 @@ public Org.OpenAPITools.Client.ApiResponse TestClassnameWithHttpInf // make the HTTP request var localVarResponse = this.Client.Patch("/fake_classname_test", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestClassname", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -284,7 +294,9 @@ public Org.OpenAPITools.Client.ApiResponse TestClassnameWithHttpInf { // verify the required parameter 'modelClient' is set if (modelClient == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling FakeClassnameTags123Api->TestClassname"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -298,12 +310,17 @@ public Org.OpenAPITools.Client.ApiResponse TestClassnameWithHttpInf "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = modelClient; @@ -314,13 +331,15 @@ public Org.OpenAPITools.Client.ApiResponse TestClassnameWithHttpInf } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PatchAsync("/fake_classname_test", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestClassname", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs index d73282dfca5f..39d2e425e630 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs @@ -586,7 +586,9 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) { // verify the required parameter 'pet' is set if (pet == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->AddPet"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -600,10 +602,16 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = pet; @@ -632,11 +640,13 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) // make the HTTP request var localVarResponse = this.Client.Post("/pet", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("AddPet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -665,7 +675,9 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) { // verify the required parameter 'pet' is set if (pet == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->AddPet"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -679,12 +691,17 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = pet; @@ -712,13 +729,15 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/pet", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("AddPet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -755,10 +774,16 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (apiKey != null) @@ -775,11 +800,13 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) // make the HTTP request var localVarResponse = this.Client.Delete("/pet/{petId}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeletePet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -818,12 +845,17 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (apiKey != null) @@ -839,13 +871,15 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeletePet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -873,7 +907,9 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn { // verify the required parameter 'status' is set if (status == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'status' when calling PetApi->FindPetsByStatus"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -887,10 +923,16 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "status", status)); @@ -919,11 +961,13 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn // make the HTTP request var localVarResponse = this.Client.Get>("/pet/findByStatus", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FindPetsByStatus", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -953,7 +997,9 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn { // verify the required parameter 'status' is set if (status == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'status' when calling PetApi->FindPetsByStatus"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -967,12 +1013,17 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "status", status)); @@ -1000,13 +1051,15 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync>("/pet/findByStatus", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FindPetsByStatus", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1036,7 +1089,9 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo { // verify the required parameter 'tags' is set if (tags == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'tags' when calling PetApi->FindPetsByTags"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1050,10 +1105,16 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "tags", tags)); @@ -1082,11 +1143,13 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo // make the HTTP request var localVarResponse = this.Client.Get>("/pet/findByTags", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FindPetsByTags", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1118,7 +1181,9 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo { // verify the required parameter 'tags' is set if (tags == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'tags' when calling PetApi->FindPetsByTags"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1132,12 +1197,17 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "tags", tags)); @@ -1165,13 +1235,15 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync>("/pet/findByTags", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FindPetsByTags", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1209,10 +1281,16 @@ public Org.OpenAPITools.Client.ApiResponse GetPetByIdWithHttpInfo(long petI }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter @@ -1224,11 +1302,13 @@ public Org.OpenAPITools.Client.ApiResponse GetPetByIdWithHttpInfo(long petI // make the HTTP request var localVarResponse = this.Client.Get("/pet/{petId}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetPetById", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1268,12 +1348,17 @@ public Org.OpenAPITools.Client.ApiResponse GetPetByIdWithHttpInfo(long petI "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter @@ -1284,13 +1369,15 @@ public Org.OpenAPITools.Client.ApiResponse GetPetByIdWithHttpInfo(long petI } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetPetById", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1317,7 +1404,9 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet { // verify the required parameter 'pet' is set if (pet == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->UpdatePet"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1331,10 +1420,16 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = pet; @@ -1363,11 +1458,13 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet // make the HTTP request var localVarResponse = this.Client.Put("/pet", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdatePet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1396,7 +1493,9 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet { // verify the required parameter 'pet' is set if (pet == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->UpdatePet"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1410,12 +1509,17 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = pet; @@ -1443,13 +1547,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/pet", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdatePet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1489,10 +1595,16 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (name != null) @@ -1513,11 +1625,13 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet // make the HTTP request var localVarResponse = this.Client.Post("/pet/{petId}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdatePetWithForm", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1559,12 +1673,17 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (name != null) @@ -1584,13 +1703,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdatePetWithForm", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1632,10 +1753,16 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (additionalMetadata != null) @@ -1656,11 +1783,13 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet // make the HTTP request var localVarResponse = this.Client.Post("/pet/{petId}/uploadImage", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UploadFile", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1704,12 +1833,17 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (additionalMetadata != null) @@ -1729,13 +1863,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/pet/{petId}/uploadImage", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UploadFile", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1767,7 +1903,9 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet { // verify the required parameter 'requiredFile' is set if (requiredFile == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredFile' when calling PetApi->UploadFileWithRequiredFile"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1781,10 +1919,16 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (additionalMetadata != null) @@ -1802,11 +1946,13 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet // make the HTTP request var localVarResponse = this.Client.Post("/fake/{petId}/uploadImageWithRequiredFile", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UploadFileWithRequiredFile", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1840,7 +1986,9 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet { // verify the required parameter 'requiredFile' is set if (requiredFile == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredFile' when calling PetApi->UploadFileWithRequiredFile"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1854,12 +2002,17 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (additionalMetadata != null) @@ -1876,13 +2029,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/{petId}/uploadImageWithRequiredFile", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UploadFileWithRequiredFile", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs index ad7387db7057..7cda385b3b40 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs @@ -345,7 +345,9 @@ public Org.OpenAPITools.Client.ApiResponse DeleteOrderWithHttpInfo(strin { // verify the required parameter 'orderId' is set if (orderId == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -357,21 +359,29 @@ public Org.OpenAPITools.Client.ApiResponse DeleteOrderWithHttpInfo(strin }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter // make the HTTP request var localVarResponse = this.Client.Delete("/store/order/{order_id}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeleteOrder", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -400,7 +410,9 @@ public Org.OpenAPITools.Client.ApiResponse DeleteOrderWithHttpInfo(strin { // verify the required parameter 'orderId' is set if (orderId == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -412,24 +424,31 @@ public Org.OpenAPITools.Client.ApiResponse DeleteOrderWithHttpInfo(strin string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/store/order/{order_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeleteOrder", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -464,10 +483,16 @@ public Org.OpenAPITools.Client.ApiResponse> GetInventory }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // authentication (api_key) required @@ -478,11 +503,13 @@ public Org.OpenAPITools.Client.ApiResponse> GetInventory // make the HTTP request var localVarResponse = this.Client.Get>("/store/inventory", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetInventory", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -519,12 +546,17 @@ public Org.OpenAPITools.Client.ApiResponse> GetInventory "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // authentication (api_key) required @@ -534,13 +566,15 @@ public Org.OpenAPITools.Client.ApiResponse> GetInventory } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync>("/store/inventory", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetInventory", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -578,21 +612,29 @@ public Org.OpenAPITools.Client.ApiResponse GetOrderByIdWithHttpInfo(long }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter // make the HTTP request var localVarResponse = this.Client.Get("/store/order/{order_id}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetOrderById", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -632,24 +674,31 @@ public Org.OpenAPITools.Client.ApiResponse GetOrderByIdWithHttpInfo(long "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/store/order/{order_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetOrderById", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -677,7 +726,9 @@ public Org.OpenAPITools.Client.ApiResponse PlaceOrderWithHttpInfo(Order o { // verify the required parameter 'order' is set if (order == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'order' when calling StoreApi->PlaceOrder"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -692,21 +743,29 @@ public Org.OpenAPITools.Client.ApiResponse PlaceOrderWithHttpInfo(Order o }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = order; // make the HTTP request var localVarResponse = this.Client.Post("/store/order", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("PlaceOrder", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -736,7 +795,9 @@ public Org.OpenAPITools.Client.ApiResponse PlaceOrderWithHttpInfo(Order o { // verify the required parameter 'order' is set if (order == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'order' when calling StoreApi->PlaceOrder"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -751,24 +812,31 @@ public Org.OpenAPITools.Client.ApiResponse PlaceOrderWithHttpInfo(Order o "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = order; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/store/order", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("PlaceOrder", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs index a2f2598c8acd..a1716303f6f3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs @@ -517,7 +517,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUserWithHttpInfo(User u { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -530,21 +532,29 @@ public Org.OpenAPITools.Client.ApiResponse CreateUserWithHttpInfo(User u }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; // make the HTTP request var localVarResponse = this.Client.Post("/user", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -573,7 +583,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUserWithHttpInfo(User u { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -586,24 +598,31 @@ public Org.OpenAPITools.Client.ApiResponse CreateUserWithHttpInfo(User u string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/user", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -630,7 +649,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithArrayInputWith { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithArrayInput"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -643,21 +664,29 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithArrayInputWith }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; // make the HTTP request var localVarResponse = this.Client.Post("/user/createWithArray", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUsersWithArrayInput", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -686,7 +715,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithArrayInputWith { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithArrayInput"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -699,24 +730,31 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithArrayInputWith string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/user/createWithArray", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUsersWithArrayInput", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -743,7 +781,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithListInputWithH { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithListInput"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -756,21 +796,29 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithListInputWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; // make the HTTP request var localVarResponse = this.Client.Post("/user/createWithList", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUsersWithListInput", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -799,7 +847,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithListInputWithH { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithListInput"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -812,24 +862,31 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithListInputWithH string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/user/createWithList", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUsersWithListInput", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -856,7 +913,9 @@ public Org.OpenAPITools.Client.ApiResponse DeleteUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->DeleteUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -868,21 +927,29 @@ public Org.OpenAPITools.Client.ApiResponse DeleteUserWithHttpInfo(string }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter // make the HTTP request var localVarResponse = this.Client.Delete("/user/{username}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeleteUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -911,7 +978,9 @@ public Org.OpenAPITools.Client.ApiResponse DeleteUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->DeleteUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -923,24 +992,31 @@ public Org.OpenAPITools.Client.ApiResponse DeleteUserWithHttpInfo(string string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeleteUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -968,7 +1044,9 @@ public Org.OpenAPITools.Client.ApiResponse GetUserByNameWithHttpInfo(strin { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->GetUserByName"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -982,21 +1060,29 @@ public Org.OpenAPITools.Client.ApiResponse GetUserByNameWithHttpInfo(strin }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter // make the HTTP request var localVarResponse = this.Client.Get("/user/{username}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetUserByName", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1026,7 +1112,9 @@ public Org.OpenAPITools.Client.ApiResponse GetUserByNameWithHttpInfo(strin { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->GetUserByName"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1040,24 +1128,31 @@ public Org.OpenAPITools.Client.ApiResponse GetUserByNameWithHttpInfo(strin "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetUserByName", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1087,11 +1182,15 @@ public Org.OpenAPITools.Client.ApiResponse LoginUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->LoginUser"); + } // verify the required parameter 'password' is set if (password == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'password' when calling UserApi->LoginUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1105,10 +1204,16 @@ public Org.OpenAPITools.Client.ApiResponse LoginUserWithHttpInfo(string }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "username", username)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "password", password)); @@ -1116,11 +1221,13 @@ public Org.OpenAPITools.Client.ApiResponse LoginUserWithHttpInfo(string // make the HTTP request var localVarResponse = this.Client.Get("/user/login", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("LoginUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1152,11 +1259,15 @@ public Org.OpenAPITools.Client.ApiResponse LoginUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->LoginUser"); + } // verify the required parameter 'password' is set if (password == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'password' when calling UserApi->LoginUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1170,25 +1281,32 @@ public Org.OpenAPITools.Client.ApiResponse LoginUserWithHttpInfo(string "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "username", username)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "password", password)); // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/user/login", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("LoginUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1221,20 +1339,28 @@ public Org.OpenAPITools.Client.ApiResponse LogoutUserWithHttpInfo() }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request var localVarResponse = this.Client.Get("/user/logout", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("LogoutUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1269,23 +1395,30 @@ public Org.OpenAPITools.Client.ApiResponse LogoutUserWithHttpInfo() string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/user/logout", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("LogoutUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1314,11 +1447,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); + } // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->UpdateUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1331,10 +1468,16 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo(string }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter localVarRequestOptions.Data = user; @@ -1342,11 +1485,13 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo(string // make the HTTP request var localVarResponse = this.Client.Put("/user/{username}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdateUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1377,11 +1522,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); + } // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->UpdateUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1394,25 +1543,32 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo(string string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter localVarRequestOptions.Data = user; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdateUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index 9d6d049ded8a..b3ddad35a07d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -117,7 +117,7 @@ public partial class AdditionalPropertiesClass : IEquatableString presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class AdditionalPropertiesClass {\n"); sb.Append(" MapProperty: ").Append(MapProperty).Append("\n"); sb.Append(" MapOfMapProperty: ").Append(MapOfMapProperty).Append("\n"); @@ -171,23 +171,41 @@ public override int GetHashCode() { int hashCode = 41; if (this.MapProperty != null) - hashCode = hashCode * 59 + this.MapProperty.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapProperty.GetHashCode(); + } if (this.MapOfMapProperty != null) - hashCode = hashCode * 59 + this.MapOfMapProperty.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapOfMapProperty.GetHashCode(); + } if (this.Anytype1 != null) - hashCode = hashCode * 59 + this.Anytype1.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Anytype1.GetHashCode(); + } if (this.MapWithUndeclaredPropertiesAnytype1 != null) - hashCode = hashCode * 59 + this.MapWithUndeclaredPropertiesAnytype1.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesAnytype1.GetHashCode(); + } if (this.MapWithUndeclaredPropertiesAnytype2 != null) - hashCode = hashCode * 59 + this.MapWithUndeclaredPropertiesAnytype2.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesAnytype2.GetHashCode(); + } if (this.MapWithUndeclaredPropertiesAnytype3 != null) - hashCode = hashCode * 59 + this.MapWithUndeclaredPropertiesAnytype3.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesAnytype3.GetHashCode(); + } if (this.EmptyMap != null) - hashCode = hashCode * 59 + this.EmptyMap.GetHashCode(); + { + hashCode = (hashCode * 59) + this.EmptyMap.GetHashCode(); + } if (this.MapWithUndeclaredPropertiesString != null) - hashCode = hashCode * 59 + this.MapWithUndeclaredPropertiesString.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesString.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs index fd7599d09ca5..e8ea00bb46a8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs @@ -85,7 +85,7 @@ protected Animal() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Animal {\n"); sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" Color: ").Append(Color).Append("\n"); @@ -133,11 +133,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.ClassName != null) - hashCode = hashCode * 59 + this.ClassName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } if (this.Color != null) - hashCode = hashCode * 59 + this.Color.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Color.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ApiResponse.cs index ff7d757270f2..79873f4ddfed 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -76,7 +76,7 @@ public partial class ApiResponse : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ApiResponse {\n"); sb.Append(" Code: ").Append(Code).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); @@ -124,13 +124,19 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Code.GetHashCode(); + hashCode = (hashCode * 59) + this.Code.GetHashCode(); if (this.Type != null) - hashCode = hashCode * 59 + this.Type.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + } if (this.Message != null) - hashCode = hashCode * 59 + this.Message.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Message.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Apple.cs index a702a9ca79f1..8b1f87d1aa9a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Apple.cs @@ -68,7 +68,7 @@ public partial class Apple : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Apple {\n"); sb.Append(" Cultivar: ").Append(Cultivar).Append("\n"); sb.Append(" Origin: ").Append(Origin).Append("\n"); @@ -116,11 +116,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.Cultivar != null) - hashCode = hashCode * 59 + this.Cultivar.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Cultivar.GetHashCode(); + } if (this.Origin != null) - hashCode = hashCode * 59 + this.Origin.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Origin.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/AppleReq.cs index 91a8d5c3aeb9..1d6d42dc9b3a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/AppleReq.cs @@ -70,7 +70,7 @@ protected AppleReq() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class AppleReq {\n"); sb.Append(" Cultivar: ").Append(Cultivar).Append("\n"); sb.Append(" Mealy: ").Append(Mealy).Append("\n"); @@ -117,8 +117,10 @@ public override int GetHashCode() { int hashCode = 41; if (this.Cultivar != null) - hashCode = hashCode * 59 + this.Cultivar.GetHashCode(); - hashCode = hashCode * 59 + this.Mealy.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Cultivar.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Mealy.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index e96382b222d1..30bf57ef0f52 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -60,7 +60,7 @@ public partial class ArrayOfArrayOfNumberOnly : IEquatableString presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ArrayOfArrayOfNumberOnly {\n"); sb.Append(" ArrayArrayNumber: ").Append(ArrayArrayNumber).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -107,9 +107,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ArrayArrayNumber != null) - hashCode = hashCode * 59 + this.ArrayArrayNumber.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayArrayNumber.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index 60c5a8576561..8a215aad133b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -60,7 +60,7 @@ public partial class ArrayOfNumberOnly : IEquatable, IValidat /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ArrayOfNumberOnly {\n"); sb.Append(" ArrayNumber: ").Append(ArrayNumber).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -107,9 +107,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ArrayNumber != null) - hashCode = hashCode * 59 + this.ArrayNumber.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayNumber.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayTest.cs index 290926768d2f..1a879a1d9ca2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -76,7 +76,7 @@ public partial class ArrayTest : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ArrayTest {\n"); sb.Append(" ArrayOfString: ").Append(ArrayOfString).Append("\n"); sb.Append(" ArrayArrayOfInteger: ").Append(ArrayArrayOfInteger).Append("\n"); @@ -125,13 +125,21 @@ public override int GetHashCode() { int hashCode = 41; if (this.ArrayOfString != null) - hashCode = hashCode * 59 + this.ArrayOfString.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayOfString.GetHashCode(); + } if (this.ArrayArrayOfInteger != null) - hashCode = hashCode * 59 + this.ArrayArrayOfInteger.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayArrayOfInteger.GetHashCode(); + } if (this.ArrayArrayOfModel != null) - hashCode = hashCode * 59 + this.ArrayArrayOfModel.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayArrayOfModel.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Banana.cs index dc0e10d46867..97939597ede8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Banana.cs @@ -60,7 +60,7 @@ public partial class Banana : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Banana {\n"); sb.Append(" LengthCm: ").Append(LengthCm).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -106,9 +106,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.LengthCm.GetHashCode(); + hashCode = (hashCode * 59) + this.LengthCm.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/BananaReq.cs index ea57bb4f0cce..fdd36929d13c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/BananaReq.cs @@ -66,7 +66,7 @@ protected BananaReq() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class BananaReq {\n"); sb.Append(" LengthCm: ").Append(LengthCm).Append("\n"); sb.Append(" Sweet: ").Append(Sweet).Append("\n"); @@ -112,8 +112,8 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.LengthCm.GetHashCode(); - hashCode = hashCode * 59 + this.Sweet.GetHashCode(); + hashCode = (hashCode * 59) + this.LengthCm.GetHashCode(); + hashCode = (hashCode * 59) + this.Sweet.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/BasquePig.cs index f9074c95c04c..ea4ff737c89a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/BasquePig.cs @@ -72,7 +72,7 @@ protected BasquePig() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class BasquePig {\n"); sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -119,9 +119,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ClassName != null) - hashCode = hashCode * 59 + this.ClassName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Capitalization.cs index 3a989f765f9e..be68a50a116a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Capitalization.cs @@ -101,7 +101,7 @@ public partial class Capitalization : IEquatable, IValidatableOb /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Capitalization {\n"); sb.Append(" SmallCamel: ").Append(SmallCamel).Append("\n"); sb.Append(" CapitalCamel: ").Append(CapitalCamel).Append("\n"); @@ -153,19 +153,33 @@ public override int GetHashCode() { int hashCode = 41; if (this.SmallCamel != null) - hashCode = hashCode * 59 + this.SmallCamel.GetHashCode(); + { + hashCode = (hashCode * 59) + this.SmallCamel.GetHashCode(); + } if (this.CapitalCamel != null) - hashCode = hashCode * 59 + this.CapitalCamel.GetHashCode(); + { + hashCode = (hashCode * 59) + this.CapitalCamel.GetHashCode(); + } if (this.SmallSnake != null) - hashCode = hashCode * 59 + this.SmallSnake.GetHashCode(); + { + hashCode = (hashCode * 59) + this.SmallSnake.GetHashCode(); + } if (this.CapitalSnake != null) - hashCode = hashCode * 59 + this.CapitalSnake.GetHashCode(); + { + hashCode = (hashCode * 59) + this.CapitalSnake.GetHashCode(); + } if (this.SCAETHFlowPoints != null) - hashCode = hashCode * 59 + this.SCAETHFlowPoints.GetHashCode(); + { + hashCode = (hashCode * 59) + this.SCAETHFlowPoints.GetHashCode(); + } if (this.ATT_NAME != null) - hashCode = hashCode * 59 + this.ATT_NAME.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ATT_NAME.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs index be96bae85eb1..2bc55707da95 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs @@ -72,7 +72,7 @@ protected Cat() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Cat {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" Declawed: ").Append(Declawed).Append("\n"); @@ -119,9 +119,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = base.GetHashCode(); - hashCode = hashCode * 59 + this.Declawed.GetHashCode(); + hashCode = (hashCode * 59) + this.Declawed.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } @@ -143,7 +145,10 @@ public override int GetHashCode() /// Validation Result protected IEnumerable BaseValidate(ValidationContext validationContext) { - foreach(var x in BaseValidate(validationContext)) yield return x; + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } yield break; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/CatAllOf.cs index 8cb5bfc3ef64..3a960e9925e3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/CatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -60,7 +60,7 @@ public partial class CatAllOf : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class CatAllOf {\n"); sb.Append(" Declawed: ").Append(Declawed).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -106,9 +106,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Declawed.GetHashCode(); + hashCode = (hashCode * 59) + this.Declawed.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Category.cs index 6b0b74ca5219..0cc23f5f6c23 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Category.cs @@ -80,7 +80,7 @@ protected Category() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Category {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); @@ -127,11 +127,15 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ChildCat.cs index 90545c4d99af..7a15a5297df2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ChildCat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ChildCat.cs @@ -92,7 +92,7 @@ protected ChildCat() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ChildCat {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); @@ -141,10 +141,14 @@ public override int GetHashCode() { int hashCode = base.GetHashCode(); if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); - hashCode = hashCode * 59 + this.PetType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + hashCode = (hashCode * 59) + this.PetType.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } @@ -166,7 +170,10 @@ public override int GetHashCode() /// Validation Result protected IEnumerable BaseValidate(ValidationContext validationContext) { - foreach(var x in BaseValidate(validationContext)) yield return x; + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } yield break; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ChildCatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ChildCatAllOf.cs index b5d479e17428..a353ad7ffd71 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ChildCatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ChildCatAllOf.cs @@ -82,7 +82,7 @@ public enum PetTypeEnum /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ChildCatAllOf {\n"); sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" PetType: ").Append(PetType).Append("\n"); @@ -130,10 +130,14 @@ public override int GetHashCode() { int hashCode = 41; if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); - hashCode = hashCode * 59 + this.PetType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + hashCode = (hashCode * 59) + this.PetType.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ClassModel.cs index 80c863484cc7..7177e9bf0b6c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ClassModel.cs @@ -60,7 +60,7 @@ public partial class ClassModel : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ClassModel {\n"); sb.Append(" Class: ").Append(Class).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -107,9 +107,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.Class != null) - hashCode = hashCode * 59 + this.Class.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Class.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index f3afcc2a7341..807f0eb26bf8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -84,7 +84,7 @@ protected ComplexQuadrilateral() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ComplexQuadrilateral {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); @@ -132,11 +132,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } if (this.QuadrilateralType != null) - hashCode = hashCode * 59 + this.QuadrilateralType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.QuadrilateralType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/DanishPig.cs index 59afe7580d04..a27b1db39297 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/DanishPig.cs @@ -72,7 +72,7 @@ protected DanishPig() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class DanishPig {\n"); sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -119,9 +119,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ClassName != null) - hashCode = hashCode * 59 + this.ClassName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/DeprecatedObject.cs index bd3d97b081db..1928b236bf66 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/DeprecatedObject.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -60,7 +60,7 @@ public partial class DeprecatedObject : IEquatable, IValidatab /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class DeprecatedObject {\n"); sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -107,9 +107,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Dog.cs index f20af26112cb..9cd520deaf82 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Dog.cs @@ -72,7 +72,7 @@ protected Dog() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Dog {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" Breed: ").Append(Breed).Append("\n"); @@ -120,9 +120,13 @@ public override int GetHashCode() { int hashCode = base.GetHashCode(); if (this.Breed != null) - hashCode = hashCode * 59 + this.Breed.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Breed.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } @@ -144,7 +148,10 @@ public override int GetHashCode() /// Validation Result protected IEnumerable BaseValidate(ValidationContext validationContext) { - foreach(var x in BaseValidate(validationContext)) yield return x; + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } yield break; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/DogAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/DogAllOf.cs index 3588b02b020d..7b026acbf1e5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/DogAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/DogAllOf.cs @@ -60,7 +60,7 @@ public partial class DogAllOf : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class DogAllOf {\n"); sb.Append(" Breed: ").Append(Breed).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -107,9 +107,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.Breed != null) - hashCode = hashCode * 59 + this.Breed.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Breed.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Drawing.cs index f7e6702be596..d8cd2a70ef61 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Drawing.cs @@ -77,7 +77,7 @@ public partial class Drawing : Dictionary, IEquatable, I /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Drawing {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" MainShape: ").Append(MainShape).Append("\n"); @@ -127,13 +127,21 @@ public override int GetHashCode() { int hashCode = base.GetHashCode(); if (this.MainShape != null) - hashCode = hashCode * 59 + this.MainShape.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MainShape.GetHashCode(); + } if (this.ShapeOrNull != null) - hashCode = hashCode * 59 + this.ShapeOrNull.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeOrNull.GetHashCode(); + } if (this.NullableShape != null) - hashCode = hashCode * 59 + this.NullableShape.GetHashCode(); + { + hashCode = (hashCode * 59) + this.NullableShape.GetHashCode(); + } if (this.Shapes != null) - hashCode = hashCode * 59 + this.Shapes.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Shapes.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/EnumArrays.cs index f4138fce032d..6d7830c0e8ba 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -109,7 +109,7 @@ public enum ArrayEnumEnum /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class EnumArrays {\n"); sb.Append(" JustSymbol: ").Append(JustSymbol).Append("\n"); sb.Append(" ArrayEnum: ").Append(ArrayEnum).Append("\n"); @@ -156,10 +156,12 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.JustSymbol.GetHashCode(); - hashCode = hashCode * 59 + this.ArrayEnum.GetHashCode(); + hashCode = (hashCode * 59) + this.JustSymbol.GetHashCode(); + hashCode = (hashCode * 59) + this.ArrayEnum.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/EnumTest.cs index 178d540314d0..6f3d2272c5c3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/EnumTest.cs @@ -238,7 +238,7 @@ protected EnumTest() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class EnumTest {\n"); sb.Append(" EnumString: ").Append(EnumString).Append("\n"); sb.Append(" EnumStringRequired: ").Append(EnumStringRequired).Append("\n"); @@ -292,17 +292,19 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.EnumString.GetHashCode(); - hashCode = hashCode * 59 + this.EnumStringRequired.GetHashCode(); - hashCode = hashCode * 59 + this.EnumInteger.GetHashCode(); - hashCode = hashCode * 59 + this.EnumIntegerOnly.GetHashCode(); - hashCode = hashCode * 59 + this.EnumNumber.GetHashCode(); - hashCode = hashCode * 59 + this.OuterEnum.GetHashCode(); - hashCode = hashCode * 59 + this.OuterEnumInteger.GetHashCode(); - hashCode = hashCode * 59 + this.OuterEnumDefaultValue.GetHashCode(); - hashCode = hashCode * 59 + this.OuterEnumIntegerDefaultValue.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumString.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumStringRequired.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumInteger.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumIntegerOnly.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumNumber.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnum.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnumInteger.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnumDefaultValue.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnumIntegerDefaultValue.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index 2e8e4d0c17d9..a931c0d6327a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -84,7 +84,7 @@ protected EquilateralTriangle() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class EquilateralTriangle {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); @@ -132,11 +132,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } if (this.TriangleType != null) - hashCode = hashCode * 59 + this.TriangleType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/File.cs index 1e859462b140..e77d15e06bce 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/File.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/File.cs @@ -61,7 +61,7 @@ public partial class File : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class File {\n"); sb.Append(" SourceURI: ").Append(SourceURI).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -108,9 +108,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.SourceURI != null) - hashCode = hashCode * 59 + this.SourceURI.GetHashCode(); + { + hashCode = (hashCode * 59) + this.SourceURI.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index b996e287ea70..6808978c49f8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -68,7 +68,7 @@ public partial class FileSchemaTestClass : IEquatable, IVal /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class FileSchemaTestClass {\n"); sb.Append(" File: ").Append(File).Append("\n"); sb.Append(" Files: ").Append(Files).Append("\n"); @@ -116,11 +116,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.File != null) - hashCode = hashCode * 59 + this.File.GetHashCode(); + { + hashCode = (hashCode * 59) + this.File.GetHashCode(); + } if (this.Files != null) - hashCode = hashCode * 59 + this.Files.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Files.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Foo.cs index a5aabbae4f3d..e64aac7b6317 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Foo.cs @@ -61,7 +61,7 @@ public Foo(string bar = "bar") /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Foo {\n"); sb.Append(" Bar: ").Append(Bar).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -108,9 +108,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.Bar != null) - hashCode = hashCode * 59 + this.Bar.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Bar.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs index ef60b6bb9fea..eb38d586bbb7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs @@ -199,7 +199,7 @@ protected FormatTest() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class FormatTest {\n"); sb.Append(" Integer: ").Append(Integer).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); @@ -260,33 +260,53 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Integer.GetHashCode(); - hashCode = hashCode * 59 + this.Int32.GetHashCode(); - hashCode = hashCode * 59 + this.Int64.GetHashCode(); - hashCode = hashCode * 59 + this.Number.GetHashCode(); - hashCode = hashCode * 59 + this.Float.GetHashCode(); - hashCode = hashCode * 59 + this.Double.GetHashCode(); - hashCode = hashCode * 59 + this.Decimal.GetHashCode(); + hashCode = (hashCode * 59) + this.Integer.GetHashCode(); + hashCode = (hashCode * 59) + this.Int32.GetHashCode(); + hashCode = (hashCode * 59) + this.Int64.GetHashCode(); + hashCode = (hashCode * 59) + this.Number.GetHashCode(); + hashCode = (hashCode * 59) + this.Float.GetHashCode(); + hashCode = (hashCode * 59) + this.Double.GetHashCode(); + hashCode = (hashCode * 59) + this.Decimal.GetHashCode(); if (this.String != null) - hashCode = hashCode * 59 + this.String.GetHashCode(); + { + hashCode = (hashCode * 59) + this.String.GetHashCode(); + } if (this.Byte != null) - hashCode = hashCode * 59 + this.Byte.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Byte.GetHashCode(); + } if (this.Binary != null) - hashCode = hashCode * 59 + this.Binary.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Binary.GetHashCode(); + } if (this.Date != null) - hashCode = hashCode * 59 + this.Date.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Date.GetHashCode(); + } if (this.DateTime != null) - hashCode = hashCode * 59 + this.DateTime.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DateTime.GetHashCode(); + } if (this.Uuid != null) - hashCode = hashCode * 59 + this.Uuid.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); + } if (this.Password != null) - hashCode = hashCode * 59 + this.Password.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Password.GetHashCode(); + } if (this.PatternWithDigits != null) - hashCode = hashCode * 59 + this.PatternWithDigits.GetHashCode(); + { + hashCode = (hashCode * 59) + this.PatternWithDigits.GetHashCode(); + } if (this.PatternWithDigitsAndDelimiter != null) - hashCode = hashCode * 59 + this.PatternWithDigitsAndDelimiter.GetHashCode(); + { + hashCode = (hashCode * 59) + this.PatternWithDigitsAndDelimiter.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } @@ -299,61 +319,61 @@ public override int GetHashCode() public IEnumerable Validate(ValidationContext validationContext) { // Integer (int) maximum - if(this.Integer > (int)100) + if (this.Integer > (int)100) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); } // Integer (int) minimum - if(this.Integer < (int)10) + if (this.Integer < (int)10) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); } // Int32 (int) maximum - if(this.Int32 > (int)200) + if (this.Int32 > (int)200) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); } // Int32 (int) minimum - if(this.Int32 < (int)20) + if (this.Int32 < (int)20) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } // Number (decimal) maximum - if(this.Number > (decimal)543.2) + if (this.Number > (decimal)543.2) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); } // Number (decimal) minimum - if(this.Number < (decimal)32.1) + if (this.Number < (decimal)32.1) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); } // Float (float) maximum - if(this.Float > (float)987.6) + if (this.Float > (float)987.6) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); } // Float (float) minimum - if(this.Float < (float)54.3) + if (this.Float < (float)54.3) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); } // Double (double) maximum - if(this.Double > (double)123.4) + if (this.Double > (double)123.4) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); } // Double (double) minimum - if(this.Double < (double)67.8) + if (this.Double < (double)67.8) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); } @@ -366,13 +386,13 @@ public override int GetHashCode() } // Password (string) maxLength - if(this.Password != null && this.Password.Length > 64) + if (this.Password != null && this.Password.Length > 64) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); } // Password (string) minLength - if(this.Password != null && this.Password.Length < 10) + if (this.Password != null && this.Password.Length < 10) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index 9edacb3815a8..cee75f3f8157 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -76,7 +76,7 @@ protected GrandparentAnimal() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class GrandparentAnimal {\n"); sb.Append(" PetType: ").Append(PetType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -123,9 +123,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.PetType != null) - hashCode = hashCode * 59 + this.PetType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.PetType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index f6219182b296..52099a7095e1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -81,7 +81,7 @@ public bool ShouldSerializeFoo() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class HasOnlyReadOnly {\n"); sb.Append(" Bar: ").Append(Bar).Append("\n"); sb.Append(" Foo: ").Append(Foo).Append("\n"); @@ -129,11 +129,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.Bar != null) - hashCode = hashCode * 59 + this.Bar.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Bar.GetHashCode(); + } if (this.Foo != null) - hashCode = hashCode * 59 + this.Foo.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Foo.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/HealthCheckResult.cs index c7c342d258a9..e8cbb68e2e4c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/HealthCheckResult.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -60,7 +60,7 @@ public partial class HealthCheckResult : IEquatable, IValidat /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class HealthCheckResult {\n"); sb.Append(" NullableMessage: ").Append(NullableMessage).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -107,9 +107,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.NullableMessage != null) - hashCode = hashCode * 59 + this.NullableMessage.GetHashCode(); + { + hashCode = (hashCode * 59) + this.NullableMessage.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/InlineResponseDefault.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/InlineResponseDefault.cs index e492ade1fc6d..ae46f1f0098f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/InlineResponseDefault.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/InlineResponseDefault.cs @@ -60,7 +60,7 @@ public partial class InlineResponseDefault : IEquatable, /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class InlineResponseDefault {\n"); sb.Append(" String: ").Append(String).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -107,9 +107,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.String != null) - hashCode = hashCode * 59 + this.String.GetHashCode(); + { + hashCode = (hashCode * 59) + this.String.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index 8d02354be3f6..50e7ce4aaa8d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -74,7 +74,7 @@ protected IsoscelesTriangle() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class IsoscelesTriangle {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); @@ -121,9 +121,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } if (this.TriangleType != null) - hashCode = hashCode * 59 + this.TriangleType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/List.cs index 5f3483a6e308..00814d110694 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/List.cs @@ -60,7 +60,7 @@ public partial class List : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class List {\n"); sb.Append(" _123List: ").Append(_123List).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -107,9 +107,13 @@ public override int GetHashCode() { int hashCode = 41; if (this._123List != null) - hashCode = hashCode * 59 + this._123List.GetHashCode(); + { + hashCode = (hashCode * 59) + this._123List.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/MapTest.cs index fa93bf24ec05..8b5a73e77365 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/MapTest.cs @@ -105,7 +105,7 @@ public enum InnerEnum /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class MapTest {\n"); sb.Append(" MapMapOfString: ").Append(MapMapOfString).Append("\n"); sb.Append(" MapOfEnumString: ").Append(MapOfEnumString).Append("\n"); @@ -155,14 +155,22 @@ public override int GetHashCode() { int hashCode = 41; if (this.MapMapOfString != null) - hashCode = hashCode * 59 + this.MapMapOfString.GetHashCode(); - hashCode = hashCode * 59 + this.MapOfEnumString.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapMapOfString.GetHashCode(); + } + hashCode = (hashCode * 59) + this.MapOfEnumString.GetHashCode(); if (this.DirectMap != null) - hashCode = hashCode * 59 + this.DirectMap.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DirectMap.GetHashCode(); + } if (this.IndirectMap != null) - hashCode = hashCode * 59 + this.IndirectMap.GetHashCode(); + { + hashCode = (hashCode * 59) + this.IndirectMap.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 8853f837f9e4..3225727af37b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -76,7 +76,7 @@ public partial class MixedPropertiesAndAdditionalPropertiesClass : IEquatableString presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); @@ -125,13 +125,21 @@ public override int GetHashCode() { int hashCode = 41; if (this.Uuid != null) - hashCode = hashCode * 59 + this.Uuid.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); + } if (this.DateTime != null) - hashCode = hashCode * 59 + this.DateTime.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DateTime.GetHashCode(); + } if (this.Map != null) - hashCode = hashCode * 59 + this.Map.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Map.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Model200Response.cs index 629a1fde7fb1..79a49ef91d28 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Model200Response.cs @@ -68,7 +68,7 @@ public partial class Model200Response : IEquatable, IValidatab /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Model200Response {\n"); sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" Class: ").Append(Class).Append("\n"); @@ -115,11 +115,15 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Name.GetHashCode(); + hashCode = (hashCode * 59) + this.Name.GetHashCode(); if (this.Class != null) - hashCode = hashCode * 59 + this.Class.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Class.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ModelClient.cs index e28bc67d630f..1995ec4b1692 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ModelClient.cs @@ -60,7 +60,7 @@ public partial class ModelClient : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ModelClient {\n"); sb.Append(" _Client: ").Append(_Client).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -107,9 +107,13 @@ public override int GetHashCode() { int hashCode = 41; if (this._Client != null) - hashCode = hashCode * 59 + this._Client.GetHashCode(); + { + hashCode = (hashCode * 59) + this._Client.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Name.cs index 462b3458215a..0dc21bb656f0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Name.cs @@ -104,7 +104,7 @@ public bool ShouldSerialize_123Number() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Name {\n"); sb.Append(" _Name: ").Append(_Name).Append("\n"); sb.Append(" SnakeCase: ").Append(SnakeCase).Append("\n"); @@ -153,13 +153,17 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this._Name.GetHashCode(); - hashCode = hashCode * 59 + this.SnakeCase.GetHashCode(); + hashCode = (hashCode * 59) + this._Name.GetHashCode(); + hashCode = (hashCode * 59) + this.SnakeCase.GetHashCode(); if (this.Property != null) - hashCode = hashCode * 59 + this.Property.GetHashCode(); - hashCode = hashCode * 59 + this._123Number.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Property.GetHashCode(); + } + hashCode = (hashCode * 59) + this._123Number.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/NullableClass.cs index 3a34e8cc1288..57555c376785 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/NullableClass.cs @@ -142,7 +142,7 @@ public partial class NullableClass : Dictionary, IEquatableString presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class NullableClass {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" IntegerProp: ").Append(IntegerProp).Append("\n"); @@ -200,29 +200,53 @@ public override int GetHashCode() { int hashCode = base.GetHashCode(); if (this.IntegerProp != null) - hashCode = hashCode * 59 + this.IntegerProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.IntegerProp.GetHashCode(); + } if (this.NumberProp != null) - hashCode = hashCode * 59 + this.NumberProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.NumberProp.GetHashCode(); + } if (this.BooleanProp != null) - hashCode = hashCode * 59 + this.BooleanProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.BooleanProp.GetHashCode(); + } if (this.StringProp != null) - hashCode = hashCode * 59 + this.StringProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.StringProp.GetHashCode(); + } if (this.DateProp != null) - hashCode = hashCode * 59 + this.DateProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DateProp.GetHashCode(); + } if (this.DatetimeProp != null) - hashCode = hashCode * 59 + this.DatetimeProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DatetimeProp.GetHashCode(); + } if (this.ArrayNullableProp != null) - hashCode = hashCode * 59 + this.ArrayNullableProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayNullableProp.GetHashCode(); + } if (this.ArrayAndItemsNullableProp != null) - hashCode = hashCode * 59 + this.ArrayAndItemsNullableProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayAndItemsNullableProp.GetHashCode(); + } if (this.ArrayItemsNullable != null) - hashCode = hashCode * 59 + this.ArrayItemsNullable.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayItemsNullable.GetHashCode(); + } if (this.ObjectNullableProp != null) - hashCode = hashCode * 59 + this.ObjectNullableProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ObjectNullableProp.GetHashCode(); + } if (this.ObjectAndItemsNullableProp != null) - hashCode = hashCode * 59 + this.ObjectAndItemsNullableProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ObjectAndItemsNullableProp.GetHashCode(); + } if (this.ObjectItemsNullable != null) - hashCode = hashCode * 59 + this.ObjectItemsNullable.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/NumberOnly.cs index 34abb32eabd7..97f869b0ebc1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -60,7 +60,7 @@ public partial class NumberOnly : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class NumberOnly {\n"); sb.Append(" JustNumber: ").Append(JustNumber).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -106,9 +106,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.JustNumber.GetHashCode(); + hashCode = (hashCode * 59) + this.JustNumber.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 021bfe71e02b..86ea32998f8c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -87,7 +87,7 @@ public partial class ObjectWithDeprecatedFields : IEquatableString presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ObjectWithDeprecatedFields {\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); sb.Append(" Id: ").Append(Id).Append("\n"); @@ -137,14 +137,22 @@ public override int GetHashCode() { int hashCode = 41; if (this.Uuid != null) - hashCode = hashCode * 59 + this.Uuid.GetHashCode(); - hashCode = hashCode * 59 + this.Id.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.DeprecatedRef != null) - hashCode = hashCode * 59 + this.DeprecatedRef.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DeprecatedRef.GetHashCode(); + } if (this.Bars != null) - hashCode = hashCode * 59 + this.Bars.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Bars.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Order.cs index e1abd07a05c4..5c52482e79b9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Order.cs @@ -128,7 +128,7 @@ public enum StatusEnum /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Order {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" PetId: ").Append(PetId).Append("\n"); @@ -179,15 +179,19 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Id.GetHashCode(); - hashCode = hashCode * 59 + this.PetId.GetHashCode(); - hashCode = hashCode * 59 + this.Quantity.GetHashCode(); + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.PetId.GetHashCode(); + hashCode = (hashCode * 59) + this.Quantity.GetHashCode(); if (this.ShipDate != null) - hashCode = hashCode * 59 + this.ShipDate.GetHashCode(); - hashCode = hashCode * 59 + this.Status.GetHashCode(); - hashCode = hashCode * 59 + this.Complete.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShipDate.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); + hashCode = (hashCode * 59) + this.Complete.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/OuterComposite.cs index 88449a1c8430..3209f6d6244e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -76,7 +76,7 @@ public partial class OuterComposite : IEquatable, IValidatableOb /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class OuterComposite {\n"); sb.Append(" MyNumber: ").Append(MyNumber).Append("\n"); sb.Append(" MyString: ").Append(MyString).Append("\n"); @@ -124,12 +124,16 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.MyNumber.GetHashCode(); + hashCode = (hashCode * 59) + this.MyNumber.GetHashCode(); if (this.MyString != null) - hashCode = hashCode * 59 + this.MyString.GetHashCode(); - hashCode = hashCode * 59 + this.MyBoolean.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MyString.GetHashCode(); + } + hashCode = (hashCode * 59) + this.MyBoolean.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ParentPet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ParentPet.cs index 899984fcc5bc..ac986b555efd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ParentPet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ParentPet.cs @@ -64,7 +64,7 @@ public ParentPet(string petType = "ParentPet") : base(petType) /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ParentPet {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -111,7 +111,9 @@ public override int GetHashCode() { int hashCode = base.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } @@ -133,7 +135,10 @@ public override int GetHashCode() /// Validation Result protected IEnumerable BaseValidate(ValidationContext validationContext) { - foreach(var x in BaseValidate(validationContext)) yield return x; + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } yield break; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Pet.cs index 8b3b614493f1..31fd118f4f68 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Pet.cs @@ -144,7 +144,7 @@ protected Pet() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Pet {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Category: ").Append(Category).Append("\n"); @@ -195,18 +195,28 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.Category != null) - hashCode = hashCode * 59 + this.Category.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Category.GetHashCode(); + } if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } if (this.PhotoUrls != null) - hashCode = hashCode * 59 + this.PhotoUrls.GetHashCode(); + { + hashCode = (hashCode * 59) + this.PhotoUrls.GetHashCode(); + } if (this.Tags != null) - hashCode = hashCode * 59 + this.Tags.GetHashCode(); - hashCode = hashCode * 59 + this.Status.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Tags.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index de200d38d54a..4d7c39c4364d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -72,7 +72,7 @@ protected QuadrilateralInterface() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class QuadrilateralInterface {\n"); sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -119,9 +119,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.QuadrilateralType != null) - hashCode = hashCode * 59 + this.QuadrilateralType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.QuadrilateralType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index 08a294a22903..ad59ca832864 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -74,7 +74,7 @@ public bool ShouldSerializeBar() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ReadOnlyFirst {\n"); sb.Append(" Bar: ").Append(Bar).Append("\n"); sb.Append(" Baz: ").Append(Baz).Append("\n"); @@ -122,11 +122,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.Bar != null) - hashCode = hashCode * 59 + this.Bar.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Bar.GetHashCode(); + } if (this.Baz != null) - hashCode = hashCode * 59 + this.Baz.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Baz.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Return.cs index 74317fbbfec5..e702e0157030 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Return.cs @@ -60,7 +60,7 @@ public partial class Return : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Return {\n"); sb.Append(" _Return: ").Append(_Return).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -106,9 +106,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this._Return.GetHashCode(); + hashCode = (hashCode * 59) + this._Return.GetHashCode(); if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index 6b4869ce8392..236839471475 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -84,7 +84,7 @@ protected ScaleneTriangle() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ScaleneTriangle {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); @@ -132,11 +132,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } if (this.TriangleType != null) - hashCode = hashCode * 59 + this.TriangleType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ShapeInterface.cs index ccd305b45098..92774561aaa5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -72,7 +72,7 @@ protected ShapeInterface() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ShapeInterface {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -119,9 +119,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index d698a788f8ea..fc9b37ce01fb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -84,7 +84,7 @@ protected SimpleQuadrilateral() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class SimpleQuadrilateral {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); @@ -132,11 +132,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } if (this.QuadrilateralType != null) - hashCode = hashCode * 59 + this.QuadrilateralType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.QuadrilateralType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialModelName.cs index 1d6445d4d624..7800467822ea 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -68,7 +68,7 @@ public partial class SpecialModelName : IEquatable, IValidatab /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class SpecialModelName {\n"); sb.Append(" SpecialPropertyName: ").Append(SpecialPropertyName).Append("\n"); sb.Append(" _SpecialModelName: ").Append(_SpecialModelName).Append("\n"); @@ -115,11 +115,15 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.SpecialPropertyName.GetHashCode(); + hashCode = (hashCode * 59) + this.SpecialPropertyName.GetHashCode(); if (this._SpecialModelName != null) - hashCode = hashCode * 59 + this._SpecialModelName.GetHashCode(); + { + hashCode = (hashCode * 59) + this._SpecialModelName.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Tag.cs index 2635acce4e4e..3df2c02e2cef 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Tag.cs @@ -68,7 +68,7 @@ public partial class Tag : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Tag {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); @@ -115,11 +115,15 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/TriangleInterface.cs index 14bd3a6724cf..7f7abb5bc85b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -72,7 +72,7 @@ protected TriangleInterface() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class TriangleInterface {\n"); sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); @@ -119,9 +119,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.TriangleType != null) - hashCode = hashCode * 59 + this.TriangleType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/User.cs index ebd632a90ac4..5f2a3020c3dd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/User.cs @@ -153,7 +153,7 @@ public partial class User : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class User {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Username: ").Append(Username).Append("\n"); @@ -210,30 +210,52 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.Username != null) - hashCode = hashCode * 59 + this.Username.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Username.GetHashCode(); + } if (this.FirstName != null) - hashCode = hashCode * 59 + this.FirstName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.FirstName.GetHashCode(); + } if (this.LastName != null) - hashCode = hashCode * 59 + this.LastName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.LastName.GetHashCode(); + } if (this.Email != null) - hashCode = hashCode * 59 + this.Email.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Email.GetHashCode(); + } if (this.Password != null) - hashCode = hashCode * 59 + this.Password.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Password.GetHashCode(); + } if (this.Phone != null) - hashCode = hashCode * 59 + this.Phone.GetHashCode(); - hashCode = hashCode * 59 + this.UserStatus.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Phone.GetHashCode(); + } + hashCode = (hashCode * 59) + this.UserStatus.GetHashCode(); if (this.ObjectWithNoDeclaredProps != null) - hashCode = hashCode * 59 + this.ObjectWithNoDeclaredProps.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ObjectWithNoDeclaredProps.GetHashCode(); + } if (this.ObjectWithNoDeclaredPropsNullable != null) - hashCode = hashCode * 59 + this.ObjectWithNoDeclaredPropsNullable.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ObjectWithNoDeclaredPropsNullable.GetHashCode(); + } if (this.AnyTypeProp != null) - hashCode = hashCode * 59 + this.AnyTypeProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AnyTypeProp.GetHashCode(); + } if (this.AnyTypePropNullable != null) - hashCode = hashCode * 59 + this.AnyTypePropNullable.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AnyTypePropNullable.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Whale.cs index 57ef3850e979..c30b6dbfabed 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Whale.cs @@ -88,7 +88,7 @@ protected Whale() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Whale {\n"); sb.Append(" HasBaleen: ").Append(HasBaleen).Append("\n"); sb.Append(" HasTeeth: ").Append(HasTeeth).Append("\n"); @@ -136,12 +136,16 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.HasBaleen.GetHashCode(); - hashCode = hashCode * 59 + this.HasTeeth.GetHashCode(); + hashCode = (hashCode * 59) + this.HasBaleen.GetHashCode(); + hashCode = (hashCode * 59) + this.HasTeeth.GetHashCode(); if (this.ClassName != null) - hashCode = hashCode * 59 + this.ClassName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Zebra.cs index bf9735fb37ed..4fb60ed8ddf2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Zebra.cs @@ -106,7 +106,7 @@ protected Zebra() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Zebra {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); @@ -154,11 +154,15 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = base.GetHashCode(); - hashCode = hashCode * 59 + this.Type.GetHashCode(); + hashCode = (hashCode * 59) + this.Type.GetHashCode(); if (this.ClassName != null) - hashCode = hashCode * 59 + this.ClassName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index ad48306e00ce..ac8fbdcdc946 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -221,7 +221,9 @@ public Org.OpenAPITools.Client.ApiResponse Call123TestSpecialTagsWi { // verify the required parameter 'modelClient' is set if (modelClient == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling AnotherFakeApi->Call123TestSpecialTags"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -235,21 +237,29 @@ public Org.OpenAPITools.Client.ApiResponse Call123TestSpecialTagsWi }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = modelClient; // make the HTTP request var localVarResponse = this.Client.Patch("/another-fake/dummy", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("Call123TestSpecialTags", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -279,7 +289,9 @@ public Org.OpenAPITools.Client.ApiResponse Call123TestSpecialTagsWi { // verify the required parameter 'modelClient' is set if (modelClient == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling AnotherFakeApi->Call123TestSpecialTags"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -293,24 +305,31 @@ public Org.OpenAPITools.Client.ApiResponse Call123TestSpecialTagsWi "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = modelClient; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PatchAsync("/another-fake/dummy", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("Call123TestSpecialTags", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/DefaultApi.cs index 8844aca4ab73..a9e5cfb9c4d2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -221,20 +221,28 @@ public Org.OpenAPITools.Client.ApiResponse FooGetWithHttp }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request var localVarResponse = this.Client.Get("/foo", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FooGet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -271,23 +279,30 @@ public Org.OpenAPITools.Client.ApiResponse FooGetWithHttp "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/foo", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FooGet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; 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 dab406002f81..57a99469634f 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 @@ -945,20 +945,28 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request var localVarResponse = this.Client.Get("/fake/health", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeHealthGet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -995,23 +1003,30 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/fake/health", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeHealthGet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1049,21 +1064,29 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = body; // make the HTTP request var localVarResponse = this.Client.Post("/fake/outer/boolean", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterBooleanSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1103,24 +1126,31 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH "*/*" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = body; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/boolean", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterBooleanSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1158,21 +1188,29 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = outerComposite; // make the HTTP request var localVarResponse = this.Client.Post("/fake/outer/composite", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterCompositeSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1212,24 +1250,31 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH "*/*" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = outerComposite; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/composite", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterCompositeSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1267,21 +1312,29 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = body; // make the HTTP request var localVarResponse = this.Client.Post("/fake/outer/number", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterNumberSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1321,24 +1374,31 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH "*/*" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = body; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/number", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterNumberSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1376,21 +1436,29 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = body; // make the HTTP request var localVarResponse = this.Client.Post("/fake/outer/string", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterStringSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1430,24 +1498,31 @@ public Org.OpenAPITools.Client.ApiResponse FakeHealthGetWithH "*/*" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = body; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/string", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FakeOuterStringSerialize", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1482,20 +1557,28 @@ public Org.OpenAPITools.Client.ApiResponse> GetArrayOfEnumsWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request var localVarResponse = this.Client.Get>("/fake/array-of-enums", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetArrayOfEnums", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1532,23 +1615,30 @@ public Org.OpenAPITools.Client.ApiResponse> GetArrayOfEnumsWithH "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync>("/fake/array-of-enums", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetArrayOfEnums", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1575,7 +1665,9 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithFileSchemaWithHtt { // verify the required parameter 'fileSchemaTestClass' is set if (fileSchemaTestClass == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'fileSchemaTestClass' when calling FakeApi->TestBodyWithFileSchema"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1588,21 +1680,29 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithFileSchemaWithHtt }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = fileSchemaTestClass; // make the HTTP request var localVarResponse = this.Client.Put("/fake/body-with-file-schema", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestBodyWithFileSchema", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1631,7 +1731,9 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithFileSchemaWithHtt { // verify the required parameter 'fileSchemaTestClass' is set if (fileSchemaTestClass == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'fileSchemaTestClass' when calling FakeApi->TestBodyWithFileSchema"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1644,24 +1746,31 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithFileSchemaWithHtt string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = fileSchemaTestClass; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/body-with-file-schema", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestBodyWithFileSchema", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1690,11 +1799,15 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithQueryParamsWithHt { // verify the required parameter 'query' is set if (query == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'query' when calling FakeApi->TestBodyWithQueryParams"); + } // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling FakeApi->TestBodyWithQueryParams"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1707,10 +1820,16 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithQueryParamsWithHt }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "query", query)); localVarRequestOptions.Data = user; @@ -1718,11 +1837,13 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithQueryParamsWithHt // make the HTTP request var localVarResponse = this.Client.Put("/fake/body-with-query-params", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestBodyWithQueryParams", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1753,11 +1874,15 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithQueryParamsWithHt { // verify the required parameter 'query' is set if (query == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'query' when calling FakeApi->TestBodyWithQueryParams"); + } // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling FakeApi->TestBodyWithQueryParams"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1770,25 +1895,32 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithQueryParamsWithHt string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "query", query)); localVarRequestOptions.Data = user; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/body-with-query-params", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestBodyWithQueryParams", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1816,7 +1948,9 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI { // verify the required parameter 'modelClient' is set if (modelClient == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling FakeApi->TestClientModel"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1830,21 +1964,29 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = modelClient; // make the HTTP request var localVarResponse = this.Client.Patch("/fake", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestClientModel", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1874,7 +2016,9 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI { // verify the required parameter 'modelClient' is set if (modelClient == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling FakeApi->TestClientModel"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1888,24 +2032,31 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = modelClient; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PatchAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestClientModel", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1958,11 +2109,15 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI { // verify the required parameter 'patternWithoutDelimiter' is set if (patternWithoutDelimiter == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'patternWithoutDelimiter' when calling FakeApi->TestEndpointParameters"); + } // verify the required parameter '_byte' is set if (_byte == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter '_byte' when calling FakeApi->TestEndpointParameters"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1975,10 +2130,16 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } if (integer != null) { @@ -2034,11 +2195,13 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI // make the HTTP request var localVarResponse = this.Client.Post("/fake", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestEndpointParameters", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2093,11 +2256,15 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI { // verify the required parameter 'patternWithoutDelimiter' is set if (patternWithoutDelimiter == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'patternWithoutDelimiter' when calling FakeApi->TestEndpointParameters"); + } // verify the required parameter '_byte' is set if (_byte == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter '_byte' when calling FakeApi->TestEndpointParameters"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2110,12 +2277,17 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } if (integer != null) { @@ -2170,13 +2342,15 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestEndpointParameters", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2226,10 +2400,16 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } if (enumQueryStringArray != null) { @@ -2267,11 +2447,13 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI // make the HTTP request var localVarResponse = this.Client.Get("/fake", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestEnumParameters", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2323,12 +2505,17 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } if (enumQueryStringArray != null) { @@ -2365,13 +2552,15 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestEnumParameters", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2416,10 +2605,16 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group)); @@ -2446,11 +2641,13 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI // make the HTTP request var localVarResponse = this.Client.Delete("/fake", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestGroupParameters", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2497,12 +2694,17 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group)); @@ -2528,13 +2730,15 @@ public Org.OpenAPITools.Client.ApiResponse TestClientModelWithHttpI } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestGroupParameters", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2561,7 +2765,9 @@ public Org.OpenAPITools.Client.ApiResponse TestInlineAdditionalPropertie { // verify the required parameter 'requestBody' is set if (requestBody == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestInlineAdditionalProperties"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2574,21 +2780,29 @@ public Org.OpenAPITools.Client.ApiResponse TestInlineAdditionalPropertie }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = requestBody; // make the HTTP request var localVarResponse = this.Client.Post("/fake/inline-additionalProperties", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestInlineAdditionalProperties", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2617,7 +2831,9 @@ public Org.OpenAPITools.Client.ApiResponse TestInlineAdditionalPropertie { // verify the required parameter 'requestBody' is set if (requestBody == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestInlineAdditionalProperties"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2630,24 +2846,31 @@ public Org.OpenAPITools.Client.ApiResponse TestInlineAdditionalPropertie string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = requestBody; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/inline-additionalProperties", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestInlineAdditionalProperties", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2676,11 +2899,15 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo( { // verify the required parameter 'param' is set if (param == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestJsonFormData"); + } // verify the required parameter 'param2' is set if (param2 == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'param2' when calling FakeApi->TestJsonFormData"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2693,10 +2920,16 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo( }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.FormParameters.Add("param", Org.OpenAPITools.Client.ClientUtils.ParameterToString(param)); // form parameter localVarRequestOptions.FormParameters.Add("param2", Org.OpenAPITools.Client.ClientUtils.ParameterToString(param2)); // form parameter @@ -2704,11 +2937,13 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo( // make the HTTP request var localVarResponse = this.Client.Get("/fake/jsonFormData", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestJsonFormData", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2739,11 +2974,15 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo( { // verify the required parameter 'param' is set if (param == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestJsonFormData"); + } // verify the required parameter 'param2' is set if (param2 == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'param2' when calling FakeApi->TestJsonFormData"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2756,25 +2995,32 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo( string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.FormParameters.Add("param", Org.OpenAPITools.Client.ClientUtils.ParameterToString(param)); // form parameter localVarRequestOptions.FormParameters.Add("param2", Org.OpenAPITools.Client.ClientUtils.ParameterToString(param2)); // form parameter // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/fake/jsonFormData", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestJsonFormData", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2809,23 +3055,33 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF { // verify the required parameter 'pipe' is set if (pipe == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pipe' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'ioutil' is set if (ioutil == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'ioutil' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'http' is set if (http == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'http' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'url' is set if (url == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'url' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'context' is set if (context == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'context' when calling FakeApi->TestQueryParameterCollectionFormat"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2837,10 +3093,16 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "pipe", pipe)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil)); @@ -2851,11 +3113,13 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF // make the HTTP request var localVarResponse = this.Client.Put("/fake/test-query-parameters", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestQueryParameterCollectionFormat", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -2892,23 +3156,33 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF { // verify the required parameter 'pipe' is set if (pipe == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pipe' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'ioutil' is set if (ioutil == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'ioutil' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'http' is set if (http == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'http' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'url' is set if (url == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'url' when calling FakeApi->TestQueryParameterCollectionFormat"); + } // verify the required parameter 'context' is set if (context == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'context' when calling FakeApi->TestQueryParameterCollectionFormat"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2920,12 +3194,17 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "pipe", pipe)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil)); @@ -2935,13 +3214,15 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/test-query-parameters", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestQueryParameterCollectionFormat", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index d4fbb5868adb..c2852b36a44b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -221,7 +221,9 @@ public Org.OpenAPITools.Client.ApiResponse TestClassnameWithHttpInf { // verify the required parameter 'modelClient' is set if (modelClient == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling FakeClassnameTags123Api->TestClassname"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -235,10 +237,16 @@ public Org.OpenAPITools.Client.ApiResponse TestClassnameWithHttpInf }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = modelClient; @@ -250,11 +258,13 @@ public Org.OpenAPITools.Client.ApiResponse TestClassnameWithHttpInf // make the HTTP request var localVarResponse = this.Client.Patch("/fake_classname_test", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestClassname", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -284,7 +294,9 @@ public Org.OpenAPITools.Client.ApiResponse TestClassnameWithHttpInf { // verify the required parameter 'modelClient' is set if (modelClient == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling FakeClassnameTags123Api->TestClassname"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -298,12 +310,17 @@ public Org.OpenAPITools.Client.ApiResponse TestClassnameWithHttpInf "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = modelClient; @@ -314,13 +331,15 @@ public Org.OpenAPITools.Client.ApiResponse TestClassnameWithHttpInf } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PatchAsync("/fake_classname_test", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("TestClassname", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/PetApi.cs index d73282dfca5f..39d2e425e630 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/PetApi.cs @@ -586,7 +586,9 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) { // verify the required parameter 'pet' is set if (pet == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->AddPet"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -600,10 +602,16 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = pet; @@ -632,11 +640,13 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) // make the HTTP request var localVarResponse = this.Client.Post("/pet", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("AddPet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -665,7 +675,9 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) { // verify the required parameter 'pet' is set if (pet == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->AddPet"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -679,12 +691,17 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = pet; @@ -712,13 +729,15 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/pet", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("AddPet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -755,10 +774,16 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (apiKey != null) @@ -775,11 +800,13 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) // make the HTTP request var localVarResponse = this.Client.Delete("/pet/{petId}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeletePet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -818,12 +845,17 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (apiKey != null) @@ -839,13 +871,15 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeletePet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -873,7 +907,9 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn { // verify the required parameter 'status' is set if (status == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'status' when calling PetApi->FindPetsByStatus"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -887,10 +923,16 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "status", status)); @@ -919,11 +961,13 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn // make the HTTP request var localVarResponse = this.Client.Get>("/pet/findByStatus", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FindPetsByStatus", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -953,7 +997,9 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn { // verify the required parameter 'status' is set if (status == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'status' when calling PetApi->FindPetsByStatus"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -967,12 +1013,17 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "status", status)); @@ -1000,13 +1051,15 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync>("/pet/findByStatus", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FindPetsByStatus", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1036,7 +1089,9 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo { // verify the required parameter 'tags' is set if (tags == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'tags' when calling PetApi->FindPetsByTags"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1050,10 +1105,16 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "tags", tags)); @@ -1082,11 +1143,13 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo // make the HTTP request var localVarResponse = this.Client.Get>("/pet/findByTags", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FindPetsByTags", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1118,7 +1181,9 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo { // verify the required parameter 'tags' is set if (tags == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'tags' when calling PetApi->FindPetsByTags"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1132,12 +1197,17 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "tags", tags)); @@ -1165,13 +1235,15 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync>("/pet/findByTags", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FindPetsByTags", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1209,10 +1281,16 @@ public Org.OpenAPITools.Client.ApiResponse GetPetByIdWithHttpInfo(long petI }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter @@ -1224,11 +1302,13 @@ public Org.OpenAPITools.Client.ApiResponse GetPetByIdWithHttpInfo(long petI // make the HTTP request var localVarResponse = this.Client.Get("/pet/{petId}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetPetById", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1268,12 +1348,17 @@ public Org.OpenAPITools.Client.ApiResponse GetPetByIdWithHttpInfo(long petI "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter @@ -1284,13 +1369,15 @@ public Org.OpenAPITools.Client.ApiResponse GetPetByIdWithHttpInfo(long petI } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetPetById", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1317,7 +1404,9 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet { // verify the required parameter 'pet' is set if (pet == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->UpdatePet"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1331,10 +1420,16 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = pet; @@ -1363,11 +1458,13 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet // make the HTTP request var localVarResponse = this.Client.Put("/pet", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdatePet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1396,7 +1493,9 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet { // verify the required parameter 'pet' is set if (pet == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->UpdatePet"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1410,12 +1509,17 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = pet; @@ -1443,13 +1547,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/pet", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdatePet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1489,10 +1595,16 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (name != null) @@ -1513,11 +1625,13 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet // make the HTTP request var localVarResponse = this.Client.Post("/pet/{petId}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdatePetWithForm", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1559,12 +1673,17 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (name != null) @@ -1584,13 +1703,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdatePetWithForm", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1632,10 +1753,16 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (additionalMetadata != null) @@ -1656,11 +1783,13 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet // make the HTTP request var localVarResponse = this.Client.Post("/pet/{petId}/uploadImage", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UploadFile", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1704,12 +1833,17 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (additionalMetadata != null) @@ -1729,13 +1863,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/pet/{petId}/uploadImage", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UploadFile", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1767,7 +1903,9 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet { // verify the required parameter 'requiredFile' is set if (requiredFile == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredFile' when calling PetApi->UploadFileWithRequiredFile"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1781,10 +1919,16 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (additionalMetadata != null) @@ -1802,11 +1946,13 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet // make the HTTP request var localVarResponse = this.Client.Post("/fake/{petId}/uploadImageWithRequiredFile", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UploadFileWithRequiredFile", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1840,7 +1986,9 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet { // verify the required parameter 'requiredFile' is set if (requiredFile == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredFile' when calling PetApi->UploadFileWithRequiredFile"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1854,12 +2002,17 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (additionalMetadata != null) @@ -1876,13 +2029,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/{petId}/uploadImageWithRequiredFile", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UploadFileWithRequiredFile", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/StoreApi.cs index ad7387db7057..7cda385b3b40 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/StoreApi.cs @@ -345,7 +345,9 @@ public Org.OpenAPITools.Client.ApiResponse DeleteOrderWithHttpInfo(strin { // verify the required parameter 'orderId' is set if (orderId == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -357,21 +359,29 @@ public Org.OpenAPITools.Client.ApiResponse DeleteOrderWithHttpInfo(strin }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter // make the HTTP request var localVarResponse = this.Client.Delete("/store/order/{order_id}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeleteOrder", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -400,7 +410,9 @@ public Org.OpenAPITools.Client.ApiResponse DeleteOrderWithHttpInfo(strin { // verify the required parameter 'orderId' is set if (orderId == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -412,24 +424,31 @@ public Org.OpenAPITools.Client.ApiResponse DeleteOrderWithHttpInfo(strin string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/store/order/{order_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeleteOrder", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -464,10 +483,16 @@ public Org.OpenAPITools.Client.ApiResponse> GetInventory }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // authentication (api_key) required @@ -478,11 +503,13 @@ public Org.OpenAPITools.Client.ApiResponse> GetInventory // make the HTTP request var localVarResponse = this.Client.Get>("/store/inventory", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetInventory", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -519,12 +546,17 @@ public Org.OpenAPITools.Client.ApiResponse> GetInventory "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // authentication (api_key) required @@ -534,13 +566,15 @@ public Org.OpenAPITools.Client.ApiResponse> GetInventory } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync>("/store/inventory", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetInventory", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -578,21 +612,29 @@ public Org.OpenAPITools.Client.ApiResponse GetOrderByIdWithHttpInfo(long }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter // make the HTTP request var localVarResponse = this.Client.Get("/store/order/{order_id}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetOrderById", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -632,24 +674,31 @@ public Org.OpenAPITools.Client.ApiResponse GetOrderByIdWithHttpInfo(long "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/store/order/{order_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetOrderById", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -677,7 +726,9 @@ public Org.OpenAPITools.Client.ApiResponse PlaceOrderWithHttpInfo(Order o { // verify the required parameter 'order' is set if (order == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'order' when calling StoreApi->PlaceOrder"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -692,21 +743,29 @@ public Org.OpenAPITools.Client.ApiResponse PlaceOrderWithHttpInfo(Order o }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = order; // make the HTTP request var localVarResponse = this.Client.Post("/store/order", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("PlaceOrder", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -736,7 +795,9 @@ public Org.OpenAPITools.Client.ApiResponse PlaceOrderWithHttpInfo(Order o { // verify the required parameter 'order' is set if (order == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'order' when calling StoreApi->PlaceOrder"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -751,24 +812,31 @@ public Org.OpenAPITools.Client.ApiResponse PlaceOrderWithHttpInfo(Order o "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = order; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/store/order", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("PlaceOrder", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/UserApi.cs index a2f2598c8acd..a1716303f6f3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/UserApi.cs @@ -517,7 +517,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUserWithHttpInfo(User u { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -530,21 +532,29 @@ public Org.OpenAPITools.Client.ApiResponse CreateUserWithHttpInfo(User u }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; // make the HTTP request var localVarResponse = this.Client.Post("/user", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -573,7 +583,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUserWithHttpInfo(User u { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -586,24 +598,31 @@ public Org.OpenAPITools.Client.ApiResponse CreateUserWithHttpInfo(User u string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/user", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -630,7 +649,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithArrayInputWith { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithArrayInput"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -643,21 +664,29 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithArrayInputWith }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; // make the HTTP request var localVarResponse = this.Client.Post("/user/createWithArray", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUsersWithArrayInput", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -686,7 +715,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithArrayInputWith { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithArrayInput"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -699,24 +730,31 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithArrayInputWith string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/user/createWithArray", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUsersWithArrayInput", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -743,7 +781,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithListInputWithH { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithListInput"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -756,21 +796,29 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithListInputWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; // make the HTTP request var localVarResponse = this.Client.Post("/user/createWithList", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUsersWithListInput", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -799,7 +847,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithListInputWithH { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithListInput"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -812,24 +862,31 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithListInputWithH string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/user/createWithList", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUsersWithListInput", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -856,7 +913,9 @@ public Org.OpenAPITools.Client.ApiResponse DeleteUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->DeleteUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -868,21 +927,29 @@ public Org.OpenAPITools.Client.ApiResponse DeleteUserWithHttpInfo(string }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter // make the HTTP request var localVarResponse = this.Client.Delete("/user/{username}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeleteUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -911,7 +978,9 @@ public Org.OpenAPITools.Client.ApiResponse DeleteUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->DeleteUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -923,24 +992,31 @@ public Org.OpenAPITools.Client.ApiResponse DeleteUserWithHttpInfo(string string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeleteUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -968,7 +1044,9 @@ public Org.OpenAPITools.Client.ApiResponse GetUserByNameWithHttpInfo(strin { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->GetUserByName"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -982,21 +1060,29 @@ public Org.OpenAPITools.Client.ApiResponse GetUserByNameWithHttpInfo(strin }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter // make the HTTP request var localVarResponse = this.Client.Get("/user/{username}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetUserByName", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1026,7 +1112,9 @@ public Org.OpenAPITools.Client.ApiResponse GetUserByNameWithHttpInfo(strin { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->GetUserByName"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1040,24 +1128,31 @@ public Org.OpenAPITools.Client.ApiResponse GetUserByNameWithHttpInfo(strin "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetUserByName", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1087,11 +1182,15 @@ public Org.OpenAPITools.Client.ApiResponse LoginUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->LoginUser"); + } // verify the required parameter 'password' is set if (password == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'password' when calling UserApi->LoginUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1105,10 +1204,16 @@ public Org.OpenAPITools.Client.ApiResponse LoginUserWithHttpInfo(string }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "username", username)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "password", password)); @@ -1116,11 +1221,13 @@ public Org.OpenAPITools.Client.ApiResponse LoginUserWithHttpInfo(string // make the HTTP request var localVarResponse = this.Client.Get("/user/login", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("LoginUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1152,11 +1259,15 @@ public Org.OpenAPITools.Client.ApiResponse LoginUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->LoginUser"); + } // verify the required parameter 'password' is set if (password == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'password' when calling UserApi->LoginUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1170,25 +1281,32 @@ public Org.OpenAPITools.Client.ApiResponse LoginUserWithHttpInfo(string "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "username", username)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "password", password)); // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/user/login", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("LoginUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1221,20 +1339,28 @@ public Org.OpenAPITools.Client.ApiResponse LogoutUserWithHttpInfo() }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request var localVarResponse = this.Client.Get("/user/logout", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("LogoutUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1269,23 +1395,30 @@ public Org.OpenAPITools.Client.ApiResponse LogoutUserWithHttpInfo() string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/user/logout", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("LogoutUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1314,11 +1447,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); + } // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->UpdateUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1331,10 +1468,16 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo(string }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter localVarRequestOptions.Data = user; @@ -1342,11 +1485,13 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo(string // make the HTTP request var localVarResponse = this.Client.Put("/user/{username}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdateUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1377,11 +1522,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); + } // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->UpdateUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1394,25 +1543,32 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo(string string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter localVarRequestOptions.Data = user; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdateUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index e58bad81ffee..d7f64e083d92 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -110,7 +110,7 @@ public partial class AdditionalPropertiesClass : IEquatableString presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class AdditionalPropertiesClass {\n"); sb.Append(" MapProperty: ").Append(MapProperty).Append("\n"); sb.Append(" MapOfMapProperty: ").Append(MapOfMapProperty).Append("\n"); @@ -163,21 +163,37 @@ public override int GetHashCode() { int hashCode = 41; if (this.MapProperty != null) - hashCode = hashCode * 59 + this.MapProperty.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapProperty.GetHashCode(); + } if (this.MapOfMapProperty != null) - hashCode = hashCode * 59 + this.MapOfMapProperty.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapOfMapProperty.GetHashCode(); + } if (this.Anytype1 != null) - hashCode = hashCode * 59 + this.Anytype1.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Anytype1.GetHashCode(); + } if (this.MapWithUndeclaredPropertiesAnytype1 != null) - hashCode = hashCode * 59 + this.MapWithUndeclaredPropertiesAnytype1.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesAnytype1.GetHashCode(); + } if (this.MapWithUndeclaredPropertiesAnytype2 != null) - hashCode = hashCode * 59 + this.MapWithUndeclaredPropertiesAnytype2.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesAnytype2.GetHashCode(); + } if (this.MapWithUndeclaredPropertiesAnytype3 != null) - hashCode = hashCode * 59 + this.MapWithUndeclaredPropertiesAnytype3.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesAnytype3.GetHashCode(); + } if (this.EmptyMap != null) - hashCode = hashCode * 59 + this.EmptyMap.GetHashCode(); + { + hashCode = (hashCode * 59) + this.EmptyMap.GetHashCode(); + } if (this.MapWithUndeclaredPropertiesString != null) - hashCode = hashCode * 59 + this.MapWithUndeclaredPropertiesString.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapWithUndeclaredPropertiesString.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Animal.cs index 633d513a1e15..c86eb126fa7f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Animal.cs @@ -75,7 +75,7 @@ protected Animal() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Animal {\n"); sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" Color: ").Append(Color).Append("\n"); @@ -122,9 +122,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ClassName != null) - hashCode = hashCode * 59 + this.ClassName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } if (this.Color != null) - hashCode = hashCode * 59 + this.Color.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Color.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ApiResponse.cs index 7f1235eec655..b29884509c01 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -69,7 +69,7 @@ public partial class ApiResponse : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ApiResponse {\n"); sb.Append(" Code: ").Append(Code).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); @@ -116,11 +116,15 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Code.GetHashCode(); + hashCode = (hashCode * 59) + this.Code.GetHashCode(); if (this.Type != null) - hashCode = hashCode * 59 + this.Type.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + } if (this.Message != null) - hashCode = hashCode * 59 + this.Message.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Message.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Apple.cs index 43fcc0a835e3..4706c3f55e83 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Apple.cs @@ -61,7 +61,7 @@ public partial class Apple : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Apple {\n"); sb.Append(" Cultivar: ").Append(Cultivar).Append("\n"); sb.Append(" Origin: ").Append(Origin).Append("\n"); @@ -108,9 +108,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.Cultivar != null) - hashCode = hashCode * 59 + this.Cultivar.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Cultivar.GetHashCode(); + } if (this.Origin != null) - hashCode = hashCode * 59 + this.Origin.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Origin.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/AppleReq.cs index 91a8d5c3aeb9..1d6d42dc9b3a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/AppleReq.cs @@ -70,7 +70,7 @@ protected AppleReq() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class AppleReq {\n"); sb.Append(" Cultivar: ").Append(Cultivar).Append("\n"); sb.Append(" Mealy: ").Append(Mealy).Append("\n"); @@ -117,8 +117,10 @@ public override int GetHashCode() { int hashCode = 41; if (this.Cultivar != null) - hashCode = hashCode * 59 + this.Cultivar.GetHashCode(); - hashCode = hashCode * 59 + this.Mealy.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Cultivar.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Mealy.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index 0a6725d5956b..7bb75ee4dd78 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -53,7 +53,7 @@ public partial class ArrayOfArrayOfNumberOnly : IEquatableString presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ArrayOfArrayOfNumberOnly {\n"); sb.Append(" ArrayArrayNumber: ").Append(ArrayArrayNumber).Append("\n"); sb.Append("}\n"); @@ -99,7 +99,9 @@ public override int GetHashCode() { int hashCode = 41; if (this.ArrayArrayNumber != null) - hashCode = hashCode * 59 + this.ArrayArrayNumber.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayArrayNumber.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index d332306ed700..1ea6f5248b28 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -53,7 +53,7 @@ public partial class ArrayOfNumberOnly : IEquatable, IValidat /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ArrayOfNumberOnly {\n"); sb.Append(" ArrayNumber: ").Append(ArrayNumber).Append("\n"); sb.Append("}\n"); @@ -99,7 +99,9 @@ public override int GetHashCode() { int hashCode = 41; if (this.ArrayNumber != null) - hashCode = hashCode * 59 + this.ArrayNumber.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayNumber.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ArrayTest.cs index 1f157ececd99..9564cd484833 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -69,7 +69,7 @@ public partial class ArrayTest : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ArrayTest {\n"); sb.Append(" ArrayOfString: ").Append(ArrayOfString).Append("\n"); sb.Append(" ArrayArrayOfInteger: ").Append(ArrayArrayOfInteger).Append("\n"); @@ -117,11 +117,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.ArrayOfString != null) - hashCode = hashCode * 59 + this.ArrayOfString.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayOfString.GetHashCode(); + } if (this.ArrayArrayOfInteger != null) - hashCode = hashCode * 59 + this.ArrayArrayOfInteger.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayArrayOfInteger.GetHashCode(); + } if (this.ArrayArrayOfModel != null) - hashCode = hashCode * 59 + this.ArrayArrayOfModel.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayArrayOfModel.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Banana.cs index 8f20422800ba..d0053dbae2d3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Banana.cs @@ -53,7 +53,7 @@ public partial class Banana : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Banana {\n"); sb.Append(" LengthCm: ").Append(LengthCm).Append("\n"); sb.Append("}\n"); @@ -98,7 +98,7 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.LengthCm.GetHashCode(); + hashCode = (hashCode * 59) + this.LengthCm.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/BananaReq.cs index ea57bb4f0cce..fdd36929d13c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/BananaReq.cs @@ -66,7 +66,7 @@ protected BananaReq() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class BananaReq {\n"); sb.Append(" LengthCm: ").Append(LengthCm).Append("\n"); sb.Append(" Sweet: ").Append(Sweet).Append("\n"); @@ -112,8 +112,8 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.LengthCm.GetHashCode(); - hashCode = hashCode * 59 + this.Sweet.GetHashCode(); + hashCode = (hashCode * 59) + this.LengthCm.GetHashCode(); + hashCode = (hashCode * 59) + this.Sweet.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/BasquePig.cs index 2cc42f67f5a9..58c8bebce5ec 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/BasquePig.cs @@ -62,7 +62,7 @@ protected BasquePig() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class BasquePig {\n"); sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append("}\n"); @@ -108,7 +108,9 @@ public override int GetHashCode() { int hashCode = 41; if (this.ClassName != null) - hashCode = hashCode * 59 + this.ClassName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Capitalization.cs index 486f269d4394..2f53c995da99 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Capitalization.cs @@ -94,7 +94,7 @@ public partial class Capitalization : IEquatable, IValidatableOb /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Capitalization {\n"); sb.Append(" SmallCamel: ").Append(SmallCamel).Append("\n"); sb.Append(" CapitalCamel: ").Append(CapitalCamel).Append("\n"); @@ -145,17 +145,29 @@ public override int GetHashCode() { int hashCode = 41; if (this.SmallCamel != null) - hashCode = hashCode * 59 + this.SmallCamel.GetHashCode(); + { + hashCode = (hashCode * 59) + this.SmallCamel.GetHashCode(); + } if (this.CapitalCamel != null) - hashCode = hashCode * 59 + this.CapitalCamel.GetHashCode(); + { + hashCode = (hashCode * 59) + this.CapitalCamel.GetHashCode(); + } if (this.SmallSnake != null) - hashCode = hashCode * 59 + this.SmallSnake.GetHashCode(); + { + hashCode = (hashCode * 59) + this.SmallSnake.GetHashCode(); + } if (this.CapitalSnake != null) - hashCode = hashCode * 59 + this.CapitalSnake.GetHashCode(); + { + hashCode = (hashCode * 59) + this.CapitalSnake.GetHashCode(); + } if (this.SCAETHFlowPoints != null) - hashCode = hashCode * 59 + this.SCAETHFlowPoints.GetHashCode(); + { + hashCode = (hashCode * 59) + this.SCAETHFlowPoints.GetHashCode(); + } if (this.ATT_NAME != null) - hashCode = hashCode * 59 + this.ATT_NAME.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ATT_NAME.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Cat.cs index 62a650fa5769..87e09bc6a571 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Cat.cs @@ -62,7 +62,7 @@ protected Cat() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Cat {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" Declawed: ").Append(Declawed).Append("\n"); @@ -108,7 +108,7 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = base.GetHashCode(); - hashCode = hashCode * 59 + this.Declawed.GetHashCode(); + hashCode = (hashCode * 59) + this.Declawed.GetHashCode(); return hashCode; } } @@ -130,7 +130,10 @@ public override int GetHashCode() /// Validation Result protected IEnumerable BaseValidate(ValidationContext validationContext) { - foreach(var x in BaseValidate(validationContext)) yield return x; + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } yield break; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/CatAllOf.cs index bc9abc8a0c43..607c2c650ed1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/CatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -53,7 +53,7 @@ public partial class CatAllOf : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class CatAllOf {\n"); sb.Append(" Declawed: ").Append(Declawed).Append("\n"); sb.Append("}\n"); @@ -98,7 +98,7 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Declawed.GetHashCode(); + hashCode = (hashCode * 59) + this.Declawed.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Category.cs index 92c01063269b..fb7778939b46 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Category.cs @@ -70,7 +70,7 @@ protected Category() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Category {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); @@ -116,9 +116,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ChildCat.cs index 78880b84b1ef..d2b819278854 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ChildCat.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ChildCat.cs @@ -82,7 +82,7 @@ protected ChildCat() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ChildCat {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); @@ -130,8 +130,10 @@ public override int GetHashCode() { int hashCode = base.GetHashCode(); if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); - hashCode = hashCode * 59 + this.PetType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + hashCode = (hashCode * 59) + this.PetType.GetHashCode(); return hashCode; } } @@ -153,7 +155,10 @@ public override int GetHashCode() /// Validation Result protected IEnumerable BaseValidate(ValidationContext validationContext) { - foreach(var x in BaseValidate(validationContext)) yield return x; + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } yield break; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ChildCatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ChildCatAllOf.cs index 28293972bebd..58d2cec42ccb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ChildCatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ChildCatAllOf.cs @@ -75,7 +75,7 @@ public enum PetTypeEnum /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ChildCatAllOf {\n"); sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" PetType: ").Append(PetType).Append("\n"); @@ -122,8 +122,10 @@ public override int GetHashCode() { int hashCode = 41; if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); - hashCode = hashCode * 59 + this.PetType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + hashCode = (hashCode * 59) + this.PetType.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ClassModel.cs index bdd2c06b7f35..5ead2b7fbfa8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ClassModel.cs @@ -53,7 +53,7 @@ public partial class ClassModel : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ClassModel {\n"); sb.Append(" Class: ").Append(Class).Append("\n"); sb.Append("}\n"); @@ -99,7 +99,9 @@ public override int GetHashCode() { int hashCode = 41; if (this.Class != null) - hashCode = hashCode * 59 + this.Class.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Class.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index e2c4a41d548f..ea5a8782d2ae 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -74,7 +74,7 @@ protected ComplexQuadrilateral() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ComplexQuadrilateral {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); @@ -121,9 +121,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } if (this.QuadrilateralType != null) - hashCode = hashCode * 59 + this.QuadrilateralType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.QuadrilateralType.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/DanishPig.cs index 0f83345da896..1718d7d43397 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/DanishPig.cs @@ -62,7 +62,7 @@ protected DanishPig() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class DanishPig {\n"); sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append("}\n"); @@ -108,7 +108,9 @@ public override int GetHashCode() { int hashCode = 41; if (this.ClassName != null) - hashCode = hashCode * 59 + this.ClassName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/DeprecatedObject.cs index 82df9376363d..2c3722a6b4a7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/DeprecatedObject.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -53,7 +53,7 @@ public partial class DeprecatedObject : IEquatable, IValidatab /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class DeprecatedObject {\n"); sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append("}\n"); @@ -99,7 +99,9 @@ public override int GetHashCode() { int hashCode = 41; if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Dog.cs index 1b57dbff541b..b49df98acbf2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Dog.cs @@ -62,7 +62,7 @@ protected Dog() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Dog {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" Breed: ").Append(Breed).Append("\n"); @@ -109,7 +109,9 @@ public override int GetHashCode() { int hashCode = base.GetHashCode(); if (this.Breed != null) - hashCode = hashCode * 59 + this.Breed.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Breed.GetHashCode(); + } return hashCode; } } @@ -131,7 +133,10 @@ public override int GetHashCode() /// Validation Result protected IEnumerable BaseValidate(ValidationContext validationContext) { - foreach(var x in BaseValidate(validationContext)) yield return x; + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } yield break; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/DogAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/DogAllOf.cs index d885628e2e9f..036f993e64a9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/DogAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/DogAllOf.cs @@ -53,7 +53,7 @@ public partial class DogAllOf : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class DogAllOf {\n"); sb.Append(" Breed: ").Append(Breed).Append("\n"); sb.Append("}\n"); @@ -99,7 +99,9 @@ public override int GetHashCode() { int hashCode = 41; if (this.Breed != null) - hashCode = hashCode * 59 + this.Breed.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Breed.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Drawing.cs index f7e6702be596..d8cd2a70ef61 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Drawing.cs @@ -77,7 +77,7 @@ public partial class Drawing : Dictionary, IEquatable, I /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Drawing {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" MainShape: ").Append(MainShape).Append("\n"); @@ -127,13 +127,21 @@ public override int GetHashCode() { int hashCode = base.GetHashCode(); if (this.MainShape != null) - hashCode = hashCode * 59 + this.MainShape.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MainShape.GetHashCode(); + } if (this.ShapeOrNull != null) - hashCode = hashCode * 59 + this.ShapeOrNull.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeOrNull.GetHashCode(); + } if (this.NullableShape != null) - hashCode = hashCode * 59 + this.NullableShape.GetHashCode(); + { + hashCode = (hashCode * 59) + this.NullableShape.GetHashCode(); + } if (this.Shapes != null) - hashCode = hashCode * 59 + this.Shapes.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Shapes.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/EnumArrays.cs index 05ac48397edb..89584f4501e9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -102,7 +102,7 @@ public enum ArrayEnumEnum /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class EnumArrays {\n"); sb.Append(" JustSymbol: ").Append(JustSymbol).Append("\n"); sb.Append(" ArrayEnum: ").Append(ArrayEnum).Append("\n"); @@ -148,8 +148,8 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.JustSymbol.GetHashCode(); - hashCode = hashCode * 59 + this.ArrayEnum.GetHashCode(); + hashCode = (hashCode * 59) + this.JustSymbol.GetHashCode(); + hashCode = (hashCode * 59) + this.ArrayEnum.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/EnumTest.cs index dcaaac95507e..54937a2fbf62 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/EnumTest.cs @@ -228,7 +228,7 @@ protected EnumTest() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class EnumTest {\n"); sb.Append(" EnumString: ").Append(EnumString).Append("\n"); sb.Append(" EnumStringRequired: ").Append(EnumStringRequired).Append("\n"); @@ -281,15 +281,15 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.EnumString.GetHashCode(); - hashCode = hashCode * 59 + this.EnumStringRequired.GetHashCode(); - hashCode = hashCode * 59 + this.EnumInteger.GetHashCode(); - hashCode = hashCode * 59 + this.EnumIntegerOnly.GetHashCode(); - hashCode = hashCode * 59 + this.EnumNumber.GetHashCode(); - hashCode = hashCode * 59 + this.OuterEnum.GetHashCode(); - hashCode = hashCode * 59 + this.OuterEnumInteger.GetHashCode(); - hashCode = hashCode * 59 + this.OuterEnumDefaultValue.GetHashCode(); - hashCode = hashCode * 59 + this.OuterEnumIntegerDefaultValue.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumString.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumStringRequired.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumInteger.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumIntegerOnly.GetHashCode(); + hashCode = (hashCode * 59) + this.EnumNumber.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnum.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnumInteger.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnumDefaultValue.GetHashCode(); + hashCode = (hashCode * 59) + this.OuterEnumIntegerDefaultValue.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index 342848daed04..48f12495bbf0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -74,7 +74,7 @@ protected EquilateralTriangle() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class EquilateralTriangle {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); @@ -121,9 +121,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } if (this.TriangleType != null) - hashCode = hashCode * 59 + this.TriangleType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/File.cs index 553899ee748a..7010f9a61033 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/File.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/File.cs @@ -54,7 +54,7 @@ public partial class File : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class File {\n"); sb.Append(" SourceURI: ").Append(SourceURI).Append("\n"); sb.Append("}\n"); @@ -100,7 +100,9 @@ public override int GetHashCode() { int hashCode = 41; if (this.SourceURI != null) - hashCode = hashCode * 59 + this.SourceURI.GetHashCode(); + { + hashCode = (hashCode * 59) + this.SourceURI.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index b799b6685c30..077da6361a97 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -61,7 +61,7 @@ public partial class FileSchemaTestClass : IEquatable, IVal /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class FileSchemaTestClass {\n"); sb.Append(" File: ").Append(File).Append("\n"); sb.Append(" Files: ").Append(Files).Append("\n"); @@ -108,9 +108,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.File != null) - hashCode = hashCode * 59 + this.File.GetHashCode(); + { + hashCode = (hashCode * 59) + this.File.GetHashCode(); + } if (this.Files != null) - hashCode = hashCode * 59 + this.Files.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Files.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Foo.cs index 3203319075ab..3abdc1cb6a07 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Foo.cs @@ -54,7 +54,7 @@ public Foo(string bar = "bar") /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Foo {\n"); sb.Append(" Bar: ").Append(Bar).Append("\n"); sb.Append("}\n"); @@ -100,7 +100,9 @@ public override int GetHashCode() { int hashCode = 41; if (this.Bar != null) - hashCode = hashCode * 59 + this.Bar.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Bar.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FormatTest.cs index 956e398caf36..586cdcb33db7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FormatTest.cs @@ -189,7 +189,7 @@ protected FormatTest() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class FormatTest {\n"); sb.Append(" Integer: ").Append(Integer).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); @@ -249,31 +249,49 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Integer.GetHashCode(); - hashCode = hashCode * 59 + this.Int32.GetHashCode(); - hashCode = hashCode * 59 + this.Int64.GetHashCode(); - hashCode = hashCode * 59 + this.Number.GetHashCode(); - hashCode = hashCode * 59 + this.Float.GetHashCode(); - hashCode = hashCode * 59 + this.Double.GetHashCode(); - hashCode = hashCode * 59 + this.Decimal.GetHashCode(); + hashCode = (hashCode * 59) + this.Integer.GetHashCode(); + hashCode = (hashCode * 59) + this.Int32.GetHashCode(); + hashCode = (hashCode * 59) + this.Int64.GetHashCode(); + hashCode = (hashCode * 59) + this.Number.GetHashCode(); + hashCode = (hashCode * 59) + this.Float.GetHashCode(); + hashCode = (hashCode * 59) + this.Double.GetHashCode(); + hashCode = (hashCode * 59) + this.Decimal.GetHashCode(); if (this.String != null) - hashCode = hashCode * 59 + this.String.GetHashCode(); + { + hashCode = (hashCode * 59) + this.String.GetHashCode(); + } if (this.Byte != null) - hashCode = hashCode * 59 + this.Byte.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Byte.GetHashCode(); + } if (this.Binary != null) - hashCode = hashCode * 59 + this.Binary.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Binary.GetHashCode(); + } if (this.Date != null) - hashCode = hashCode * 59 + this.Date.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Date.GetHashCode(); + } if (this.DateTime != null) - hashCode = hashCode * 59 + this.DateTime.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DateTime.GetHashCode(); + } if (this.Uuid != null) - hashCode = hashCode * 59 + this.Uuid.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); + } if (this.Password != null) - hashCode = hashCode * 59 + this.Password.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Password.GetHashCode(); + } if (this.PatternWithDigits != null) - hashCode = hashCode * 59 + this.PatternWithDigits.GetHashCode(); + { + hashCode = (hashCode * 59) + this.PatternWithDigits.GetHashCode(); + } if (this.PatternWithDigitsAndDelimiter != null) - hashCode = hashCode * 59 + this.PatternWithDigitsAndDelimiter.GetHashCode(); + { + hashCode = (hashCode * 59) + this.PatternWithDigitsAndDelimiter.GetHashCode(); + } return hashCode; } } @@ -286,61 +304,61 @@ public override int GetHashCode() public IEnumerable Validate(ValidationContext validationContext) { // Integer (int) maximum - if(this.Integer > (int)100) + if (this.Integer > (int)100) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); } // Integer (int) minimum - if(this.Integer < (int)10) + if (this.Integer < (int)10) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); } // Int32 (int) maximum - if(this.Int32 > (int)200) + if (this.Int32 > (int)200) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); } // Int32 (int) minimum - if(this.Int32 < (int)20) + if (this.Int32 < (int)20) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } // Number (decimal) maximum - if(this.Number > (decimal)543.2) + if (this.Number > (decimal)543.2) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); } // Number (decimal) minimum - if(this.Number < (decimal)32.1) + if (this.Number < (decimal)32.1) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); } // Float (float) maximum - if(this.Float > (float)987.6) + if (this.Float > (float)987.6) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); } // Float (float) minimum - if(this.Float < (float)54.3) + if (this.Float < (float)54.3) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); } // Double (double) maximum - if(this.Double > (double)123.4) + if (this.Double > (double)123.4) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); } // Double (double) minimum - if(this.Double < (double)67.8) + if (this.Double < (double)67.8) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); } @@ -353,13 +371,13 @@ public override int GetHashCode() } // Password (string) maxLength - if(this.Password != null && this.Password.Length > 64) + if (this.Password != null && this.Password.Length > 64) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be less than 64.", new [] { "Password" }); } // Password (string) minLength - if(this.Password != null && this.Password.Length < 10) + if (this.Password != null && this.Password.Length < 10) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" }); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index 81a69e9da4b3..579beb9a18de 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -66,7 +66,7 @@ protected GrandparentAnimal() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class GrandparentAnimal {\n"); sb.Append(" PetType: ").Append(PetType).Append("\n"); sb.Append("}\n"); @@ -112,7 +112,9 @@ public override int GetHashCode() { int hashCode = 41; if (this.PetType != null) - hashCode = hashCode * 59 + this.PetType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.PetType.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index 79ae107761aa..498c8226fc1b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -74,7 +74,7 @@ public bool ShouldSerializeFoo() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class HasOnlyReadOnly {\n"); sb.Append(" Bar: ").Append(Bar).Append("\n"); sb.Append(" Foo: ").Append(Foo).Append("\n"); @@ -121,9 +121,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.Bar != null) - hashCode = hashCode * 59 + this.Bar.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Bar.GetHashCode(); + } if (this.Foo != null) - hashCode = hashCode * 59 + this.Foo.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Foo.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/HealthCheckResult.cs index 06ccf424c78a..520aa05bac48 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/HealthCheckResult.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -53,7 +53,7 @@ public partial class HealthCheckResult : IEquatable, IValidat /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class HealthCheckResult {\n"); sb.Append(" NullableMessage: ").Append(NullableMessage).Append("\n"); sb.Append("}\n"); @@ -99,7 +99,9 @@ public override int GetHashCode() { int hashCode = 41; if (this.NullableMessage != null) - hashCode = hashCode * 59 + this.NullableMessage.GetHashCode(); + { + hashCode = (hashCode * 59) + this.NullableMessage.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/InlineResponseDefault.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/InlineResponseDefault.cs index 8b38704524b6..755f9aebc707 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/InlineResponseDefault.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/InlineResponseDefault.cs @@ -53,7 +53,7 @@ public partial class InlineResponseDefault : IEquatable, /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class InlineResponseDefault {\n"); sb.Append(" String: ").Append(String).Append("\n"); sb.Append("}\n"); @@ -99,7 +99,9 @@ public override int GetHashCode() { int hashCode = 41; if (this.String != null) - hashCode = hashCode * 59 + this.String.GetHashCode(); + { + hashCode = (hashCode * 59) + this.String.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index 8d02354be3f6..50e7ce4aaa8d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -74,7 +74,7 @@ protected IsoscelesTriangle() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class IsoscelesTriangle {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); @@ -121,9 +121,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } if (this.TriangleType != null) - hashCode = hashCode * 59 + this.TriangleType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/List.cs index a3e18100b375..33b69997a749 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/List.cs @@ -53,7 +53,7 @@ public partial class List : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class List {\n"); sb.Append(" _123List: ").Append(_123List).Append("\n"); sb.Append("}\n"); @@ -99,7 +99,9 @@ public override int GetHashCode() { int hashCode = 41; if (this._123List != null) - hashCode = hashCode * 59 + this._123List.GetHashCode(); + { + hashCode = (hashCode * 59) + this._123List.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/MapTest.cs index 7265530086eb..d947debc81c5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/MapTest.cs @@ -98,7 +98,7 @@ public enum InnerEnum /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class MapTest {\n"); sb.Append(" MapMapOfString: ").Append(MapMapOfString).Append("\n"); sb.Append(" MapOfEnumString: ").Append(MapOfEnumString).Append("\n"); @@ -147,12 +147,18 @@ public override int GetHashCode() { int hashCode = 41; if (this.MapMapOfString != null) - hashCode = hashCode * 59 + this.MapMapOfString.GetHashCode(); - hashCode = hashCode * 59 + this.MapOfEnumString.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MapMapOfString.GetHashCode(); + } + hashCode = (hashCode * 59) + this.MapOfEnumString.GetHashCode(); if (this.DirectMap != null) - hashCode = hashCode * 59 + this.DirectMap.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DirectMap.GetHashCode(); + } if (this.IndirectMap != null) - hashCode = hashCode * 59 + this.IndirectMap.GetHashCode(); + { + hashCode = (hashCode * 59) + this.IndirectMap.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index ff7fa7cfa9e1..44fc73ca3a98 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -69,7 +69,7 @@ public partial class MixedPropertiesAndAdditionalPropertiesClass : IEquatableString presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); @@ -117,11 +117,17 @@ public override int GetHashCode() { int hashCode = 41; if (this.Uuid != null) - hashCode = hashCode * 59 + this.Uuid.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); + } if (this.DateTime != null) - hashCode = hashCode * 59 + this.DateTime.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DateTime.GetHashCode(); + } if (this.Map != null) - hashCode = hashCode * 59 + this.Map.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Map.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Model200Response.cs index 94512afac2dc..938ffce9d00c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Model200Response.cs @@ -61,7 +61,7 @@ public partial class Model200Response : IEquatable, IValidatab /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Model200Response {\n"); sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" Class: ").Append(Class).Append("\n"); @@ -107,9 +107,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Name.GetHashCode(); + hashCode = (hashCode * 59) + this.Name.GetHashCode(); if (this.Class != null) - hashCode = hashCode * 59 + this.Class.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Class.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ModelClient.cs index 32ed922e3903..a6746a6136c1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ModelClient.cs @@ -53,7 +53,7 @@ public partial class ModelClient : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ModelClient {\n"); sb.Append(" _Client: ").Append(_Client).Append("\n"); sb.Append("}\n"); @@ -99,7 +99,9 @@ public override int GetHashCode() { int hashCode = 41; if (this._Client != null) - hashCode = hashCode * 59 + this._Client.GetHashCode(); + { + hashCode = (hashCode * 59) + this._Client.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Name.cs index 5432980b6bd6..560d91db2342 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Name.cs @@ -94,7 +94,7 @@ public bool ShouldSerialize_123Number() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Name {\n"); sb.Append(" _Name: ").Append(_Name).Append("\n"); sb.Append(" SnakeCase: ").Append(SnakeCase).Append("\n"); @@ -142,11 +142,13 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this._Name.GetHashCode(); - hashCode = hashCode * 59 + this.SnakeCase.GetHashCode(); + hashCode = (hashCode * 59) + this._Name.GetHashCode(); + hashCode = (hashCode * 59) + this.SnakeCase.GetHashCode(); if (this.Property != null) - hashCode = hashCode * 59 + this.Property.GetHashCode(); - hashCode = hashCode * 59 + this._123Number.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Property.GetHashCode(); + } + hashCode = (hashCode * 59) + this._123Number.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/NullableClass.cs index 3a34e8cc1288..57555c376785 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/NullableClass.cs @@ -142,7 +142,7 @@ public partial class NullableClass : Dictionary, IEquatableString presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class NullableClass {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" IntegerProp: ").Append(IntegerProp).Append("\n"); @@ -200,29 +200,53 @@ public override int GetHashCode() { int hashCode = base.GetHashCode(); if (this.IntegerProp != null) - hashCode = hashCode * 59 + this.IntegerProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.IntegerProp.GetHashCode(); + } if (this.NumberProp != null) - hashCode = hashCode * 59 + this.NumberProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.NumberProp.GetHashCode(); + } if (this.BooleanProp != null) - hashCode = hashCode * 59 + this.BooleanProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.BooleanProp.GetHashCode(); + } if (this.StringProp != null) - hashCode = hashCode * 59 + this.StringProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.StringProp.GetHashCode(); + } if (this.DateProp != null) - hashCode = hashCode * 59 + this.DateProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DateProp.GetHashCode(); + } if (this.DatetimeProp != null) - hashCode = hashCode * 59 + this.DatetimeProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DatetimeProp.GetHashCode(); + } if (this.ArrayNullableProp != null) - hashCode = hashCode * 59 + this.ArrayNullableProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayNullableProp.GetHashCode(); + } if (this.ArrayAndItemsNullableProp != null) - hashCode = hashCode * 59 + this.ArrayAndItemsNullableProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayAndItemsNullableProp.GetHashCode(); + } if (this.ArrayItemsNullable != null) - hashCode = hashCode * 59 + this.ArrayItemsNullable.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ArrayItemsNullable.GetHashCode(); + } if (this.ObjectNullableProp != null) - hashCode = hashCode * 59 + this.ObjectNullableProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ObjectNullableProp.GetHashCode(); + } if (this.ObjectAndItemsNullableProp != null) - hashCode = hashCode * 59 + this.ObjectAndItemsNullableProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ObjectAndItemsNullableProp.GetHashCode(); + } if (this.ObjectItemsNullable != null) - hashCode = hashCode * 59 + this.ObjectItemsNullable.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/NumberOnly.cs index 971605b38df6..467579e6689c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -53,7 +53,7 @@ public partial class NumberOnly : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class NumberOnly {\n"); sb.Append(" JustNumber: ").Append(JustNumber).Append("\n"); sb.Append("}\n"); @@ -98,7 +98,7 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.JustNumber.GetHashCode(); + hashCode = (hashCode * 59) + this.JustNumber.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 893a33830b98..308018f5d230 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -80,7 +80,7 @@ public partial class ObjectWithDeprecatedFields : IEquatableString presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ObjectWithDeprecatedFields {\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); sb.Append(" Id: ").Append(Id).Append("\n"); @@ -129,12 +129,18 @@ public override int GetHashCode() { int hashCode = 41; if (this.Uuid != null) - hashCode = hashCode * 59 + this.Uuid.GetHashCode(); - hashCode = hashCode * 59 + this.Id.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.DeprecatedRef != null) - hashCode = hashCode * 59 + this.DeprecatedRef.GetHashCode(); + { + hashCode = (hashCode * 59) + this.DeprecatedRef.GetHashCode(); + } if (this.Bars != null) - hashCode = hashCode * 59 + this.Bars.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Bars.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Order.cs index b985923e0233..306417b4a86b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Order.cs @@ -121,7 +121,7 @@ public enum StatusEnum /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Order {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" PetId: ").Append(PetId).Append("\n"); @@ -171,13 +171,15 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Id.GetHashCode(); - hashCode = hashCode * 59 + this.PetId.GetHashCode(); - hashCode = hashCode * 59 + this.Quantity.GetHashCode(); + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.PetId.GetHashCode(); + hashCode = (hashCode * 59) + this.Quantity.GetHashCode(); if (this.ShipDate != null) - hashCode = hashCode * 59 + this.ShipDate.GetHashCode(); - hashCode = hashCode * 59 + this.Status.GetHashCode(); - hashCode = hashCode * 59 + this.Complete.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShipDate.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); + hashCode = (hashCode * 59) + this.Complete.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/OuterComposite.cs index a2f05013b0b1..53d715349852 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -69,7 +69,7 @@ public partial class OuterComposite : IEquatable, IValidatableOb /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class OuterComposite {\n"); sb.Append(" MyNumber: ").Append(MyNumber).Append("\n"); sb.Append(" MyString: ").Append(MyString).Append("\n"); @@ -116,10 +116,12 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.MyNumber.GetHashCode(); + hashCode = (hashCode * 59) + this.MyNumber.GetHashCode(); if (this.MyString != null) - hashCode = hashCode * 59 + this.MyString.GetHashCode(); - hashCode = hashCode * 59 + this.MyBoolean.GetHashCode(); + { + hashCode = (hashCode * 59) + this.MyString.GetHashCode(); + } + hashCode = (hashCode * 59) + this.MyBoolean.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ParentPet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ParentPet.cs index 7ddd99d4e0f8..c9f4484a5a6d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ParentPet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ParentPet.cs @@ -54,7 +54,7 @@ public ParentPet(string petType = "ParentPet") : base(petType) /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ParentPet {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append("}\n"); @@ -120,7 +120,10 @@ public override int GetHashCode() /// Validation Result protected IEnumerable BaseValidate(ValidationContext validationContext) { - foreach(var x in BaseValidate(validationContext)) yield return x; + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } yield break; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Pet.cs index 1e864bcd01dd..f540c101ec6a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Pet.cs @@ -134,7 +134,7 @@ protected Pet() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Pet {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Category: ").Append(Category).Append("\n"); @@ -184,16 +184,24 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.Category != null) - hashCode = hashCode * 59 + this.Category.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Category.GetHashCode(); + } if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } if (this.PhotoUrls != null) - hashCode = hashCode * 59 + this.PhotoUrls.GetHashCode(); + { + hashCode = (hashCode * 59) + this.PhotoUrls.GetHashCode(); + } if (this.Tags != null) - hashCode = hashCode * 59 + this.Tags.GetHashCode(); - hashCode = hashCode * 59 + this.Status.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Tags.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index c55a39f75d26..09312553eca0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -62,7 +62,7 @@ protected QuadrilateralInterface() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class QuadrilateralInterface {\n"); sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); sb.Append("}\n"); @@ -108,7 +108,9 @@ public override int GetHashCode() { int hashCode = 41; if (this.QuadrilateralType != null) - hashCode = hashCode * 59 + this.QuadrilateralType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.QuadrilateralType.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index 08a4bf03ab3d..1bf6cf2fdf5e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -67,7 +67,7 @@ public bool ShouldSerializeBar() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ReadOnlyFirst {\n"); sb.Append(" Bar: ").Append(Bar).Append("\n"); sb.Append(" Baz: ").Append(Baz).Append("\n"); @@ -114,9 +114,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.Bar != null) - hashCode = hashCode * 59 + this.Bar.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Bar.GetHashCode(); + } if (this.Baz != null) - hashCode = hashCode * 59 + this.Baz.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Baz.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Return.cs index 8250818df72c..250852d067ca 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Return.cs @@ -53,7 +53,7 @@ public partial class Return : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Return {\n"); sb.Append(" _Return: ").Append(_Return).Append("\n"); sb.Append("}\n"); @@ -98,7 +98,7 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this._Return.GetHashCode(); + hashCode = (hashCode * 59) + this._Return.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index 80bd3d4a1789..f9dd3abd817d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -74,7 +74,7 @@ protected ScaleneTriangle() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ScaleneTriangle {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); @@ -121,9 +121,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } if (this.TriangleType != null) - hashCode = hashCode * 59 + this.TriangleType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ShapeInterface.cs index f147ffe20c51..00642181a1fc 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -62,7 +62,7 @@ protected ShapeInterface() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ShapeInterface {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append("}\n"); @@ -108,7 +108,9 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index 019b6fddad7b..14fe11a65296 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -74,7 +74,7 @@ protected SimpleQuadrilateral() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class SimpleQuadrilateral {\n"); sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); @@ -121,9 +121,13 @@ public override int GetHashCode() { int hashCode = 41; if (this.ShapeType != null) - hashCode = hashCode * 59 + this.ShapeType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShapeType.GetHashCode(); + } if (this.QuadrilateralType != null) - hashCode = hashCode * 59 + this.QuadrilateralType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.QuadrilateralType.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/SpecialModelName.cs index 0323c228a6ff..8c202780cc1c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -61,7 +61,7 @@ public partial class SpecialModelName : IEquatable, IValidatab /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class SpecialModelName {\n"); sb.Append(" SpecialPropertyName: ").Append(SpecialPropertyName).Append("\n"); sb.Append(" _SpecialModelName: ").Append(_SpecialModelName).Append("\n"); @@ -107,9 +107,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.SpecialPropertyName.GetHashCode(); + hashCode = (hashCode * 59) + this.SpecialPropertyName.GetHashCode(); if (this._SpecialModelName != null) - hashCode = hashCode * 59 + this._SpecialModelName.GetHashCode(); + { + hashCode = (hashCode * 59) + this._SpecialModelName.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Tag.cs index df2fdd191412..a40a78f7267b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Tag.cs @@ -61,7 +61,7 @@ public partial class Tag : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Tag {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); @@ -107,9 +107,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/TriangleInterface.cs index f2a5d1cb779b..6eec5e9b9359 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -62,7 +62,7 @@ protected TriangleInterface() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class TriangleInterface {\n"); sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); sb.Append("}\n"); @@ -108,7 +108,9 @@ public override int GetHashCode() { int hashCode = 41; if (this.TriangleType != null) - hashCode = hashCode * 59 + this.TriangleType.GetHashCode(); + { + hashCode = (hashCode * 59) + this.TriangleType.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/User.cs index 07a5171eb905..874421d46553 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/User.cs @@ -146,7 +146,7 @@ public partial class User : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class User {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Username: ").Append(Username).Append("\n"); @@ -202,28 +202,48 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.Username != null) - hashCode = hashCode * 59 + this.Username.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Username.GetHashCode(); + } if (this.FirstName != null) - hashCode = hashCode * 59 + this.FirstName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.FirstName.GetHashCode(); + } if (this.LastName != null) - hashCode = hashCode * 59 + this.LastName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.LastName.GetHashCode(); + } if (this.Email != null) - hashCode = hashCode * 59 + this.Email.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Email.GetHashCode(); + } if (this.Password != null) - hashCode = hashCode * 59 + this.Password.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Password.GetHashCode(); + } if (this.Phone != null) - hashCode = hashCode * 59 + this.Phone.GetHashCode(); - hashCode = hashCode * 59 + this.UserStatus.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Phone.GetHashCode(); + } + hashCode = (hashCode * 59) + this.UserStatus.GetHashCode(); if (this.ObjectWithNoDeclaredProps != null) - hashCode = hashCode * 59 + this.ObjectWithNoDeclaredProps.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ObjectWithNoDeclaredProps.GetHashCode(); + } if (this.ObjectWithNoDeclaredPropsNullable != null) - hashCode = hashCode * 59 + this.ObjectWithNoDeclaredPropsNullable.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ObjectWithNoDeclaredPropsNullable.GetHashCode(); + } if (this.AnyTypeProp != null) - hashCode = hashCode * 59 + this.AnyTypeProp.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AnyTypeProp.GetHashCode(); + } if (this.AnyTypePropNullable != null) - hashCode = hashCode * 59 + this.AnyTypePropNullable.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AnyTypePropNullable.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Whale.cs index 2795e2fe59ff..74df24d5a8f5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Whale.cs @@ -78,7 +78,7 @@ protected Whale() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Whale {\n"); sb.Append(" HasBaleen: ").Append(HasBaleen).Append("\n"); sb.Append(" HasTeeth: ").Append(HasTeeth).Append("\n"); @@ -125,10 +125,12 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.HasBaleen.GetHashCode(); - hashCode = hashCode * 59 + this.HasTeeth.GetHashCode(); + hashCode = (hashCode * 59) + this.HasBaleen.GetHashCode(); + hashCode = (hashCode * 59) + this.HasTeeth.GetHashCode(); if (this.ClassName != null) - hashCode = hashCode * 59 + this.ClassName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Zebra.cs index bf9735fb37ed..4fb60ed8ddf2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Zebra.cs @@ -106,7 +106,7 @@ protected Zebra() /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Zebra {\n"); sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); @@ -154,11 +154,15 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = base.GetHashCode(); - hashCode = hashCode * 59 + this.Type.GetHashCode(); + hashCode = (hashCode * 59) + this.Type.GetHashCode(); if (this.ClassName != null) - hashCode = hashCode * 59 + this.ClassName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ClassName.GetHashCode(); + } if (this.AdditionalProperties != null) - hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Api/PetApi.cs index 6f8809911e94..08b2900cec60 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Api/PetApi.cs @@ -538,7 +538,9 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) { // verify the required parameter 'pet' is set if (pet == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->AddPet"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -554,10 +556,16 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = pet; @@ -570,11 +578,13 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) // make the HTTP request var localVarResponse = this.Client.Post("/pet", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("AddPet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -604,7 +614,9 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) { // verify the required parameter 'pet' is set if (pet == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->AddPet"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -620,12 +632,17 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = pet; @@ -637,13 +654,15 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/pet", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("AddPet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -680,10 +699,16 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (apiKey != null) @@ -700,11 +725,13 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) // make the HTTP request var localVarResponse = this.Client.Delete("/pet/{petId}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeletePet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -743,12 +770,17 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (apiKey != null) @@ -764,13 +796,15 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo(Pet pet) } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeletePet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -798,7 +832,9 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn { // verify the required parameter 'status' is set if (status == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'status' when calling PetApi->FindPetsByStatus"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -812,10 +848,16 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "status", status)); @@ -828,11 +870,13 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn // make the HTTP request var localVarResponse = this.Client.Get>("/pet/findByStatus", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FindPetsByStatus", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -862,7 +906,9 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn { // verify the required parameter 'status' is set if (status == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'status' when calling PetApi->FindPetsByStatus"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -876,12 +922,17 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "status", status)); @@ -893,13 +944,15 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByStatusWithHttpIn } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync>("/pet/findByStatus", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FindPetsByStatus", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -929,7 +982,9 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo { // verify the required parameter 'tags' is set if (tags == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'tags' when calling PetApi->FindPetsByTags"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -943,10 +998,16 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "tags", tags)); @@ -959,11 +1020,13 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo // make the HTTP request var localVarResponse = this.Client.Get>("/pet/findByTags", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FindPetsByTags", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -995,7 +1058,9 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo { // verify the required parameter 'tags' is set if (tags == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'tags' when calling PetApi->FindPetsByTags"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1009,12 +1074,17 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "tags", tags)); @@ -1026,13 +1096,15 @@ public Org.OpenAPITools.Client.ApiResponse> FindPetsByTagsWithHttpInfo } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync>("/pet/findByTags", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("FindPetsByTags", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1070,10 +1142,16 @@ public Org.OpenAPITools.Client.ApiResponse GetPetByIdWithHttpInfo(long petI }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter @@ -1085,11 +1163,13 @@ public Org.OpenAPITools.Client.ApiResponse GetPetByIdWithHttpInfo(long petI // make the HTTP request var localVarResponse = this.Client.Get("/pet/{petId}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetPetById", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1129,12 +1209,17 @@ public Org.OpenAPITools.Client.ApiResponse GetPetByIdWithHttpInfo(long petI "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter @@ -1145,13 +1230,15 @@ public Org.OpenAPITools.Client.ApiResponse GetPetByIdWithHttpInfo(long petI } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetPetById", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1179,7 +1266,9 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet) { // verify the required parameter 'pet' is set if (pet == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->UpdatePet"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1195,10 +1284,16 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet) }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = pet; @@ -1211,11 +1306,13 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet) // make the HTTP request var localVarResponse = this.Client.Put("/pet", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdatePet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1245,7 +1342,9 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet) { // verify the required parameter 'pet' is set if (pet == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->UpdatePet"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1261,12 +1360,17 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet) "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = pet; @@ -1278,13 +1382,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet) } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/pet", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdatePet", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1324,10 +1430,16 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet) }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (name != null) @@ -1348,11 +1460,13 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet) // make the HTTP request var localVarResponse = this.Client.Post("/pet/{petId}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdatePetWithForm", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1394,12 +1508,17 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet) string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (name != null) @@ -1419,13 +1538,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet) } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdatePetWithForm", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1467,10 +1588,16 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet) }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (additionalMetadata != null) @@ -1491,11 +1618,13 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet) // make the HTTP request var localVarResponse = this.Client.Post("/pet/{petId}/uploadImage", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UploadFile", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1539,12 +1668,17 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet) "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (additionalMetadata != null) @@ -1564,13 +1698,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo(Pet pet) } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/pet/{petId}/uploadImage", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UploadFile", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Api/StoreApi.cs index 67f8c23d6ca6..81a9795bedf9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Api/StoreApi.cs @@ -345,7 +345,9 @@ public Org.OpenAPITools.Client.ApiResponse DeleteOrderWithHttpInfo(strin { // verify the required parameter 'orderId' is set if (orderId == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -357,21 +359,29 @@ public Org.OpenAPITools.Client.ApiResponse DeleteOrderWithHttpInfo(strin }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("orderId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter // make the HTTP request var localVarResponse = this.Client.Delete("/store/order/{orderId}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeleteOrder", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -400,7 +410,9 @@ public Org.OpenAPITools.Client.ApiResponse DeleteOrderWithHttpInfo(strin { // verify the required parameter 'orderId' is set if (orderId == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -412,24 +424,31 @@ public Org.OpenAPITools.Client.ApiResponse DeleteOrderWithHttpInfo(strin string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("orderId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/store/order/{orderId}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeleteOrder", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -464,10 +483,16 @@ public Org.OpenAPITools.Client.ApiResponse> GetInventory }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // authentication (api_key) required @@ -478,11 +503,13 @@ public Org.OpenAPITools.Client.ApiResponse> GetInventory // make the HTTP request var localVarResponse = this.Client.Get>("/store/inventory", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetInventory", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -519,12 +546,17 @@ public Org.OpenAPITools.Client.ApiResponse> GetInventory "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // authentication (api_key) required @@ -534,13 +566,15 @@ public Org.OpenAPITools.Client.ApiResponse> GetInventory } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync>("/store/inventory", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetInventory", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -578,21 +612,29 @@ public Org.OpenAPITools.Client.ApiResponse GetOrderByIdWithHttpInfo(long }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("orderId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter // make the HTTP request var localVarResponse = this.Client.Get("/store/order/{orderId}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetOrderById", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -632,24 +674,31 @@ public Org.OpenAPITools.Client.ApiResponse GetOrderByIdWithHttpInfo(long "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("orderId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/store/order/{orderId}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetOrderById", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -677,7 +726,9 @@ public Org.OpenAPITools.Client.ApiResponse PlaceOrderWithHttpInfo(Order o { // verify the required parameter 'order' is set if (order == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'order' when calling StoreApi->PlaceOrder"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -692,21 +743,29 @@ public Org.OpenAPITools.Client.ApiResponse PlaceOrderWithHttpInfo(Order o }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = order; // make the HTTP request var localVarResponse = this.Client.Post("/store/order", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("PlaceOrder", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -736,7 +795,9 @@ public Org.OpenAPITools.Client.ApiResponse PlaceOrderWithHttpInfo(Order o { // verify the required parameter 'order' is set if (order == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'order' when calling StoreApi->PlaceOrder"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -751,24 +812,31 @@ public Org.OpenAPITools.Client.ApiResponse PlaceOrderWithHttpInfo(Order o "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = order; // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/store/order", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("PlaceOrder", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Api/UserApi.cs index ac62b62f067f..907a252179d6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Api/UserApi.cs @@ -517,7 +517,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUserWithHttpInfo(User u { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -530,10 +532,16 @@ public Org.OpenAPITools.Client.ApiResponse CreateUserWithHttpInfo(User u }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; @@ -545,11 +553,13 @@ public Org.OpenAPITools.Client.ApiResponse CreateUserWithHttpInfo(User u // make the HTTP request var localVarResponse = this.Client.Post("/user", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -578,7 +588,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUserWithHttpInfo(User u { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -591,12 +603,17 @@ public Org.OpenAPITools.Client.ApiResponse CreateUserWithHttpInfo(User u string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; @@ -607,13 +624,15 @@ public Org.OpenAPITools.Client.ApiResponse CreateUserWithHttpInfo(User u } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/user", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -640,7 +659,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithArrayInputWith { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithArrayInput"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -653,10 +674,16 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithArrayInputWith }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; @@ -668,11 +695,13 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithArrayInputWith // make the HTTP request var localVarResponse = this.Client.Post("/user/createWithArray", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUsersWithArrayInput", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -701,7 +730,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithArrayInputWith { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithArrayInput"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -714,12 +745,17 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithArrayInputWith string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; @@ -730,13 +766,15 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithArrayInputWith } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/user/createWithArray", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUsersWithArrayInput", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -763,7 +801,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithListInputWithH { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithListInput"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -776,10 +816,16 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithListInputWithH }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; @@ -791,11 +837,13 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithListInputWithH // make the HTTP request var localVarResponse = this.Client.Post("/user/createWithList", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUsersWithListInput", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -824,7 +872,9 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithListInputWithH { // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithListInput"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -837,12 +887,17 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithListInputWithH string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.Data = user; @@ -853,13 +908,15 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithListInputWithH } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/user/createWithList", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("CreateUsersWithListInput", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -886,7 +943,9 @@ public Org.OpenAPITools.Client.ApiResponse DeleteUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->DeleteUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -898,10 +957,16 @@ public Org.OpenAPITools.Client.ApiResponse DeleteUserWithHttpInfo(string }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter @@ -913,11 +978,13 @@ public Org.OpenAPITools.Client.ApiResponse DeleteUserWithHttpInfo(string // make the HTTP request var localVarResponse = this.Client.Delete("/user/{username}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeleteUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -946,7 +1013,9 @@ public Org.OpenAPITools.Client.ApiResponse DeleteUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->DeleteUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -958,12 +1027,17 @@ public Org.OpenAPITools.Client.ApiResponse DeleteUserWithHttpInfo(string string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter @@ -974,13 +1048,15 @@ public Org.OpenAPITools.Client.ApiResponse DeleteUserWithHttpInfo(string } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("DeleteUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1008,7 +1084,9 @@ public Org.OpenAPITools.Client.ApiResponse GetUserByNameWithHttpInfo(strin { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->GetUserByName"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1022,21 +1100,29 @@ public Org.OpenAPITools.Client.ApiResponse GetUserByNameWithHttpInfo(strin }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter // make the HTTP request var localVarResponse = this.Client.Get("/user/{username}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetUserByName", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1066,7 +1152,9 @@ public Org.OpenAPITools.Client.ApiResponse GetUserByNameWithHttpInfo(strin { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->GetUserByName"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1080,24 +1168,31 @@ public Org.OpenAPITools.Client.ApiResponse GetUserByNameWithHttpInfo(strin "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetUserByName", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1127,11 +1222,15 @@ public Org.OpenAPITools.Client.ApiResponse LoginUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->LoginUser"); + } // verify the required parameter 'password' is set if (password == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'password' when calling UserApi->LoginUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1145,10 +1244,16 @@ public Org.OpenAPITools.Client.ApiResponse LoginUserWithHttpInfo(string }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "username", username)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "password", password)); @@ -1156,11 +1261,13 @@ public Org.OpenAPITools.Client.ApiResponse LoginUserWithHttpInfo(string // make the HTTP request var localVarResponse = this.Client.Get("/user/login", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("LoginUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1192,11 +1299,15 @@ public Org.OpenAPITools.Client.ApiResponse LoginUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->LoginUser"); + } // verify the required parameter 'password' is set if (password == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'password' when calling UserApi->LoginUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1210,25 +1321,32 @@ public Org.OpenAPITools.Client.ApiResponse LoginUserWithHttpInfo(string "application/json" }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "username", username)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "password", password)); // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/user/login", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("LoginUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1261,10 +1379,16 @@ public Org.OpenAPITools.Client.ApiResponse LogoutUserWithHttpInfo() }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // authentication (api_key) required @@ -1275,11 +1399,13 @@ public Org.OpenAPITools.Client.ApiResponse LogoutUserWithHttpInfo() // make the HTTP request var localVarResponse = this.Client.Get("/user/logout", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("LogoutUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1314,12 +1440,17 @@ public Org.OpenAPITools.Client.ApiResponse LogoutUserWithHttpInfo() string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } // authentication (api_key) required @@ -1329,13 +1460,15 @@ public Org.OpenAPITools.Client.ApiResponse LogoutUserWithHttpInfo() } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/user/logout", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("LogoutUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1364,11 +1497,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); + } // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->UpdateUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1381,10 +1518,16 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo(string }; var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter localVarRequestOptions.Data = user; @@ -1397,11 +1540,13 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo(string // make the HTTP request var localVarResponse = this.Client.Put("/user/{username}", localVarRequestOptions, this.Configuration); - if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdateUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; @@ -1432,11 +1577,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo(string { // verify the required parameter 'username' is set if (username == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); + } // verify the required parameter 'user' is set if (user == null) + { throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->UpdateUser"); + } Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1449,12 +1598,17 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo(string string[] _accepts = new string[] { }; - var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); - if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); - if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter localVarRequestOptions.Data = user; @@ -1466,13 +1620,15 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo(string } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("UpdateUser", localVarResponse); - if (_exception != null) throw _exception; + if (_exception != null) + { + throw _exception; + } } return localVarResponse; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/ApiResponse.cs index ab1912d31c8a..cc3ceb025cb7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -69,7 +69,7 @@ public partial class ApiResponse : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class ApiResponse {\n"); sb.Append(" Code: ").Append(Code).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); @@ -116,11 +116,15 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Code.GetHashCode(); + hashCode = (hashCode * 59) + this.Code.GetHashCode(); if (this.Type != null) - hashCode = hashCode * 59 + this.Type.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Type.GetHashCode(); + } if (this.Message != null) - hashCode = hashCode * 59 + this.Message.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Message.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Category.cs index d6e998cd0080..e1cd62ca772a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Category.cs @@ -61,7 +61,7 @@ public partial class Category : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Category {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); @@ -107,9 +107,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Order.cs index 5abdf28d6a74..df6c3d1d1380 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Order.cs @@ -121,7 +121,7 @@ public enum StatusEnum /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Order {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" PetId: ").Append(PetId).Append("\n"); @@ -171,13 +171,15 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Id.GetHashCode(); - hashCode = hashCode * 59 + this.PetId.GetHashCode(); - hashCode = hashCode * 59 + this.Quantity.GetHashCode(); + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.PetId.GetHashCode(); + hashCode = (hashCode * 59) + this.Quantity.GetHashCode(); if (this.ShipDate != null) - hashCode = hashCode * 59 + this.ShipDate.GetHashCode(); - hashCode = hashCode * 59 + this.Status.GetHashCode(); - hashCode = hashCode * 59 + this.Complete.GetHashCode(); + { + hashCode = (hashCode * 59) + this.ShipDate.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); + hashCode = (hashCode * 59) + this.Complete.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Pet.cs index 7f9ca2654909..0416d758d6f0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Pet.cs @@ -135,7 +135,7 @@ protected Pet() { } /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Pet {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Category: ").Append(Category).Append("\n"); @@ -185,16 +185,24 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.Category != null) - hashCode = hashCode * 59 + this.Category.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Category.GetHashCode(); + } if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } if (this.PhotoUrls != null) - hashCode = hashCode * 59 + this.PhotoUrls.GetHashCode(); + { + hashCode = (hashCode * 59) + this.PhotoUrls.GetHashCode(); + } if (this.Tags != null) - hashCode = hashCode * 59 + this.Tags.GetHashCode(); - hashCode = hashCode * 59 + this.Status.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Tags.GetHashCode(); + } + hashCode = (hashCode * 59) + this.Status.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Tag.cs index caf1c640c2e0..d0042987aae4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/Tag.cs @@ -61,7 +61,7 @@ public partial class Tag : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class Tag {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); @@ -107,9 +107,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/User.cs index aa0d4a26a819..8b03a001b074 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/src/Org.OpenAPITools/Model/User.cs @@ -110,7 +110,7 @@ public partial class User : IEquatable, IValidatableObject /// String presentation of the object public override string ToString() { - var sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(); sb.Append("class User {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Username: ").Append(Username).Append("\n"); @@ -162,20 +162,32 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Id.GetHashCode(); + hashCode = (hashCode * 59) + this.Id.GetHashCode(); if (this.Username != null) - hashCode = hashCode * 59 + this.Username.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Username.GetHashCode(); + } if (this.FirstName != null) - hashCode = hashCode * 59 + this.FirstName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.FirstName.GetHashCode(); + } if (this.LastName != null) - hashCode = hashCode * 59 + this.LastName.GetHashCode(); + { + hashCode = (hashCode * 59) + this.LastName.GetHashCode(); + } if (this.Email != null) - hashCode = hashCode * 59 + this.Email.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Email.GetHashCode(); + } if (this.Password != null) - hashCode = hashCode * 59 + this.Password.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Password.GetHashCode(); + } if (this.Phone != null) - hashCode = hashCode * 59 + this.Phone.GetHashCode(); - hashCode = hashCode * 59 + this.UserStatus.GetHashCode(); + { + hashCode = (hashCode * 59) + this.Phone.GetHashCode(); + } + hashCode = (hashCode * 59) + this.UserStatus.GetHashCode(); return hashCode; } } From 08eaafa871b536e2f357fd282483f4bc797292c2 Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Thu, 25 Nov 2021 01:17:50 -0500 Subject: [PATCH 034/117] Add operation level servers support for java okhttp-gson client (#10925) * Add Operation Servers to {operation}Call method * add getter/setter methods Add methods for hostIndex and customBaseUrl * Fix return types for getters * Add custom baseUrl logic if you dont specifically declare a custom base url using the set method then it uses the 1st server in the operation host index array if no custom url is set and the operation base path array is empty however, the call throws an exception * Update server selection logic First checks to see if a custom url is provided If not, checks to see if operation level server is defined and uses the supplied host index (default 0) If neither is supplied, uses the ApiClient default base path * Update samples and docs --- .../libraries/okhttp-gson/ApiClient.mustache | 16 +- .../Java/libraries/okhttp-gson/api.mustache | 34 ++- .../org/openapitools/client/ApiClient.java | 16 +- .../org/openapitools/client/api/PingApi.java | 34 ++- .../org/openapitools/client/ApiClient.java | 16 +- .../client/api/AnotherFakeApi.java | 34 ++- .../org/openapitools/client/api/FakeApi.java | 242 +++++++++++++++++- .../client/api/FakeClassnameTags123Api.java | 34 ++- .../org/openapitools/client/api/PetApi.java | 162 +++++++++++- .../org/openapitools/client/api/StoreApi.java | 82 +++++- .../org/openapitools/client/api/UserApi.java | 146 ++++++++++- .../org/openapitools/client/ApiClient.java | 16 +- .../client/api/AnotherFakeApi.java | 34 ++- .../org/openapitools/client/api/FakeApi.java | 242 +++++++++++++++++- .../client/api/FakeClassnameTags123Api.java | 34 ++- .../org/openapitools/client/api/PetApi.java | 162 +++++++++++- .../org/openapitools/client/api/StoreApi.java | 82 +++++- .../org/openapitools/client/api/UserApi.java | 146 ++++++++++- .../org/openapitools/client/ApiClient.java | 16 +- .../client/api/AnotherFakeApi.java | 34 ++- .../org/openapitools/client/api/FakeApi.java | 242 +++++++++++++++++- .../client/api/FakeClassnameTags123Api.java | 34 ++- .../org/openapitools/client/api/PetApi.java | 162 +++++++++++- .../org/openapitools/client/api/StoreApi.java | 82 +++++- .../org/openapitools/client/api/UserApi.java | 146 ++++++++++- 25 files changed, 2105 insertions(+), 143 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache index 732551cec585..a0c3c4e5b7c8 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache @@ -1314,8 +1314,8 @@ public class ApiClient { * @return The HTTP call * @throws org.openapitools.client.ApiException If fail to serialize the request body object */ - public Call buildCall(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - Request request = buildRequest(path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); + public Call buildCall(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + Request request = buildRequest(baseUrl, path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); return httpClient.newCall(request); } @@ -1336,12 +1336,12 @@ public class ApiClient { * @return The HTTP request * @throws org.openapitools.client.ApiException If fail to serialize the request body object */ - public Request buildRequest(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + public Request buildRequest(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams List allQueryParams = new ArrayList(queryParams); allQueryParams.addAll(collectionQueryParams); - final String url = buildUrl(path, queryParams, collectionQueryParams); + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); // prepare HTTP request body RequestBody reqBody; @@ -1396,9 +1396,13 @@ public class ApiClient { * @param collectionQueryParams The collection query parameters * @return The full URL */ - public String buildUrl(String path, List queryParams, List collectionQueryParams) { + public String buildUrl(String baseUrl, String path, List queryParams, List collectionQueryParams) { final StringBuilder url = new StringBuilder(); - url.append(basePath).append(path); + if (baseUrl != null) { + url.append(baseUrl).append(path); + } else { + url.append(basePath).append(path); + } if (queryParams != null && !queryParams.isEmpty()) { // support (constant) query string in `path`, e.g. "/posts?draft=1" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache index 525d56fa5d51..50b7cfc5ed53 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache @@ -55,6 +55,8 @@ import java.io.InputStream; {{#operations}} public class {{classname}} { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public {{classname}}() { this(Configuration.getDefaultApiClient()); @@ -72,6 +74,22 @@ public class {{classname}} { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + {{#operation}} {{^vendorExtensions.x-group-parameters}}/** * Build call for {{operationId}}{{#allParams}} @@ -100,6 +118,20 @@ public class {{classname}} { @Deprecated {{/isDeprecated}} public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} okhttp3.Call {{operationId}}Call({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { {{#servers}}"{{{url}}}"{{^-last}}, {{/-last}}{{/servers}} }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; // create path and map variables @@ -177,7 +209,7 @@ public class {{classname}} { } String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; - return localVarApiClient.buildCall(localVarPath, {{^dynamicOperations}}"{{httpMethod}}"{{/dynamicOperations}}{{#dynamicOperations}}apiOperation.getMethod(){{/dynamicOperations}}, localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, {{^dynamicOperations}}"{{httpMethod}}"{{/dynamicOperations}}{{#dynamicOperations}}apiOperation.getMethod(){{/dynamicOperations}}, localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } {{#isDeprecated}} diff --git a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiClient.java index 443b6003638b..843d13b69a1c 100644 --- a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiClient.java @@ -1102,8 +1102,8 @@ public T handleResponse(Response response, Type returnType) throws ApiExcept * @return The HTTP call * @throws org.openapitools.client.ApiException If fail to serialize the request body object */ - public Call buildCall(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - Request request = buildRequest(path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); + public Call buildCall(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + Request request = buildRequest(baseUrl, path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); return httpClient.newCall(request); } @@ -1124,12 +1124,12 @@ public Call buildCall(String path, String method, List queryParams, List

    queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + public Request buildRequest(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams List allQueryParams = new ArrayList(queryParams); allQueryParams.addAll(collectionQueryParams); - final String url = buildUrl(path, queryParams, collectionQueryParams); + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); // prepare HTTP request body RequestBody reqBody; @@ -1184,9 +1184,13 @@ public Request buildRequest(String path, String method, List queryParams, * @param collectionQueryParams The collection query parameters * @return The full URL */ - public String buildUrl(String path, List queryParams, List collectionQueryParams) { + public String buildUrl(String baseUrl, String path, List queryParams, List collectionQueryParams) { final StringBuilder url = new StringBuilder(); - url.append(basePath).append(path); + if (baseUrl != null) { + url.append(baseUrl).append(path); + } else { + url.append(basePath).append(path); + } if (queryParams != null && !queryParams.isEmpty()) { // support (constant) query string in `path`, e.g. "/posts?draft=1" diff --git a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/api/PingApi.java b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/api/PingApi.java index c29f49e68a36..2f60324f3765 100644 --- a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/api/PingApi.java +++ b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/api/PingApi.java @@ -38,6 +38,8 @@ public class PingApi { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public PingApi() { this(Configuration.getDefaultApiClient()); @@ -55,6 +57,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for postPing * @param someObj (optional) @@ -68,6 +86,20 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call postPingCall(SomeObj someObj, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = someObj; // create path and map variables @@ -96,7 +128,7 @@ public okhttp3.Call postPingCall(SomeObj someObj, final ApiCallback _callback) t } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java index 32fb9f79f0f2..69d6469c85a8 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java @@ -1180,8 +1180,8 @@ public T handleResponse(Response response, Type returnType) throws ApiExcept * @return The HTTP call * @throws org.openapitools.client.ApiException If fail to serialize the request body object */ - public Call buildCall(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - Request request = buildRequest(path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); + public Call buildCall(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + Request request = buildRequest(baseUrl, path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); return httpClient.newCall(request); } @@ -1202,12 +1202,12 @@ public Call buildCall(String path, String method, List queryParams, List

    queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + public Request buildRequest(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams List allQueryParams = new ArrayList(queryParams); allQueryParams.addAll(collectionQueryParams); - final String url = buildUrl(path, queryParams, collectionQueryParams); + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); // prepare HTTP request body RequestBody reqBody; @@ -1262,9 +1262,13 @@ public Request buildRequest(String path, String method, List queryParams, * @param collectionQueryParams The collection query parameters * @return The full URL */ - public String buildUrl(String path, List queryParams, List collectionQueryParams) { + public String buildUrl(String baseUrl, String path, List queryParams, List collectionQueryParams) { final StringBuilder url = new StringBuilder(); - url.append(basePath).append(path); + if (baseUrl != null) { + url.append(baseUrl).append(path); + } else { + url.append(basePath).append(path); + } if (queryParams != null && !queryParams.isEmpty()) { // support (constant) query string in `path`, e.g. "/posts?draft=1" diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index c93b4ce865a3..f85c9c873bf8 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -40,6 +40,8 @@ public class AnotherFakeApi { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public AnotherFakeApi() { this(Configuration.getDefaultApiClient()); @@ -57,6 +59,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for call123testSpecialTags * @param body client model (required) @@ -70,6 +88,20 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call call123testSpecialTagsCall(Client body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -106,7 +138,7 @@ public okhttp3.Call call123testSpecialTagsCall(Client body, final ApiCallback _c } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeApi.java index 06844d6e641b..5052c1b986c1 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeApi.java @@ -48,6 +48,8 @@ public class FakeApi { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public FakeApi() { this(Configuration.getDefaultApiClient()); @@ -65,6 +67,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for createXmlItem * @param xmlItem XmlItem Body (required) @@ -78,6 +96,20 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call createXmlItemCall(XmlItem xmlItem, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = xmlItem; // create path and map variables @@ -114,7 +146,7 @@ public okhttp3.Call createXmlItemCall(XmlItem xmlItem, final ApiCallback _callba } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -195,6 +227,20 @@ public okhttp3.Call createXmlItemAsync(XmlItem xmlItem, final ApiCallback */ public okhttp3.Call fakeOuterBooleanSerializeCall(Boolean body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -231,7 +277,7 @@ public okhttp3.Call fakeOuterBooleanSerializeCall(Boolean body, final ApiCallbac } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -311,6 +357,20 @@ public okhttp3.Call fakeOuterBooleanSerializeAsync(Boolean body, final ApiCallba */ public okhttp3.Call fakeOuterCompositeSerializeCall(OuterComposite body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -347,7 +407,7 @@ public okhttp3.Call fakeOuterCompositeSerializeCall(OuterComposite body, final A } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -427,6 +487,20 @@ public okhttp3.Call fakeOuterCompositeSerializeAsync(OuterComposite body, final */ public okhttp3.Call fakeOuterNumberSerializeCall(BigDecimal body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -463,7 +537,7 @@ public okhttp3.Call fakeOuterNumberSerializeCall(BigDecimal body, final ApiCallb } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -543,6 +617,20 @@ public okhttp3.Call fakeOuterNumberSerializeAsync(BigDecimal body, final ApiCall */ public okhttp3.Call fakeOuterStringSerializeCall(String body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -579,7 +667,7 @@ public okhttp3.Call fakeOuterStringSerializeCall(String body, final ApiCallback } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -659,6 +747,20 @@ public okhttp3.Call fakeOuterStringSerializeAsync(String body, final ApiCallback */ public okhttp3.Call testBodyWithFileSchemaCall(FileSchemaTestClass body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -695,7 +797,7 @@ public okhttp3.Call testBodyWithFileSchemaCall(FileSchemaTestClass body, final A } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -777,6 +879,20 @@ public okhttp3.Call testBodyWithFileSchemaAsync(FileSchemaTestClass body, final */ public okhttp3.Call testBodyWithQueryParamsCall(String query, User body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -814,7 +930,7 @@ public okhttp3.Call testBodyWithQueryParamsCall(String query, User body, final A } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -903,6 +1019,20 @@ public okhttp3.Call testBodyWithQueryParamsAsync(String query, User body, final */ public okhttp3.Call testClientModelCall(Client body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -939,7 +1069,7 @@ public okhttp3.Call testClientModelCall(Client body, final ApiCallback _callback } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1038,6 +1168,20 @@ public okhttp3.Call testClientModelAsync(Client body, final ApiCallback */ public okhttp3.Call testEndpointParametersCall(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -1130,7 +1274,7 @@ public okhttp3.Call testEndpointParametersCall(BigDecimal number, Double _double } String[] localVarAuthNames = new String[] { "http_basic_test" }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1276,6 +1420,20 @@ public okhttp3.Call testEndpointParametersAsync(BigDecimal number, Double _doubl */ public okhttp3.Call testEnumParametersCall(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -1326,7 +1484,7 @@ public okhttp3.Call testEnumParametersCall(List enumHeaderStringArray, S } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1414,6 +1572,20 @@ public okhttp3.Call testEnumParametersAsync(List enumHeaderStringArray, return localVarCall; } private okhttp3.Call testGroupParametersCall(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -1456,7 +1628,7 @@ private okhttp3.Call testGroupParametersCall(Integer requiredStringGroup, Boolea } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1627,6 +1799,20 @@ public APItestGroupParametersRequest testGroupParameters(Integer requiredStringG */ public okhttp3.Call testInlineAdditionalPropertiesCall(Map param, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = param; // create path and map variables @@ -1663,7 +1849,7 @@ public okhttp3.Call testInlineAdditionalPropertiesCall(Map param } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1745,6 +1931,20 @@ public okhttp3.Call testInlineAdditionalPropertiesAsync(Map para */ public okhttp3.Call testJsonFormDataCall(String param, String param2, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -1789,7 +1989,7 @@ public okhttp3.Call testJsonFormDataCall(String param, String param2, final ApiC } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1882,6 +2082,20 @@ public okhttp3.Call testJsonFormDataAsync(String param, String param2, final Api */ public okhttp3.Call testQueryParameterCollectionFormatCall(List pipe, List ioutil, List http, List url, List context, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -1923,7 +2137,7 @@ public okhttp3.Call testQueryParameterCollectionFormatCall(List pipe, Li } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index ab4032b3ba48..fcef8d5e735a 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -40,6 +40,8 @@ public class FakeClassnameTags123Api { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public FakeClassnameTags123Api() { this(Configuration.getDefaultApiClient()); @@ -57,6 +59,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for testClassname * @param body client model (required) @@ -70,6 +88,20 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call testClassnameCall(Client body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -106,7 +138,7 @@ public okhttp3.Call testClassnameCall(Client body, final ApiCallback _callback) } String[] localVarAuthNames = new String[] { "api_key_query" }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/PetApi.java index 164b243db0a1..2171c8f1a0de 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/PetApi.java @@ -43,6 +43,8 @@ public class PetApi { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public PetApi() { this(Configuration.getDefaultApiClient()); @@ -60,6 +62,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for addPet * @param body Pet object that needs to be added to the store (required) @@ -74,6 +92,20 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call addPetCall(Pet body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -110,7 +142,7 @@ public okhttp3.Call addPetCall(Pet body, final ApiCallback _callback) throws Api } String[] localVarAuthNames = new String[] { "petstore_auth" }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -196,6 +228,20 @@ public okhttp3.Call addPetAsync(Pet body, final ApiCallback _callback) thr */ public okhttp3.Call deletePetCall(Long petId, String apiKey, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -234,7 +280,7 @@ public okhttp3.Call deletePetCall(Long petId, String apiKey, final ApiCallback _ } String[] localVarAuthNames = new String[] { "petstore_auth" }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -322,6 +368,20 @@ public okhttp3.Call deletePetAsync(Long petId, String apiKey, final ApiCallback< */ public okhttp3.Call findPetsByStatusCall(List status, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -359,7 +419,7 @@ public okhttp3.Call findPetsByStatusCall(List status, final ApiCallback } String[] localVarAuthNames = new String[] { "petstore_auth" }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -450,6 +510,20 @@ public okhttp3.Call findPetsByStatusAsync(List status, final ApiCallback */ @Deprecated public okhttp3.Call findPetsByTagsCall(Set tags, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -487,7 +561,7 @@ public okhttp3.Call findPetsByTagsCall(Set tags, final ApiCallback _call } String[] localVarAuthNames = new String[] { "petstore_auth" }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @Deprecated @@ -584,6 +658,20 @@ public okhttp3.Call findPetsByTagsAsync(Set tags, final ApiCallback */ public okhttp3.Call getPetByIdCall(Long petId, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -621,7 +709,7 @@ public okhttp3.Call getPetByIdCall(Long petId, final ApiCallback _callback) thro } String[] localVarAuthNames = new String[] { "api_key" }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -715,6 +803,20 @@ public okhttp3.Call getPetByIdAsync(Long petId, final ApiCallback _callback */ public okhttp3.Call updatePetCall(Pet body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -751,7 +853,7 @@ public okhttp3.Call updatePetCall(Pet body, final ApiCallback _callback) throws } String[] localVarAuthNames = new String[] { "petstore_auth" }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -843,6 +945,20 @@ public okhttp3.Call updatePetAsync(Pet body, final ApiCallback _callback) */ public okhttp3.Call updatePetWithFormCall(Long petId, String name, String status, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -888,7 +1004,7 @@ public okhttp3.Call updatePetWithFormCall(Long petId, String name, String status } String[] localVarAuthNames = new String[] { "petstore_auth" }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -977,6 +1093,20 @@ public okhttp3.Call updatePetWithFormAsync(Long petId, String name, String statu */ public okhttp3.Call uploadFileCall(Long petId, String additionalMetadata, File file, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -1022,7 +1152,7 @@ public okhttp3.Call uploadFileCall(Long petId, String additionalMetadata, File f } String[] localVarAuthNames = new String[] { "petstore_auth" }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1115,6 +1245,20 @@ public okhttp3.Call uploadFileAsync(Long petId, String additionalMetadata, File */ public okhttp3.Call uploadFileWithRequiredFileCall(Long petId, File requiredFile, String additionalMetadata, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -1160,7 +1304,7 @@ public okhttp3.Call uploadFileWithRequiredFileCall(Long petId, File requiredFile } String[] localVarAuthNames = new String[] { "petstore_auth" }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/StoreApi.java index 795c365962f6..a2d86c9f5416 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/StoreApi.java @@ -40,6 +40,8 @@ public class StoreApi { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public StoreApi() { this(Configuration.getDefaultApiClient()); @@ -57,6 +59,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for deleteOrder * @param orderId ID of the order that needs to be deleted (required) @@ -71,6 +89,20 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call deleteOrderCall(String orderId, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -108,7 +140,7 @@ public okhttp3.Call deleteOrderCall(String orderId, final ApiCallback _callback) } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -191,6 +223,20 @@ public okhttp3.Call deleteOrderAsync(String orderId, final ApiCallback _ca */ public okhttp3.Call getInventoryCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -227,7 +273,7 @@ public okhttp3.Call getInventoryCall(final ApiCallback _callback) throws ApiExce } String[] localVarAuthNames = new String[] { "api_key" }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -306,6 +352,20 @@ public okhttp3.Call getInventoryAsync(final ApiCallback> _c */ public okhttp3.Call getOrderByIdCall(Long orderId, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -343,7 +403,7 @@ public okhttp3.Call getOrderByIdCall(Long orderId, final ApiCallback _callback) } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -435,6 +495,20 @@ public okhttp3.Call getOrderByIdAsync(Long orderId, final ApiCallback _ca */ public okhttp3.Call placeOrderCall(Order body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -471,7 +545,7 @@ public okhttp3.Call placeOrderCall(Order body, final ApiCallback _callback) thro } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/UserApi.java index 63385ff35548..b6ab5b1bd532 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/UserApi.java @@ -40,6 +40,8 @@ public class UserApi { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public UserApi() { this(Configuration.getDefaultApiClient()); @@ -57,6 +59,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for createUser * @param body Created user object (required) @@ -70,6 +88,20 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call createUserCall(User body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -106,7 +138,7 @@ public okhttp3.Call createUserCall(User body, final ApiCallback _callback) throw } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -187,6 +219,20 @@ public okhttp3.Call createUserAsync(User body, final ApiCallback _callback */ public okhttp3.Call createUsersWithArrayInputCall(List body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -223,7 +269,7 @@ public okhttp3.Call createUsersWithArrayInputCall(List body, final ApiCall } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -304,6 +350,20 @@ public okhttp3.Call createUsersWithArrayInputAsync(List body, final ApiCal */ public okhttp3.Call createUsersWithListInputCall(List body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -340,7 +400,7 @@ public okhttp3.Call createUsersWithListInputCall(List body, final ApiCallb } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -422,6 +482,20 @@ public okhttp3.Call createUsersWithListInputAsync(List body, final ApiCall */ public okhttp3.Call deleteUserCall(String username, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -459,7 +533,7 @@ public okhttp3.Call deleteUserCall(String username, final ApiCallback _callback) } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -545,6 +619,20 @@ public okhttp3.Call deleteUserAsync(String username, final ApiCallback _ca */ public okhttp3.Call getUserByNameCall(String username, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -582,7 +670,7 @@ public okhttp3.Call getUserByNameCall(String username, final ApiCallback _callba } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -675,6 +763,20 @@ public okhttp3.Call getUserByNameAsync(String username, final ApiCallback */ public okhttp3.Call loginUserCall(String username, String password, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -713,7 +815,7 @@ public okhttp3.Call loginUserCall(String username, String password, final ApiCal } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -808,6 +910,20 @@ public okhttp3.Call loginUserAsync(String username, String password, final ApiCa */ public okhttp3.Call logoutUserCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -844,7 +960,7 @@ public okhttp3.Call logoutUserCall(final ApiCallback _callback) throws ApiExcept } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -919,6 +1035,20 @@ public okhttp3.Call logoutUserAsync(final ApiCallback _callback) throws Ap */ public okhttp3.Call updateUserCall(String username, User body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -956,7 +1086,7 @@ public okhttp3.Call updateUserCall(String username, User body, final ApiCallback } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, apiOperation.getMethod(), localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java index 67508f676bfe..7ef420e3c7c4 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java @@ -1181,8 +1181,8 @@ public T handleResponse(Response response, Type returnType) throws ApiExcept * @return The HTTP call * @throws org.openapitools.client.ApiException If fail to serialize the request body object */ - public Call buildCall(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - Request request = buildRequest(path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); + public Call buildCall(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + Request request = buildRequest(baseUrl, path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); return httpClient.newCall(request); } @@ -1203,12 +1203,12 @@ public Call buildCall(String path, String method, List queryParams, List

    queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + public Request buildRequest(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams List allQueryParams = new ArrayList(queryParams); allQueryParams.addAll(collectionQueryParams); - final String url = buildUrl(path, queryParams, collectionQueryParams); + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); // prepare HTTP request body RequestBody reqBody; @@ -1263,9 +1263,13 @@ public Request buildRequest(String path, String method, List queryParams, * @param collectionQueryParams The collection query parameters * @return The full URL */ - public String buildUrl(String path, List queryParams, List collectionQueryParams) { + public String buildUrl(String baseUrl, String path, List queryParams, List collectionQueryParams) { final StringBuilder url = new StringBuilder(); - url.append(basePath).append(path); + if (baseUrl != null) { + url.append(baseUrl).append(path); + } else { + url.append(basePath).append(path); + } if (queryParams != null && !queryParams.isEmpty()) { // support (constant) query string in `path`, e.g. "/posts?draft=1" diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 7bfa5d1220e9..07dd5b37fb24 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -37,6 +37,8 @@ public class AnotherFakeApi { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public AnotherFakeApi() { this(Configuration.getDefaultApiClient()); @@ -54,6 +56,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for call123testSpecialTags * @param body client model (required) @@ -67,6 +85,20 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call call123testSpecialTagsCall(Client body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -95,7 +127,7 @@ public okhttp3.Call call123testSpecialTagsCall(Client body, final ApiCallback _c } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") 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 28d018f4bc43..7c1a5959f08f 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 @@ -45,6 +45,8 @@ public class FakeApi { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public FakeApi() { this(Configuration.getDefaultApiClient()); @@ -62,6 +64,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for createXmlItem * @param xmlItem XmlItem Body (required) @@ -75,6 +93,20 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call createXmlItemCall(XmlItem xmlItem, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = xmlItem; // create path and map variables @@ -103,7 +135,7 @@ public okhttp3.Call createXmlItemCall(XmlItem xmlItem, final ApiCallback _callba } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -184,6 +216,20 @@ public okhttp3.Call createXmlItemAsync(XmlItem xmlItem, final ApiCallback */ public okhttp3.Call fakeOuterBooleanSerializeCall(Boolean body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -212,7 +258,7 @@ public okhttp3.Call fakeOuterBooleanSerializeCall(Boolean body, final ApiCallbac } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -292,6 +338,20 @@ public okhttp3.Call fakeOuterBooleanSerializeAsync(Boolean body, final ApiCallba */ public okhttp3.Call fakeOuterCompositeSerializeCall(OuterComposite body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -320,7 +380,7 @@ public okhttp3.Call fakeOuterCompositeSerializeCall(OuterComposite body, final A } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -400,6 +460,20 @@ public okhttp3.Call fakeOuterCompositeSerializeAsync(OuterComposite body, final */ public okhttp3.Call fakeOuterNumberSerializeCall(BigDecimal body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -428,7 +502,7 @@ public okhttp3.Call fakeOuterNumberSerializeCall(BigDecimal body, final ApiCallb } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -508,6 +582,20 @@ public okhttp3.Call fakeOuterNumberSerializeAsync(BigDecimal body, final ApiCall */ public okhttp3.Call fakeOuterStringSerializeCall(String body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -536,7 +624,7 @@ public okhttp3.Call fakeOuterStringSerializeCall(String body, final ApiCallback } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -616,6 +704,20 @@ public okhttp3.Call fakeOuterStringSerializeAsync(String body, final ApiCallback */ public okhttp3.Call testBodyWithFileSchemaCall(FileSchemaTestClass body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -644,7 +746,7 @@ public okhttp3.Call testBodyWithFileSchemaCall(FileSchemaTestClass body, final A } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -726,6 +828,20 @@ public okhttp3.Call testBodyWithFileSchemaAsync(FileSchemaTestClass body, final */ public okhttp3.Call testBodyWithQueryParamsCall(String query, User body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -758,7 +874,7 @@ public okhttp3.Call testBodyWithQueryParamsCall(String query, User body, final A } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -847,6 +963,20 @@ public okhttp3.Call testBodyWithQueryParamsAsync(String query, User body, final */ public okhttp3.Call testClientModelCall(Client body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -875,7 +1005,7 @@ public okhttp3.Call testClientModelCall(Client body, final ApiCallback _callback } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -974,6 +1104,20 @@ public okhttp3.Call testClientModelAsync(Client body, final ApiCallback */ public okhttp3.Call testEndpointParametersCall(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -1058,7 +1202,7 @@ public okhttp3.Call testEndpointParametersCall(BigDecimal number, Double _double } String[] localVarAuthNames = new String[] { "http_basic_test" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1204,6 +1348,20 @@ public okhttp3.Call testEndpointParametersAsync(BigDecimal number, Double _doubl */ public okhttp3.Call testEnumParametersCall(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -1264,7 +1422,7 @@ public okhttp3.Call testEnumParametersCall(List enumHeaderStringArray, S } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1352,6 +1510,20 @@ public okhttp3.Call testEnumParametersAsync(List enumHeaderStringArray, return localVarCall; } private okhttp3.Call testGroupParametersCall(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -1404,7 +1576,7 @@ private okhttp3.Call testGroupParametersCall(Integer requiredStringGroup, Boolea } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1575,6 +1747,20 @@ public APItestGroupParametersRequest testGroupParameters(Integer requiredStringG */ public okhttp3.Call testInlineAdditionalPropertiesCall(Map param, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = param; // create path and map variables @@ -1603,7 +1789,7 @@ public okhttp3.Call testInlineAdditionalPropertiesCall(Map param } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1685,6 +1871,20 @@ public okhttp3.Call testInlineAdditionalPropertiesAsync(Map para */ public okhttp3.Call testJsonFormDataCall(String param, String param2, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -1721,7 +1921,7 @@ public okhttp3.Call testJsonFormDataCall(String param, String param2, final ApiC } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1814,6 +2014,20 @@ public okhttp3.Call testJsonFormDataAsync(String param, String param2, final Api */ public okhttp3.Call testQueryParameterCollectionFormatCall(List pipe, List ioutil, List http, List url, List context, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -1862,7 +2076,7 @@ public okhttp3.Call testQueryParameterCollectionFormatCall(List pipe, Li } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 54cef2eb37b9..6073bb91da6d 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -37,6 +37,8 @@ public class FakeClassnameTags123Api { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public FakeClassnameTags123Api() { this(Configuration.getDefaultApiClient()); @@ -54,6 +56,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for testClassname * @param body client model (required) @@ -67,6 +85,20 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call testClassnameCall(Client body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -95,7 +127,7 @@ public okhttp3.Call testClassnameCall(Client body, final ApiCallback _callback) } String[] localVarAuthNames = new String[] { "api_key_query" }; - return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java index 71a69f587865..6f6083f2d2ca 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java @@ -40,6 +40,8 @@ public class PetApi { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public PetApi() { this(Configuration.getDefaultApiClient()); @@ -57,6 +59,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for addPet * @param body Pet object that needs to be added to the store (required) @@ -71,6 +89,20 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call addPetCall(Pet body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -99,7 +131,7 @@ public okhttp3.Call addPetCall(Pet body, final ApiCallback _callback) throws Api } String[] localVarAuthNames = new String[] { "petstore_auth" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -185,6 +217,20 @@ public okhttp3.Call addPetAsync(Pet body, final ApiCallback _callback) thr */ public okhttp3.Call deletePetCall(Long petId, String apiKey, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -218,7 +264,7 @@ public okhttp3.Call deletePetCall(Long petId, String apiKey, final ApiCallback _ } String[] localVarAuthNames = new String[] { "petstore_auth" }; - return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -306,6 +352,20 @@ public okhttp3.Call deletePetAsync(Long petId, String apiKey, final ApiCallback< */ public okhttp3.Call findPetsByStatusCall(List status, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -338,7 +398,7 @@ public okhttp3.Call findPetsByStatusCall(List status, final ApiCallback } String[] localVarAuthNames = new String[] { "petstore_auth" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -429,6 +489,20 @@ public okhttp3.Call findPetsByStatusAsync(List status, final ApiCallback */ @Deprecated public okhttp3.Call findPetsByTagsCall(Set tags, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -461,7 +535,7 @@ public okhttp3.Call findPetsByTagsCall(Set tags, final ApiCallback _call } String[] localVarAuthNames = new String[] { "petstore_auth" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @Deprecated @@ -558,6 +632,20 @@ public okhttp3.Call findPetsByTagsAsync(Set tags, final ApiCallback */ public okhttp3.Call getPetByIdCall(Long petId, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -587,7 +675,7 @@ public okhttp3.Call getPetByIdCall(Long petId, final ApiCallback _callback) thro } String[] localVarAuthNames = new String[] { "api_key" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -681,6 +769,20 @@ public okhttp3.Call getPetByIdAsync(Long petId, final ApiCallback _callback */ public okhttp3.Call updatePetCall(Pet body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -709,7 +811,7 @@ public okhttp3.Call updatePetCall(Pet body, final ApiCallback _callback) throws } String[] localVarAuthNames = new String[] { "petstore_auth" }; - return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -801,6 +903,20 @@ public okhttp3.Call updatePetAsync(Pet body, final ApiCallback _callback) */ public okhttp3.Call updatePetWithFormCall(Long petId, String name, String status, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -838,7 +954,7 @@ public okhttp3.Call updatePetWithFormCall(Long petId, String name, String status } String[] localVarAuthNames = new String[] { "petstore_auth" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -927,6 +1043,20 @@ public okhttp3.Call updatePetWithFormAsync(Long petId, String name, String statu */ public okhttp3.Call uploadFileCall(Long petId, String additionalMetadata, File file, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -964,7 +1094,7 @@ public okhttp3.Call uploadFileCall(Long petId, String additionalMetadata, File f } String[] localVarAuthNames = new String[] { "petstore_auth" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1057,6 +1187,20 @@ public okhttp3.Call uploadFileAsync(Long petId, String additionalMetadata, File */ public okhttp3.Call uploadFileWithRequiredFileCall(Long petId, File requiredFile, String additionalMetadata, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -1094,7 +1238,7 @@ public okhttp3.Call uploadFileWithRequiredFileCall(Long petId, File requiredFile } String[] localVarAuthNames = new String[] { "petstore_auth" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/StoreApi.java index 13b63b31ec14..21960166fd9b 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/StoreApi.java @@ -37,6 +37,8 @@ public class StoreApi { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public StoreApi() { this(Configuration.getDefaultApiClient()); @@ -54,6 +56,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for deleteOrder * @param orderId ID of the order that needs to be deleted (required) @@ -68,6 +86,20 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call deleteOrderCall(String orderId, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -97,7 +129,7 @@ public okhttp3.Call deleteOrderCall(String orderId, final ApiCallback _callback) } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -180,6 +212,20 @@ public okhttp3.Call deleteOrderAsync(String orderId, final ApiCallback _ca */ public okhttp3.Call getInventoryCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -208,7 +254,7 @@ public okhttp3.Call getInventoryCall(final ApiCallback _callback) throws ApiExce } String[] localVarAuthNames = new String[] { "api_key" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -287,6 +333,20 @@ public okhttp3.Call getInventoryAsync(final ApiCallback> _c */ public okhttp3.Call getOrderByIdCall(Long orderId, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -316,7 +376,7 @@ public okhttp3.Call getOrderByIdCall(Long orderId, final ApiCallback _callback) } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -408,6 +468,20 @@ public okhttp3.Call getOrderByIdAsync(Long orderId, final ApiCallback _ca */ public okhttp3.Call placeOrderCall(Order body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -436,7 +510,7 @@ public okhttp3.Call placeOrderCall(Order body, final ApiCallback _callback) thro } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java index af4538427c10..7e6577a7b11d 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java @@ -37,6 +37,8 @@ public class UserApi { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public UserApi() { this(Configuration.getDefaultApiClient()); @@ -54,6 +56,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for createUser * @param body Created user object (required) @@ -67,6 +85,20 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call createUserCall(User body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -95,7 +127,7 @@ public okhttp3.Call createUserCall(User body, final ApiCallback _callback) throw } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -176,6 +208,20 @@ public okhttp3.Call createUserAsync(User body, final ApiCallback _callback */ public okhttp3.Call createUsersWithArrayInputCall(List body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -204,7 +250,7 @@ public okhttp3.Call createUsersWithArrayInputCall(List body, final ApiCall } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -285,6 +331,20 @@ public okhttp3.Call createUsersWithArrayInputAsync(List body, final ApiCal */ public okhttp3.Call createUsersWithListInputCall(List body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -313,7 +373,7 @@ public okhttp3.Call createUsersWithListInputCall(List body, final ApiCallb } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -395,6 +455,20 @@ public okhttp3.Call createUsersWithListInputAsync(List body, final ApiCall */ public okhttp3.Call deleteUserCall(String username, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -424,7 +498,7 @@ public okhttp3.Call deleteUserCall(String username, final ApiCallback _callback) } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -510,6 +584,20 @@ public okhttp3.Call deleteUserAsync(String username, final ApiCallback _ca */ public okhttp3.Call getUserByNameCall(String username, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -539,7 +627,7 @@ public okhttp3.Call getUserByNameCall(String username, final ApiCallback _callba } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -632,6 +720,20 @@ public okhttp3.Call getUserByNameAsync(String username, final ApiCallback */ public okhttp3.Call loginUserCall(String username, String password, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -668,7 +770,7 @@ public okhttp3.Call loginUserCall(String username, String password, final ApiCal } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -763,6 +865,20 @@ public okhttp3.Call loginUserAsync(String username, String password, final ApiCa */ public okhttp3.Call logoutUserCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -791,7 +907,7 @@ public okhttp3.Call logoutUserCall(final ApiCallback _callback) throws ApiExcept } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -866,6 +982,20 @@ public okhttp3.Call logoutUserAsync(final ApiCallback _callback) throws Ap */ public okhttp3.Call updateUserCall(String username, User body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -895,7 +1025,7 @@ public okhttp3.Call updateUserCall(String username, User body, final ApiCallback } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java index 67508f676bfe..7ef420e3c7c4 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java @@ -1181,8 +1181,8 @@ public T handleResponse(Response response, Type returnType) throws ApiExcept * @return The HTTP call * @throws org.openapitools.client.ApiException If fail to serialize the request body object */ - public Call buildCall(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - Request request = buildRequest(path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); + public Call buildCall(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + Request request = buildRequest(baseUrl, path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); return httpClient.newCall(request); } @@ -1203,12 +1203,12 @@ public Call buildCall(String path, String method, List queryParams, List

    queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + public Request buildRequest(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams List allQueryParams = new ArrayList(queryParams); allQueryParams.addAll(collectionQueryParams); - final String url = buildUrl(path, queryParams, collectionQueryParams); + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); // prepare HTTP request body RequestBody reqBody; @@ -1263,9 +1263,13 @@ public Request buildRequest(String path, String method, List queryParams, * @param collectionQueryParams The collection query parameters * @return The full URL */ - public String buildUrl(String path, List queryParams, List collectionQueryParams) { + public String buildUrl(String baseUrl, String path, List queryParams, List collectionQueryParams) { final StringBuilder url = new StringBuilder(); - url.append(basePath).append(path); + if (baseUrl != null) { + url.append(baseUrl).append(path); + } else { + url.append(basePath).append(path); + } if (queryParams != null && !queryParams.isEmpty()) { // support (constant) query string in `path`, e.g. "/posts?draft=1" diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 7bfa5d1220e9..07dd5b37fb24 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -37,6 +37,8 @@ public class AnotherFakeApi { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public AnotherFakeApi() { this(Configuration.getDefaultApiClient()); @@ -54,6 +56,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for call123testSpecialTags * @param body client model (required) @@ -67,6 +85,20 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call call123testSpecialTagsCall(Client body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -95,7 +127,7 @@ public okhttp3.Call call123testSpecialTagsCall(Client body, final ApiCallback _c } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") 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 28d018f4bc43..7c1a5959f08f 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 @@ -45,6 +45,8 @@ public class FakeApi { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public FakeApi() { this(Configuration.getDefaultApiClient()); @@ -62,6 +64,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for createXmlItem * @param xmlItem XmlItem Body (required) @@ -75,6 +93,20 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call createXmlItemCall(XmlItem xmlItem, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = xmlItem; // create path and map variables @@ -103,7 +135,7 @@ public okhttp3.Call createXmlItemCall(XmlItem xmlItem, final ApiCallback _callba } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -184,6 +216,20 @@ public okhttp3.Call createXmlItemAsync(XmlItem xmlItem, final ApiCallback */ public okhttp3.Call fakeOuterBooleanSerializeCall(Boolean body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -212,7 +258,7 @@ public okhttp3.Call fakeOuterBooleanSerializeCall(Boolean body, final ApiCallbac } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -292,6 +338,20 @@ public okhttp3.Call fakeOuterBooleanSerializeAsync(Boolean body, final ApiCallba */ public okhttp3.Call fakeOuterCompositeSerializeCall(OuterComposite body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -320,7 +380,7 @@ public okhttp3.Call fakeOuterCompositeSerializeCall(OuterComposite body, final A } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -400,6 +460,20 @@ public okhttp3.Call fakeOuterCompositeSerializeAsync(OuterComposite body, final */ public okhttp3.Call fakeOuterNumberSerializeCall(BigDecimal body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -428,7 +502,7 @@ public okhttp3.Call fakeOuterNumberSerializeCall(BigDecimal body, final ApiCallb } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -508,6 +582,20 @@ public okhttp3.Call fakeOuterNumberSerializeAsync(BigDecimal body, final ApiCall */ public okhttp3.Call fakeOuterStringSerializeCall(String body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -536,7 +624,7 @@ public okhttp3.Call fakeOuterStringSerializeCall(String body, final ApiCallback } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -616,6 +704,20 @@ public okhttp3.Call fakeOuterStringSerializeAsync(String body, final ApiCallback */ public okhttp3.Call testBodyWithFileSchemaCall(FileSchemaTestClass body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -644,7 +746,7 @@ public okhttp3.Call testBodyWithFileSchemaCall(FileSchemaTestClass body, final A } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -726,6 +828,20 @@ public okhttp3.Call testBodyWithFileSchemaAsync(FileSchemaTestClass body, final */ public okhttp3.Call testBodyWithQueryParamsCall(String query, User body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -758,7 +874,7 @@ public okhttp3.Call testBodyWithQueryParamsCall(String query, User body, final A } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -847,6 +963,20 @@ public okhttp3.Call testBodyWithQueryParamsAsync(String query, User body, final */ public okhttp3.Call testClientModelCall(Client body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -875,7 +1005,7 @@ public okhttp3.Call testClientModelCall(Client body, final ApiCallback _callback } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -974,6 +1104,20 @@ public okhttp3.Call testClientModelAsync(Client body, final ApiCallback */ public okhttp3.Call testEndpointParametersCall(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -1058,7 +1202,7 @@ public okhttp3.Call testEndpointParametersCall(BigDecimal number, Double _double } String[] localVarAuthNames = new String[] { "http_basic_test" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1204,6 +1348,20 @@ public okhttp3.Call testEndpointParametersAsync(BigDecimal number, Double _doubl */ public okhttp3.Call testEnumParametersCall(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -1264,7 +1422,7 @@ public okhttp3.Call testEnumParametersCall(List enumHeaderStringArray, S } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1352,6 +1510,20 @@ public okhttp3.Call testEnumParametersAsync(List enumHeaderStringArray, return localVarCall; } private okhttp3.Call testGroupParametersCall(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -1404,7 +1576,7 @@ private okhttp3.Call testGroupParametersCall(Integer requiredStringGroup, Boolea } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1575,6 +1747,20 @@ public APItestGroupParametersRequest testGroupParameters(Integer requiredStringG */ public okhttp3.Call testInlineAdditionalPropertiesCall(Map param, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = param; // create path and map variables @@ -1603,7 +1789,7 @@ public okhttp3.Call testInlineAdditionalPropertiesCall(Map param } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1685,6 +1871,20 @@ public okhttp3.Call testInlineAdditionalPropertiesAsync(Map para */ public okhttp3.Call testJsonFormDataCall(String param, String param2, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -1721,7 +1921,7 @@ public okhttp3.Call testJsonFormDataCall(String param, String param2, final ApiC } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1814,6 +2014,20 @@ public okhttp3.Call testJsonFormDataAsync(String param, String param2, final Api */ public okhttp3.Call testQueryParameterCollectionFormatCall(List pipe, List ioutil, List http, List url, List context, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -1862,7 +2076,7 @@ public okhttp3.Call testQueryParameterCollectionFormatCall(List pipe, Li } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 54cef2eb37b9..6073bb91da6d 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -37,6 +37,8 @@ public class FakeClassnameTags123Api { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public FakeClassnameTags123Api() { this(Configuration.getDefaultApiClient()); @@ -54,6 +56,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for testClassname * @param body client model (required) @@ -67,6 +85,20 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call testClassnameCall(Client body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -95,7 +127,7 @@ public okhttp3.Call testClassnameCall(Client body, final ApiCallback _callback) } String[] localVarAuthNames = new String[] { "api_key_query" }; - return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java index 71a69f587865..6f6083f2d2ca 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java @@ -40,6 +40,8 @@ public class PetApi { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public PetApi() { this(Configuration.getDefaultApiClient()); @@ -57,6 +59,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for addPet * @param body Pet object that needs to be added to the store (required) @@ -71,6 +89,20 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call addPetCall(Pet body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -99,7 +131,7 @@ public okhttp3.Call addPetCall(Pet body, final ApiCallback _callback) throws Api } String[] localVarAuthNames = new String[] { "petstore_auth" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -185,6 +217,20 @@ public okhttp3.Call addPetAsync(Pet body, final ApiCallback _callback) thr */ public okhttp3.Call deletePetCall(Long petId, String apiKey, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -218,7 +264,7 @@ public okhttp3.Call deletePetCall(Long petId, String apiKey, final ApiCallback _ } String[] localVarAuthNames = new String[] { "petstore_auth" }; - return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -306,6 +352,20 @@ public okhttp3.Call deletePetAsync(Long petId, String apiKey, final ApiCallback< */ public okhttp3.Call findPetsByStatusCall(List status, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -338,7 +398,7 @@ public okhttp3.Call findPetsByStatusCall(List status, final ApiCallback } String[] localVarAuthNames = new String[] { "petstore_auth" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -429,6 +489,20 @@ public okhttp3.Call findPetsByStatusAsync(List status, final ApiCallback */ @Deprecated public okhttp3.Call findPetsByTagsCall(Set tags, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -461,7 +535,7 @@ public okhttp3.Call findPetsByTagsCall(Set tags, final ApiCallback _call } String[] localVarAuthNames = new String[] { "petstore_auth" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @Deprecated @@ -558,6 +632,20 @@ public okhttp3.Call findPetsByTagsAsync(Set tags, final ApiCallback */ public okhttp3.Call getPetByIdCall(Long petId, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -587,7 +675,7 @@ public okhttp3.Call getPetByIdCall(Long petId, final ApiCallback _callback) thro } String[] localVarAuthNames = new String[] { "api_key" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -681,6 +769,20 @@ public okhttp3.Call getPetByIdAsync(Long petId, final ApiCallback _callback */ public okhttp3.Call updatePetCall(Pet body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -709,7 +811,7 @@ public okhttp3.Call updatePetCall(Pet body, final ApiCallback _callback) throws } String[] localVarAuthNames = new String[] { "petstore_auth" }; - return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -801,6 +903,20 @@ public okhttp3.Call updatePetAsync(Pet body, final ApiCallback _callback) */ public okhttp3.Call updatePetWithFormCall(Long petId, String name, String status, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -838,7 +954,7 @@ public okhttp3.Call updatePetWithFormCall(Long petId, String name, String status } String[] localVarAuthNames = new String[] { "petstore_auth" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -927,6 +1043,20 @@ public okhttp3.Call updatePetWithFormAsync(Long petId, String name, String statu */ public okhttp3.Call uploadFileCall(Long petId, String additionalMetadata, File file, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -964,7 +1094,7 @@ public okhttp3.Call uploadFileCall(Long petId, String additionalMetadata, File f } String[] localVarAuthNames = new String[] { "petstore_auth" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -1057,6 +1187,20 @@ public okhttp3.Call uploadFileAsync(Long petId, String additionalMetadata, File */ public okhttp3.Call uploadFileWithRequiredFileCall(Long petId, File requiredFile, String additionalMetadata, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -1094,7 +1238,7 @@ public okhttp3.Call uploadFileWithRequiredFileCall(Long petId, File requiredFile } String[] localVarAuthNames = new String[] { "petstore_auth" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/StoreApi.java index 13b63b31ec14..21960166fd9b 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/StoreApi.java @@ -37,6 +37,8 @@ public class StoreApi { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public StoreApi() { this(Configuration.getDefaultApiClient()); @@ -54,6 +56,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for deleteOrder * @param orderId ID of the order that needs to be deleted (required) @@ -68,6 +86,20 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call deleteOrderCall(String orderId, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -97,7 +129,7 @@ public okhttp3.Call deleteOrderCall(String orderId, final ApiCallback _callback) } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -180,6 +212,20 @@ public okhttp3.Call deleteOrderAsync(String orderId, final ApiCallback _ca */ public okhttp3.Call getInventoryCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -208,7 +254,7 @@ public okhttp3.Call getInventoryCall(final ApiCallback _callback) throws ApiExce } String[] localVarAuthNames = new String[] { "api_key" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -287,6 +333,20 @@ public okhttp3.Call getInventoryAsync(final ApiCallback> _c */ public okhttp3.Call getOrderByIdCall(Long orderId, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -316,7 +376,7 @@ public okhttp3.Call getOrderByIdCall(Long orderId, final ApiCallback _callback) } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -408,6 +468,20 @@ public okhttp3.Call getOrderByIdAsync(Long orderId, final ApiCallback _ca */ public okhttp3.Call placeOrderCall(Order body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -436,7 +510,7 @@ public okhttp3.Call placeOrderCall(Order body, final ApiCallback _callback) thro } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java index af4538427c10..7e6577a7b11d 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java @@ -37,6 +37,8 @@ public class UserApi { private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; public UserApi() { this(Configuration.getDefaultApiClient()); @@ -54,6 +56,22 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + /** * Build call for createUser * @param body Created user object (required) @@ -67,6 +85,20 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call createUserCall(User body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -95,7 +127,7 @@ public okhttp3.Call createUserCall(User body, final ApiCallback _callback) throw } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -176,6 +208,20 @@ public okhttp3.Call createUserAsync(User body, final ApiCallback _callback */ public okhttp3.Call createUsersWithArrayInputCall(List body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -204,7 +250,7 @@ public okhttp3.Call createUsersWithArrayInputCall(List body, final ApiCall } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -285,6 +331,20 @@ public okhttp3.Call createUsersWithArrayInputAsync(List body, final ApiCal */ public okhttp3.Call createUsersWithListInputCall(List body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -313,7 +373,7 @@ public okhttp3.Call createUsersWithListInputCall(List body, final ApiCallb } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -395,6 +455,20 @@ public okhttp3.Call createUsersWithListInputAsync(List body, final ApiCall */ public okhttp3.Call deleteUserCall(String username, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -424,7 +498,7 @@ public okhttp3.Call deleteUserCall(String username, final ApiCallback _callback) } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -510,6 +584,20 @@ public okhttp3.Call deleteUserAsync(String username, final ApiCallback _ca */ public okhttp3.Call getUserByNameCall(String username, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -539,7 +627,7 @@ public okhttp3.Call getUserByNameCall(String username, final ApiCallback _callba } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -632,6 +720,20 @@ public okhttp3.Call getUserByNameAsync(String username, final ApiCallback */ public okhttp3.Call loginUserCall(String username, String password, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -668,7 +770,7 @@ public okhttp3.Call loginUserCall(String username, String password, final ApiCal } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -763,6 +865,20 @@ public okhttp3.Call loginUserAsync(String username, String password, final ApiCa */ public okhttp3.Call logoutUserCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = null; // create path and map variables @@ -791,7 +907,7 @@ public okhttp3.Call logoutUserCall(final ApiCallback _callback) throws ApiExcept } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") @@ -866,6 +982,20 @@ public okhttp3.Call logoutUserAsync(final ApiCallback _callback) throws Ap */ public okhttp3.Call updateUserCall(String username, User body, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = body; // create path and map variables @@ -895,7 +1025,7 @@ public okhttp3.Call updateUserCall(String username, User body, final ApiCallback } String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") From 5bd045289397c41973a0254a79fa9703ced799cc Mon Sep 17 00:00:00 2001 From: Steve Mason Date: Thu, 25 Nov 2021 06:44:57 +0000 Subject: [PATCH 035/117] [Java][Native] Drain InputStream when no response is being read (#10956) The [docs for ofInputStream](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.BodySubscribers.html#ofInputStream()) say: > To ensure that all resources associated with the corresponding exchange are properly released the caller must ensure to either read all lines until the stream is exhausted, or call BaseStream.close() if it is unable or unwilling to do so. Calling close before exhausting the stream may cause the underlying HTTP connection to be closed and prevent it from being reused for subsequent operations. When ObjectMapper.readValue is called with an InputStream it implicitly closes it, but when the library is not expecting a return type it's not passing the InputStream to Jackson, so the stream needs to be manually drained and closed as per the docs Failure to do this leads to a leak of HttpClient socket handles, and ultimately the exception `java.net.BindException: Cannot assign requested address` when trying to make API calls --- .../Java/libraries/native/api.mustache | 21 +- .../client/api/AnotherFakeApi.java | 14 +- .../org/openapitools/client/api/FakeApi.java | 223 +++++++++++++----- .../client/api/FakeClassnameTags123Api.java | 14 +- .../org/openapitools/client/api/PetApi.java | 138 +++++++---- .../org/openapitools/client/api/StoreApi.java | 59 +++-- .../org/openapitools/client/api/UserApi.java | 130 +++++++--- 7 files changed, 429 insertions(+), 170 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache index 018f51b32cef..218a432d1064 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache @@ -222,14 +222,25 @@ public class {{classname}} { if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("{{operationId}}", localVarResponse); - } - return new ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}>( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("{{operationId}}", localVarResponse); + } + return new ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}>( localVarResponse.statusCode(), localVarResponse.headers().map(), - {{#returnType}}memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<{{{returnType}}}>() {}){{/returnType}}{{^returnType}}null{{/returnType}} + {{#returnType}}memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<{{{returnType}}}>() {}) // closes the InputStream{{/returnType}} + {{^returnType}}null{{/returnType}} ); + } finally { + {{^returnType}} + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + {{/returnType}} + } } catch (IOException e) { throw new ApiException(e); } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index e553b758ccff..cacc3ac7cf40 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -102,14 +102,18 @@ public ApiResponse call123testSpecialTagsWithHttpInfo(Client body) throw if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("call123testSpecialTags", localVarResponse); - } - return new ApiResponse( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("call123testSpecialTags", localVarResponse); + } + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream + ); + } finally { + } } catch (IOException e) { throw new ApiException(e); } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeApi.java index 36f4539d7cca..6618620891c5 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeApi.java @@ -108,14 +108,23 @@ public ApiResponse createXmlItemWithHttpInfo(XmlItem xmlItem) throws ApiEx if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("createXmlItem", localVarResponse); - } - return new ApiResponse( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("createXmlItem", localVarResponse); + } + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), + null ); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } } catch (IOException e) { throw new ApiException(e); } @@ -182,14 +191,18 @@ public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(Boolean body) if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("fakeOuterBooleanSerialize", localVarResponse); - } - return new ApiResponse( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("fakeOuterBooleanSerialize", localVarResponse); + } + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream + ); + } finally { + } } catch (IOException e) { throw new ApiException(e); } @@ -252,14 +265,18 @@ public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(Outer if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("fakeOuterCompositeSerialize", localVarResponse); - } - return new ApiResponse( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("fakeOuterCompositeSerialize", localVarResponse); + } + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream + ); + } finally { + } } catch (IOException e) { throw new ApiException(e); } @@ -322,14 +339,18 @@ public ApiResponse fakeOuterNumberSerializeWithHttpInfo(BigDecimal b if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("fakeOuterNumberSerialize", localVarResponse); - } - return new ApiResponse( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("fakeOuterNumberSerialize", localVarResponse); + } + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream + ); + } finally { + } } catch (IOException e) { throw new ApiException(e); } @@ -392,14 +413,18 @@ public ApiResponse fakeOuterStringSerializeWithHttpInfo(String body) thr if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("fakeOuterStringSerialize", localVarResponse); - } - return new ApiResponse( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("fakeOuterStringSerialize", localVarResponse); + } + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream + ); + } finally { + } } catch (IOException e) { throw new ApiException(e); } @@ -460,14 +485,23 @@ public ApiResponse testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("testBodyWithFileSchema", localVarResponse); - } - return new ApiResponse( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("testBodyWithFileSchema", localVarResponse); + } + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), + null ); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } } catch (IOException e) { throw new ApiException(e); } @@ -534,14 +568,23 @@ public ApiResponse testBodyWithQueryParamsWithHttpInfo(String query, User if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("testBodyWithQueryParams", localVarResponse); - } - return new ApiResponse( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("testBodyWithQueryParams", localVarResponse); + } + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), + null ); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } } catch (IOException e) { throw new ApiException(e); } @@ -621,14 +664,18 @@ public ApiResponse testClientModelWithHttpInfo(Client body) throws ApiEx if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("testClientModel", localVarResponse); - } - return new ApiResponse( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("testClientModel", localVarResponse); + } + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream + ); + } finally { + } } catch (IOException e) { throw new ApiException(e); } @@ -719,14 +766,23 @@ public ApiResponse testEndpointParametersWithHttpInfo(BigDecimal number, D if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("testEndpointParameters", localVarResponse); - } - return new ApiResponse( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("testEndpointParameters", localVarResponse); + } + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), + null ); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } } catch (IOException e) { throw new ApiException(e); } @@ -811,14 +867,23 @@ public ApiResponse testEnumParametersWithHttpInfo(List enumHeaderS if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("testEnumParameters", localVarResponse); - } - return new ApiResponse( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("testEnumParameters", localVarResponse); + } + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), + null ); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } } catch (IOException e) { throw new ApiException(e); } @@ -934,14 +999,23 @@ public ApiResponse testGroupParametersWithHttpInfo(Integer requiredStringG if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("testGroupParameters", localVarResponse); - } - return new ApiResponse( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("testGroupParameters", localVarResponse); + } + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), + null ); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } } catch (IOException e) { throw new ApiException(e); } @@ -1103,14 +1177,23 @@ public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(Map( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("testInlineAdditionalProperties", localVarResponse); + } + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), + null ); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } } catch (IOException e) { throw new ApiException(e); } @@ -1177,14 +1260,23 @@ public ApiResponse testJsonFormDataWithHttpInfo(String param, String param if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("testJsonFormData", localVarResponse); - } - return new ApiResponse( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("testJsonFormData", localVarResponse); + } + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), + null ); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } } catch (IOException e) { throw new ApiException(e); } @@ -1255,14 +1347,23 @@ public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(List( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("testQueryParameterCollectionFormat", localVarResponse); + } + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), + null ); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } } catch (IOException e) { throw new ApiException(e); } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 565c5651c181..b85f56083192 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -102,14 +102,18 @@ public ApiResponse testClassnameWithHttpInfo(Client body) throws ApiExce if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("testClassname", localVarResponse); - } - return new ApiResponse( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("testClassname", localVarResponse); + } + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream + ); + } finally { + } } catch (IOException e) { throw new ApiException(e); } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/PetApi.java index a754fb97777f..758142dfa7b2 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/PetApi.java @@ -103,14 +103,23 @@ public ApiResponse addPetWithHttpInfo(Pet body) throws ApiException { if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("addPet", localVarResponse); - } - return new ApiResponse( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("addPet", localVarResponse); + } + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), + null ); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } } catch (IOException e) { throw new ApiException(e); } @@ -177,14 +186,23 @@ public ApiResponse deletePetWithHttpInfo(Long petId, String apiKey) throws if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("deletePet", localVarResponse); - } - return new ApiResponse( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("deletePet", localVarResponse); + } + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), + null ); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } } catch (IOException e) { throw new ApiException(e); } @@ -249,14 +267,18 @@ public ApiResponse> findPetsByStatusWithHttpInfo(List status) if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("findPetsByStatus", localVarResponse); - } - return new ApiResponse>( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("findPetsByStatus", localVarResponse); + } + return new ApiResponse>( localVarResponse.statusCode(), localVarResponse.headers().map(), - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}) + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}) // closes the InputStream + ); + } finally { + } } catch (IOException e) { throw new ApiException(e); } @@ -330,14 +352,18 @@ public ApiResponse> findPetsByTagsWithHttpInfo(Set tags) throws if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("findPetsByTags", localVarResponse); - } - return new ApiResponse>( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("findPetsByTags", localVarResponse); + } + return new ApiResponse>( localVarResponse.statusCode(), localVarResponse.headers().map(), - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}) + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}) // closes the InputStream + ); + } finally { + } } catch (IOException e) { throw new ApiException(e); } @@ -407,14 +433,18 @@ public ApiResponse getPetByIdWithHttpInfo(Long petId) throws ApiException { if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("getPetById", localVarResponse); - } - return new ApiResponse( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getPetById", localVarResponse); + } + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream + ); + } finally { + } } catch (IOException e) { throw new ApiException(e); } @@ -474,14 +504,23 @@ public ApiResponse updatePetWithHttpInfo(Pet body) throws ApiException { if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("updatePet", localVarResponse); - } - return new ApiResponse( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("updatePet", localVarResponse); + } + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), + null ); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } } catch (IOException e) { throw new ApiException(e); } @@ -550,14 +589,23 @@ public ApiResponse updatePetWithFormWithHttpInfo(Long petId, String name, if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("updatePetWithForm", localVarResponse); - } - return new ApiResponse( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("updatePetWithForm", localVarResponse); + } + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), + null ); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } } catch (IOException e) { throw new ApiException(e); } @@ -623,14 +671,18 @@ public ApiResponse uploadFileWithHttpInfo(Long petId, String a if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("uploadFile", localVarResponse); - } - return new ApiResponse( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("uploadFile", localVarResponse); + } + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream + ); + } finally { + } } catch (IOException e) { throw new ApiException(e); } @@ -696,14 +748,18 @@ public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("uploadFileWithRequiredFile", localVarResponse); - } - return new ApiResponse( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("uploadFileWithRequiredFile", localVarResponse); + } + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream + ); + } finally { + } } catch (IOException e) { throw new ApiException(e); } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/StoreApi.java index 2d691aec852a..bde07853f967 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/StoreApi.java @@ -100,14 +100,23 @@ public ApiResponse deleteOrderWithHttpInfo(String orderId) throws ApiExcep if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("deleteOrder", localVarResponse); - } - return new ApiResponse( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("deleteOrder", localVarResponse); + } + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), + null ); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } } catch (IOException e) { throw new ApiException(e); } @@ -167,14 +176,18 @@ public ApiResponse> getInventoryWithHttpInfo() throws ApiEx if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("getInventory", localVarResponse); - } - return new ApiResponse>( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getInventory", localVarResponse); + } + return new ApiResponse>( localVarResponse.statusCode(), localVarResponse.headers().map(), - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}) + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}) // closes the InputStream + ); + } finally { + } } catch (IOException e) { throw new ApiException(e); } @@ -231,14 +244,18 @@ public ApiResponse getOrderByIdWithHttpInfo(Long orderId) throws ApiExcep if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("getOrderById", localVarResponse); - } - return new ApiResponse( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getOrderById", localVarResponse); + } + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream + ); + } finally { + } } catch (IOException e) { throw new ApiException(e); } @@ -300,14 +317,18 @@ public ApiResponse placeOrderWithHttpInfo(Order body) throws ApiException if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("placeOrder", localVarResponse); - } - return new ApiResponse( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("placeOrder", localVarResponse); + } + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream + ); + } finally { + } } catch (IOException e) { throw new ApiException(e); } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/UserApi.java index 6afc9d06f6d9..d4f06af3fd58 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/UserApi.java @@ -100,14 +100,23 @@ public ApiResponse createUserWithHttpInfo(User body) throws ApiException { if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("createUser", localVarResponse); - } - return new ApiResponse( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("createUser", localVarResponse); + } + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), + null ); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } } catch (IOException e) { throw new ApiException(e); } @@ -172,14 +181,23 @@ public ApiResponse createUsersWithArrayInputWithHttpInfo(List body) if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("createUsersWithArrayInput", localVarResponse); - } - return new ApiResponse( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("createUsersWithArrayInput", localVarResponse); + } + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), + null ); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } } catch (IOException e) { throw new ApiException(e); } @@ -244,14 +262,23 @@ public ApiResponse createUsersWithListInputWithHttpInfo(List body) t if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("createUsersWithListInput", localVarResponse); - } - return new ApiResponse( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("createUsersWithListInput", localVarResponse); + } + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), + null ); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } } catch (IOException e) { throw new ApiException(e); } @@ -316,14 +343,23 @@ public ApiResponse deleteUserWithHttpInfo(String username) throws ApiExcep if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("deleteUser", localVarResponse); - } - return new ApiResponse( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("deleteUser", localVarResponse); + } + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), + null ); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } } catch (IOException e) { throw new ApiException(e); } @@ -385,14 +421,18 @@ public ApiResponse getUserByNameWithHttpInfo(String username) throws ApiEx if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("getUserByName", localVarResponse); - } - return new ApiResponse( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getUserByName", localVarResponse); + } + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream + ); + } finally { + } } catch (IOException e) { throw new ApiException(e); } @@ -456,14 +496,18 @@ public ApiResponse loginUserWithHttpInfo(String username, String passwor if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("loginUser", localVarResponse); - } - return new ApiResponse( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("loginUser", localVarResponse); + } + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream + ); + } finally { + } } catch (IOException e) { throw new ApiException(e); } @@ -534,14 +578,23 @@ public ApiResponse logoutUserWithHttpInfo() throws ApiException { if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("logoutUser", localVarResponse); - } - return new ApiResponse( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("logoutUser", localVarResponse); + } + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), + null ); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } } catch (IOException e) { throw new ApiException(e); } @@ -598,14 +651,23 @@ public ApiResponse updateUserWithHttpInfo(String username, User body) thro if (memberVarResponseInterceptor != null) { memberVarResponseInterceptor.accept(localVarResponse); } - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("updateUser", localVarResponse); - } - return new ApiResponse( + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("updateUser", localVarResponse); + } + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), + null ); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } } catch (IOException e) { throw new ApiException(e); } From 8e303150ae18e89c70ca4c17c90d41f522ba2773 Mon Sep 17 00:00:00 2001 From: Berlin Cho Date: Thu, 25 Nov 2021 16:12:55 +0800 Subject: [PATCH 036/117] [Java][resttemplate] Support URL queryParams Comma encoding (#10958) * Java Encode comma (with unit tests) * fix PMD warnings --- .../libraries/resttemplate/ApiClient.mustache | 41 ++++++++++++------- .../org/openapitools/client/ApiClient.java | 41 ++++++++++++------- .../openapitools/client/ApiClientTest.java | 31 ++++++++++++++ .../org/openapitools/client/ApiClient.java | 41 ++++++++++++------- .../openapitools/client/ApiClientTest.java | 31 ++++++++++++++ 5 files changed, 143 insertions(+), 42 deletions(-) create mode 100644 samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/ApiClientTest.java create mode 100644 samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/ApiClientTest.java diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache index e48370f1539d..f868eaa6dbf3 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache @@ -34,6 +34,7 @@ import org.springframework.util.StringUtils; import org.springframework.web.client.RestClientException; import org.springframework.web.client.RestTemplate; import org.springframework.web.util.UriComponentsBuilder; +import org.springframework.web.util.DefaultUriBuilderFactory; {{#threetenbp}} import org.threeten.bp.*; import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; @@ -622,6 +623,12 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @return path with placeholders replaced by variables */ public String expandPath(String pathTemplate, Map variables) { + // disable default URL encoding + DefaultUriBuilderFactory uriBuilderFactory = new DefaultUriBuilderFactory(); + uriBuilderFactory.setEncodingMode(DefaultUriBuilderFactory.EncodingMode.NONE); + final RestTemplate restTemplate = new RestTemplate(); + restTemplate.setUriTemplateHandler(uriBuilderFactory); + return restTemplate.getUriTemplateHandler().expand(pathTemplate, variables).toString(); } @@ -632,27 +639,33 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @param uriParams The path parameters * return templatized query string */ - private String generateQueryUri(MultiValueMap queryParams, Map uriParams) { + public String generateQueryUri(MultiValueMap queryParams, Map uriParams) { StringBuilder queryBuilder = new StringBuilder(); queryParams.forEach((name, values) -> { - if (CollectionUtils.isEmpty(values)) { - if (queryBuilder.length() != 0) { - queryBuilder.append('&'); - } - queryBuilder.append(name); - } else { - int valueItemCounter = 0; - for (Object value : values) { + try { + final String encodedName = URLEncoder.encode(name.toString(), "UTF-8"); + if (CollectionUtils.isEmpty(values)) { if (queryBuilder.length() != 0) { queryBuilder.append('&'); } - queryBuilder.append(name); - if (value != null) { - String templatizedKey = name + valueItemCounter++; - uriParams.put(templatizedKey, value.toString()); - queryBuilder.append('=').append("{").append(templatizedKey).append("}"); + queryBuilder.append(encodedName); + } else { + int valueItemCounter = 0; + for (Object value : values) { + if (queryBuilder.length() != 0) { + queryBuilder.append('&'); + } + queryBuilder.append(encodedName); + if (value != null) { + String templatizedKey = encodedName + valueItemCounter++; + final String encodedValue = URLEncoder.encode(value.toString(), "UTF-8"); + uriParams.put(templatizedKey, encodedValue); + queryBuilder.append('=').append("{").append(templatizedKey).append("}"); + } } } + } catch (UnsupportedEncodingException e) { + } }); return queryBuilder.toString(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java index 093e48971445..8e5e2933cec3 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java @@ -30,6 +30,7 @@ import org.springframework.web.client.RestClientException; import org.springframework.web.client.RestTemplate; import org.springframework.web.util.UriComponentsBuilder; +import org.springframework.web.util.DefaultUriBuilderFactory; import org.threeten.bp.*; import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; import org.springframework.http.converter.HttpMessageConverter; @@ -578,6 +579,12 @@ protected Object selectBody(Object obj, MultiValueMap formParams * @return path with placeholders replaced by variables */ public String expandPath(String pathTemplate, Map variables) { + // disable default URL encoding + DefaultUriBuilderFactory uriBuilderFactory = new DefaultUriBuilderFactory(); + uriBuilderFactory.setEncodingMode(DefaultUriBuilderFactory.EncodingMode.NONE); + final RestTemplate restTemplate = new RestTemplate(); + restTemplate.setUriTemplateHandler(uriBuilderFactory); + return restTemplate.getUriTemplateHandler().expand(pathTemplate, variables).toString(); } @@ -588,27 +595,33 @@ public String expandPath(String pathTemplate, Map variables) { * @param uriParams The path parameters * return templatized query string */ - private String generateQueryUri(MultiValueMap queryParams, Map uriParams) { + public String generateQueryUri(MultiValueMap queryParams, Map uriParams) { StringBuilder queryBuilder = new StringBuilder(); queryParams.forEach((name, values) -> { - if (CollectionUtils.isEmpty(values)) { - if (queryBuilder.length() != 0) { - queryBuilder.append('&'); - } - queryBuilder.append(name); - } else { - int valueItemCounter = 0; - for (Object value : values) { + try { + final String encodedName = URLEncoder.encode(name.toString(), "UTF-8"); + if (CollectionUtils.isEmpty(values)) { if (queryBuilder.length() != 0) { queryBuilder.append('&'); } - queryBuilder.append(name); - if (value != null) { - String templatizedKey = name + valueItemCounter++; - uriParams.put(templatizedKey, value.toString()); - queryBuilder.append('=').append("{").append(templatizedKey).append("}"); + queryBuilder.append(encodedName); + } else { + int valueItemCounter = 0; + for (Object value : values) { + if (queryBuilder.length() != 0) { + queryBuilder.append('&'); + } + queryBuilder.append(encodedName); + if (value != null) { + String templatizedKey = encodedName + valueItemCounter++; + final String encodedValue = URLEncoder.encode(value.toString(), "UTF-8"); + uriParams.put(templatizedKey, encodedValue); + queryBuilder.append('=').append("{").append(templatizedKey).append("}"); + } } } + } catch (UnsupportedEncodingException e) { + } }); return queryBuilder.toString(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/ApiClientTest.java b/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/ApiClientTest.java new file mode 100644 index 000000000000..4b3a63c3e266 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/ApiClientTest.java @@ -0,0 +1,31 @@ +package org.openapitools.client; + +import static org.hamcrest.CoreMatchers.*; +import static org.junit.Assert.*; + +import java.util.*; +import org.junit.*; +import org.springframework.util.MultiValueMap; +import org.springframework.util.LinkedMultiValueMap; + +public class ApiClientTest { + ApiClient apiClient; + + @Before + public void setup() { + apiClient = new ApiClient(); + } + + /** + * Test uri encoding when params contains comma + */ + @Test + public void testUriEncoderWithComma() { + Map uriParams = new HashMap<>(); + MultiValueMap queryParams = new LinkedMultiValueMap(); + queryParams.add("key", "val,comma"); + apiClient.generateQueryUri(queryParams, uriParams); + + assertEquals("/key=val%2Ccomma", apiClient.expandPath("/key={key0}", uriParams)); + } +} \ No newline at end of file diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java index 89f43f67cc1a..42d81a59578f 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java @@ -25,6 +25,7 @@ import org.springframework.web.client.RestClientException; import org.springframework.web.client.RestTemplate; import org.springframework.web.util.UriComponentsBuilder; +import org.springframework.web.util.DefaultUriBuilderFactory; import org.threeten.bp.*; import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; import org.springframework.http.converter.HttpMessageConverter; @@ -573,6 +574,12 @@ protected Object selectBody(Object obj, MultiValueMap formParams * @return path with placeholders replaced by variables */ public String expandPath(String pathTemplate, Map variables) { + // disable default URL encoding + DefaultUriBuilderFactory uriBuilderFactory = new DefaultUriBuilderFactory(); + uriBuilderFactory.setEncodingMode(DefaultUriBuilderFactory.EncodingMode.NONE); + final RestTemplate restTemplate = new RestTemplate(); + restTemplate.setUriTemplateHandler(uriBuilderFactory); + return restTemplate.getUriTemplateHandler().expand(pathTemplate, variables).toString(); } @@ -583,27 +590,33 @@ public String expandPath(String pathTemplate, Map variables) { * @param uriParams The path parameters * return templatized query string */ - private String generateQueryUri(MultiValueMap queryParams, Map uriParams) { + public String generateQueryUri(MultiValueMap queryParams, Map uriParams) { StringBuilder queryBuilder = new StringBuilder(); queryParams.forEach((name, values) -> { - if (CollectionUtils.isEmpty(values)) { - if (queryBuilder.length() != 0) { - queryBuilder.append('&'); - } - queryBuilder.append(name); - } else { - int valueItemCounter = 0; - for (Object value : values) { + try { + final String encodedName = URLEncoder.encode(name.toString(), "UTF-8"); + if (CollectionUtils.isEmpty(values)) { if (queryBuilder.length() != 0) { queryBuilder.append('&'); } - queryBuilder.append(name); - if (value != null) { - String templatizedKey = name + valueItemCounter++; - uriParams.put(templatizedKey, value.toString()); - queryBuilder.append('=').append("{").append(templatizedKey).append("}"); + queryBuilder.append(encodedName); + } else { + int valueItemCounter = 0; + for (Object value : values) { + if (queryBuilder.length() != 0) { + queryBuilder.append('&'); + } + queryBuilder.append(encodedName); + if (value != null) { + String templatizedKey = encodedName + valueItemCounter++; + final String encodedValue = URLEncoder.encode(value.toString(), "UTF-8"); + uriParams.put(templatizedKey, encodedValue); + queryBuilder.append('=').append("{").append(templatizedKey).append("}"); + } } } + } catch (UnsupportedEncodingException e) { + } }); return queryBuilder.toString(); diff --git a/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/ApiClientTest.java b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/ApiClientTest.java new file mode 100644 index 000000000000..4b3a63c3e266 --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/ApiClientTest.java @@ -0,0 +1,31 @@ +package org.openapitools.client; + +import static org.hamcrest.CoreMatchers.*; +import static org.junit.Assert.*; + +import java.util.*; +import org.junit.*; +import org.springframework.util.MultiValueMap; +import org.springframework.util.LinkedMultiValueMap; + +public class ApiClientTest { + ApiClient apiClient; + + @Before + public void setup() { + apiClient = new ApiClient(); + } + + /** + * Test uri encoding when params contains comma + */ + @Test + public void testUriEncoderWithComma() { + Map uriParams = new HashMap<>(); + MultiValueMap queryParams = new LinkedMultiValueMap(); + queryParams.add("key", "val,comma"); + apiClient.generateQueryUri(queryParams, uriParams); + + assertEquals("/key=val%2Ccomma", apiClient.expandPath("/key={key0}", uriParams)); + } +} \ No newline at end of file From a620853216ff7fb6848760bf559aff2db1cf946f Mon Sep 17 00:00:00 2001 From: Fumito Nakazawa Date: Fri, 26 Nov 2021 01:55:06 +0900 Subject: [PATCH 037/117] [swift5] Refactor encodeToJSON (#10961) * Add protocol extension method * execute sample script * Add Packing.cmake * Revert "Add Packing.cmake" This reverts commit cb52547fe34c5d17dd83267daa259b7ee3ddd503. * Remove empty lines * Revert FILES * Add Packing.cmake --- .../main/resources/swift5/Extensions.mustache | 48 ++++--------------- .../src/main/resources/swift5/Models.mustache | 4 ++ samples/client/petstore/c/Packing.cmake | 24 ++++++++++ .../Classes/OpenAPIs/Extensions.swift | 48 ++++--------------- .../Classes/OpenAPIs/Models.swift | 4 ++ .../Classes/OpenAPIs/Extensions.swift | 48 ++++--------------- .../Classes/OpenAPIs/Models.swift | 4 ++ .../Classes/OpenAPIs/Extensions.swift | 48 ++++--------------- .../Classes/OpenAPIs/Models.swift | 4 ++ .../Classes/OpenAPIs/Extensions.swift | 48 ++++--------------- .../Classes/OpenAPIs/Models.swift | 4 ++ .../Classes/OpenAPIs/Extensions.swift | 48 ++++--------------- .../Classes/OpenAPIs/Models.swift | 4 ++ .../Classes/OpenAPIs/Extensions.swift | 48 ++++--------------- .../Classes/OpenAPIs/Models.swift | 4 ++ .../Classes/OpenAPIs/Extensions.swift | 48 ++++--------------- .../Classes/OpenAPIs/Models.swift | 4 ++ .../Classes/OpenAPIs/Extensions.swift | 48 ++++--------------- .../Classes/OpenAPIs/Models.swift | 4 ++ .../Classes/OpenAPIs/Extensions.swift | 48 ++++--------------- .../Classes/OpenAPIs/Models.swift | 4 ++ .../Classes/OpenAPIs/Extensions.swift | 48 ++++--------------- .../Classes/OpenAPIs/Models.swift | 4 ++ .../Classes/OpenAPIs/Extensions.swift | 48 ++++--------------- .../Classes/OpenAPIs/Models.swift | 4 ++ .../Classes/OpenAPIs/Extensions.swift | 48 ++++--------------- .../Classes/OpenAPIs/Models.swift | 4 ++ .../Sources/PetstoreClient/Extensions.swift | 48 ++++--------------- .../Sources/PetstoreClient/Models.swift | 4 ++ .../Classes/OpenAPIs/Extensions.swift | 48 ++++--------------- .../Classes/OpenAPIs/Models.swift | 4 ++ 31 files changed, 219 insertions(+), 585 deletions(-) create mode 100644 samples/client/petstore/c/Packing.cmake diff --git a/modules/openapi-generator/src/main/resources/swift5/Extensions.mustache b/modules/openapi-generator/src/main/resources/swift5/Extensions.mustache index b286fa9f42a4..eb3fd11eb8e1 100644 --- a/modules/openapi-generator/src/main/resources/swift5/Extensions.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/Extensions.mustache @@ -11,33 +11,15 @@ import AnyCodable import PromiseKit{{/usePromiseKit}}{{#useVapor}} import Vapor{{/useVapor}}{{^useVapor}} -extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Int32: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } -} - -extension Int64: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } -} - -extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension String: JSONEncodable { - func encodeToJSON() -> Any { return self } -} +extension Bool: JSONEncodable {} +extension Float: JSONEncodable {} +extension Int: JSONEncodable {} +extension Int32: JSONEncodable {} +extension Int64: JSONEncodable {} +extension Double: JSONEncodable {} +extension String: JSONEncodable {} +extension URL: JSONEncodable {} +extension UUID: JSONEncodable {} extension RawRepresentable where RawValue: JSONEncodable { func encodeToJSON() -> Any { return self.rawValue } @@ -83,18 +65,6 @@ extension Date: JSONEncodable { func encodeToJSON() -> Any { return CodableHelper.dateFormatter.string(from: self) } -} - -extension URL: JSONEncodable { - func encodeToJSON() -> Any { - return self - } -} - -extension UUID: JSONEncodable { - func encodeToJSON() -> Any { - return self.uuidString - } }{{/useVapor}}{{#generateModelAdditionalProperties}} extension String: CodingKey { diff --git a/modules/openapi-generator/src/main/resources/swift5/Models.mustache b/modules/openapi-generator/src/main/resources/swift5/Models.mustache index e8ca64cdc524..3b2c5eafce1b 100644 --- a/modules/openapi-generator/src/main/resources/swift5/Models.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/Models.mustache @@ -10,6 +10,10 @@ protocol JSONEncodable { func encodeToJSON() -> Any } +extension JSONEncodable { + func encodeToJSON() -> Any { self } +} + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } diff --git a/samples/client/petstore/c/Packing.cmake b/samples/client/petstore/c/Packing.cmake new file mode 100644 index 000000000000..15bd4c8d5e9b --- /dev/null +++ b/samples/client/petstore/c/Packing.cmake @@ -0,0 +1,24 @@ +set(CPACK_PACKAGE_NAME lib${pkgName}) + +set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) +set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) +set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) + +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${PROJECT_PACKAGE_DESCRIPTION_SUMMARY}) +set(CPACK_PACKAGE_VENDOR ${PROJECT_PACKAGE_VENDOR}) +set(CPACK_PACKAGE_CONTACT ${PROJECT_PACKAGE_CONTACT}) +set(CPACK_DEBIAN_PACKAGE_MAINTAINER ${PROJECT_PACKAGE_MAINTAINER}) + +set(CPACK_VERBATIM_VARIABLES YES) + +set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME}) + +set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}) + +set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT) + +set(CPACK_DEB_COMPONENT_INSTALL YES) + +set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS TRUE) + +include(CPack) \ 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 5831422f09d8..e2b73073804d 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -9,33 +9,15 @@ import Foundation import AnyCodable #endif -extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Int32: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } -} - -extension Int64: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } -} - -extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension String: JSONEncodable { - func encodeToJSON() -> Any { return self } -} +extension Bool: JSONEncodable {} +extension Float: JSONEncodable {} +extension Int: JSONEncodable {} +extension Int32: JSONEncodable {} +extension Int64: JSONEncodable {} +extension Double: JSONEncodable {} +extension String: JSONEncodable {} +extension URL: JSONEncodable {} +extension UUID: JSONEncodable {} extension RawRepresentable where RawValue: JSONEncodable { func encodeToJSON() -> Any { return self.rawValue } @@ -83,18 +65,6 @@ extension Date: JSONEncodable { } } -extension URL: JSONEncodable { - func encodeToJSON() -> Any { - return self - } -} - -extension UUID: JSONEncodable { - func encodeToJSON() -> Any { - return self.uuidString - } -} - extension String: CodingKey { public var stringValue: String { 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 e58029901670..ab4165a9b450 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,6 +10,10 @@ protocol JSONEncodable { func encodeToJSON() -> Any } +extension JSONEncodable { + func encodeToJSON() -> Any { self } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 5831422f09d8..e2b73073804d 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -9,33 +9,15 @@ import Foundation import AnyCodable #endif -extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Int32: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } -} - -extension Int64: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } -} - -extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension String: JSONEncodable { - func encodeToJSON() -> Any { return self } -} +extension Bool: JSONEncodable {} +extension Float: JSONEncodable {} +extension Int: JSONEncodable {} +extension Int32: JSONEncodable {} +extension Int64: JSONEncodable {} +extension Double: JSONEncodable {} +extension String: JSONEncodable {} +extension URL: JSONEncodable {} +extension UUID: JSONEncodable {} extension RawRepresentable where RawValue: JSONEncodable { func encodeToJSON() -> Any { return self.rawValue } @@ -83,18 +65,6 @@ extension Date: JSONEncodable { } } -extension URL: JSONEncodable { - func encodeToJSON() -> Any { - return self - } -} - -extension UUID: JSONEncodable { - func encodeToJSON() -> Any { - return self.uuidString - } -} - extension String: CodingKey { public var stringValue: String { diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index e58029901670..ab4165a9b450 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,6 +10,10 @@ protocol JSONEncodable { func encodeToJSON() -> Any } +extension JSONEncodable { + func encodeToJSON() -> Any { self } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } 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 5831422f09d8..e2b73073804d 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -9,33 +9,15 @@ import Foundation import AnyCodable #endif -extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Int32: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } -} - -extension Int64: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } -} - -extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension String: JSONEncodable { - func encodeToJSON() -> Any { return self } -} +extension Bool: JSONEncodable {} +extension Float: JSONEncodable {} +extension Int: JSONEncodable {} +extension Int32: JSONEncodable {} +extension Int64: JSONEncodable {} +extension Double: JSONEncodable {} +extension String: JSONEncodable {} +extension URL: JSONEncodable {} +extension UUID: JSONEncodable {} extension RawRepresentable where RawValue: JSONEncodable { func encodeToJSON() -> Any { return self.rawValue } @@ -83,18 +65,6 @@ extension Date: JSONEncodable { } } -extension URL: JSONEncodable { - func encodeToJSON() -> Any { - return self - } -} - -extension UUID: JSONEncodable { - func encodeToJSON() -> Any { - return self.uuidString - } -} - extension String: CodingKey { public var stringValue: String { 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 e58029901670..ab4165a9b450 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,6 +10,10 @@ protocol JSONEncodable { func encodeToJSON() -> Any } +extension JSONEncodable { + func encodeToJSON() -> Any { self } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } 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 5831422f09d8..e2b73073804d 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -9,33 +9,15 @@ import Foundation import AnyCodable #endif -extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Int32: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } -} - -extension Int64: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } -} - -extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension String: JSONEncodable { - func encodeToJSON() -> Any { return self } -} +extension Bool: JSONEncodable {} +extension Float: JSONEncodable {} +extension Int: JSONEncodable {} +extension Int32: JSONEncodable {} +extension Int64: JSONEncodable {} +extension Double: JSONEncodable {} +extension String: JSONEncodable {} +extension URL: JSONEncodable {} +extension UUID: JSONEncodable {} extension RawRepresentable where RawValue: JSONEncodable { func encodeToJSON() -> Any { return self.rawValue } @@ -83,18 +65,6 @@ extension Date: JSONEncodable { } } -extension URL: JSONEncodable { - func encodeToJSON() -> Any { - return self - } -} - -extension UUID: JSONEncodable { - func encodeToJSON() -> Any { - return self.uuidString - } -} - extension String: CodingKey { public var stringValue: String { 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 e58029901670..ab4165a9b450 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,6 +10,10 @@ protocol JSONEncodable { func encodeToJSON() -> Any } +extension JSONEncodable { + func encodeToJSON() -> Any { self } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 5831422f09d8..e2b73073804d 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -9,33 +9,15 @@ import Foundation import AnyCodable #endif -extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Int32: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } -} - -extension Int64: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } -} - -extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension String: JSONEncodable { - func encodeToJSON() -> Any { return self } -} +extension Bool: JSONEncodable {} +extension Float: JSONEncodable {} +extension Int: JSONEncodable {} +extension Int32: JSONEncodable {} +extension Int64: JSONEncodable {} +extension Double: JSONEncodable {} +extension String: JSONEncodable {} +extension URL: JSONEncodable {} +extension UUID: JSONEncodable {} extension RawRepresentable where RawValue: JSONEncodable { func encodeToJSON() -> Any { return self.rawValue } @@ -83,18 +65,6 @@ extension Date: JSONEncodable { } } -extension URL: JSONEncodable { - func encodeToJSON() -> Any { - return self - } -} - -extension UUID: JSONEncodable { - func encodeToJSON() -> Any { - return self.uuidString - } -} - extension String: CodingKey { public var stringValue: String { diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift index e58029901670..ab4165a9b450 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,6 +10,10 @@ protocol JSONEncodable { func encodeToJSON() -> Any } +extension JSONEncodable { + func encodeToJSON() -> Any { self } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } 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 63647fe3703b..255ab49db7b6 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -9,33 +9,15 @@ import Foundation import AnyCodable #endif -extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Int32: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } -} - -extension Int64: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } -} - -extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension String: JSONEncodable { - func encodeToJSON() -> Any { return self } -} +extension Bool: JSONEncodable {} +extension Float: JSONEncodable {} +extension Int: JSONEncodable {} +extension Int32: JSONEncodable {} +extension Int64: JSONEncodable {} +extension Double: JSONEncodable {} +extension String: JSONEncodable {} +extension URL: JSONEncodable {} +extension UUID: JSONEncodable {} extension RawRepresentable where RawValue: JSONEncodable { func encodeToJSON() -> Any { return self.rawValue } @@ -83,18 +65,6 @@ extension Date: JSONEncodable { } } -extension URL: JSONEncodable { - func encodeToJSON() -> Any { - return self - } -} - -extension UUID: JSONEncodable { - func encodeToJSON() -> Any { - return self.uuidString - } -} - extension String: CodingKey { public var stringValue: String { 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 5db24390bd78..0c1c75488981 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,6 +10,10 @@ protocol JSONEncodable { func encodeToJSON() -> Any } +extension JSONEncodable { + func encodeToJSON() -> Any { self } +} + internal enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } 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 5831422f09d8..e2b73073804d 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -9,33 +9,15 @@ import Foundation import AnyCodable #endif -extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Int32: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } -} - -extension Int64: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } -} - -extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension String: JSONEncodable { - func encodeToJSON() -> Any { return self } -} +extension Bool: JSONEncodable {} +extension Float: JSONEncodable {} +extension Int: JSONEncodable {} +extension Int32: JSONEncodable {} +extension Int64: JSONEncodable {} +extension Double: JSONEncodable {} +extension String: JSONEncodable {} +extension URL: JSONEncodable {} +extension UUID: JSONEncodable {} extension RawRepresentable where RawValue: JSONEncodable { func encodeToJSON() -> Any { return self.rawValue } @@ -83,18 +65,6 @@ extension Date: JSONEncodable { } } -extension URL: JSONEncodable { - func encodeToJSON() -> Any { - return self - } -} - -extension UUID: JSONEncodable { - func encodeToJSON() -> Any { - return self.uuidString - } -} - extension String: CodingKey { public var stringValue: String { 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 e58029901670..ab4165a9b450 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,6 +10,10 @@ protocol JSONEncodable { func encodeToJSON() -> Any } +extension JSONEncodable { + func encodeToJSON() -> Any { self } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 5831422f09d8..e2b73073804d 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -9,33 +9,15 @@ import Foundation import AnyCodable #endif -extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Int32: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } -} - -extension Int64: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } -} - -extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension String: JSONEncodable { - func encodeToJSON() -> Any { return self } -} +extension Bool: JSONEncodable {} +extension Float: JSONEncodable {} +extension Int: JSONEncodable {} +extension Int32: JSONEncodable {} +extension Int64: JSONEncodable {} +extension Double: JSONEncodable {} +extension String: JSONEncodable {} +extension URL: JSONEncodable {} +extension UUID: JSONEncodable {} extension RawRepresentable where RawValue: JSONEncodable { func encodeToJSON() -> Any { return self.rawValue } @@ -83,18 +65,6 @@ extension Date: JSONEncodable { } } -extension URL: JSONEncodable { - func encodeToJSON() -> Any { - return self - } -} - -extension UUID: JSONEncodable { - func encodeToJSON() -> Any { - return self.uuidString - } -} - extension String: CodingKey { public var stringValue: String { diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models.swift index e58029901670..ab4165a9b450 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,6 +10,10 @@ protocol JSONEncodable { func encodeToJSON() -> Any } +extension JSONEncodable { + func encodeToJSON() -> Any { self } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } 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 2c1ceeb385be..cc93d4c30d3c 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -10,33 +10,15 @@ import AnyCodable #endif import PromiseKit -extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Int32: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } -} - -extension Int64: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } -} - -extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension String: JSONEncodable { - func encodeToJSON() -> Any { return self } -} +extension Bool: JSONEncodable {} +extension Float: JSONEncodable {} +extension Int: JSONEncodable {} +extension Int32: JSONEncodable {} +extension Int64: JSONEncodable {} +extension Double: JSONEncodable {} +extension String: JSONEncodable {} +extension URL: JSONEncodable {} +extension UUID: JSONEncodable {} extension RawRepresentable where RawValue: JSONEncodable { func encodeToJSON() -> Any { return self.rawValue } @@ -84,18 +66,6 @@ extension Date: JSONEncodable { } } -extension URL: JSONEncodable { - func encodeToJSON() -> Any { - return self - } -} - -extension UUID: JSONEncodable { - func encodeToJSON() -> Any { - return self.uuidString - } -} - extension String: CodingKey { public var stringValue: String { 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 e58029901670..ab4165a9b450 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,6 +10,10 @@ protocol JSONEncodable { func encodeToJSON() -> Any } +extension JSONEncodable { + func encodeToJSON() -> Any { self } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 5831422f09d8..e2b73073804d 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -9,33 +9,15 @@ import Foundation import AnyCodable #endif -extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Int32: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } -} - -extension Int64: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } -} - -extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension String: JSONEncodable { - func encodeToJSON() -> Any { return self } -} +extension Bool: JSONEncodable {} +extension Float: JSONEncodable {} +extension Int: JSONEncodable {} +extension Int32: JSONEncodable {} +extension Int64: JSONEncodable {} +extension Double: JSONEncodable {} +extension String: JSONEncodable {} +extension URL: JSONEncodable {} +extension UUID: JSONEncodable {} extension RawRepresentable where RawValue: JSONEncodable { func encodeToJSON() -> Any { return self.rawValue } @@ -83,18 +65,6 @@ extension Date: JSONEncodable { } } -extension URL: JSONEncodable { - func encodeToJSON() -> Any { - return self - } -} - -extension UUID: JSONEncodable { - func encodeToJSON() -> Any { - return self.uuidString - } -} - extension String: CodingKey { public var stringValue: String { diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift index e58029901670..ab4165a9b450 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,6 +10,10 @@ protocol JSONEncodable { func encodeToJSON() -> Any } +extension JSONEncodable { + func encodeToJSON() -> Any { self } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } 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 5831422f09d8..e2b73073804d 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -9,33 +9,15 @@ import Foundation import AnyCodable #endif -extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Int32: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } -} - -extension Int64: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } -} - -extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension String: JSONEncodable { - func encodeToJSON() -> Any { return self } -} +extension Bool: JSONEncodable {} +extension Float: JSONEncodable {} +extension Int: JSONEncodable {} +extension Int32: JSONEncodable {} +extension Int64: JSONEncodable {} +extension Double: JSONEncodable {} +extension String: JSONEncodable {} +extension URL: JSONEncodable {} +extension UUID: JSONEncodable {} extension RawRepresentable where RawValue: JSONEncodable { func encodeToJSON() -> Any { return self.rawValue } @@ -83,18 +65,6 @@ extension Date: JSONEncodable { } } -extension URL: JSONEncodable { - func encodeToJSON() -> Any { - return self - } -} - -extension UUID: JSONEncodable { - func encodeToJSON() -> Any { - return self.uuidString - } -} - extension String: CodingKey { public var stringValue: String { 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 e58029901670..ab4165a9b450 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,6 +10,10 @@ protocol JSONEncodable { func encodeToJSON() -> Any } +extension JSONEncodable { + func encodeToJSON() -> Any { self } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } 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 4077c82552a6..570ea5f64bdf 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -9,33 +9,15 @@ import Foundation import AnyCodable #endif -extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Int32: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } -} - -extension Int64: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } -} - -extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension String: JSONEncodable { - func encodeToJSON() -> Any { return self } -} +extension Bool: JSONEncodable {} +extension Float: JSONEncodable {} +extension Int: JSONEncodable {} +extension Int32: JSONEncodable {} +extension Int64: JSONEncodable {} +extension Double: JSONEncodable {} +extension String: JSONEncodable {} +extension URL: JSONEncodable {} +extension UUID: JSONEncodable {} extension RawRepresentable where RawValue: JSONEncodable { func encodeToJSON() -> Any { return self.rawValue } @@ -83,18 +65,6 @@ extension Date: JSONEncodable { } } -extension URL: JSONEncodable { - func encodeToJSON() -> Any { - return self - } -} - -extension UUID: JSONEncodable { - func encodeToJSON() -> Any { - return self.uuidString - } -} - extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { return (200 ..< 300).contains(statusCode) 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 e58029901670..ab4165a9b450 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,6 +10,10 @@ protocol JSONEncodable { func encodeToJSON() -> Any } +extension JSONEncodable { + func encodeToJSON() -> Any { self } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Extensions.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Extensions.swift index 5831422f09d8..e2b73073804d 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Extensions.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Extensions.swift @@ -9,33 +9,15 @@ import Foundation import AnyCodable #endif -extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Int32: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } -} - -extension Int64: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } -} - -extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension String: JSONEncodable { - func encodeToJSON() -> Any { return self } -} +extension Bool: JSONEncodable {} +extension Float: JSONEncodable {} +extension Int: JSONEncodable {} +extension Int32: JSONEncodable {} +extension Int64: JSONEncodable {} +extension Double: JSONEncodable {} +extension String: JSONEncodable {} +extension URL: JSONEncodable {} +extension UUID: JSONEncodable {} extension RawRepresentable where RawValue: JSONEncodable { func encodeToJSON() -> Any { return self.rawValue } @@ -83,18 +65,6 @@ extension Date: JSONEncodable { } } -extension URL: JSONEncodable { - func encodeToJSON() -> Any { - return self - } -} - -extension UUID: JSONEncodable { - func encodeToJSON() -> Any { - return self.uuidString - } -} - extension String: CodingKey { public var stringValue: String { diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models.swift index e58029901670..ab4165a9b450 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models.swift @@ -10,6 +10,10 @@ protocol JSONEncodable { func encodeToJSON() -> Any } +extension JSONEncodable { + func encodeToJSON() -> Any { self } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 5831422f09d8..e2b73073804d 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -9,33 +9,15 @@ import Foundation import AnyCodable #endif -extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension Int32: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } -} - -extension Int64: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } -} - -extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self } -} - -extension String: JSONEncodable { - func encodeToJSON() -> Any { return self } -} +extension Bool: JSONEncodable {} +extension Float: JSONEncodable {} +extension Int: JSONEncodable {} +extension Int32: JSONEncodable {} +extension Int64: JSONEncodable {} +extension Double: JSONEncodable {} +extension String: JSONEncodable {} +extension URL: JSONEncodable {} +extension UUID: JSONEncodable {} extension RawRepresentable where RawValue: JSONEncodable { func encodeToJSON() -> Any { return self.rawValue } @@ -83,18 +65,6 @@ extension Date: JSONEncodable { } } -extension URL: JSONEncodable { - func encodeToJSON() -> Any { - return self - } -} - -extension UUID: JSONEncodable { - func encodeToJSON() -> Any { - return self.uuidString - } -} - extension String: CodingKey { public var stringValue: String { diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models.swift index e58029901670..ab4165a9b450 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,6 +10,10 @@ protocol JSONEncodable { func encodeToJSON() -> Any } +extension JSONEncodable { + func encodeToJSON() -> Any { self } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } From 06faa289bd93c5fe1f2caa376e32ec6cc07627a2 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Thu, 25 Nov 2021 18:00:53 -0800 Subject: [PATCH 038/117] Adds codegenParameter.schema to allow referenced schemas in parameters (#10934) * Removes python-experimental folder * Sets schema in fromParameter * Sets schema in codegenParameter * Adds tests of schema --- .../org/openapitools/codegen/CodegenParameter.java | 13 ++++++++++++- .../org/openapitools/codegen/DefaultCodegen.java | 2 ++ .../openapitools/codegen/DefaultCodegenTest.java | 4 ++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java index 38eb785410e5..5bd8a369f0d3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java @@ -52,6 +52,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties { public boolean hasValidation; public boolean isNullable; public boolean isDeprecated; + private CodegenProperty schema; /** * Determines whether this parameter is mandatory. If the parameter is in "path", * this property is required and its value MUST be true. Otherwise, the property @@ -162,6 +163,9 @@ public CodegenParameter copy() { output.setHasDiscriminatorWithNonEmptyMapping(this.hasDiscriminatorWithNonEmptyMapping); output.setHasMultipleTypes(this.hasMultipleTypes); + if (this.schema != null) { + output.setSchema(this.schema); + } if (this.composedSchemas != null) { output.setComposedSchemas(this.getComposedSchemas()); } @@ -222,7 +226,7 @@ public CodegenParameter copy() { @Override public int hashCode() { - return Objects.hash(isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, isContainer, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, baseName, paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription, baseType, defaultValue, enumName, style, isDeepObject, isAllowEmptyValue, example, jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject, isAnyType, isArray, isMap, isFile, isEnum, _enum, allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars, vendorExtensions, hasValidation, getMaxProperties(), getMinProperties(), isNullable, isDeprecated, required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf, isNull, additionalPropertiesIsAnyType, hasVars, hasRequired, isShort, isUnboundedInteger, hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes); + return Objects.hash(isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, isContainer, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, baseName, paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription, baseType, defaultValue, enumName, style, isDeepObject, isAllowEmptyValue, example, jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject, isAnyType, isArray, isMap, isFile, isEnum, _enum, allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars, vendorExtensions, hasValidation, getMaxProperties(), getMinProperties(), isNullable, isDeprecated, required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf, isNull, additionalPropertiesIsAnyType, hasVars, hasRequired, isShort, isUnboundedInteger, hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes, schema); } @Override @@ -278,6 +282,7 @@ public boolean equals(Object o) { getExclusiveMaximum() == that.getExclusiveMaximum() && getExclusiveMinimum() == that.getExclusiveMinimum() && getUniqueItems() == that.getUniqueItems() && + Objects.equals(schema, that.getSchema()) && Objects.equals(composedSchemas, that.getComposedSchemas()) && Objects.equals(baseName, that.baseName) && Objects.equals(paramName, that.paramName) && @@ -403,6 +408,7 @@ public String toString() { sb.append(", getHasDiscriminatorWithNonEmptyMapping=").append(hasDiscriminatorWithNonEmptyMapping); sb.append(", composedSchemas=").append(composedSchemas); sb.append(", hasMultipleTypes=").append(hasMultipleTypes); + sb.append(", schema=").append(schema); sb.append('}'); return sb.toString(); } @@ -732,5 +738,10 @@ public CodegenComposedSchemas getComposedSchemas() { @Override public void setHasMultipleTypes(boolean hasMultipleTypes) { this.hasMultipleTypes = hasMultipleTypes; } + + public CodegenProperty getSchema() {return schema; } + + public void setSchema(CodegenProperty schema) { this.schema = schema; } + } 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 6e669ab37cde..563dc10ebc94 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 @@ -4499,6 +4499,8 @@ public CodegenParameter fromParameter(Parameter parameter, Set imports) Schema parameterSchema; if (parameter.getSchema() != null) { parameterSchema = parameter.getSchema(); + CodegenProperty prop = fromProperty(parameter.getName(), parameterSchema); + codegenParameter.setSchema(prop); } else if (parameter.getContent() != null) { Content content = parameter.getContent(); if (content.size() > 1) { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java index 7afce7c43915..aaede097e3d8 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java @@ -222,6 +222,7 @@ public void testFormParameterHasDefaultValue() { CodegenParameter codegenParameter = codegen.fromFormProperty("enum_form_string", (Schema) requestBodySchema.getProperties().get("enum_form_string"), new HashSet()); Assert.assertEquals(codegenParameter.defaultValue, "-efg"); + Assert.assertEquals(codegenParameter.getSchema(), null); } @Test @@ -2035,6 +2036,9 @@ public void objectQueryParamIdentifyAsObject() { Assert.assertEquals(parameter.dataType, "PageQuery1"); Assert.assertEquals(imports.size(), 1); Assert.assertEquals(imports.iterator().next(), "PageQuery1"); + + Assert.assertNotNull(parameter.getSchema()); + Assert.assertEquals(parameter.getSchema().baseType, "object"); } @Test From 3d92df5a4173384b3e3f35a447dfd7782f112473 Mon Sep 17 00:00:00 2001 From: Kevin Chen Date: Fri, 26 Nov 2021 01:04:19 -0600 Subject: [PATCH 039/117] [Java][okhttp-gson] Support text/plain body (#10885) * support serialize RequestBody with contentType text/plain * add Serialize test * update test comment --- .../libraries/okhttp-gson/ApiClient.mustache | 2 ++ .../org/openapitools/client/ApiClient.java | 2 ++ .../org/openapitools/client/ApiClient.java | 2 ++ .../org/openapitools/client/ApiClient.java | 2 ++ .../org/openapitools/client/ApiClient.java | 2 ++ .../org/openapitools/client/ApiClientTest.java | 18 ++++++++++++++++++ 6 files changed, 28 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache index a0c3c4e5b7c8..421b7782ebef 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache @@ -1081,6 +1081,8 @@ public class ApiClient { } else if (obj instanceof File) { // File body parameter support. return RequestBody.create((File) obj, MediaType.parse(contentType)); + } else if ("text/plain".equals(contentType) && obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); } else if (isJsonMime(contentType)) { String content; if (obj != null) { diff --git a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiClient.java index 843d13b69a1c..f2fca9d7ea3b 100644 --- a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/ApiClient.java @@ -871,6 +871,8 @@ public RequestBody serialize(Object obj, String contentType) throws ApiException } else if (obj instanceof File) { // File body parameter support. return RequestBody.create((File) obj, MediaType.parse(contentType)); + } else if ("text/plain".equals(contentType) && obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); } else if (isJsonMime(contentType)) { String content; if (obj != null) { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java index 69d6469c85a8..ddd9a420bb65 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java @@ -972,6 +972,8 @@ public RequestBody serialize(Object obj, String contentType) throws ApiException } else if (obj instanceof File) { // File body parameter support. return RequestBody.create((File) obj, MediaType.parse(contentType)); + } else if ("text/plain".equals(contentType) && obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); } else if (isJsonMime(contentType)) { String content; if (obj != null) { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java index 7ef420e3c7c4..93328801c2e1 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java @@ -973,6 +973,8 @@ public RequestBody serialize(Object obj, String contentType) throws ApiException } else if (obj instanceof File) { // File body parameter support. return RequestBody.create((File) obj, MediaType.parse(contentType)); + } else if ("text/plain".equals(contentType) && obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); } else if (isJsonMime(contentType)) { String content; if (obj != null) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java index 7ef420e3c7c4..93328801c2e1 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java @@ -973,6 +973,8 @@ public RequestBody serialize(Object obj, String contentType) throws ApiException } else if (obj instanceof File) { // File body parameter support. return RequestBody.create((File) obj, MediaType.parse(contentType)); + } else if ("text/plain".equals(contentType) && obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); } else if (isJsonMime(contentType)) { String content; if (obj != null) { diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ApiClientTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ApiClientTest.java index 9edd0ae7bedc..9daf2dcf886c 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ApiClientTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ApiClientTest.java @@ -342,4 +342,22 @@ public void testNewHttpClient() { public void testNullHttpClient() { apiClient.setHttpClient(null); } + + /** + * Tests the ApiClient serialize methods + */ + @Test + public void testSerializeRequest() throws ApiException { + assertNotNull(apiClient.serialize("test", "text/plain")); + assertNotNull(apiClient.serialize("{}", "application/json")); + } + + /** + * Tests the ApiClient serialize methods with unsupported content-type + * should raise ApiException + */ + @Test(expected = ApiException.class) + public void testUnsupportedSerializeRequest() throws ApiException { + apiClient.serialize("test", "unsupported/type"); + } } From 309b67f91e182bdf0d80d53f8564e69232f3ebd8 Mon Sep 17 00:00:00 2001 From: sullis Date: Thu, 25 Nov 2021 23:05:47 -0800 Subject: [PATCH 040/117] update GitHub Actions (#10963) - use setup-java v2 everywhere - use Temurin JDK everywhere --- .../workflows/check-supported-versions.yaml | 2 +- .github/workflows/gradle-test.yaml | 2 +- .github/workflows/openapi-generator.yaml | 18 ++++++++++++------ .github/workflows/samples-dart.yaml | 4 ++-- .github/workflows/samples-kotlin.yaml | 2 +- .github/workflows/sonar.yml | 2 +- 6 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.github/workflows/check-supported-versions.yaml b/.github/workflows/check-supported-versions.yaml index ba496f3ab5c3..017b4bdf0ab4 100644 --- a/.github/workflows/check-supported-versions.yaml +++ b/.github/workflows/check-supported-versions.yaml @@ -26,7 +26,7 @@ jobs: - name: Set up JDK ${{ matrix.java }} uses: actions/setup-java@v2 with: - distribution: 'adopt' + distribution: 'temurin' java-version: ${{ matrix.java }} - uses: actions/cache@v2.1.7 diff --git a/.github/workflows/gradle-test.yaml b/.github/workflows/gradle-test.yaml index 6be454c68a6b..c6f6f495ab17 100644 --- a/.github/workflows/gradle-test.yaml +++ b/.github/workflows/gradle-test.yaml @@ -36,7 +36,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-java@v2 with: - distribution: 'adopt' + distribution: 'temurin' java-version: 11 # Cache Gradle Dependencies - name: Setup Gradle Dependencies Cache diff --git a/.github/workflows/openapi-generator.yaml b/.github/workflows/openapi-generator.yaml index a5defde9826d..b2e477592d48 100644 --- a/.github/workflows/openapi-generator.yaml +++ b/.github/workflows/openapi-generator.yaml @@ -17,9 +17,10 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up JDK 8 - uses: actions/setup-java@v1 + uses: actions/setup-java@v2 with: java-version: 8 + distribution: 'temurin' - name: Cache maven dependencies uses: actions/cache@v2.1.7 env: @@ -52,9 +53,10 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up JDK 8 - uses: actions/setup-java@v1 + uses: actions/setup-java@v2 with: java-version: 8 + distribution: 'temurin' - name: Cache maven dependencies uses: actions/cache@v2.1.7 env: @@ -86,9 +88,10 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up JDK 8 - uses: actions/setup-java@v1 + uses: actions/setup-java@v2 with: java-version: 8 + distribution: 'temurin' - name: Download openapi-generator-cli.jar artifact uses: actions/download-artifact@v2.0.10 with: @@ -124,9 +127,10 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up JDK 8 - uses: actions/setup-java@v1 + uses: actions/setup-java@v2 with: java-version: 8 + distribution: 'temurin' - name: Download openapi-generator-cli.jar artifact uses: actions/download-artifact@v2.0.10 with: @@ -158,9 +162,10 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up JDK 11 - uses: actions/setup-java@v1 + uses: actions/setup-java@v2 with: java-version: 11 + distribution: 'temurin' - name: Cache maven dependencies uses: actions/cache@v2.1.7 env: @@ -190,9 +195,10 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up JDK 11 - uses: actions/setup-java@v1 + uses: actions/setup-java@v2 with: java-version: 11 + distribution: 'temurin' - name: Cache maven dependencies uses: actions/cache@v2.1.7 env: diff --git a/.github/workflows/samples-dart.yaml b/.github/workflows/samples-dart.yaml index e4c94f3f1255..5efe3b6b686f 100644 --- a/.github/workflows/samples-dart.yaml +++ b/.github/workflows/samples-dart.yaml @@ -20,7 +20,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-java@v2 with: - distribution: 'adopt' + distribution: 'temurin' java-version: 8 - name: Cache maven dependencies uses: actions/cache@v2.1.7 @@ -53,7 +53,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-java@v2 with: - distribution: 'adopt' + distribution: 'temurin' java-version: 8 - name: Cache maven dependencies uses: actions/cache@v2.1.7 diff --git a/.github/workflows/samples-kotlin.yaml b/.github/workflows/samples-kotlin.yaml index 39a7ea7c9576..c6f6f3745c0f 100644 --- a/.github/workflows/samples-kotlin.yaml +++ b/.github/workflows/samples-kotlin.yaml @@ -45,7 +45,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-java@v2 with: - distribution: 'adopt' + distribution: 'temurin' java-version: 8 - name: Cache maven dependencies uses: actions/cache@v2.1.7 diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index d991e052a7d6..63f622d66e10 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -16,7 +16,7 @@ jobs: - name: Set up JDK 11 uses: actions/setup-java@v2 with: - distribution: 'adopt' + distribution: 'temurin' java-version: 11 - name: Compile with Maven run: mvn -B -q clean install jacoco:report From ae911ff2c1902ce91e3e3e0056b33a33e4365eac Mon Sep 17 00:00:00 2001 From: Tal Kirshboim Date: Sat, 27 Nov 2021 02:36:19 +0100 Subject: [PATCH 041/117] Support generated gradle module as child module (#10966) --- docs/generators/kotlin.md | 1 + .../openapitools/codegen/languages/KotlinClientCodegen.java | 2 ++ .../libraries/multiplatform/build.gradle.kts.mustache | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/generators/kotlin.md b/docs/generators/kotlin.md index fca84164c692..49e02994b749 100644 --- a/docs/generators/kotlin.md +++ b/docs/generators/kotlin.md @@ -17,6 +17,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |library|Library template (sub-template) to use|

    **jvm-okhttp4**
    [DEFAULT] Platform: Java Virtual Machine. HTTP client: OkHttp 4.2.0 (Android 5.0+ and Java 8+). JSON processing: Moshi 1.8.0.
    **jvm-okhttp3**
    Platform: Java Virtual Machine. HTTP client: OkHttp 3.12.4 (Android 2.3+ and Java 7+). JSON processing: Moshi 1.8.0.
    **jvm-retrofit2**
    Platform: Java Virtual Machine. HTTP client: Retrofit 2.6.2.
    **multiplatform**
    Platform: Kotlin multiplatform. HTTP client: Ktor 1.6.0. JSON processing: Kotlinx Serialization: 1.2.1.
    |jvm-okhttp4| |modelMutable|Create mutable models| |false| |moshiCodeGen|Whether to enable codegen with the Moshi library. Refer to the [official Moshi doc](https://github.com/square/moshi#codegen) for more info.| |false| +|omitGradlePluginVersions|Whether to declare Gradle plugin versions in build files.| |false| |packageName|Generated artifact package name.| |org.openapitools.client| |parcelizeModels|toggle "@Parcelize" for generated models| |null| |requestDateConverter|JVM-Option. Defines in how to handle date-time objects that are used for a request (as query or parameter)|
    **toJson**
    [DEFAULT] Date formatter option using a json converter.
    **toString**
    Use the 'toString'-method of the date-time object to retrieve the related string representation.
    |toJson| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java index 91e3ce32c3ff..28a3853332dd 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java @@ -49,6 +49,7 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { public static final String USE_RX_JAVA3 = "useRxJava3"; public static final String USE_COROUTINES = "useCoroutines"; public static final String DO_NOT_USE_RX_AND_COROUTINES = "doNotUseRxAndCoroutines"; + public static final String OMIT_GRADLE_PLUGIN_VERSIONS = "omitGradlePluginVersions"; public static final String DATE_LIBRARY = "dateLibrary"; public static final String REQUEST_DATE_CONVERTER = "requestDateConverter"; @@ -201,6 +202,7 @@ public KotlinClientCodegen() { cliOptions.add(CliOption.newBoolean(USE_RX_JAVA2, "Whether to use the RxJava2 adapter with the retrofit2 library. IMPORTANT: this option has been deprecated. Please use `useRxJava3` instead.")); cliOptions.add(CliOption.newBoolean(USE_RX_JAVA3, "Whether to use the RxJava3 adapter with the retrofit2 library.")); cliOptions.add(CliOption.newBoolean(USE_COROUTINES, "Whether to use the Coroutines adapter with the retrofit2 library.")); + cliOptions.add(CliOption.newBoolean(OMIT_GRADLE_PLUGIN_VERSIONS, "Whether to declare Gradle plugin versions in build files.")); cliOptions.add(CliOption.newBoolean(MOSHI_CODE_GEN, "Whether to enable codegen with the Moshi library. Refer to the [official Moshi doc](https://github.com/square/moshi#codegen) for more info.")); diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/build.gradle.kts.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/build.gradle.kts.mustache index ac4f19048a15..2a620721ba49 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/build.gradle.kts.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/build.gradle.kts.mustache @@ -1,8 +1,8 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget plugins { - kotlin("multiplatform") version "1.5.31" // kotlin_version - kotlin("plugin.serialization") version "1.5.31" // kotlin_version + kotlin("multiplatform"){{^omitGradlePluginVersions}} version "1.5.31" // kotlin_version{{/omitGradlePluginVersions}} + kotlin("plugin.serialization"){{^omitGradlePluginVersions}} version "1.5.31" // kotlin_version{{/omitGradlePluginVersions}} } group = "{{groupId}}" From b7e7c13673bd20de9b605a4e310cfcde607b84fe Mon Sep 17 00:00:00 2001 From: Takayuki Matsubara Date: Sat, 27 Nov 2021 11:02:14 +0900 Subject: [PATCH 042/117] update ruby's default options on document (#10924) --- docs/generators/ruby.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/generators/ruby.md b/docs/generators/ruby.md index c9e0477e9677..5cd52c8c27af 100644 --- a/docs/generators/ruby.md +++ b/docs/generators/ruby.md @@ -10,13 +10,13 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| -|gemAuthor|gem author (only one is supported).| |null| +|gemAuthor|gem author (only one is supported).| |OpenAPI-Generator| |gemAuthorEmail|gem author email (only one is supported).| |null| |gemDescription|gem description. | |This gem maps to a REST API| -|gemHomepage|gem homepage. | |http://org.openapitools| +|gemHomepage|gem homepage. | |https://openapi-generator.tech| |gemLicense|gem license. | |unlicense| |gemName|gem name (convention: underscore_case).| |openapi_client| -|gemRequiredRubyVersion|gem required Ruby version. | |>= 1.9| +|gemRequiredRubyVersion|gem required Ruby version. | |>= 2.4| |gemSummary|gem summary. | |A ruby wrapper for the REST APIs| |gemVersion|gem version.| |1.0.0| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| From 3b5345eb57280340a606cde9a8eb9d25bfec03b1 Mon Sep 17 00:00:00 2001 From: WILLIAM CHENG Date: Sat, 27 Nov 2021 10:03:03 +0800 Subject: [PATCH 043/117] update option value in ruby generator --- .../openapitools/codegen/languages/RubyClientCodegen.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java index f7d5a20e079e..335a329ef59f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java @@ -141,10 +141,10 @@ public RubyClientCodegen() { defaultValue("unlicense")); cliOptions.add(new CliOption(GEM_REQUIRED_RUBY_VERSION, "gem required Ruby version. "). - defaultValue(">= 1.9")); + defaultValue(">= 2.4")); cliOptions.add(new CliOption(GEM_HOMEPAGE, "gem homepage. "). - defaultValue("http://org.openapitools")); + defaultValue("https://openapi-generator.tech")); cliOptions.add(new CliOption(GEM_SUMMARY, "gem summary. "). defaultValue("A ruby wrapper for the REST APIs")); @@ -152,7 +152,7 @@ public RubyClientCodegen() { cliOptions.add(new CliOption(GEM_DESCRIPTION, "gem description. "). defaultValue("This gem maps to a REST API")); - cliOptions.add(new CliOption(GEM_AUTHOR, "gem author (only one is supported).")); + cliOptions.add(new CliOption(GEM_AUTHOR, "gem author (only one is supported).").defaultValue("OpenAPI-Generator")); cliOptions.add(new CliOption(GEM_AUTHOR_EMAIL, "gem author email (only one is supported).")); From 8e2e200e18f746805712d5629edceee159ba4abc Mon Sep 17 00:00:00 2001 From: Alexander Karkossa Date: Mon, 29 Nov 2021 17:42:22 +0100 Subject: [PATCH 044/117] fix: changed Any to kotlin.Any (#10985) --- .../src/main/resources/kotlin-client/enum_class.mustache | 4 ++-- .../src/main/kotlin/org/openapitools/client/models/PetEnum.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/enum_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/enum_class.mustache index 57b1e5f12728..fcdcd87ffa99 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/enum_class.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/enum_class.mustache @@ -67,12 +67,12 @@ import kotlinx.serialization.* /** * Converts the provided [data] to a [String] on success, null otherwise. */ - fun encode(data: Any?): kotlin.String? = if (data is {{classname}}) "$data" else null + fun encode(data: kotlin.Any?): kotlin.String? = if (data is {{classname}}) "$data" else null /** * Returns a valid [{{classname}}] for [data], null otherwise. */ - fun decode(data: Any?): {{classname}}? = data?.let { + fun decode(data: kotlin.Any?): {{classname}}? = data?.let { val normalizedData = "$it".lowercase() values().firstOrNull { value -> it == value || normalizedData == "$value".lowercase() 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 aa6831225a20..4d9fa1abd645 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 @@ -50,12 +50,12 @@ enum class PetEnum(val value: kotlin.String) { /** * Converts the provided [data] to a [String] on success, null otherwise. */ - fun encode(data: Any?): kotlin.String? = if (data is PetEnum) "$data" else null + fun encode(data: kotlin.Any?): kotlin.String? = if (data is PetEnum) "$data" else null /** * Returns a valid [PetEnum] for [data], null otherwise. */ - fun decode(data: Any?): PetEnum? = data?.let { + fun decode(data: kotlin.Any?): PetEnum? = data?.let { val normalizedData = "$it".lowercase() values().firstOrNull { value -> it == value || normalizedData == "$value".lowercase() From 8702f24f05dfa561ad3cb4cdfa4d0d5d6f7c2abf Mon Sep 17 00:00:00 2001 From: Justin Black Date: Mon, 29 Nov 2021 09:31:38 -0800 Subject: [PATCH 045/117] Adds request body content data to allow multiple content types to be sent to servers (#10973) * Adds CodegenMediaType and CodegenEncoding * Adds partial new code to set Parameter content data * Adds content to CodegenParameter * Sets content for request bodies * Adds testParameterContent * Adds testRequestBodyContent --- .../openapitools/codegen/CodegenEncoding.java | 67 +++++++++++++++ .../codegen/CodegenMediaType.java | 45 ++++++++++ .../codegen/CodegenParameter.java | 15 +++- .../openapitools/codegen/DefaultCodegen.java | 57 +++++++++++++ .../codegen/DefaultCodegenTest.java | 72 ++++++++++++++++ .../src/test/resources/3_0/content-data.yaml | 83 +++++++++++++++++++ .../src/openapi_server/openapi/openapi.yaml | 13 +++ .../openapi_server/openapi/openapi.yaml | 13 +++ .../petstore/python-fastapi/openapi.yaml | 8 ++ .../openapi_server/openapi/openapi.yaml | 13 +++ 10 files changed, 385 insertions(+), 1 deletion(-) create mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenEncoding.java create mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenMediaType.java create mode 100644 modules/openapi-generator/src/test/resources/3_0/content-data.yaml diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenEncoding.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenEncoding.java new file mode 100644 index 000000000000..efd5b0f16abc --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenEncoding.java @@ -0,0 +1,67 @@ +package org.openapitools.codegen; + +import java.util.List; +import java.util.Objects; + +public class CodegenEncoding { + private String contentType; + private List headers; + private String style; + private boolean explode; + private boolean allowReserved; + + public CodegenEncoding(String contentType, List headers, String style, boolean explode, boolean allowReserved) { + this.contentType = contentType; + this.headers = headers; + this.style = style; + this.explode = explode; + this.allowReserved = allowReserved; + } + + public String getContentType() { + return contentType; + } + + public List getHeaders() { + return headers; + } + + public String getStyle() { + return style; + } + + public boolean getExplode() { + return explode; + } + + public boolean getAllowReserved() { + return allowReserved; + } + + public String toString() { + final StringBuilder sb = new StringBuilder("CodegenEncoding{"); + sb.append("contentType=").append(contentType); + sb.append(", headers=").append(headers); + sb.append(", style=").append(style); + sb.append(", explode=").append(explode); + sb.append(", allowReserved=").append(allowReserved); + sb.append('}'); + return sb.toString(); + } + + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + CodegenEncoding that = (CodegenEncoding) o; + return contentType == that.getContentType() && + Objects.equals(headers, that.getHeaders()) && + style == that.getStyle() && + explode == that.getExplode() && + allowReserved == that.getAllowReserved(); + } + + @Override + public int hashCode() { + return Objects.hash(contentType, headers, style, explode, allowReserved); + } +} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenMediaType.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenMediaType.java new file mode 100644 index 000000000000..965e50319427 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenMediaType.java @@ -0,0 +1,45 @@ +package org.openapitools.codegen; + +import java.util.LinkedHashMap; +import java.util.Objects; + +public class CodegenMediaType { + private CodegenProperty schema; + private LinkedHashMap encoding; + + public CodegenMediaType(CodegenProperty schema, LinkedHashMap encoding) { + this.schema = schema; + this.encoding = encoding; + } + + public CodegenProperty getSchema() { + return schema; + } + + public LinkedHashMap getEncoding() { + return encoding; + } + + public String toString() { + final StringBuilder sb = new StringBuilder("CodegenMediaType{"); + sb.append("schema=").append(schema); + sb.append(", encoding=").append(encoding); + sb.append('}'); + return sb.toString(); + } + + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + CodegenMediaType that = (CodegenMediaType) o; + return Objects.equals(schema,that.getSchema()) && + Objects.equals(encoding, that.getEncoding()); + } + + @Override + public int hashCode() { + return Objects.hash(schema, encoding); + } +} + + diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java index 5bd8a369f0d3..dba1721fbca2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java @@ -110,6 +110,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties { private boolean hasDiscriminatorWithNonEmptyMapping; private CodegenComposedSchemas composedSchemas; private boolean hasMultipleTypes = false; + private LinkedHashMap content; public CodegenParameter copy() { CodegenParameter output = new CodegenParameter(); @@ -163,6 +164,9 @@ public CodegenParameter copy() { output.setHasDiscriminatorWithNonEmptyMapping(this.hasDiscriminatorWithNonEmptyMapping); output.setHasMultipleTypes(this.hasMultipleTypes); + if (this.content != null) { + output.setContent(this.content); + } if (this.schema != null) { output.setSchema(this.schema); } @@ -226,7 +230,7 @@ public CodegenParameter copy() { @Override public int hashCode() { - return Objects.hash(isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, isContainer, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, baseName, paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription, baseType, defaultValue, enumName, style, isDeepObject, isAllowEmptyValue, example, jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject, isAnyType, isArray, isMap, isFile, isEnum, _enum, allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars, vendorExtensions, hasValidation, getMaxProperties(), getMinProperties(), isNullable, isDeprecated, required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf, isNull, additionalPropertiesIsAnyType, hasVars, hasRequired, isShort, isUnboundedInteger, hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes, schema); + return Objects.hash(isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, isContainer, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, baseName, paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription, baseType, defaultValue, enumName, style, isDeepObject, isAllowEmptyValue, example, jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject, isAnyType, isArray, isMap, isFile, isEnum, _enum, allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars, vendorExtensions, hasValidation, getMaxProperties(), getMinProperties(), isNullable, isDeprecated, required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf, isNull, additionalPropertiesIsAnyType, hasVars, hasRequired, isShort, isUnboundedInteger, hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes, schema, content); } @Override @@ -282,6 +286,7 @@ public boolean equals(Object o) { getExclusiveMaximum() == that.getExclusiveMaximum() && getExclusiveMinimum() == that.getExclusiveMinimum() && getUniqueItems() == that.getUniqueItems() && + Objects.equals(content, that.getContent()) && Objects.equals(schema, that.getSchema()) && Objects.equals(composedSchemas, that.getComposedSchemas()) && Objects.equals(baseName, that.baseName) && @@ -409,6 +414,7 @@ public String toString() { sb.append(", composedSchemas=").append(composedSchemas); sb.append(", hasMultipleTypes=").append(hasMultipleTypes); sb.append(", schema=").append(schema); + sb.append(", content=").append(content); sb.append('}'); return sb.toString(); } @@ -743,5 +749,12 @@ public CodegenComposedSchemas getComposedSchemas() { public void setSchema(CodegenProperty schema) { this.schema = schema; } + public LinkedHashMap getContent() { + return content; + } + + public void setContent(LinkedHashMap content) { + this.content = content; + } } 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 563dc10ebc94..046d8609d3ce 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 @@ -4486,6 +4486,7 @@ public CodegenParameter fromParameter(Parameter parameter, Set imports) codegenParameter.isDeprecated = parameter.getDeprecated(); } codegenParameter.jsonSchema = Json.pretty(parameter); + codegenParameter.setContent(getContent(parameter.getContent(), imports)); if (GlobalSettings.getProperty("debugParser") != null) { LOGGER.info("working on Parameter {}", parameter.getName()); @@ -6557,6 +6558,61 @@ protected void updateRequestBodyForString(CodegenParameter codegenParameter, Sch codegenParameter.pattern = toRegularExpression(schema.getPattern()); } + protected LinkedHashMap getContent(Content content, Set imports) { + if (content == null) { + return null; + } + LinkedHashMap cmtContent = new LinkedHashMap<>(); + for (Entry contentEntry: content.entrySet()) { + MediaType mt = contentEntry.getValue(); + LinkedHashMap ceMap = null; + if (mt.getEncoding() != null ) { + ceMap = new LinkedHashMap<>(); + Map encMap = mt.getEncoding(); + for (Entry encodingEntry: encMap.entrySet()) { + Encoding enc = encodingEntry.getValue(); + List headers = new ArrayList<>(); + if (enc.getHeaders() != null) { + Map encHeaders = enc.getHeaders(); + for (Entry headerEntry: encHeaders.entrySet()) { + String headerName = headerEntry.getKey(); + Header header = ModelUtils.getReferencedHeader(this.openAPI, headerEntry.getValue()); + Parameter headerParam = new Parameter(); + headerParam.setName(headerName); + headerParam.setIn("header"); + headerParam.setDescription(header.getDescription()); + headerParam.setRequired(header.getRequired()); + headerParam.setDeprecated(header.getDeprecated()); + headerParam.setStyle(Parameter.StyleEnum.valueOf(header.getStyle().name())); + headerParam.setExplode(header.getExplode()); + headerParam.setSchema(header.getSchema()); + headerParam.setExamples(header.getExamples()); + headerParam.setExample(header.getExample()); + headerParam.setContent(header.getContent()); + headerParam.setExtensions(header.getExtensions()); + CodegenParameter param = fromParameter(headerParam, imports); + headers.add(param); + } + } + CodegenEncoding ce = new CodegenEncoding( + enc.getContentType(), + headers, + enc.getStyle().toString(), + enc.getExplode().booleanValue(), + enc.getAllowReserved().booleanValue() + ); + String propName = encodingEntry.getKey(); + ceMap.put(propName, ce); + } + } + CodegenProperty schemaProp = fromProperty("schema", mt.getSchema()); + CodegenMediaType codegenMt = new CodegenMediaType(schemaProp, ceMap); + String contentType = contentEntry.getKey(); + cmtContent.put(contentType, codegenMt); + } + return cmtContent; + } + public CodegenParameter fromRequestBody(RequestBody body, Set imports, String bodyParameterName) { if (body == null) { LOGGER.error("body in fromRequestBody cannot be null!"); @@ -6578,6 +6634,7 @@ public CodegenParameter fromRequestBody(RequestBody body, Set imports, S if (schema == null) { throw new RuntimeException("Request body cannot be null. Possible cause: missing schema in body parameter (OAS v2): " + body); } + codegenParameter.setContent(getContent(body.getContent(), imports)); if (StringUtils.isNotBlank(schema.get$ref())) { name = ModelUtils.getSimpleRef(schema.get$ref()); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java index aaede097e3d8..28748850f1bd 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java @@ -3875,4 +3875,76 @@ public void testByteArrayTypeInSchemas() { assertTrue(pr.isByteArray); assertFalse(pr.getIsString()); } + + @Test + public void testParameterContent() { + DefaultCodegen codegen = new DefaultCodegen(); + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/content-data.yaml"); + codegen.setOpenAPI(openAPI); + String path; + CodegenOperation co; + + path = "/jsonQueryParams"; + co = codegen.fromOperation(path, "GET", openAPI.getPaths().get(path).getGet(), null); + CodegenParameter coordinatesInlineSchema = co.queryParams.get(0); + LinkedHashMap content = coordinatesInlineSchema.getContent(); + assertNotNull(content); + assertEquals(content.keySet(), new HashSet<>(Arrays.asList("application/json"))); + CodegenMediaType mt = content.get("application/json"); + assertNull(mt.getEncoding()); + CodegenProperty cp = mt.getSchema(); + assertTrue(cp.isMap); + assertEquals(cp.complexType, "object"); + + CodegenParameter coordinatesReferencedSchema = co.queryParams.get(1); + content = coordinatesReferencedSchema.getContent(); + mt = content.get("application/json"); + assertNull(mt.getEncoding()); + cp = mt.getSchema(); + assertFalse(cp.isMap); // because it is a referenced schema + assertEquals(cp.complexType, "coordinates"); + } + + @Test + public void testRequestBodyContent() { + DefaultCodegen codegen = new DefaultCodegen(); + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/content-data.yaml"); + codegen.setOpenAPI(openAPI); + String path; + CodegenOperation co; + + path = "/inlineRequestBodySchemasDifferingByContentType"; + co = codegen.fromOperation(path, "POST", openAPI.getPaths().get(path).getPost(), null); + CodegenParameter bodyParameter = co.bodyParam; + LinkedHashMap content = bodyParameter.getContent(); + assertNotNull(content); + assertEquals(content.keySet(), new HashSet<>(Arrays.asList("application/json", "text/plain"))); + CodegenMediaType mt = content.get("application/json"); + assertNull(mt.getEncoding()); + CodegenProperty cp = mt.getSchema(); + assertNotNull(cp); + + mt = content.get("text/plain"); + assertNull(mt.getEncoding()); + cp = mt.getSchema(); + assertNotNull(cp); + // Note: the inline model resolver has a bug for this use case; it extracts an inline request body into a component + // but the schema it references is not string type + + path = "/refRequestBodySchemasDifferingByContentType"; + co = codegen.fromOperation(path, "POST", openAPI.getPaths().get(path).getPost(), null); + bodyParameter = co.bodyParam; + content = bodyParameter.getContent(); + assertNotNull(content); + assertEquals(content.keySet(), new HashSet<>(Arrays.asList("application/json", "text/plain"))); + mt = content.get("application/json"); + assertNull(mt.getEncoding()); + cp = mt.getSchema(); + assertEquals(cp.complexType, "coordinates"); + + mt = content.get("text/plain"); + assertNull(mt.getEncoding()); + cp = mt.getSchema(); + assertTrue(cp.isString); + } } diff --git a/modules/openapi-generator/src/test/resources/3_0/content-data.yaml b/modules/openapi-generator/src/test/resources/3_0/content-data.yaml new file mode 100644 index 000000000000..56228cd30543 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/content-data.yaml @@ -0,0 +1,83 @@ +openapi: 3.0.0 +info: + title: Tests content data in an endpoint parameter and a request body + description: blah +paths: + /jsonQueryParams: + get: + parameters: + - name: coordinatesInlineSchema + in: query + content: + application/json: + schema: + type: object + required: + - lat + - long + properties: + lat: + type: number + long: + type: number + - name: coordinatesReferencedSchema + in: query + content: + application/json: + schema: + $ref: '#/components/schemas/coordinates' + responses: + '201': + description: 'OK' + /inlineRequestBodySchemasDifferingByContentType: + post: + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - lat + - long + properties: + lat: + type: number + long: + type: number + text/plain: + schema: + type: string + minLength: 5 + responses: + 200: + description: OK + /refRequestBodySchemasDifferingByContentType: + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/coordinates' + text/plain: + schema: + $ref: '#/components/schemas/stringWithMinLength' + responses: + 200: + description: OK +components: + schemas: + stringWithMinLength: + type: string + minLength: 5 + coordinates: + type: object + required: + - lat + - long + properties: + lat: + type: number + long: + type: number diff --git a/samples/server/petstore/python-aiohttp-srclayout/src/openapi_server/openapi/openapi.yaml b/samples/server/petstore/python-aiohttp-srclayout/src/openapi_server/openapi/openapi.yaml index 8b70dbaa5fb1..416d4ab0b6d6 100644 --- a/samples/server/petstore/python-aiohttp-srclayout/src/openapi_server/openapi/openapi.yaml +++ b/samples/server/petstore/python-aiohttp-srclayout/src/openapi_server/openapi/openapi.yaml @@ -680,22 +680,30 @@ components: properties: id: format: int64 + title: id type: integer username: + title: username type: string firstName: + title: firstName type: string lastName: + title: lastName type: string email: + title: email type: string password: + title: password type: string phone: + title: phone type: string userStatus: description: User Status format: int32 + title: userStatus type: integer title: a User type: object @@ -738,15 +746,18 @@ components: properties: id: format: int64 + title: id type: integer category: $ref: '#/components/schemas/Category' name: example: doggie + title: name type: string photoUrls: items: type: string + title: photoUrls type: array xml: name: photoUrl @@ -754,6 +765,7 @@ components: tags: items: $ref: '#/components/schemas/Tag' + title: tags type: array xml: name: tag @@ -764,6 +776,7 @@ components: - available - pending - sold + title: status type: string required: - name diff --git a/samples/server/petstore/python-aiohttp/openapi_server/openapi/openapi.yaml b/samples/server/petstore/python-aiohttp/openapi_server/openapi/openapi.yaml index 8b70dbaa5fb1..416d4ab0b6d6 100644 --- a/samples/server/petstore/python-aiohttp/openapi_server/openapi/openapi.yaml +++ b/samples/server/petstore/python-aiohttp/openapi_server/openapi/openapi.yaml @@ -680,22 +680,30 @@ components: properties: id: format: int64 + title: id type: integer username: + title: username type: string firstName: + title: firstName type: string lastName: + title: lastName type: string email: + title: email type: string password: + title: password type: string phone: + title: phone type: string userStatus: description: User Status format: int32 + title: userStatus type: integer title: a User type: object @@ -738,15 +746,18 @@ components: properties: id: format: int64 + title: id type: integer category: $ref: '#/components/schemas/Category' name: example: doggie + title: name type: string photoUrls: items: type: string + title: photoUrls type: array xml: name: photoUrl @@ -754,6 +765,7 @@ components: tags: items: $ref: '#/components/schemas/Tag' + title: tags type: array xml: name: tag @@ -764,6 +776,7 @@ components: - available - pending - sold + title: status type: string required: - name diff --git a/samples/server/petstore/python-fastapi/openapi.yaml b/samples/server/petstore/python-fastapi/openapi.yaml index 133f2f16cfcf..94256ed0a0f2 100644 --- a/samples/server/petstore/python-fastapi/openapi.yaml +++ b/samples/server/petstore/python-fastapi/openapi.yaml @@ -691,22 +691,30 @@ components: properties: id: format: int64 + title: id type: integer username: + title: username type: string firstName: + title: firstName type: string lastName: + title: lastName type: string email: + title: email type: string password: + title: password type: string phone: + title: phone type: string userStatus: description: User Status format: int32 + title: userStatus type: integer title: a User type: object diff --git a/samples/server/petstore/python-flask/openapi_server/openapi/openapi.yaml b/samples/server/petstore/python-flask/openapi_server/openapi/openapi.yaml index 8b402c5f7bbd..f94133dcf463 100644 --- a/samples/server/petstore/python-flask/openapi_server/openapi/openapi.yaml +++ b/samples/server/petstore/python-flask/openapi_server/openapi/openapi.yaml @@ -669,22 +669,30 @@ components: properties: id: format: int64 + title: id type: integer username: + title: username type: string firstName: + title: firstName type: string lastName: + title: lastName type: string email: + title: email type: string password: + title: password type: string phone: + title: phone type: string userStatus: description: User Status format: int32 + title: userStatus type: integer title: a User type: object @@ -727,15 +735,18 @@ components: properties: id: format: int64 + title: id type: integer category: $ref: '#/components/schemas/Category' name: example: doggie + title: name type: string photoUrls: items: type: string + title: photoUrls type: array xml: name: photoUrl @@ -743,6 +754,7 @@ components: tags: items: $ref: '#/components/schemas/Tag' + title: tags type: array xml: name: tag @@ -753,6 +765,7 @@ components: - available - pending - sold + title: status type: string required: - name From 6406e5c03162e1ba842cd86ecc691640f2669fd0 Mon Sep 17 00:00:00 2001 From: Tal Kirshboim Date: Tue, 30 Nov 2021 02:33:42 +0100 Subject: [PATCH 046/117] [Kotlin][Multiplatform] Support custom Ktor HTTP client configuration (#10968) * Support using a custom Ktor HTTP client configuration * Remove ApiClient.kt secondary constructor --- .../kotlin-client/libraries/multiplatform/api.mustache | 4 +++- .../multiplatform/infrastructure/ApiClient.kt.mustache | 10 ++++++++-- .../kotlin/org/openapitools/client/apis/PetApi.kt | 4 +++- .../kotlin/org/openapitools/client/apis/StoreApi.kt | 4 +++- .../kotlin/org/openapitools/client/apis/UserApi.kt | 4 +++- .../openapitools/client/infrastructure/ApiClient.kt | 10 ++++++++-- 6 files changed, 28 insertions(+), 8 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/api.mustache index bbae188effd5..c523b913d2a3 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/api.mustache @@ -5,6 +5,7 @@ package {{apiPackage}} {{/imports}} import {{packageName}}.infrastructure.* +import io.ktor.client.HttpClientConfig import io.ktor.client.request.forms.formData import io.ktor.client.engine.HttpClientEngine import io.ktor.client.features.json.serializer.KotlinxSerializer @@ -18,8 +19,9 @@ import kotlinx.serialization.encoding.* {{#nonPublicApi}}internal {{/nonPublicApi}}class {{classname}}( baseUrl: String = ApiClient.BASE_URL, httpClientEngine: HttpClientEngine? = null, + httpClientConfig: ((HttpClientConfig<*>) -> Unit)? = null, jsonSerializer: Json = ApiClient.JSON_DEFAULT -) : ApiClient(baseUrl, httpClientEngine, jsonSerializer) { +) : ApiClient(baseUrl, httpClientEngine, httpClientConfig, jsonSerializer) { {{#operation}} /** diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/infrastructure/ApiClient.kt.mustache index 27b6162f1211..84836e45e7e1 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/infrastructure/ApiClient.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/infrastructure/ApiClient.kt.mustache @@ -16,6 +16,7 @@ import io.ktor.client.utils.EmptyContent import io.ktor.http.* import io.ktor.http.content.OutgoingContent import io.ktor.http.content.PartData +import kotlin.Unit import kotlinx.serialization.json.Json import {{apiPackage}}.* @@ -25,6 +26,7 @@ import {{packageName}}.auth.* {{#nonPublicApi}}internal {{/nonPublicApi}}open class ApiClient( private val baseUrl: String, httpClientEngine: HttpClientEngine?, + httpClientConfig: ((HttpClientConfig<*>) -> Unit)? = null, private val json: Json ) { @@ -32,9 +34,13 @@ import {{packageName}}.auth.* KotlinxSerializer(json).ignoreOutgoingContent() } - private val client: HttpClient by lazy { + private val defaultHttpClientConfig: (HttpClientConfig<*>) -> Unit by lazy { val jsonConfig: JsonFeature.Config.() -> Unit = { this.serializer = this@ApiClient.serializer } - val clientConfig: (HttpClientConfig<*>) -> Unit = { it.install(JsonFeature, jsonConfig) } + { it.install(JsonFeature, jsonConfig) } + } + + private val client: HttpClient by lazy { + val clientConfig: (HttpClientConfig<*>) -> Unit = httpClientConfig ?: defaultHttpClientConfig httpClientEngine?.let { HttpClient(it, clientConfig) } ?: HttpClient(clientConfig) } {{#hasAuthMethods}} diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/PetApi.kt index 2d2f96b6b89d..fe81cdf5bc0d 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/PetApi.kt @@ -24,6 +24,7 @@ import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet import org.openapitools.client.infrastructure.* +import io.ktor.client.HttpClientConfig import io.ktor.client.request.forms.formData import io.ktor.client.engine.HttpClientEngine import io.ktor.client.features.json.serializer.KotlinxSerializer @@ -36,8 +37,9 @@ import kotlinx.serialization.encoding.* class PetApi( baseUrl: String = ApiClient.BASE_URL, httpClientEngine: HttpClientEngine? = null, + httpClientConfig: ((HttpClientConfig<*>) -> Unit)? = null, jsonSerializer: Json = ApiClient.JSON_DEFAULT -) : ApiClient(baseUrl, httpClientEngine, jsonSerializer) { +) : ApiClient(baseUrl, httpClientEngine, httpClientConfig, jsonSerializer) { /** * Add a new pet to the store diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/StoreApi.kt index eb85ffc9f1cf..ab2acfc425f4 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -23,6 +23,7 @@ package org.openapitools.client.apis import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.* +import io.ktor.client.HttpClientConfig import io.ktor.client.request.forms.formData import io.ktor.client.engine.HttpClientEngine import io.ktor.client.features.json.serializer.KotlinxSerializer @@ -35,8 +36,9 @@ import kotlinx.serialization.encoding.* class StoreApi( baseUrl: String = ApiClient.BASE_URL, httpClientEngine: HttpClientEngine? = null, + httpClientConfig: ((HttpClientConfig<*>) -> Unit)? = null, jsonSerializer: Json = ApiClient.JSON_DEFAULT -) : ApiClient(baseUrl, httpClientEngine, jsonSerializer) { +) : ApiClient(baseUrl, httpClientEngine, httpClientConfig, jsonSerializer) { /** * Delete purchase order by ID diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/UserApi.kt index 4d16f664b831..83832e3cfa9d 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/UserApi.kt @@ -23,6 +23,7 @@ package org.openapitools.client.apis import org.openapitools.client.models.User import org.openapitools.client.infrastructure.* +import io.ktor.client.HttpClientConfig import io.ktor.client.request.forms.formData import io.ktor.client.engine.HttpClientEngine import io.ktor.client.features.json.serializer.KotlinxSerializer @@ -35,8 +36,9 @@ import kotlinx.serialization.encoding.* class UserApi( baseUrl: String = ApiClient.BASE_URL, httpClientEngine: HttpClientEngine? = null, + httpClientConfig: ((HttpClientConfig<*>) -> Unit)? = null, jsonSerializer: Json = ApiClient.JSON_DEFAULT -) : ApiClient(baseUrl, httpClientEngine, jsonSerializer) { +) : ApiClient(baseUrl, httpClientEngine, httpClientConfig, jsonSerializer) { /** * Create user diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 9f25b1059539..4fbb14f3f451 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -16,6 +16,7 @@ import io.ktor.client.utils.EmptyContent import io.ktor.http.* import io.ktor.http.content.OutgoingContent import io.ktor.http.content.PartData +import kotlin.Unit import kotlinx.serialization.json.Json import org.openapitools.client.apis.* @@ -25,6 +26,7 @@ import org.openapitools.client.auth.* open class ApiClient( private val baseUrl: String, httpClientEngine: HttpClientEngine?, + httpClientConfig: ((HttpClientConfig<*>) -> Unit)? = null, private val json: Json ) { @@ -32,9 +34,13 @@ open class ApiClient( KotlinxSerializer(json).ignoreOutgoingContent() } - private val client: HttpClient by lazy { + private val defaultHttpClientConfig: (HttpClientConfig<*>) -> Unit by lazy { val jsonConfig: JsonFeature.Config.() -> Unit = { this.serializer = this@ApiClient.serializer } - val clientConfig: (HttpClientConfig<*>) -> Unit = { it.install(JsonFeature, jsonConfig) } + { it.install(JsonFeature, jsonConfig) } + } + + private val client: HttpClient by lazy { + val clientConfig: (HttpClientConfig<*>) -> Unit = httpClientConfig ?: defaultHttpClientConfig httpClientEngine?.let { HttpClient(it, clientConfig) } ?: HttpClient(clientConfig) } private val authentications: kotlin.collections.Map by lazy { From e7ac0eec4b9410b20bef63222089fb174ec5c447 Mon Sep 17 00:00:00 2001 From: jiangyuan <469391363@qq.com> Date: Tue, 30 Nov 2021 09:50:19 +0800 Subject: [PATCH 047/117] [Python] fix model.mustache import (#10988) * fix model.mustache import * add samples file change Co-authored-by: jiangyuan04 --- .../openapi-generator/src/main/resources/python/model.mustache | 2 +- .../python/petstore_api/model/additional_properties_any_type.py | 2 +- .../python/petstore_api/model/additional_properties_array.py | 2 +- .../python/petstore_api/model/additional_properties_boolean.py | 2 +- .../python/petstore_api/model/additional_properties_class.py | 2 +- .../python/petstore_api/model/additional_properties_integer.py | 2 +- .../python/petstore_api/model/additional_properties_number.py | 2 +- .../python/petstore_api/model/additional_properties_object.py | 2 +- .../python/petstore_api/model/additional_properties_string.py | 2 +- samples/client/petstore/python/petstore_api/model/animal.py | 2 +- .../client/petstore/python/petstore_api/model/animal_farm.py | 2 +- .../client/petstore/python/petstore_api/model/api_response.py | 2 +- .../python/petstore_api/model/array_of_array_of_number_only.py | 2 +- .../petstore/python/petstore_api/model/array_of_number_only.py | 2 +- samples/client/petstore/python/petstore_api/model/array_test.py | 2 +- .../client/petstore/python/petstore_api/model/capitalization.py | 2 +- samples/client/petstore/python/petstore_api/model/cat.py | 2 +- samples/client/petstore/python/petstore_api/model/cat_all_of.py | 2 +- samples/client/petstore/python/petstore_api/model/category.py | 2 +- samples/client/petstore/python/petstore_api/model/child.py | 2 +- .../client/petstore/python/petstore_api/model/child_all_of.py | 2 +- samples/client/petstore/python/petstore_api/model/child_cat.py | 2 +- .../petstore/python/petstore_api/model/child_cat_all_of.py | 2 +- samples/client/petstore/python/petstore_api/model/child_dog.py | 2 +- .../petstore/python/petstore_api/model/child_dog_all_of.py | 2 +- .../client/petstore/python/petstore_api/model/child_lizard.py | 2 +- .../petstore/python/petstore_api/model/child_lizard_all_of.py | 2 +- .../client/petstore/python/petstore_api/model/class_model.py | 2 +- samples/client/petstore/python/petstore_api/model/client.py | 2 +- samples/client/petstore/python/petstore_api/model/dog.py | 2 +- samples/client/petstore/python/petstore_api/model/dog_all_of.py | 2 +- .../client/petstore/python/petstore_api/model/enum_arrays.py | 2 +- samples/client/petstore/python/petstore_api/model/enum_class.py | 2 +- samples/client/petstore/python/petstore_api/model/enum_test.py | 2 +- samples/client/petstore/python/petstore_api/model/file.py | 2 +- .../python/petstore_api/model/file_schema_test_class.py | 2 +- .../client/petstore/python/petstore_api/model/format_test.py | 2 +- .../client/petstore/python/petstore_api/model/grandparent.py | 2 +- .../petstore/python/petstore_api/model/grandparent_animal.py | 2 +- .../petstore/python/petstore_api/model/has_only_read_only.py | 2 +- samples/client/petstore/python/petstore_api/model/list.py | 2 +- samples/client/petstore/python/petstore_api/model/map_test.py | 2 +- .../model/mixed_properties_and_additional_properties_class.py | 2 +- .../petstore/python/petstore_api/model/model200_response.py | 2 +- .../client/petstore/python/petstore_api/model/model_return.py | 2 +- samples/client/petstore/python/petstore_api/model/name.py | 2 +- .../client/petstore/python/petstore_api/model/number_only.py | 2 +- .../python/petstore_api/model/number_with_validations.py | 2 +- .../python/petstore_api/model/object_model_with_ref_props.py | 2 +- samples/client/petstore/python/petstore_api/model/order.py | 2 +- samples/client/petstore/python/petstore_api/model/parent.py | 2 +- .../client/petstore/python/petstore_api/model/parent_all_of.py | 2 +- samples/client/petstore/python/petstore_api/model/parent_pet.py | 2 +- samples/client/petstore/python/petstore_api/model/pet.py | 2 +- samples/client/petstore/python/petstore_api/model/player.py | 2 +- .../petstore/python/petstore_api/model/read_only_first.py | 2 +- .../petstore/python/petstore_api/model/special_model_name.py | 2 +- .../petstore/python/petstore_api/model/string_boolean_map.py | 2 +- .../client/petstore/python/petstore_api/model/string_enum.py | 2 +- samples/client/petstore/python/petstore_api/model/tag.py | 2 +- .../petstore/python/petstore_api/model/type_holder_default.py | 2 +- .../petstore/python/petstore_api/model/type_holder_example.py | 2 +- samples/client/petstore/python/petstore_api/model/user.py | 2 +- samples/client/petstore/python/petstore_api/model/xml_item.py | 2 +- .../petstore_api/model/additional_properties_any_type.py | 2 +- .../petstore_api/model/additional_properties_array.py | 2 +- .../petstore_api/model/additional_properties_boolean.py | 2 +- .../petstore_api/model/additional_properties_class.py | 2 +- .../petstore_api/model/additional_properties_integer.py | 2 +- .../petstore_api/model/additional_properties_number.py | 2 +- .../petstore_api/model/additional_properties_object.py | 2 +- .../petstore_api/model/additional_properties_string.py | 2 +- .../petstore_api/model/animal.py | 2 +- .../petstore_api/model/animal_farm.py | 2 +- .../petstore_api/model/api_response.py | 2 +- .../petstore_api/model/array_of_array_of_number_only.py | 2 +- .../petstore_api/model/array_of_number_only.py | 2 +- .../petstore_api/model/array_test.py | 2 +- .../petstore_api/model/capitalization.py | 2 +- .../petstore_api/model/cat.py | 2 +- .../petstore_api/model/cat_all_of.py | 2 +- .../petstore_api/model/category.py | 2 +- .../petstore_api/model/child.py | 2 +- .../petstore_api/model/child_all_of.py | 2 +- .../petstore_api/model/child_cat.py | 2 +- .../petstore_api/model/child_cat_all_of.py | 2 +- .../petstore_api/model/child_dog.py | 2 +- .../petstore_api/model/child_dog_all_of.py | 2 +- .../petstore_api/model/child_lizard.py | 2 +- .../petstore_api/model/child_lizard_all_of.py | 2 +- .../petstore_api/model/class_model.py | 2 +- .../petstore_api/model/client.py | 2 +- .../petstore_api/model/dog.py | 2 +- .../petstore_api/model/dog_all_of.py | 2 +- .../petstore_api/model/enum_arrays.py | 2 +- .../petstore_api/model/enum_class.py | 2 +- .../petstore_api/model/enum_test.py | 2 +- .../petstore_api/model/file.py | 2 +- .../petstore_api/model/file_schema_test_class.py | 2 +- .../petstore_api/model/format_test.py | 2 +- .../petstore_api/model/grandparent.py | 2 +- .../petstore_api/model/grandparent_animal.py | 2 +- .../petstore_api/model/has_only_read_only.py | 2 +- .../petstore_api/model/list.py | 2 +- .../petstore_api/model/map_test.py | 2 +- .../model/mixed_properties_and_additional_properties_class.py | 2 +- .../petstore_api/model/model200_response.py | 2 +- .../petstore_api/model/model_return.py | 2 +- .../petstore_api/model/name.py | 2 +- .../petstore_api/model/number_only.py | 2 +- .../petstore_api/model/number_with_validations.py | 2 +- .../petstore_api/model/object_model_with_ref_props.py | 2 +- .../petstore_api/model/order.py | 2 +- .../petstore_api/model/parent.py | 2 +- .../petstore_api/model/parent_all_of.py | 2 +- .../petstore_api/model/parent_pet.py | 2 +- .../petstore_api/model/pet.py | 2 +- .../petstore_api/model/player.py | 2 +- .../petstore_api/model/read_only_first.py | 2 +- .../petstore_api/model/special_model_name.py | 2 +- .../petstore_api/model/string_boolean_map.py | 2 +- .../petstore_api/model/string_enum.py | 2 +- .../petstore_api/model/tag.py | 2 +- .../petstore_api/model/type_holder_default.py | 2 +- .../petstore_api/model/type_holder_example.py | 2 +- .../petstore_api/model/user.py | 2 +- .../petstore_api/model/xml_item.py | 2 +- .../python/petstore_api/model/additional_properties_class.py | 2 +- .../model/additional_properties_with_array_of_enums.py | 2 +- .../client/petstore/python/petstore_api/model/address.py | 2 +- .../client/petstore/python/petstore_api/model/animal.py | 2 +- .../client/petstore/python/petstore_api/model/animal_farm.py | 2 +- .../client/petstore/python/petstore_api/model/api_response.py | 2 +- .../openapi3/client/petstore/python/petstore_api/model/apple.py | 2 +- .../client/petstore/python/petstore_api/model/apple_req.py | 2 +- .../python/petstore_api/model/array_of_array_of_number_only.py | 2 +- .../client/petstore/python/petstore_api/model/array_of_enums.py | 2 +- .../petstore/python/petstore_api/model/array_of_number_only.py | 2 +- .../client/petstore/python/petstore_api/model/array_test.py | 2 +- .../client/petstore/python/petstore_api/model/banana.py | 2 +- .../client/petstore/python/petstore_api/model/banana_req.py | 2 +- .../client/petstore/python/petstore_api/model/basque_pig.py | 2 +- .../client/petstore/python/petstore_api/model/boolean_enum.py | 2 +- .../client/petstore/python/petstore_api/model/capitalization.py | 2 +- .../openapi3/client/petstore/python/petstore_api/model/cat.py | 2 +- .../client/petstore/python/petstore_api/model/cat_all_of.py | 2 +- .../client/petstore/python/petstore_api/model/category.py | 2 +- .../client/petstore/python/petstore_api/model/child_cat.py | 2 +- .../petstore/python/petstore_api/model/child_cat_all_of.py | 2 +- .../client/petstore/python/petstore_api/model/class_model.py | 2 +- .../client/petstore/python/petstore_api/model/client.py | 2 +- .../petstore/python/petstore_api/model/complex_quadrilateral.py | 2 +- .../model/composed_one_of_number_with_validations.py | 2 +- .../model/composed_schema_with_props_and_no_add_props.py | 2 +- .../client/petstore/python/petstore_api/model/danish_pig.py | 2 +- .../openapi3/client/petstore/python/petstore_api/model/dog.py | 2 +- .../client/petstore/python/petstore_api/model/dog_all_of.py | 2 +- .../client/petstore/python/petstore_api/model/drawing.py | 2 +- .../client/petstore/python/petstore_api/model/enum_arrays.py | 2 +- .../client/petstore/python/petstore_api/model/enum_class.py | 2 +- .../client/petstore/python/petstore_api/model/enum_test.py | 2 +- .../petstore/python/petstore_api/model/equilateral_triangle.py | 2 +- ...fake_post_inline_additional_properties_payload_array_data.py | 2 +- .../openapi3/client/petstore/python/petstore_api/model/file.py | 2 +- .../python/petstore_api/model/file_schema_test_class.py | 2 +- .../openapi3/client/petstore/python/petstore_api/model/foo.py | 2 +- .../client/petstore/python/petstore_api/model/format_test.py | 2 +- .../openapi3/client/petstore/python/petstore_api/model/fruit.py | 2 +- .../client/petstore/python/petstore_api/model/fruit_req.py | 2 +- .../client/petstore/python/petstore_api/model/gm_fruit.py | 2 +- .../python/petstore_api/model/gm_fruit_no_properties.py | 2 +- .../petstore/python/petstore_api/model/grandparent_animal.py | 2 +- .../petstore/python/petstore_api/model/has_only_read_only.py | 2 +- .../petstore/python/petstore_api/model/health_check_result.py | 2 +- .../model/inline_additional_properties_ref_payload.py | 2 +- .../client/petstore/python/petstore_api/model/inline_object6.py | 2 +- .../python/petstore_api/model/inline_response_default.py | 2 +- .../client/petstore/python/petstore_api/model/integer_enum.py | 2 +- .../python/petstore_api/model/integer_enum_one_value.py | 2 +- .../petstore_api/model/integer_enum_with_default_value.py | 2 +- .../petstore/python/petstore_api/model/isosceles_triangle.py | 2 +- .../openapi3/client/petstore/python/petstore_api/model/legs.py | 2 +- .../openapi3/client/petstore/python/petstore_api/model/list.py | 2 +- .../client/petstore/python/petstore_api/model/mammal.py | 2 +- .../client/petstore/python/petstore_api/model/map_test.py | 2 +- .../model/mixed_properties_and_additional_properties_class.py | 2 +- .../petstore/python/petstore_api/model/model200_response.py | 2 +- .../client/petstore/python/petstore_api/model/model_return.py | 2 +- .../openapi3/client/petstore/python/petstore_api/model/mole.py | 2 +- .../openapi3/client/petstore/python/petstore_api/model/name.py | 2 +- .../client/petstore/python/petstore_api/model/nullable_class.py | 2 +- .../client/petstore/python/petstore_api/model/nullable_shape.py | 2 +- .../client/petstore/python/petstore_api/model/number_only.py | 2 +- .../python/petstore_api/model/number_with_validations.py | 2 +- .../petstore/python/petstore_api/model/object_interface.py | 2 +- .../python/petstore_api/model/object_model_with_ref_props.py | 2 +- .../python/petstore_api/model/object_with_validations.py | 2 +- .../openapi3/client/petstore/python/petstore_api/model/order.py | 2 +- .../client/petstore/python/petstore_api/model/parent_pet.py | 2 +- .../openapi3/client/petstore/python/petstore_api/model/pet.py | 2 +- .../openapi3/client/petstore/python/petstore_api/model/pig.py | 2 +- .../client/petstore/python/petstore_api/model/quadrilateral.py | 2 +- .../python/petstore_api/model/quadrilateral_interface.py | 2 +- .../petstore/python/petstore_api/model/read_only_first.py | 2 +- .../client/petstore/python/petstore_api/model/readonly.py | 2 +- .../petstore/python/petstore_api/model/scalene_triangle.py | 2 +- .../openapi3/client/petstore/python/petstore_api/model/shape.py | 2 +- .../petstore/python/petstore_api/model/shape_interface.py | 2 +- .../client/petstore/python/petstore_api/model/shape_or_null.py | 2 +- .../petstore/python/petstore_api/model/simple_quadrilateral.py | 2 +- .../client/petstore/python/petstore_api/model/some_object.py | 2 +- .../python/petstore_api/model/some_object_with_self_attr.py | 2 +- .../petstore/python/petstore_api/model/special_model_name.py | 2 +- .../petstore/python/petstore_api/model/string_boolean_map.py | 2 +- .../client/petstore/python/petstore_api/model/string_enum.py | 2 +- .../python/petstore_api/model/string_enum_with_default_value.py | 2 +- .../openapi3/client/petstore/python/petstore_api/model/tag.py | 2 +- .../client/petstore/python/petstore_api/model/triangle.py | 2 +- .../petstore/python/petstore_api/model/triangle_interface.py | 2 +- .../openapi3/client/petstore/python/petstore_api/model/user.py | 2 +- .../openapi3/client/petstore/python/petstore_api/model/whale.py | 2 +- .../openapi3/client/petstore/python/petstore_api/model/zebra.py | 2 +- 222 files changed, 222 insertions(+), 222 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/model.mustache b/modules/openapi-generator/src/main/resources/python/model.mustache index c8e1bfaa0042..e2e70c837dea 100644 --- a/modules/openapi-generator/src/main/resources/python/model.mustache +++ b/modules/openapi-generator/src/main/resources/python/model.mustache @@ -16,8 +16,8 @@ from {{packageName}}.model_utils import ( # noqa: F401 file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from {{packageName}}.exceptions import ApiAttributeError {{#models}} diff --git a/samples/client/petstore/python/petstore_api/model/additional_properties_any_type.py b/samples/client/petstore/python/petstore_api/model/additional_properties_any_type.py index 34ae88833fbe..d98c15e0abb3 100644 --- a/samples/client/petstore/python/petstore_api/model/additional_properties_any_type.py +++ b/samples/client/petstore/python/petstore_api/model/additional_properties_any_type.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/additional_properties_array.py b/samples/client/petstore/python/petstore_api/model/additional_properties_array.py index 55f44f411c27..c45c5af7f1f1 100644 --- a/samples/client/petstore/python/petstore_api/model/additional_properties_array.py +++ b/samples/client/petstore/python/petstore_api/model/additional_properties_array.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/additional_properties_boolean.py b/samples/client/petstore/python/petstore_api/model/additional_properties_boolean.py index b9c5c258e3cc..de4abb39d434 100644 --- a/samples/client/petstore/python/petstore_api/model/additional_properties_boolean.py +++ b/samples/client/petstore/python/petstore_api/model/additional_properties_boolean.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/additional_properties_class.py b/samples/client/petstore/python/petstore_api/model/additional_properties_class.py index 7e4d3d93c5f5..ae112087fcc8 100644 --- a/samples/client/petstore/python/petstore_api/model/additional_properties_class.py +++ b/samples/client/petstore/python/petstore_api/model/additional_properties_class.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/additional_properties_integer.py b/samples/client/petstore/python/petstore_api/model/additional_properties_integer.py index f6f80f89c7ad..cab715522292 100644 --- a/samples/client/petstore/python/petstore_api/model/additional_properties_integer.py +++ b/samples/client/petstore/python/petstore_api/model/additional_properties_integer.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/additional_properties_number.py b/samples/client/petstore/python/petstore_api/model/additional_properties_number.py index 6c094699462a..5a9b0c623ab5 100644 --- a/samples/client/petstore/python/petstore_api/model/additional_properties_number.py +++ b/samples/client/petstore/python/petstore_api/model/additional_properties_number.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/additional_properties_object.py b/samples/client/petstore/python/petstore_api/model/additional_properties_object.py index 1fa671aff9b2..908865783525 100644 --- a/samples/client/petstore/python/petstore_api/model/additional_properties_object.py +++ b/samples/client/petstore/python/petstore_api/model/additional_properties_object.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/additional_properties_string.py b/samples/client/petstore/python/petstore_api/model/additional_properties_string.py index 0afa8a9e6376..07394244c688 100644 --- a/samples/client/petstore/python/petstore_api/model/additional_properties_string.py +++ b/samples/client/petstore/python/petstore_api/model/additional_properties_string.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/animal.py b/samples/client/petstore/python/petstore_api/model/animal.py index fda6c283ebdc..ffcbc727b3be 100644 --- a/samples/client/petstore/python/petstore_api/model/animal.py +++ b/samples/client/petstore/python/petstore_api/model/animal.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/animal_farm.py b/samples/client/petstore/python/petstore_api/model/animal_farm.py index 042a8274ee7a..0cca3901cb37 100644 --- a/samples/client/petstore/python/petstore_api/model/animal_farm.py +++ b/samples/client/petstore/python/petstore_api/model/animal_farm.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/api_response.py b/samples/client/petstore/python/petstore_api/model/api_response.py index d1f3b363bef5..ed202b6bdcca 100644 --- a/samples/client/petstore/python/petstore_api/model/api_response.py +++ b/samples/client/petstore/python/petstore_api/model/api_response.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/array_of_array_of_number_only.py b/samples/client/petstore/python/petstore_api/model/array_of_array_of_number_only.py index 16d9bda29f1f..39a76641c6d5 100644 --- a/samples/client/petstore/python/petstore_api/model/array_of_array_of_number_only.py +++ b/samples/client/petstore/python/petstore_api/model/array_of_array_of_number_only.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/array_of_number_only.py b/samples/client/petstore/python/petstore_api/model/array_of_number_only.py index 0e44ab61aff5..73abf32b511f 100644 --- a/samples/client/petstore/python/petstore_api/model/array_of_number_only.py +++ b/samples/client/petstore/python/petstore_api/model/array_of_number_only.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/array_test.py b/samples/client/petstore/python/petstore_api/model/array_test.py index 64c180d11bc5..fc4e6c345375 100644 --- a/samples/client/petstore/python/petstore_api/model/array_test.py +++ b/samples/client/petstore/python/petstore_api/model/array_test.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/capitalization.py b/samples/client/petstore/python/petstore_api/model/capitalization.py index 2f1323481dca..d5d7202f9af1 100644 --- a/samples/client/petstore/python/petstore_api/model/capitalization.py +++ b/samples/client/petstore/python/petstore_api/model/capitalization.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/cat.py b/samples/client/petstore/python/petstore_api/model/cat.py index 9a42057a87e1..2764c714e13f 100644 --- a/samples/client/petstore/python/petstore_api/model/cat.py +++ b/samples/client/petstore/python/petstore_api/model/cat.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/cat_all_of.py b/samples/client/petstore/python/petstore_api/model/cat_all_of.py index a5bef948f72b..0fa2471efddc 100644 --- a/samples/client/petstore/python/petstore_api/model/cat_all_of.py +++ b/samples/client/petstore/python/petstore_api/model/cat_all_of.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/category.py b/samples/client/petstore/python/petstore_api/model/category.py index b40329c9424d..b4557487e022 100644 --- a/samples/client/petstore/python/petstore_api/model/category.py +++ b/samples/client/petstore/python/petstore_api/model/category.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/child.py b/samples/client/petstore/python/petstore_api/model/child.py index b63ce3fce770..23ef528ea748 100644 --- a/samples/client/petstore/python/petstore_api/model/child.py +++ b/samples/client/petstore/python/petstore_api/model/child.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/child_all_of.py b/samples/client/petstore/python/petstore_api/model/child_all_of.py index e38d28f52d1b..148fa59f6445 100644 --- a/samples/client/petstore/python/petstore_api/model/child_all_of.py +++ b/samples/client/petstore/python/petstore_api/model/child_all_of.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/child_cat.py b/samples/client/petstore/python/petstore_api/model/child_cat.py index 355321a2c4ca..5fd213c0ce9d 100644 --- a/samples/client/petstore/python/petstore_api/model/child_cat.py +++ b/samples/client/petstore/python/petstore_api/model/child_cat.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/child_cat_all_of.py b/samples/client/petstore/python/petstore_api/model/child_cat_all_of.py index 48b725d7c3c6..21c3ac606b2b 100644 --- a/samples/client/petstore/python/petstore_api/model/child_cat_all_of.py +++ b/samples/client/petstore/python/petstore_api/model/child_cat_all_of.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/child_dog.py b/samples/client/petstore/python/petstore_api/model/child_dog.py index ba163cc764ce..d49a0fc295c2 100644 --- a/samples/client/petstore/python/petstore_api/model/child_dog.py +++ b/samples/client/petstore/python/petstore_api/model/child_dog.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/child_dog_all_of.py b/samples/client/petstore/python/petstore_api/model/child_dog_all_of.py index 40d4f048f87e..e753ba145383 100644 --- a/samples/client/petstore/python/petstore_api/model/child_dog_all_of.py +++ b/samples/client/petstore/python/petstore_api/model/child_dog_all_of.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/child_lizard.py b/samples/client/petstore/python/petstore_api/model/child_lizard.py index 1a8867869557..f714f3d1f909 100644 --- a/samples/client/petstore/python/petstore_api/model/child_lizard.py +++ b/samples/client/petstore/python/petstore_api/model/child_lizard.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/child_lizard_all_of.py b/samples/client/petstore/python/petstore_api/model/child_lizard_all_of.py index b0e9771c5800..fe6896926bb3 100644 --- a/samples/client/petstore/python/petstore_api/model/child_lizard_all_of.py +++ b/samples/client/petstore/python/petstore_api/model/child_lizard_all_of.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/class_model.py b/samples/client/petstore/python/petstore_api/model/class_model.py index a3f2b58f87f3..d73e8f42ef7f 100644 --- a/samples/client/petstore/python/petstore_api/model/class_model.py +++ b/samples/client/petstore/python/petstore_api/model/class_model.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/client.py b/samples/client/petstore/python/petstore_api/model/client.py index 3dca32f7926b..091a06051333 100644 --- a/samples/client/petstore/python/petstore_api/model/client.py +++ b/samples/client/petstore/python/petstore_api/model/client.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/dog.py b/samples/client/petstore/python/petstore_api/model/dog.py index b6eed138105c..c213921a2276 100644 --- a/samples/client/petstore/python/petstore_api/model/dog.py +++ b/samples/client/petstore/python/petstore_api/model/dog.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/dog_all_of.py b/samples/client/petstore/python/petstore_api/model/dog_all_of.py index dbc36cb2c8f3..967558a7de88 100644 --- a/samples/client/petstore/python/petstore_api/model/dog_all_of.py +++ b/samples/client/petstore/python/petstore_api/model/dog_all_of.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/enum_arrays.py b/samples/client/petstore/python/petstore_api/model/enum_arrays.py index da42763d9c32..56b055e4a517 100644 --- a/samples/client/petstore/python/petstore_api/model/enum_arrays.py +++ b/samples/client/petstore/python/petstore_api/model/enum_arrays.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/enum_class.py b/samples/client/petstore/python/petstore_api/model/enum_class.py index b0ed3d8966d9..476d3da6587e 100644 --- a/samples/client/petstore/python/petstore_api/model/enum_class.py +++ b/samples/client/petstore/python/petstore_api/model/enum_class.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/enum_test.py b/samples/client/petstore/python/petstore_api/model/enum_test.py index a3f47184d1a0..7ba923a9959b 100644 --- a/samples/client/petstore/python/petstore_api/model/enum_test.py +++ b/samples/client/petstore/python/petstore_api/model/enum_test.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/file.py b/samples/client/petstore/python/petstore_api/model/file.py index 849f5727dc9f..90ebbacfefe9 100644 --- a/samples/client/petstore/python/petstore_api/model/file.py +++ b/samples/client/petstore/python/petstore_api/model/file.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/file_schema_test_class.py b/samples/client/petstore/python/petstore_api/model/file_schema_test_class.py index f7e154e47b7c..4dcd9995d8aa 100644 --- a/samples/client/petstore/python/petstore_api/model/file_schema_test_class.py +++ b/samples/client/petstore/python/petstore_api/model/file_schema_test_class.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/format_test.py b/samples/client/petstore/python/petstore_api/model/format_test.py index 1d3ef5f76b40..43c1c21afa8a 100644 --- a/samples/client/petstore/python/petstore_api/model/format_test.py +++ b/samples/client/petstore/python/petstore_api/model/format_test.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/grandparent.py b/samples/client/petstore/python/petstore_api/model/grandparent.py index b92e3acdcf39..c3260576e4ba 100644 --- a/samples/client/petstore/python/petstore_api/model/grandparent.py +++ b/samples/client/petstore/python/petstore_api/model/grandparent.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/grandparent_animal.py b/samples/client/petstore/python/petstore_api/model/grandparent_animal.py index fd77a46211fe..d57f18a695d1 100644 --- a/samples/client/petstore/python/petstore_api/model/grandparent_animal.py +++ b/samples/client/petstore/python/petstore_api/model/grandparent_animal.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/has_only_read_only.py b/samples/client/petstore/python/petstore_api/model/has_only_read_only.py index 33d1c15b58d9..967d83544cd8 100644 --- a/samples/client/petstore/python/petstore_api/model/has_only_read_only.py +++ b/samples/client/petstore/python/petstore_api/model/has_only_read_only.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/list.py b/samples/client/petstore/python/petstore_api/model/list.py index 4b71d9deec05..f22e79bdde21 100644 --- a/samples/client/petstore/python/petstore_api/model/list.py +++ b/samples/client/petstore/python/petstore_api/model/list.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/map_test.py b/samples/client/petstore/python/petstore_api/model/map_test.py index 39c3b180e88c..5ffaa783df3a 100644 --- a/samples/client/petstore/python/petstore_api/model/map_test.py +++ b/samples/client/petstore/python/petstore_api/model/map_test.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python/petstore_api/model/mixed_properties_and_additional_properties_class.py index f46cd0b89726..780a112d2439 100644 --- a/samples/client/petstore/python/petstore_api/model/mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python/petstore_api/model/mixed_properties_and_additional_properties_class.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/model200_response.py b/samples/client/petstore/python/petstore_api/model/model200_response.py index 41a8dee5fdf2..4fda496353e3 100644 --- a/samples/client/petstore/python/petstore_api/model/model200_response.py +++ b/samples/client/petstore/python/petstore_api/model/model200_response.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/model_return.py b/samples/client/petstore/python/petstore_api/model/model_return.py index f3720b05246f..ed436bd3890a 100644 --- a/samples/client/petstore/python/petstore_api/model/model_return.py +++ b/samples/client/petstore/python/petstore_api/model/model_return.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/name.py b/samples/client/petstore/python/petstore_api/model/name.py index d46618c88a14..65e733099c69 100644 --- a/samples/client/petstore/python/petstore_api/model/name.py +++ b/samples/client/petstore/python/petstore_api/model/name.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/number_only.py b/samples/client/petstore/python/petstore_api/model/number_only.py index a96d91650569..92d24e178c03 100644 --- a/samples/client/petstore/python/petstore_api/model/number_only.py +++ b/samples/client/petstore/python/petstore_api/model/number_only.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/number_with_validations.py b/samples/client/petstore/python/petstore_api/model/number_with_validations.py index 5d66fec5ec67..d782cb7492a1 100644 --- a/samples/client/petstore/python/petstore_api/model/number_with_validations.py +++ b/samples/client/petstore/python/petstore_api/model/number_with_validations.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/object_model_with_ref_props.py b/samples/client/petstore/python/petstore_api/model/object_model_with_ref_props.py index 2ef48316f430..68142db9a2b8 100644 --- a/samples/client/petstore/python/petstore_api/model/object_model_with_ref_props.py +++ b/samples/client/petstore/python/petstore_api/model/object_model_with_ref_props.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/order.py b/samples/client/petstore/python/petstore_api/model/order.py index eeefff1513f6..eac0013231d2 100644 --- a/samples/client/petstore/python/petstore_api/model/order.py +++ b/samples/client/petstore/python/petstore_api/model/order.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/parent.py b/samples/client/petstore/python/petstore_api/model/parent.py index de116a11c76a..a4102110d47b 100644 --- a/samples/client/petstore/python/petstore_api/model/parent.py +++ b/samples/client/petstore/python/petstore_api/model/parent.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/parent_all_of.py b/samples/client/petstore/python/petstore_api/model/parent_all_of.py index 602e3f610a0a..2ec9da892e62 100644 --- a/samples/client/petstore/python/petstore_api/model/parent_all_of.py +++ b/samples/client/petstore/python/petstore_api/model/parent_all_of.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/parent_pet.py b/samples/client/petstore/python/petstore_api/model/parent_pet.py index df59bb60ed36..3a3de6bcec95 100644 --- a/samples/client/petstore/python/petstore_api/model/parent_pet.py +++ b/samples/client/petstore/python/petstore_api/model/parent_pet.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/pet.py b/samples/client/petstore/python/petstore_api/model/pet.py index 8946f6d4bea3..2a33b0889ab1 100644 --- a/samples/client/petstore/python/petstore_api/model/pet.py +++ b/samples/client/petstore/python/petstore_api/model/pet.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/player.py b/samples/client/petstore/python/petstore_api/model/player.py index 50ab531029b8..84ca922abd37 100644 --- a/samples/client/petstore/python/petstore_api/model/player.py +++ b/samples/client/petstore/python/petstore_api/model/player.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/read_only_first.py b/samples/client/petstore/python/petstore_api/model/read_only_first.py index 38cb5e2634f6..bd2a75175ae5 100644 --- a/samples/client/petstore/python/petstore_api/model/read_only_first.py +++ b/samples/client/petstore/python/petstore_api/model/read_only_first.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/special_model_name.py b/samples/client/petstore/python/petstore_api/model/special_model_name.py index cc2e49f6bcb0..9a7743a2a42e 100644 --- a/samples/client/petstore/python/petstore_api/model/special_model_name.py +++ b/samples/client/petstore/python/petstore_api/model/special_model_name.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/string_boolean_map.py b/samples/client/petstore/python/petstore_api/model/string_boolean_map.py index 05f8527fec1e..cb0e03f19e57 100644 --- a/samples/client/petstore/python/petstore_api/model/string_boolean_map.py +++ b/samples/client/petstore/python/petstore_api/model/string_boolean_map.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/string_enum.py b/samples/client/petstore/python/petstore_api/model/string_enum.py index 2397dd59fc95..de5d86886d7e 100644 --- a/samples/client/petstore/python/petstore_api/model/string_enum.py +++ b/samples/client/petstore/python/petstore_api/model/string_enum.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/tag.py b/samples/client/petstore/python/petstore_api/model/tag.py index 7db3cee0baaf..512587947dd5 100644 --- a/samples/client/petstore/python/petstore_api/model/tag.py +++ b/samples/client/petstore/python/petstore_api/model/tag.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/type_holder_default.py b/samples/client/petstore/python/petstore_api/model/type_holder_default.py index be884db9d136..ac3c78a4db2b 100644 --- a/samples/client/petstore/python/petstore_api/model/type_holder_default.py +++ b/samples/client/petstore/python/petstore_api/model/type_holder_default.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/type_holder_example.py b/samples/client/petstore/python/petstore_api/model/type_holder_example.py index a0836e32d3f3..c12c79c27bb7 100644 --- a/samples/client/petstore/python/petstore_api/model/type_holder_example.py +++ b/samples/client/petstore/python/petstore_api/model/type_holder_example.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/user.py b/samples/client/petstore/python/petstore_api/model/user.py index 9c5bc4dfd412..3d0bf626cf9b 100644 --- a/samples/client/petstore/python/petstore_api/model/user.py +++ b/samples/client/petstore/python/petstore_api/model/user.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python/petstore_api/model/xml_item.py b/samples/client/petstore/python/petstore_api/model/xml_item.py index 060ed03809c6..29e1bfe54e63 100644 --- a/samples/client/petstore/python/petstore_api/model/xml_item.py +++ b/samples/client/petstore/python/petstore_api/model/xml_item.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_any_type.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_any_type.py index 34ae88833fbe..d98c15e0abb3 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_any_type.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_any_type.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_array.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_array.py index 55f44f411c27..c45c5af7f1f1 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_array.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_array.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_boolean.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_boolean.py index b9c5c258e3cc..de4abb39d434 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_boolean.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_boolean.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_class.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_class.py index 5a38128ad89e..5daea08d6efc 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_class.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_class.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_integer.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_integer.py index f6f80f89c7ad..cab715522292 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_integer.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_integer.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_number.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_number.py index 6c094699462a..5a9b0c623ab5 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_number.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_number.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_object.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_object.py index 1fa671aff9b2..908865783525 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_object.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_object.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_string.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_string.py index 0afa8a9e6376..07394244c688 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_string.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/additional_properties_string.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/animal.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/animal.py index d1a9e4afbb06..874bb7f85773 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/animal.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/animal.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/animal_farm.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/animal_farm.py index 042a8274ee7a..0cca3901cb37 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/animal_farm.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/animal_farm.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/api_response.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/api_response.py index 5abc32eafe2a..e3342da4b4d8 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/api_response.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/api_response.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_of_array_of_number_only.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_of_array_of_number_only.py index 905860719151..a05dc0dbbad1 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_of_array_of_number_only.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_of_array_of_number_only.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_of_number_only.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_of_number_only.py index e343a727d6e1..ee080ed5d5a3 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_of_number_only.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_of_number_only.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_test.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_test.py index 13649acbe327..3d1146f50cbc 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_test.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/array_test.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/capitalization.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/capitalization.py index 75a354d29595..797721eebf5b 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/capitalization.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/capitalization.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/cat.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/cat.py index dd757730af17..9a6866afe82b 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/cat.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/cat.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/cat_all_of.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/cat_all_of.py index 5ed2c9cdf280..435f20644275 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/cat_all_of.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/cat_all_of.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/category.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/category.py index cf8a13849754..9542039484f4 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/category.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/category.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child.py index 657121c1a91a..981c19faf91e 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_all_of.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_all_of.py index e3f8db2e199a..c5ca4d148099 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_all_of.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_all_of.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_cat.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_cat.py index a0f68d481fce..6fbffb9fc083 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_cat.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_cat.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_cat_all_of.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_cat_all_of.py index ceacfbcd7b15..8e5c88070be3 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_cat_all_of.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_cat_all_of.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_dog.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_dog.py index 55c39ff65187..e6b17573c5bb 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_dog.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_dog.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_dog_all_of.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_dog_all_of.py index 41c87c20618b..c1e24971772e 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_dog_all_of.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_dog_all_of.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_lizard.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_lizard.py index e1f30dcb774f..90befa4eb00d 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_lizard.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_lizard.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_lizard_all_of.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_lizard_all_of.py index f88016d08793..789018bd8fa1 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_lizard_all_of.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/child_lizard_all_of.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/class_model.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/class_model.py index 0ecc844f84c3..44580c1ca6f1 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/class_model.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/class_model.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/client.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/client.py index 2b4ac4b91a82..0c7ad8a06d45 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/client.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/client.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/dog.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/dog.py index d4a4e0192f60..02ec7f30cfe5 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/dog.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/dog.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/dog_all_of.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/dog_all_of.py index cdc633dc66ff..887c999b895d 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/dog_all_of.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/dog_all_of.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_arrays.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_arrays.py index 39fe0ffb838c..c96038e71a76 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_arrays.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_arrays.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_class.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_class.py index b0ed3d8966d9..476d3da6587e 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_class.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_class.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_test.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_test.py index a75f4774ae71..c06e9e6f7a96 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_test.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/enum_test.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/file.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/file.py index a2beaf44a016..04a45eb77bdc 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/file.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/file.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/file_schema_test_class.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/file_schema_test_class.py index e3f7608e95da..ed37ce5cdd28 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/file_schema_test_class.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/file_schema_test_class.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/format_test.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/format_test.py index 1588b1de0531..ee392df1b2d4 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/format_test.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/format_test.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/grandparent.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/grandparent.py index c25e0b3f843d..02af8c351653 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/grandparent.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/grandparent.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/grandparent_animal.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/grandparent_animal.py index e053af7d5387..f092f0a94692 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/grandparent_animal.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/grandparent_animal.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/has_only_read_only.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/has_only_read_only.py index 294a16ddc46d..9dd7a4a74d4b 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/has_only_read_only.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/has_only_read_only.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/list.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/list.py index 18863e57bc74..8f5755cb1c46 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/list.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/list.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/map_test.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/map_test.py index 612810807990..280f49176afa 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/map_test.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/map_test.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/mixed_properties_and_additional_properties_class.py index 954689631564..efb028619a50 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/mixed_properties_and_additional_properties_class.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model200_response.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model200_response.py index d094c7f84c64..a57ce4b84caa 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model200_response.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model200_response.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model_return.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model_return.py index 51bcf6f1649f..8463f3405872 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model_return.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/model_return.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/name.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/name.py index 4ee3e1ed2bf1..80bdb2200390 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/name.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/name.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/number_only.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/number_only.py index c4163787bc14..f5db0482a059 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/number_only.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/number_only.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/number_with_validations.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/number_with_validations.py index 5d66fec5ec67..d782cb7492a1 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/number_with_validations.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/number_with_validations.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/object_model_with_ref_props.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/object_model_with_ref_props.py index dfe5d05cf051..a308dbd2013c 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/object_model_with_ref_props.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/object_model_with_ref_props.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/order.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/order.py index b69e94ae36be..620fc2371035 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/order.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/order.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent.py index 4b17c55c74a3..ff20cef07b59 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent_all_of.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent_all_of.py index 97916a1dd4e2..ff7c5d02e388 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent_all_of.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent_all_of.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent_pet.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent_pet.py index bd36702a7a9a..28efff2107fb 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent_pet.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent_pet.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/pet.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/pet.py index a7b888a2aa38..b51c7d6dcbd5 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/pet.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/pet.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/player.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/player.py index 104c4d2900df..8bbd2fa5a2ae 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/player.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/player.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/read_only_first.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/read_only_first.py index ad0bfbaac115..7dff5dfe68a6 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/read_only_first.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/read_only_first.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/special_model_name.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/special_model_name.py index fa13828d6b9f..374c641f75bf 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/special_model_name.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/special_model_name.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/string_boolean_map.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/string_boolean_map.py index 05f8527fec1e..cb0e03f19e57 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/string_boolean_map.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/string_boolean_map.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/string_enum.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/string_enum.py index 2397dd59fc95..de5d86886d7e 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/string_enum.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/string_enum.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/tag.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/tag.py index 913976557b40..6f7dee860a51 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/tag.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/tag.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/type_holder_default.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/type_holder_default.py index b156cbac46e3..d6b5b41e7fcd 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/type_holder_default.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/type_holder_default.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/type_holder_example.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/type_holder_example.py index c7a3f13b63ce..d9cce030f115 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/type_holder_example.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/type_holder_example.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/user.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/user.py index a3a4019042be..8ed232432399 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/user.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/user.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/xml_item.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/xml_item.py index 183234163189..bf44ba72c71f 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/xml_item.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/xml_item.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_class.py b/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_class.py index 6540576f957b..0d8a59a4a97b 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_class.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_class.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_with_array_of_enums.py index f8e0b8529ccd..1846afd1eec7 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_with_array_of_enums.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/additional_properties_with_array_of_enums.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/address.py b/samples/openapi3/client/petstore/python/petstore_api/model/address.py index a7c88b8fec25..01ff154e5262 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/address.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/address.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/animal.py b/samples/openapi3/client/petstore/python/petstore_api/model/animal.py index cc070a6d8fe6..8f80b4669b60 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/animal.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/animal.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/animal_farm.py b/samples/openapi3/client/petstore/python/petstore_api/model/animal_farm.py index 042a8274ee7a..0cca3901cb37 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/animal_farm.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/animal_farm.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/api_response.py b/samples/openapi3/client/petstore/python/petstore_api/model/api_response.py index d1f3b363bef5..ed202b6bdcca 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/api_response.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/api_response.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/apple.py b/samples/openapi3/client/petstore/python/petstore_api/model/apple.py index b5d3d62826d8..dee3d8ef80bc 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/apple.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/apple.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/apple_req.py b/samples/openapi3/client/petstore/python/petstore_api/model/apple_req.py index 469aa6e1f6e6..b4ce3f132a40 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/apple_req.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/apple_req.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python/petstore_api/model/array_of_array_of_number_only.py index 16d9bda29f1f..39a76641c6d5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/array_of_array_of_number_only.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/array_of_array_of_number_only.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/array_of_enums.py b/samples/openapi3/client/petstore/python/petstore_api/model/array_of_enums.py index d83a7f15709a..fbe28556441b 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/array_of_enums.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/array_of_enums.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/array_of_number_only.py b/samples/openapi3/client/petstore/python/petstore_api/model/array_of_number_only.py index 0e44ab61aff5..73abf32b511f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/array_of_number_only.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/array_of_number_only.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/array_test.py b/samples/openapi3/client/petstore/python/petstore_api/model/array_test.py index 64c180d11bc5..fc4e6c345375 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/array_test.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/array_test.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/banana.py b/samples/openapi3/client/petstore/python/petstore_api/model/banana.py index 2e2249d2f5e1..2d527ca3bbec 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/banana.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/banana.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/banana_req.py b/samples/openapi3/client/petstore/python/petstore_api/model/banana_req.py index ff367d1d550f..1974ea8a9627 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/banana_req.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/banana_req.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/basque_pig.py b/samples/openapi3/client/petstore/python/petstore_api/model/basque_pig.py index bdf993909529..b7a690cd388a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/basque_pig.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/basque_pig.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/boolean_enum.py b/samples/openapi3/client/petstore/python/petstore_api/model/boolean_enum.py index af104c19c78f..e19d454603a1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/boolean_enum.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/boolean_enum.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/capitalization.py b/samples/openapi3/client/petstore/python/petstore_api/model/capitalization.py index 2f1323481dca..d5d7202f9af1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/capitalization.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/capitalization.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/cat.py b/samples/openapi3/client/petstore/python/petstore_api/model/cat.py index 809db1a23710..03d534161075 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/cat.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/cat.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/cat_all_of.py b/samples/openapi3/client/petstore/python/petstore_api/model/cat_all_of.py index a5bef948f72b..0fa2471efddc 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/cat_all_of.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/cat_all_of.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/category.py b/samples/openapi3/client/petstore/python/petstore_api/model/category.py index b40329c9424d..b4557487e022 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/category.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/category.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/child_cat.py b/samples/openapi3/client/petstore/python/petstore_api/model/child_cat.py index 355321a2c4ca..5fd213c0ce9d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/child_cat.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/child_cat.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/child_cat_all_of.py b/samples/openapi3/client/petstore/python/petstore_api/model/child_cat_all_of.py index 48b725d7c3c6..21c3ac606b2b 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/child_cat_all_of.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/child_cat_all_of.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/class_model.py b/samples/openapi3/client/petstore/python/petstore_api/model/class_model.py index a3f2b58f87f3..d73e8f42ef7f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/class_model.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/class_model.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/client.py b/samples/openapi3/client/petstore/python/petstore_api/model/client.py index 3dca32f7926b..091a06051333 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/client.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/complex_quadrilateral.py b/samples/openapi3/client/petstore/python/petstore_api/model/complex_quadrilateral.py index 08f77421bbfa..99d9199382a0 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/complex_quadrilateral.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/complex_quadrilateral.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/composed_one_of_number_with_validations.py b/samples/openapi3/client/petstore/python/petstore_api/model/composed_one_of_number_with_validations.py index 49d97511457a..67429de5a425 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/composed_one_of_number_with_validations.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/composed_one_of_number_with_validations.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/composed_schema_with_props_and_no_add_props.py b/samples/openapi3/client/petstore/python/petstore_api/model/composed_schema_with_props_and_no_add_props.py index bd41caf68353..4fd927a1e5cd 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/composed_schema_with_props_and_no_add_props.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/composed_schema_with_props_and_no_add_props.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/danish_pig.py b/samples/openapi3/client/petstore/python/petstore_api/model/danish_pig.py index c102f99cd285..72ca3e3b2eb0 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/danish_pig.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/danish_pig.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/dog.py b/samples/openapi3/client/petstore/python/petstore_api/model/dog.py index b700f88db114..22fbae182f48 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/dog.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/dog.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/dog_all_of.py b/samples/openapi3/client/petstore/python/petstore_api/model/dog_all_of.py index 8e7c1d8f27d3..830390f06fa0 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/dog_all_of.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/dog_all_of.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/drawing.py b/samples/openapi3/client/petstore/python/petstore_api/model/drawing.py index 41b4a5802c03..68143f247fe5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/drawing.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/drawing.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/enum_arrays.py b/samples/openapi3/client/petstore/python/petstore_api/model/enum_arrays.py index da42763d9c32..56b055e4a517 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/enum_arrays.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/enum_arrays.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/enum_class.py b/samples/openapi3/client/petstore/python/petstore_api/model/enum_class.py index b0ed3d8966d9..476d3da6587e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/enum_class.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/enum_class.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/enum_test.py b/samples/openapi3/client/petstore/python/petstore_api/model/enum_test.py index db45011e5ecf..924212176dcb 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/enum_test.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/enum_test.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/equilateral_triangle.py b/samples/openapi3/client/petstore/python/petstore_api/model/equilateral_triangle.py index 03ac634dda24..1ef377f52403 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/equilateral_triangle.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/equilateral_triangle.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/fake_post_inline_additional_properties_payload_array_data.py b/samples/openapi3/client/petstore/python/petstore_api/model/fake_post_inline_additional_properties_payload_array_data.py index bf9761b084c7..95faf3468d0a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/fake_post_inline_additional_properties_payload_array_data.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/fake_post_inline_additional_properties_payload_array_data.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/file.py b/samples/openapi3/client/petstore/python/petstore_api/model/file.py index 849f5727dc9f..90ebbacfefe9 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/file.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/file.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/file_schema_test_class.py b/samples/openapi3/client/petstore/python/petstore_api/model/file_schema_test_class.py index f7e154e47b7c..4dcd9995d8aa 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/file_schema_test_class.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/file_schema_test_class.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/foo.py b/samples/openapi3/client/petstore/python/petstore_api/model/foo.py index ad17251f73b6..e572bea9afe1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/foo.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/foo.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/format_test.py b/samples/openapi3/client/petstore/python/petstore_api/model/format_test.py index 6d4b3b79d705..1cf20a6b1ebc 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/format_test.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/format_test.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/fruit.py b/samples/openapi3/client/petstore/python/petstore_api/model/fruit.py index c2971bdb5469..deddaf8a7399 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/fruit.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/fruit.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/fruit_req.py b/samples/openapi3/client/petstore/python/petstore_api/model/fruit_req.py index f428e5cff634..b9ecc53a570f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/fruit_req.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/fruit_req.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/gm_fruit.py b/samples/openapi3/client/petstore/python/petstore_api/model/gm_fruit.py index 238eb5c82932..d30fc516b056 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/gm_fruit.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/gm_fruit.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/gm_fruit_no_properties.py b/samples/openapi3/client/petstore/python/petstore_api/model/gm_fruit_no_properties.py index 160b41305b4a..d8ddf14ea593 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/gm_fruit_no_properties.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/gm_fruit_no_properties.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/grandparent_animal.py b/samples/openapi3/client/petstore/python/petstore_api/model/grandparent_animal.py index 1580c5a7b724..7037a2283303 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/grandparent_animal.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/grandparent_animal.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/has_only_read_only.py b/samples/openapi3/client/petstore/python/petstore_api/model/has_only_read_only.py index 33d1c15b58d9..967d83544cd8 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/has_only_read_only.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/has_only_read_only.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/health_check_result.py b/samples/openapi3/client/petstore/python/petstore_api/model/health_check_result.py index 0b3818b7c506..a6174163da85 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/health_check_result.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/health_check_result.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/inline_additional_properties_ref_payload.py b/samples/openapi3/client/petstore/python/petstore_api/model/inline_additional_properties_ref_payload.py index 85d3fa5922f1..861507574d0e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/inline_additional_properties_ref_payload.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/inline_additional_properties_ref_payload.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/inline_object6.py b/samples/openapi3/client/petstore/python/petstore_api/model/inline_object6.py index 828d30aa0762..b6277de408d3 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/inline_object6.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/inline_object6.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/inline_response_default.py b/samples/openapi3/client/petstore/python/petstore_api/model/inline_response_default.py index b755dbadd364..7e12891bfed5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/inline_response_default.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/inline_response_default.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum.py b/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum.py index aa397a09ebd4..97384f48acfe 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_one_value.py b/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_one_value.py index 0ed72fe14cd3..252560ee7690 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_one_value.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_one_value.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_with_default_value.py b/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_with_default_value.py index 2c4793329838..df7749b22f8b 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_with_default_value.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/integer_enum_with_default_value.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/isosceles_triangle.py b/samples/openapi3/client/petstore/python/petstore_api/model/isosceles_triangle.py index d2b908e476e5..d093a15ac36f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/isosceles_triangle.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/isosceles_triangle.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/legs.py b/samples/openapi3/client/petstore/python/petstore_api/model/legs.py index 57e01527a854..3258e0a85be1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/legs.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/legs.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/list.py b/samples/openapi3/client/petstore/python/petstore_api/model/list.py index 4b71d9deec05..f22e79bdde21 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/list.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/list.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/mammal.py b/samples/openapi3/client/petstore/python/petstore_api/model/mammal.py index e4e659732784..e06cc8396c05 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/mammal.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/mammal.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/map_test.py b/samples/openapi3/client/petstore/python/petstore_api/model/map_test.py index 39c3b180e88c..5ffaa783df3a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/map_test.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/map_test.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python/petstore_api/model/mixed_properties_and_additional_properties_class.py index f46cd0b89726..780a112d2439 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/mixed_properties_and_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/mixed_properties_and_additional_properties_class.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/model200_response.py b/samples/openapi3/client/petstore/python/petstore_api/model/model200_response.py index 41a8dee5fdf2..4fda496353e3 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/model200_response.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/model200_response.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/model_return.py b/samples/openapi3/client/petstore/python/petstore_api/model/model_return.py index f3720b05246f..ed436bd3890a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/model_return.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/model_return.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/mole.py b/samples/openapi3/client/petstore/python/petstore_api/model/mole.py index 328168b21235..53c2f443ad92 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/mole.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/mole.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/name.py b/samples/openapi3/client/petstore/python/petstore_api/model/name.py index d46618c88a14..65e733099c69 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/name.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/name.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/nullable_class.py b/samples/openapi3/client/petstore/python/petstore_api/model/nullable_class.py index ad5e551dd0fd..e038a93fe219 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/nullable_class.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/nullable_class.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/nullable_shape.py b/samples/openapi3/client/petstore/python/petstore_api/model/nullable_shape.py index 90ef787c27fb..04bc5a0a3457 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/nullable_shape.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/nullable_shape.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/number_only.py b/samples/openapi3/client/petstore/python/petstore_api/model/number_only.py index a96d91650569..92d24e178c03 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/number_only.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/number_only.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/number_with_validations.py b/samples/openapi3/client/petstore/python/petstore_api/model/number_with_validations.py index 9a8a82b48219..068c1c47dfb7 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/number_with_validations.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/number_with_validations.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/object_interface.py b/samples/openapi3/client/petstore/python/petstore_api/model/object_interface.py index 23d16918fd60..4b3275bcc8e8 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/object_interface.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/object_interface.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/object_model_with_ref_props.py b/samples/openapi3/client/petstore/python/petstore_api/model/object_model_with_ref_props.py index 56a55a14c090..bd98ec208bfc 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/object_model_with_ref_props.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/object_model_with_ref_props.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_validations.py b/samples/openapi3/client/petstore/python/petstore_api/model/object_with_validations.py index dd38862e11bf..bbedc4a07fc4 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/object_with_validations.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/object_with_validations.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/order.py b/samples/openapi3/client/petstore/python/petstore_api/model/order.py index eeefff1513f6..eac0013231d2 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/order.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/order.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/parent_pet.py b/samples/openapi3/client/petstore/python/petstore_api/model/parent_pet.py index 8ead627ef6c6..f72997edfbcf 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/parent_pet.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/parent_pet.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/pet.py b/samples/openapi3/client/petstore/python/petstore_api/model/pet.py index 8946f6d4bea3..2a33b0889ab1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/pet.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/pet.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/pig.py b/samples/openapi3/client/petstore/python/petstore_api/model/pig.py index f7f1a953e92b..a8e18e7b9fb0 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/pig.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/pig.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral.py b/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral.py index 0afb36e36acc..c5eef71f4569 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral_interface.py b/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral_interface.py index 5ca8fae392a8..7f46f6bd626c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral_interface.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/quadrilateral_interface.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/read_only_first.py b/samples/openapi3/client/petstore/python/petstore_api/model/read_only_first.py index 38cb5e2634f6..bd2a75175ae5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/read_only_first.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/read_only_first.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/readonly.py b/samples/openapi3/client/petstore/python/petstore_api/model/readonly.py index 9a98af452eb8..7ce992e47142 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/readonly.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/readonly.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/scalene_triangle.py b/samples/openapi3/client/petstore/python/petstore_api/model/scalene_triangle.py index 518f6d14ca43..d2143ba334e8 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/scalene_triangle.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/scalene_triangle.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/shape.py b/samples/openapi3/client/petstore/python/petstore_api/model/shape.py index cadcab7e52ca..cec42d033227 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/shape.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/shape.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/shape_interface.py b/samples/openapi3/client/petstore/python/petstore_api/model/shape_interface.py index 0f11d5a14466..313de6aa05ea 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/shape_interface.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/shape_interface.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/shape_or_null.py b/samples/openapi3/client/petstore/python/petstore_api/model/shape_or_null.py index 04c338516165..bde6391563ad 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/shape_or_null.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/shape_or_null.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/simple_quadrilateral.py b/samples/openapi3/client/petstore/python/petstore_api/model/simple_quadrilateral.py index c4878086ec3b..3db924e7dd1e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/simple_quadrilateral.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/simple_quadrilateral.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/some_object.py b/samples/openapi3/client/petstore/python/petstore_api/model/some_object.py index 3acbe976bb55..7e650d0dea1c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/some_object.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/some_object.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/some_object_with_self_attr.py b/samples/openapi3/client/petstore/python/petstore_api/model/some_object_with_self_attr.py index 76e776ae67fc..25e24ea8ee5c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/some_object_with_self_attr.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/some_object_with_self_attr.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/special_model_name.py b/samples/openapi3/client/petstore/python/petstore_api/model/special_model_name.py index cc2e49f6bcb0..9a7743a2a42e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/special_model_name.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/special_model_name.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/string_boolean_map.py b/samples/openapi3/client/petstore/python/petstore_api/model/string_boolean_map.py index 05f8527fec1e..cb0e03f19e57 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/string_boolean_map.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/string_boolean_map.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/string_enum.py b/samples/openapi3/client/petstore/python/petstore_api/model/string_enum.py index 3563698aacbf..a208eb4780ea 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/string_enum.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/string_enum.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/string_enum_with_default_value.py b/samples/openapi3/client/petstore/python/petstore_api/model/string_enum_with_default_value.py index b6432cdbd1b8..2c53501ef3ec 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/string_enum_with_default_value.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/string_enum_with_default_value.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/tag.py b/samples/openapi3/client/petstore/python/petstore_api/model/tag.py index 95a08c180731..9daf411a5bb0 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/tag.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/tag.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/triangle.py b/samples/openapi3/client/petstore/python/petstore_api/model/triangle.py index 70c34f3a7acd..3329e98a7b72 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/triangle.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/triangle.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/triangle_interface.py b/samples/openapi3/client/petstore/python/petstore_api/model/triangle_interface.py index 783e5fe3bf83..2b88e89e3326 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/triangle_interface.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/triangle_interface.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/user.py b/samples/openapi3/client/petstore/python/petstore_api/model/user.py index f77ab381d217..39efcbbc2ddf 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/user.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/user.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/whale.py b/samples/openapi3/client/petstore/python/petstore_api/model/whale.py index a8eb263b118f..d03a3a7b5c9e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/whale.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/whale.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/zebra.py b/samples/openapi3/client/petstore/python/petstore_api/model/zebra.py index c348b3316715..cd897ef3b6ec 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/zebra.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/zebra.py @@ -24,8 +24,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from petstore_api.exceptions import ApiAttributeError From b061bd21467c4c9a5de7f4ce551f50d314956e31 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 30 Nov 2021 15:33:42 +0800 Subject: [PATCH 048/117] [Java][Okhttp] Add oneOf support (#10875) * add custom gson deserializer * add check for additional fields, required fields * add tests for custom deserializer * add custom adapter * add custom adapter * register type adapter factory * comment out custom deserializer and use adapter instead * add okhttp-gson-nextgen * add new files * restore okhttp-gson * switch to adapter * remove custom de/serializer * add comment * update tests * test nextgen in ci * update doc * use full model name in JSON.java * undo changes * add oneof discriminator support * fix anyOf * remove mappings * add more tests * fix oneof deserialization, add more tests * add error body and type to api exception class * JSON to use instance variables/methods * Revert "add error body and type to api exception class" This reverts commit 07f34e2c450ad9f808b728173018b1e4d8fed458. --- bin/configs/java-okhttp-gson-nextgen.yaml | 9 + docs/generators/java.md | 2 +- .../codegen/languages/JavaClientCodegen.java | 11 +- .../AbstractOpenApiSchema.mustache | 138 + .../okhttp-gson-nextgen/ApiCallback.mustache | 51 + .../okhttp-gson-nextgen/ApiClient.mustache | 1737 ++++++++++++ .../okhttp-gson-nextgen/ApiResponse.mustache | 75 + .../GzipRequestInterceptor.mustache | 74 + .../okhttp-gson-nextgen/JSON.mustache | 553 ++++ .../ProgressRequestBody.mustache | 62 + .../ProgressResponseBody.mustache | 59 + .../okhttp-gson-nextgen/README.mustache | 183 ++ .../okhttp-gson-nextgen/anyof_model.mustache | 183 ++ .../okhttp-gson-nextgen/api.mustache | 500 ++++ .../okhttp-gson-nextgen/apiException.mustache | 159 ++ .../okhttp-gson-nextgen/api_doc.mustache | 106 + .../okhttp-gson-nextgen/api_test.mustache | 56 + .../auth/ApiKeyAuth.mustache | 69 + .../auth/Authentication.mustache | 25 + .../auth/HttpBasicAuth.mustache | 46 + .../auth/HttpBearerAuth.mustache | 52 + .../okhttp-gson-nextgen/auth/OAuth.mustache | 31 + .../auth/OAuthOkHttpClient.mustache | 70 + .../auth/RetryingOAuth.mustache | 184 ++ .../okhttp-gson-nextgen/build.gradle.mustache | 169 ++ .../okhttp-gson-nextgen/build.sbt.mustache | 39 + .../okhttp-gson-nextgen/model.mustache | 61 + .../okhttp-gson-nextgen/oneof_model.mustache | 190 ++ .../okhttp-gson-nextgen/pojo.mustache | 445 +++ .../okhttp-gson-nextgen/pom.mustache | 420 +++ ...sting-with-http-signature-okhttp-gson.yaml | 2145 ++++++++++++++ pom.xml | 1 + .../client/model/AbstractOpenApiSchema.java | 149 + .../java/okhttp-gson-nextgen/.gitignore | 21 + .../.openapi-generator-ignore | 14 + .../.openapi-generator/FILES | 195 ++ .../.openapi-generator/VERSION | 1 + .../java/okhttp-gson-nextgen/.travis.yml | 22 + .../java/okhttp-gson-nextgen/README.md | 277 ++ .../java/okhttp-gson-nextgen/api/openapi.yaml | 2464 +++++++++++++++++ .../java/okhttp-gson-nextgen/build.gradle | 153 + .../java/okhttp-gson-nextgen/build.sbt | 27 + .../docs/AdditionalPropertiesAnyType.md | 13 + .../docs/AdditionalPropertiesArray.md | 13 + .../docs/AdditionalPropertiesBoolean.md | 13 + .../docs/AdditionalPropertiesClass.md | 20 + .../docs/AdditionalPropertiesInteger.md | 13 + .../docs/AdditionalPropertiesNumber.md | 13 + .../docs/AdditionalPropertiesObject.md | 13 + .../docs/AdditionalPropertiesString.md | 13 + .../java/okhttp-gson-nextgen/docs/Animal.md | 14 + .../okhttp-gson-nextgen/docs/AnimalFarm.md | 9 + .../docs/AnotherFakeApi.md | 71 + .../java/okhttp-gson-nextgen/docs/Apple.md | 14 + .../java/okhttp-gson-nextgen/docs/AppleReq.md | 14 + .../docs/ArrayOfArrayOfNumberOnly.md | 13 + .../docs/ArrayOfNumberOnly.md | 13 + .../okhttp-gson-nextgen/docs/ArrayTest.md | 15 + .../java/okhttp-gson-nextgen/docs/Banana.md | 13 + .../okhttp-gson-nextgen/docs/BananaReq.md | 14 + .../okhttp-gson-nextgen/docs/BasquePig.md | 13 + .../java/okhttp-gson-nextgen/docs/BigCat.md | 24 + .../okhttp-gson-nextgen/docs/BigCatAllOf.md | 24 + .../docs/Capitalization.md | 18 + .../java/okhttp-gson-nextgen/docs/Cat.md | 13 + .../java/okhttp-gson-nextgen/docs/CatAllOf.md | 13 + .../java/okhttp-gson-nextgen/docs/Category.md | 14 + .../java/okhttp-gson-nextgen/docs/ChildCat.md | 22 + .../okhttp-gson-nextgen/docs/ChildCatAllOf.md | 22 + .../okhttp-gson-nextgen/docs/ClassModel.md | 14 + .../java/okhttp-gson-nextgen/docs/Client.md | 13 + .../docs/ComplexQuadrilateral.md | 14 + .../okhttp-gson-nextgen/docs/DanishPig.md | 13 + .../okhttp-gson-nextgen/docs/DefaultApi.md | 65 + .../docs/DeprecatedObject.md | 13 + .../java/okhttp-gson-nextgen/docs/Dog.md | 13 + .../java/okhttp-gson-nextgen/docs/DogAllOf.md | 13 + .../java/okhttp-gson-nextgen/docs/Drawing.md | 16 + .../okhttp-gson-nextgen/docs/EnumArrays.md | 32 + .../okhttp-gson-nextgen/docs/EnumClass.md | 15 + .../java/okhttp-gson-nextgen/docs/EnumTest.md | 68 + .../docs/EquilateralTriangle.md | 14 + .../java/okhttp-gson-nextgen/docs/FakeApi.md | 1006 +++++++ .../docs/FakeClassnameTags123Api.md | 78 + .../docs/FileSchemaTestClass.md | 14 + .../java/okhttp-gson-nextgen/docs/Foo.md | 13 + .../okhttp-gson-nextgen/docs/FormatTest.md | 28 + .../java/okhttp-gson-nextgen/docs/Fruit.md | 16 + .../java/okhttp-gson-nextgen/docs/FruitReq.md | 16 + .../java/okhttp-gson-nextgen/docs/GmFruit.md | 16 + .../docs/GrandparentAnimal.md | 13 + .../docs/HasOnlyReadOnly.md | 14 + .../docs/HealthCheckResult.md | 14 + .../docs/InlineResponseDefault.md | 13 + .../docs/IsoscelesTriangle.md | 14 + .../java/okhttp-gson-nextgen/docs/Mammal.md | 26 + .../java/okhttp-gson-nextgen/docs/MapTest.md | 25 + ...dPropertiesAndAdditionalPropertiesClass.md | 15 + .../docs/Model200Response.md | 15 + .../docs/ModelApiResponse.md | 15 + .../okhttp-gson-nextgen/docs/ModelReturn.md | 14 + .../java/okhttp-gson-nextgen/docs/Name.md | 17 + .../okhttp-gson-nextgen/docs/NullableClass.md | 24 + .../okhttp-gson-nextgen/docs/NullableShape.md | 15 + .../okhttp-gson-nextgen/docs/NumberOnly.md | 13 + .../docs/ObjectWithDeprecatedFields.md | 16 + .../java/okhttp-gson-nextgen/docs/Order.md | 28 + .../docs/OuterComposite.md | 15 + .../okhttp-gson-nextgen/docs/OuterEnum.md | 15 + .../docs/OuterEnumDefaultValue.md | 15 + .../docs/OuterEnumInteger.md | 15 + .../docs/OuterEnumIntegerDefaultValue.md | 15 + .../okhttp-gson-nextgen/docs/ParentPet.md | 12 + .../java/okhttp-gson-nextgen/docs/Pet.md | 28 + .../java/okhttp-gson-nextgen/docs/PetApi.md | 630 +++++ .../java/okhttp-gson-nextgen/docs/Pig.md | 13 + .../okhttp-gson-nextgen/docs/Quadrilateral.md | 14 + .../docs/QuadrilateralInterface.md | 13 + .../okhttp-gson-nextgen/docs/ReadOnlyFirst.md | 14 + .../docs/ScaleneTriangle.md | 14 + .../java/okhttp-gson-nextgen/docs/Shape.md | 14 + .../docs/ShapeInterface.md | 13 + .../okhttp-gson-nextgen/docs/ShapeOrNull.md | 15 + .../docs/SimpleQuadrilateral.md | 14 + .../docs/SpecialModelName.md | 14 + .../java/okhttp-gson-nextgen/docs/StoreApi.md | 264 ++ .../docs/StringBooleanMap.md | 9 + .../java/okhttp-gson-nextgen/docs/Tag.md | 14 + .../java/okhttp-gson-nextgen/docs/Triangle.md | 14 + .../docs/TriangleInterface.md | 13 + .../docs/TypeHolderDefault.md | 17 + .../docs/TypeHolderExample.md | 18 + .../java/okhttp-gson-nextgen/docs/User.md | 24 + .../java/okhttp-gson-nextgen/docs/UserApi.md | 501 ++++ .../java/okhttp-gson-nextgen/docs/Whale.md | 15 + .../java/okhttp-gson-nextgen/docs/XmlItem.md | 41 + .../java/okhttp-gson-nextgen/docs/Zebra.md | 24 + .../java/okhttp-gson-nextgen/git_push.sh | 57 + .../okhttp-gson-nextgen/gradle.properties | 6 + .../gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 59536 bytes .../gradle/wrapper/gradle-wrapper.properties | 5 + .../petstore/java/okhttp-gson-nextgen/gradlew | 234 ++ .../java/okhttp-gson-nextgen/gradlew.bat | 89 + .../java/okhttp-gson-nextgen/hello.txt | 1 + .../petstore/java/okhttp-gson-nextgen/pom.xml | 349 +++ .../java/okhttp-gson-nextgen/settings.gradle | 1 + .../src/main/AndroidManifest.xml | 3 + .../org/openapitools/client/ApiCallback.java | 62 + .../org/openapitools/client/ApiClient.java | 1552 +++++++++++ .../org/openapitools/client/ApiException.java | 154 ++ .../org/openapitools/client/ApiResponse.java | 76 + .../openapitools/client/Configuration.java | 39 + .../client/GzipRequestInterceptor.java | 85 + .../java/org/openapitools/client/JSON.java | 594 ++++ .../java/org/openapitools/client/Pair.java | 61 + .../client/ProgressRequestBody.java | 73 + .../client/ProgressResponseBody.java | 70 + .../client/ServerConfiguration.java | 58 + .../openapitools/client/ServerVariable.java | 23 + .../org/openapitools/client/StringUtil.java | 83 + .../client/api/AnotherFakeApi.java | 170 ++ .../openapitools/client/api/DefaultApi.java | 161 ++ .../org/openapitools/client/api/FakeApi.java | 2065 ++++++++++++++ .../client/api/FakeClassnameTags123Api.java | 170 ++ .../org/openapitools/client/api/PetApi.java | 1167 ++++++++ .../org/openapitools/client/api/StoreApi.java | 514 ++++ .../org/openapitools/client/api/UserApi.java | 977 +++++++ .../openapitools/client/auth/ApiKeyAuth.java | 80 + .../client/auth/Authentication.java | 36 + .../client/auth/HttpBasicAuth.java | 57 + .../client/auth/HttpBearerAuth.java | 63 + .../org/openapitools/client/auth/OAuth.java | 42 + .../openapitools/client/auth/OAuthFlow.java | 22 + .../client/auth/OAuthOkHttpClient.java | 68 + .../client/auth/RetryingOAuth.java | 182 ++ .../client/model/AbstractOpenApiSchema.java | 149 + .../model/AdditionalPropertiesClass.java | 419 +++ .../org/openapitools/client/model/Animal.java | 203 ++ .../org/openapitools/client/model/Apple.java | 192 ++ .../openapitools/client/model/AppleReq.java | 200 ++ .../model/ArrayOfArrayOfNumberOnly.java | 173 ++ .../client/model/ArrayOfNumberOnly.java | 173 ++ .../openapitools/client/model/ArrayTest.java | 249 ++ .../org/openapitools/client/model/Banana.java | 163 ++ .../openapitools/client/model/BananaReq.java | 201 ++ .../openapitools/client/model/BasquePig.java | 170 ++ .../client/model/Capitalization.java | 312 +++ .../org/openapitools/client/model/Cat.java | 177 ++ .../openapitools/client/model/CatAllOf.java | 162 ++ .../openapitools/client/model/Category.java | 200 ++ .../client/model/ChildCatAllOf.java | 216 ++ .../openapitools/client/model/ClassModel.java | 163 ++ .../org/openapitools/client/model/Client.java | 162 ++ .../client/model/ComplexQuadrilateral.java | 203 ++ .../openapitools/client/model/DanishPig.java | 170 ++ .../client/model/DeprecatedObject.java | 164 ++ .../org/openapitools/client/model/Dog.java | 177 ++ .../openapitools/client/model/DogAllOf.java | 162 ++ .../openapitools/client/model/Drawing.java | 282 ++ .../openapitools/client/model/EnumArrays.java | 296 ++ .../openapitools/client/model/EnumClass.java | 75 + .../openapitools/client/model/EnumTest.java | 665 +++++ .../client/model/EquilateralTriangle.java | 203 ++ .../client/model/FileSchemaTestClass.java | 202 ++ .../org/openapitools/client/model/Foo.java | 162 ++ .../openapitools/client/model/FormatTest.java | 638 +++++ .../org/openapitools/client/model/Fruit.java | 221 ++ .../openapitools/client/model/FruitReq.java | 226 ++ .../openapitools/client/model/GmFruit.java | 216 ++ .../client/model/GrandparentAnimal.java | 172 ++ .../client/model/HasOnlyReadOnly.java | 184 ++ .../client/model/HealthCheckResult.java | 175 ++ .../client/model/InlineResponseDefault.java | 163 ++ .../client/model/IsoscelesTriangle.java | 203 ++ .../org/openapitools/client/model/Mammal.java | 261 ++ .../openapitools/client/model/MapTest.java | 334 +++ ...ropertiesAndAdditionalPropertiesClass.java | 236 ++ .../client/model/Model200Response.java | 193 ++ .../client/model/ModelApiResponse.java | 222 ++ .../client/model/ModelReturn.java | 163 ++ .../org/openapitools/client/model/Name.java | 253 ++ .../client/model/NullableClass.java | 561 ++++ .../client/model/NullableShape.java | 225 ++ .../openapitools/client/model/NumberOnly.java | 163 ++ .../model/ObjectWithDeprecatedFields.java | 270 ++ .../org/openapitools/client/model/Order.java | 362 +++ .../client/model/OuterComposite.java | 223 ++ .../openapitools/client/model/OuterEnum.java | 75 + .../client/model/OuterEnumDefaultValue.java | 75 + .../client/model/OuterEnumInteger.java | 75 + .../model/OuterEnumIntegerDefaultValue.java | 75 + .../openapitools/client/model/ParentPet.java | 144 + .../org/openapitools/client/model/Pet.java | 387 +++ .../org/openapitools/client/model/Pig.java | 220 ++ .../client/model/Quadrilateral.java | 220 ++ .../client/model/QuadrilateralInterface.java | 170 ++ .../client/model/ReadOnlyFirst.java | 191 ++ .../client/model/ScaleneTriangle.java | 203 ++ .../org/openapitools/client/model/Shape.java | 220 ++ .../client/model/ShapeInterface.java | 170 ++ .../client/model/ShapeOrNull.java | 225 ++ .../client/model/SimpleQuadrilateral.java | 203 ++ .../client/model/SpecialModelName.java | 192 ++ .../org/openapitools/client/model/Tag.java | 192 ++ .../openapitools/client/model/Triangle.java | 261 ++ .../client/model/TriangleInterface.java | 170 ++ .../org/openapitools/client/model/User.java | 504 ++++ .../org/openapitools/client/model/Whale.java | 230 ++ .../org/openapitools/client/model/Zebra.java | 253 ++ .../openapitools/client/ApiClientTest.java | 345 +++ .../client/ConfigurationTest.java | 15 + .../org/openapitools/client/JSONTest.java | 348 +++ .../openapitools/client/StringUtilTest.java | 33 + .../client/api/AnotherFakeApiTest.java | 41 + .../client/api/DefaultApiTest.java | 49 + .../openapitools/client/api/FakeApiTest.java | 302 ++ .../api/FakeClassnameTags123ApiTest.java | 41 + .../openapitools/client/api/PetApiTest.java | 575 ++++ .../openapitools/client/api/StoreApiTest.java | 86 + .../openapitools/client/api/UserApiTest.java | 138 + .../client/auth/ApiKeyAuthTest.java | 119 + .../client/auth/HttpBasicAuthTest.java | 65 + .../client/auth/RetryingOAuthTest.java | 123 + .../model/AdditionalPropertiesClassTest.java | 111 + .../openapitools/client/model/AnimalTest.java | 61 + .../client/model/AppleReqTest.java | 59 + .../openapitools/client/model/AppleTest.java | 59 + .../client/model/ArrayOfNumberOnlyTest.java | 54 + .../client/model/ArrayTestTest.java | 70 + .../client/model/BananaReqTest.java | 60 + .../openapitools/client/model/BananaTest.java | 52 + .../client/model/BasquePigTest.java | 51 + .../client/model/CapitalizationTest.java | 91 + .../client/model/CatAllOfTest.java | 51 + .../openapitools/client/model/CatTest.java | 69 + .../client/model/CategoryTest.java | 59 + .../client/model/ClassModelTest.java | 51 + .../openapitools/client/model/ClientTest.java | 51 + .../model/ComplexQuadrilateralTest.java | 61 + .../client/model/DanishPigTest.java | 51 + .../client/model/DeprecatedObjectTest.java | 51 + .../client/model/DogAllOfTest.java | 51 + .../openapitools/client/model/DogTest.java | 69 + .../client/model/DrawingTest.java | 84 + .../client/model/EnumArraysTest.java | 61 + .../client/model/EnumClassTest.java | 34 + .../client/model/EnumTestTest.java | 120 + .../client/model/EquilateralTriangleTest.java | 61 + .../client/model/FileSchemaTestClassTest.java | 61 + .../openapitools/client/model/FooTest.java | 51 + .../client/model/FormatTestTest.java | 176 ++ .../client/model/FruitReqTest.java | 78 + .../openapitools/client/model/FruitTest.java | 70 + .../client/model/GmFruitTest.java | 70 + .../client/model/GrandparentAnimalTest.java | 52 + .../client/model/HasOnlyReadOnlyTest.java | 59 + .../client/model/HealthCheckResultTest.java | 52 + .../model/InlineResponseDefaultTest.java | 52 + .../client/model/IsoscelesTriangleTest.java | 61 + .../openapitools/client/model/MammalTest.java | 78 + .../client/model/MapTestTest.java | 78 + ...rtiesAndAdditionalPropertiesClassTest.java | 73 + .../client/model/Model200ResponseTest.java | 59 + .../client/model/ModelApiResponseTest.java | 67 + .../client/model/ModelReturnTest.java | 51 + .../openapitools/client/model/NameTest.java | 75 + .../client/model/NullableClassTest.java | 147 + .../client/model/NullableShapeTest.java | 69 + .../client/model/NumberOnlyTest.java | 52 + .../model/ObjectWithDeprecatedFieldsTest.java | 79 + .../openapitools/client/model/OrderTest.java | 92 + .../client/model/OuterCompositeTest.java | 68 + .../model/OuterEnumDefaultValueTest.java | 34 + .../OuterEnumIntegerDefaultValueTest.java | 34 + .../client/model/OuterEnumIntegerTest.java | 34 + .../client/model/OuterEnumTest.java | 34 + .../client/model/ParentPetTest.java | 52 + .../openapitools/client/model/PigTest.java | 53 + .../model/QuadrilateralInterfaceTest.java | 51 + .../client/model/QuadrilateralTest.java | 61 + .../client/model/ReadOnlyFirstTest.java | 59 + .../client/model/ScaleneTriangleTest.java | 61 + .../client/model/ShapeInterfaceTest.java | 51 + .../client/model/ShapeOrNullTest.java | 69 + .../openapitools/client/model/ShapeTest.java | 69 + .../client/model/SimpleQuadrilateralTest.java | 61 + .../client/model/SpecialModelNameTest.java | 59 + .../openapitools/client/model/TagTest.java | 59 + .../client/model/TriangleInterfaceTest.java | 51 + .../client/model/TriangleTest.java | 62 + .../openapitools/client/model/UserTest.java | 140 + .../openapitools/client/model/WhaleTest.java | 67 + .../openapitools/client/model/ZebraTest.java | 61 + .../client/model/AbstractOpenApiSchema.java | 149 + 334 files changed, 48332 insertions(+), 4 deletions(-) create mode 100644 bin/configs/java-okhttp-gson-nextgen.yaml create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/AbstractOpenApiSchema.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ApiCallback.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ApiClient.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ApiResponse.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/GzipRequestInterceptor.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/JSON.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ProgressRequestBody.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ProgressResponseBody.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/README.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/apiException.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api_doc.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api_test.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/ApiKeyAuth.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/Authentication.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/HttpBasicAuth.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/HttpBearerAuth.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/OAuth.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/OAuthOkHttpClient.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/RetryingOAuth.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/build.gradle.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/build.sbt.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/model.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pojo.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pom.mustache create mode 100644 modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml create mode 100644 samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/.gitignore create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator-ignore create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/FILES create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/VERSION create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/.travis.yml create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/README.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/build.gradle create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/build.sbt create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesAnyType.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesArray.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesBoolean.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesClass.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesInteger.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesNumber.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesObject.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesString.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Animal.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/AnimalFarm.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Apple.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/AppleReq.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/ArrayOfNumberOnly.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/ArrayTest.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Banana.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/BananaReq.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/BasquePig.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/BigCat.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Capitalization.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Cat.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/CatAllOf.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Category.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/ChildCat.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/ChildCatAllOf.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/ClassModel.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Client.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/ComplexQuadrilateral.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/DanishPig.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/DefaultApi.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/DeprecatedObject.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Dog.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/DogAllOf.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Drawing.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/EnumArrays.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/EnumClass.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/EnumTest.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/EquilateralTriangle.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeApi.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeClassnameTags123Api.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/FileSchemaTestClass.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Foo.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/FormatTest.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Fruit.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/FruitReq.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/GmFruit.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/GrandparentAnimal.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/HasOnlyReadOnly.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/HealthCheckResult.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/InlineResponseDefault.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/IsoscelesTriangle.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Mammal.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/MapTest.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Model200Response.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelApiResponse.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelReturn.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Name.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/NullableClass.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/NullableShape.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/NumberOnly.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/ObjectWithDeprecatedFields.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Order.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/OuterComposite.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/OuterEnum.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/OuterEnumDefaultValue.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/OuterEnumInteger.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/OuterEnumIntegerDefaultValue.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/ParentPet.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Pet.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/PetApi.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Pig.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Quadrilateral.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/QuadrilateralInterface.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/ReadOnlyFirst.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/ScaleneTriangle.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Shape.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/ShapeInterface.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/ShapeOrNull.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/SimpleQuadrilateral.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/SpecialModelName.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/StoreApi.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/StringBooleanMap.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Tag.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Triangle.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/TriangleInterface.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/TypeHolderDefault.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/TypeHolderExample.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/User.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/UserApi.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Whale.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/XmlItem.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Zebra.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/git_push.sh create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/gradle.properties create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/gradle/wrapper/gradle-wrapper.jar create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/gradle/wrapper/gradle-wrapper.properties create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/gradlew create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/gradlew.bat create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/hello.txt create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/pom.xml create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/settings.gradle create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/AndroidManifest.xml create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiCallback.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiClient.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiException.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiResponse.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/Configuration.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/GzipRequestInterceptor.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/Pair.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ProgressRequestBody.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ProgressResponseBody.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ServerConfiguration.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ServerVariable.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/StringUtil.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/AnotherFakeApi.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/DefaultApi.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeApi.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/PetApi.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/StoreApi.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/UserApi.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/Authentication.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/OAuth.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/OAuthFlow.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/RetryingOAuth.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Animal.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Apple.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AppleReq.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Banana.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/BananaReq.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/BasquePig.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Capitalization.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Cat.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/CatAllOf.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Category.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ChildCatAllOf.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ClassModel.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Client.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DanishPig.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DeprecatedObject.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Dog.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DogAllOf.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Drawing.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumArrays.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumClass.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EquilateralTriangle.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Foo.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FormatTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GrandparentAnimal.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/HealthCheckResult.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/InlineResponseDefault.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/MapTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Model200Response.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelApiResponse.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelReturn.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Name.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableClass.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NumberOnly.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Order.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterComposite.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterEnum.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterEnumInteger.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ParentPet.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pet.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ScaleneTriangle.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeInterface.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/SpecialModelName.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Tag.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/TriangleInterface.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/User.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Whale.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Zebra.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/ApiClientTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/ConfigurationTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/StringUtilTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/DefaultApiTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/FakeApiTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/PetApiTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/StoreApiTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/UserApiTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/auth/RetryingOAuthTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/AnimalTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/AppleReqTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/AppleTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ArrayTestTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/BananaReqTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/BananaTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/BasquePigTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/CapitalizationTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/CatAllOfTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/CatTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/CategoryTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ClassModelTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ClientTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ComplexQuadrilateralTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/DanishPigTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/DogAllOfTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/DogTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/DrawingTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/EnumArraysTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/EnumClassTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/EnumTestTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/EquilateralTriangleTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FooTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FormatTestTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FruitReqTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FruitTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/GmFruitTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/GrandparentAnimalTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/InlineResponseDefaultTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/IsoscelesTriangleTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/MammalTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/MapTestTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/Model200ResponseTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelReturnTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/NameTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/NullableClassTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/NullableShapeTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/NumberOnlyTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OrderTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OuterCompositeTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OuterEnumTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ParentPetTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/PigTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/QuadrilateralInterfaceTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/QuadrilateralTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ScaleneTriangleTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ShapeInterfaceTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ShapeOrNullTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ShapeTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/SimpleQuadrilateralTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/TagTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/TriangleInterfaceTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/TriangleTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/UserTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/WhaleTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ZebraTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java diff --git a/bin/configs/java-okhttp-gson-nextgen.yaml b/bin/configs/java-okhttp-gson-nextgen.yaml new file mode 100644 index 000000000000..b6b12f86bddc --- /dev/null +++ b/bin/configs/java-okhttp-gson-nextgen.yaml @@ -0,0 +1,9 @@ +generatorName: java +outputDir: samples/client/petstore/java/okhttp-gson-nextgen +library: okhttp-gson-nextgen +#inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml +templateDir: modules/openapi-generator/src/main/resources/Java +additionalProperties: + artifactId: petstore-okhttp-gson-nextgen + hideGenerationTimestamp: "true" diff --git a/docs/generators/java.md b/docs/generators/java.md index 8b360b4b427d..1160c36f8b96 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -38,7 +38,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |invokerPackage|root package for generated code| |org.openapitools.client| |java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |true| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| -|library|library template (sub-template) to use|
    **jersey1**
    HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libraries instead.
    **jersey2**
    HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x
    **feign**
    HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x.
    **okhttp-gson**
    [DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.
    **retrofit2**
    HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2/3]=true'. (RxJava 1.x or 2.x or 3.x)
    **resttemplate**
    HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x
    **webclient**
    HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x
    **resteasy**
    HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x
    **vertx**
    HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x
    **google-api-client**
    HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x
    **rest-assured**
    HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.10.x. Only for Java 8
    **native**
    HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+
    **microprofile**
    HTTP client: Microprofile client 1.x. JSON processing: JSON-B
    **apache-httpclient**
    HTTP client: Apache httpclient 4.x
    |okhttp-gson| +|library|library template (sub-template) to use|
    **jersey1**
    HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libraries instead.
    **jersey2**
    HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x
    **feign**
    HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x.
    **okhttp-gson**
    [DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.
    **okhttp-gson-nextgen**
    HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x.'. Better support for oneOf/anyOf with breaking changes. Will replace `okhttp-gson` in the 6.0.0 release.
    **retrofit2**
    HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2/3]=true'. (RxJava 1.x or 2.x or 3.x)
    **resttemplate**
    HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x
    **webclient**
    HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x
    **resteasy**
    HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x
    **vertx**
    HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x
    **google-api-client**
    HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x
    **rest-assured**
    HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.10.x. Only for Java 8
    **native**
    HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+
    **microprofile**
    HTTP client: Microprofile client 1.x. JSON processing: JSON-B
    **apache-httpclient**
    HTTP client: Apache httpclient 4.x
    |okhttp-gson| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |microprofileFramework|Framework for microprofile. Possible values "kumuluzee"| |null| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java index 0d9266020acf..965da6dbd770 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java @@ -80,6 +80,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen public static final String JERSEY2 = "jersey2"; public static final String NATIVE = "native"; public static final String OKHTTP_GSON = "okhttp-gson"; + public static final String OKHTTP_GSON_NEXTGEN = "okhttp-gson-nextgen"; public static final String RESTEASY = "resteasy"; public static final String RESTTEMPLATE = "resttemplate"; public static final String WEBCLIENT = "webclient"; @@ -168,6 +169,7 @@ public JavaClientCodegen() { supportedLibraries.put(JERSEY2, "HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x"); supportedLibraries.put(FEIGN, "HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x."); supportedLibraries.put(OKHTTP_GSON, "[DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'."); + supportedLibraries.put(OKHTTP_GSON_NEXTGEN, "HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x.'. Better support for oneOf/anyOf with breaking changes. Will replace `okhttp-gson` in the 6.0.0 release."); supportedLibraries.put(RETROFIT_2, "HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2/3]=true'. (RxJava 1.x or 2.x or 3.x)"); supportedLibraries.put(RESTTEMPLATE, "HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x"); supportedLibraries.put(WEBCLIENT, "HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x"); @@ -423,7 +425,7 @@ public void processOpts() { supportingFiles.add(new SupportingFile("ParamExpander.mustache", invokerFolder, "ParamExpander.java")); supportingFiles.add(new SupportingFile("EncodingUtils.mustache", invokerFolder, "EncodingUtils.java")); supportingFiles.add(new SupportingFile("auth/DefaultApi20Impl.mustache", authFolder, "DefaultApi20Impl.java")); - } else if (OKHTTP_GSON.equals(getLibrary()) || StringUtils.isEmpty(getLibrary())) { + } else if (OKHTTP_GSON.equals(getLibrary()) || StringUtils.isEmpty(getLibrary()) || OKHTTP_GSON_NEXTGEN.equals(getLibrary())) { // the "okhttp-gson" library template requires "ApiCallback.mustache" for async call supportingFiles.add(new SupportingFile("ApiCallback.mustache", invokerFolder, "ApiCallback.java")); supportingFiles.add(new SupportingFile("ApiResponse.mustache", invokerFolder, "ApiResponse.java")); @@ -431,6 +433,9 @@ public void processOpts() { supportingFiles.add(new SupportingFile("ProgressRequestBody.mustache", invokerFolder, "ProgressRequestBody.java")); supportingFiles.add(new SupportingFile("ProgressResponseBody.mustache", invokerFolder, "ProgressResponseBody.java")); supportingFiles.add(new SupportingFile("GzipRequestInterceptor.mustache", invokerFolder, "GzipRequestInterceptor.java")); + if (OKHTTP_GSON_NEXTGEN.equals(getLibrary())) { + supportingFiles.add(new SupportingFile("AbstractOpenApiSchema.mustache", modelsFolder, "AbstractOpenApiSchema.java")); + } // NOTE: below moved to postProcessOperationsWithModels //supportingFiles.add(new SupportingFile("auth/OAuthOkHttpClient.mustache", authFolder, "OAuthOkHttpClient.java")); @@ -615,7 +620,7 @@ public void processOpts() { // has OAuth defined if (ProcessUtils.hasOAuthMethods(openAPI)) { // for okhttp-gson (default), check to see if OAuth is defined and included OAuth-related files accordingly - if ((OKHTTP_GSON.equals(getLibrary()) || StringUtils.isEmpty(getLibrary()))) { + if ((OKHTTP_GSON.equals(getLibrary()) || StringUtils.isEmpty(getLibrary())) || OKHTTP_GSON_NEXTGEN.equals(getLibrary())) { supportingFiles.add(new SupportingFile("auth/OAuthOkHttpClient.mustache", authFolder, "OAuthOkHttpClient.java")); supportingFiles.add(new SupportingFile("auth/RetryingOAuth.mustache", authFolder, "RetryingOAuth.java")); } @@ -916,7 +921,7 @@ public Map postProcessModels(Map objs) { CodegenModel cm = (CodegenModel) mo.get("model"); cm.getVendorExtensions().putIfAbsent("x-implements", new ArrayList()); - if (JERSEY2.equals(getLibrary()) || NATIVE.equals(getLibrary())) { + if (JERSEY2.equals(getLibrary()) || NATIVE.equals(getLibrary()) || OKHTTP_GSON_NEXTGEN.equals(getLibrary())) { cm.getVendorExtensions().put("x-implements", new ArrayList()); if (cm.oneOf != null && !cm.oneOf.isEmpty() && cm.oneOf.contains("ModelNull")) { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/AbstractOpenApiSchema.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/AbstractOpenApiSchema.mustache new file mode 100644 index 000000000000..3ba02e44c0e3 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/AbstractOpenApiSchema.mustache @@ -0,0 +1,138 @@ +{{>licenseInfo}} + +package {{modelPackage}}; + +import {{invokerPackage}}.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}} +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + +{{>libraries/jersey2/additional_properties}} + +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ApiCallback.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ApiCallback.mustache new file mode 100644 index 000000000000..53b6a7b8e34f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ApiCallback.mustache @@ -0,0 +1,51 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ApiClient.mustache new file mode 100644 index 000000000000..732551cec585 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ApiClient.mustache @@ -0,0 +1,1737 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +{{#dynamicOperations}} +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.PathItem; +import io.swagger.v3.oas.models.parameters.Parameter; +import io.swagger.v3.oas.models.parameters.Parameter.StyleEnum; +import io.swagger.v3.parser.OpenAPIV3Parser; +{{/dynamicOperations}} +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; +{{#joda}} +import org.joda.time.DateTime; +import org.joda.time.LocalDate; +import org.joda.time.format.DateTimeFormatter; +{{/joda}} +{{#threetenbp}} +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.format.DateTimeFormatter; +{{/threetenbp}} +{{#hasOAuthMethods}} +import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; +import org.apache.oltu.oauth2.common.message.types.GrantType; +{{/hasOAuthMethods}} + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +{{#java8}} +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +{{/java8}} +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import {{invokerPackage}}.auth.Authentication; +import {{invokerPackage}}.auth.HttpBasicAuth; +import {{invokerPackage}}.auth.HttpBearerAuth; +import {{invokerPackage}}.auth.ApiKeyAuth; +{{#hasOAuthMethods}} +import {{invokerPackage}}.auth.OAuth; +import {{invokerPackage}}.auth.RetryingOAuth; +import {{invokerPackage}}.auth.OAuthFlow; +{{/hasOAuthMethods}} + +/** + *

    ApiClient class.

    + */ +public class ApiClient { + + private String basePath = "{{{basePath}}}"; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + {{#dynamicOperations}} + private Map operationLookupMap = new HashMap<>(); + + {{/dynamicOperations}} + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication).{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} + authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /** + * Basic constructor with custom OkHttpClient + * + * @param client a {@link okhttp3.OkHttpClient} object + */ + public ApiClient(OkHttpClient client) { + init(); + + httpClient = client; + + // Setup authentications (key: authentication name, value: authentication).{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} + authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + {{#hasOAuthMethods}} + {{#oauthMethods}} + {{#-first}} + /** + * Constructor for ApiClient to support access token retry on 401/403 configured with client ID + * + * @param clientId client ID + */ + public ApiClient(String clientId) { + this(clientId, null, null); + } + + /** + * Constructor for ApiClient to support access token retry on 401/403 configured with client ID and additional parameters + * + * @param clientId client ID + * @param parameters a {@link java.util.Map} of parameters + */ + public ApiClient(String clientId, Map parameters) { + this(clientId, null, parameters); + } + + /** + * Constructor for ApiClient to support access token retry on 401/403 configured with client ID, secret, and additional parameters + * + * @param clientId client ID + * @param clientSecret client secret + * @param parameters a {@link java.util.Map} of parameters + */ + public ApiClient(String clientId, String clientSecret, Map parameters) { + this(null, clientId, clientSecret, parameters); + } + + /** + * Constructor for ApiClient to support access token retry on 401/403 configured with base path, client ID, secret, and additional parameters + * + * @param basePath base path + * @param clientId client ID + * @param clientSecret client secret + * @param parameters a {@link java.util.Map} of parameters + */ + public ApiClient(String basePath, String clientId, String clientSecret, Map parameters) { + init(); + if (basePath != null) { + this.basePath = basePath; + } + +{{#hasOAuthMethods}} + String tokenUrl = "{{tokenUrl}}"; + if (!"".equals(tokenUrl) && !URI.create(tokenUrl).isAbsolute()) { + URI uri = URI.create(getBasePath()); + tokenUrl = uri.getScheme() + ":" + + (uri.getAuthority() != null ? "//" + uri.getAuthority() : "") + + tokenUrl; + if (!URI.create(tokenUrl).isAbsolute()) { + throw new IllegalArgumentException("OAuth2 token URL must be an absolute URL"); + } + } + RetryingOAuth retryingOAuth = new RetryingOAuth(tokenUrl, clientId, OAuthFlow.{{flow}}, clientSecret, parameters); + authentications.put( + "{{name}}", + retryingOAuth + ); + initHttpClient(Collections.singletonList(retryingOAuth)); +{{/hasOAuthMethods}} + // Setup authentications (key: authentication name, value: authentication).{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{/authMethods}} + + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + {{/-first}} + {{/oauthMethods}} + {{/hasOAuthMethods}} + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + {{#useGzipFeature}} + // Enable gzip request compression + builder.addInterceptor(new GzipRequestInterceptor()); + {{/useGzipFeature}} + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); + + authentications = new HashMap(); + {{#dynamicOperations}} + + OpenAPI openAPI = new OpenAPIV3Parser().read("openapi/openapi.yaml"); + createOperationLookupMap(openAPI); + {{/dynamicOperations}} + } + + /** + * Get base path + * + * @return Base path + */ + public String getBasePath() { + return basePath; + } + + /** + * Set base path + * + * @param basePath Base path of the URL (e.g {{{basePath}}} + * @return An instance of OkHttpClient + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + return this; + } + + /** + * Get HTTP client + * + * @return An instance of OkHttpClient + */ + public OkHttpClient getHttpClient() { + return httpClient; + } + + /** + * Set HTTP client, which must never be null. + * + * @param newHttpClient An instance of OkHttpClient + * @return Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

    Getter for the field keyManagers.

    + * + * @return an array of {@link javax.net.ssl.KeyManager} objects + */ + public KeyManager[] getKeyManagers() { + return keyManagers; + } + + /** + * Configure client keys to use for authorization in an SSL session. + * Use null to reset to default. + * + * @param managers The KeyManagers to use + * @return ApiClient + */ + public ApiClient setKeyManagers(KeyManager[] managers) { + this.keyManagers = managers; + applySslSettings(); + return this; + } + + /** + *

    Getter for the field dateFormat.

    + * + * @return a {@link java.text.DateFormat} object + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + *

    Setter for the field dateFormat.

    + * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link org.openapitools.client.ApiClient} object + */ + public ApiClient setDateFormat(DateFormat dateFormat) { + this.json.setDateFormat(dateFormat); + return this; + } + + /** + *

    Set SqlDateFormat.

    + * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link org.openapitools.client.ApiClient} object + */ + public ApiClient setSqlDateFormat(DateFormat dateFormat) { + this.json.setSqlDateFormat(dateFormat); + return this; + } + + {{#joda}} + public ApiClient setDateTimeFormat(DateTimeFormatter dateFormat) { + this.json.setDateTimeFormat(dateFormat); + return this; + } + + public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { + this.json.setLocalDateFormat(dateFormat); + return this; + } + + {{/joda}} + {{#jsr310}} + /** + *

    Set OffsetDateTimeFormat.

    + * + * @param dateFormat a {@link org.threeten.bp.format.DateTimeFormatter} object + * @return a {@link org.openapitools.client.ApiClient} object + */ + public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + this.json.setOffsetDateTimeFormat(dateFormat); + return this; + } + + /** + *

    Set LocalDateFormat.

    + * + * @param dateFormat a {@link org.threeten.bp.format.DateTimeFormatter} object + * @return a {@link org.openapitools.client.ApiClient} object + */ + public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { + this.json.setLocalDateFormat(dateFormat); + return this; + } + + {{/jsr310}} + /** + *

    Set LenientOnJson.

    + * + * @param lenientOnJson a boolean + * @return a {@link org.openapitools.client.ApiClient} object + */ + public ApiClient setLenientOnJson(boolean lenientOnJson) { + this.json.setLenientOnJson(lenientOnJson); + return this; + } + + /** + * Get authentications (key: authentication name, value: authentication). + * + * @return Map of authentication objects + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + {{#hasHttpBearerMethods}} + /** + * Helper method to set access token for the first Bearer authentication. + * @param bearerToken Bearer token + */ + public void setBearerToken(String bearerToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBearerAuth) { + ((HttpBearerAuth) auth).setBearerToken(bearerToken); + return; + } + } + throw new RuntimeException("No Bearer authentication configured!"); + } + {{/hasHttpBearerMethods}} + + /** + * Helper method to set username for the first HTTP basic authentication. + * + * @param username Username + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * + * @param password Password + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + * + * @param apiKey API key + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * + * @param apiKeyPrefix API key prefix + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set access token for the first OAuth2 authentication. + * + * @param accessToken Access token + */ + public void setAccessToken(String accessToken) { + {{#hasOAuthMethods}} + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setAccessToken(accessToken); + return; + } + } + {{/hasOAuthMethods}} + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Set the User-Agent header's value (by adding to the default header map). + * + * @param userAgent HTTP request's user agent + * @return ApiClient + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Add a default header. + * + * @param key The header's key + * @param value The header's value + * @return ApiClient + */ + public ApiClient addDefaultHeader(String key, String value) { + defaultHeaderMap.put(key, value); + return this; + } + + /** + * Add a default cookie. + * + * @param key The cookie's key + * @param value The cookie's value + * @return ApiClient + */ + public ApiClient addDefaultCookie(String key, String value) { + defaultCookieMap.put(key, value); + return this; + } + + /** + * Check that whether debugging is enabled for this API client. + * + * @return True if debugging is enabled, false otherwise. + */ + public boolean isDebugging() { + return debugging; + } + + /** + * Enable/disable debugging for this API client. + * + * @param debugging To enable (true) or disable (false) debugging + * @return ApiClient + */ + public ApiClient setDebugging(boolean debugging) { + if (debugging != this.debugging) { + if (debugging) { + loggingInterceptor = new HttpLoggingInterceptor(); + loggingInterceptor.setLevel(Level.BODY); + httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build(); + } else { + final OkHttpClient.Builder builder = httpClient.newBuilder(); + builder.interceptors().remove(loggingInterceptor); + httpClient = builder.build(); + loggingInterceptor = null; + } + } + this.debugging = debugging; + return this; + } + + /** + * The path of temporary folder used to store downloaded files from endpoints + * with file response. The default value is null, i.e. using + * the system's default temporary folder. + * + * @see createTempFile + * @return Temporary folder path + */ + public String getTempFolderPath() { + return tempFolderPath; + } + + /** + * Set the temporary folder path (for downloading files) + * + * @param tempFolderPath Temporary folder path + * @return ApiClient + */ + public ApiClient setTempFolderPath(String tempFolderPath) { + this.tempFolderPath = tempFolderPath; + return this; + } + + /** + * Get connection timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getConnectTimeout() { + return httpClient.connectTimeoutMillis(); + } + + /** + * Sets the connect timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param connectionTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setConnectTimeout(int connectionTimeout) { + httpClient = httpClient.newBuilder().connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Get read timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getReadTimeout() { + return httpClient.readTimeoutMillis(); + } + + /** + * Sets the read timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param readTimeout read timeout in milliseconds + * @return Api client + */ + public ApiClient setReadTimeout(int readTimeout) { + httpClient = httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Get write timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getWriteTimeout() { + return httpClient.writeTimeoutMillis(); + } + + /** + * Sets the write timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param writeTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setWriteTimeout(int writeTimeout) { + httpClient = httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + {{#hasOAuthMethods}} + /** + * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) + * + * @return Token request builder + */ + public TokenRequestBuilder getTokenEndPoint() { + for (Authentication apiAuth : authentications.values()) { + if (apiAuth instanceof RetryingOAuth) { + RetryingOAuth retryingOAuth = (RetryingOAuth) apiAuth; + return retryingOAuth.getTokenRequestBuilder(); + } + } + return null; + } + {{/hasOAuthMethods}} + + /** + * Format the given parameter object into string. + * + * @param param Parameter + * @return String representation of the parameter + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date {{#joda}}|| param instanceof DateTime || param instanceof LocalDate{{/joda}}{{#jsr310}}|| param instanceof OffsetDateTime || param instanceof LocalDate{{/jsr310}}) { + //Serialize to json string and remove the " enclosing characters + String jsonStr = json.serialize(param); + return jsonStr.substring(1, jsonStr.length() - 1); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for (Object o : (Collection) param) { + if (b.length() > 0) { + b.append(","); + } + b.append(String.valueOf(o)); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /** + * Formats the specified query parameter to a list containing a single {@code Pair} object. + * + * Note that {@code value} must not be a collection. + * + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list containing a single {@code Pair} object. + */ + public List parameterToPair(String name, Object value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value instanceof Collection) { + return params; + } + + params.add(new Pair(name, parameterToString(value))); + return params; + } + + {{^dynamicOperations}} + /** + * Formats the specified collection query parameters to a list of {@code Pair} objects. + * + * Note that the values of each of the returned Pair objects are percent-encoded. + * + * @param collectionFormat The collection format of the parameter. + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list of {@code Pair} objects. + */ + public List parameterToPairs(String collectionFormat, String name, Collection value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value.isEmpty()) { + return params; + } + + // create the params based on the collection format + if ("multi".equals(collectionFormat)) { + for (Object item : value) { + params.add(new Pair(name, escapeString(parameterToString(item)))); + } + return params; + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + // escape all delimiters except commas, which are URI reserved + // characters + if ("ssv".equals(collectionFormat)) { + delimiter = escapeString(" "); + } else if ("tsv".equals(collectionFormat)) { + delimiter = escapeString("\t"); + } else if ("pipes".equals(collectionFormat)) { + delimiter = escapeString("|"); + } + + StringBuilder sb = new StringBuilder(); + for (Object item : value) { + sb.append(delimiter); + sb.append(escapeString(parameterToString(item))); + } + + params.add(new Pair(name, sb.substring(delimiter.length()))); + + return params; + } + {{/dynamicOperations}} + {{#dynamicOperations}} + public List parameterToPairs(Parameter param, Collection value) { + List params = new ArrayList(); + + // preconditions + if (param == null || param.getName() == null || param.getName().isEmpty() || value == null) { + return params; + } + + // create the params based on the collection format + if (StyleEnum.FORM.equals(param.getStyle()) && Boolean.TRUE.equals(param.getExplode())) { + for (Object item : value) { + params.add(new Pair(param.getName(), escapeString(parameterToString(item)))); + } + return params; + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + // escape all delimiters except commas, which are URI reserved + // characters + if (StyleEnum.SPACEDELIMITED.equals(param.getStyle())) { + delimiter = escapeString(" "); + } else if (StyleEnum.PIPEDELIMITED.equals(param.getStyle())) { + delimiter = escapeString("|"); + } + + StringBuilder sb = new StringBuilder(); + for (Object item : value) { + sb.append(delimiter); + sb.append(escapeString(parameterToString(item))); + } + + params.add(new Pair(param.getName(), sb.substring(delimiter.length()))); + + return params; + } + {{/dynamicOperations}} + + /** + * Formats the specified collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param Type + * @param response HTTP response + * @param returnType The type of the Java object + * @return The deserialized Java object + * @throws org.openapitools.client.ApiException If fail to deserialize response body, i.e. cannot read response body + * or the Content-Type of the response is not supported. + */ + @SuppressWarnings("unchecked") + public T deserialize(Response response, Type returnType) throws ApiException { + if (response == null || returnType == null) { + return null; + } + + if ("byte[]".equals(returnType.toString())) { + // Handle binary response (byte array). + try { + return (T) response.body().bytes(); + } catch (IOException e) { + throw new ApiException(e); + } + } else if (returnType.equals(File.class)) { + // Handle file downloading. + return (T) downloadFileFromResponse(response); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return json.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws org.openapitools.client.ApiException If fail to serialize the given object + */ + public RequestBody serialize(Object obj, String contentType) throws ApiException { + if (obj instanceof byte[]) { + // Binary (byte array) body parameter support. + return RequestBody.create((byte[]) obj, MediaType.parse(contentType)); + } else if (obj instanceof File) { + // File body parameter support. + return RequestBody.create((File) obj, MediaType.parse(contentType)); + } else if (isJsonMime(contentType)) { + String content; + if (obj != null) { + content = json.serialize(obj); + } else { + content = null; + } + return RequestBody.create(content, MediaType.parse(contentType)); + } else { + throw new ApiException("Content type \"" + contentType + "\" is not supported"); + } + } + + /** + * Download file from the given response. + * + * @param response An instance of the Response object + * @throws org.openapitools.client.ApiException If fail to read file content from response and write to disk + * @return Downloaded file + */ + public File downloadFileFromResponse(Response response) throws ApiException { + try { + File file = prepareDownloadFile(response); + BufferedSink sink = Okio.buffer(Okio.sink(file)); + sink.writeAll(response.body().source()); + sink.close(); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * Prepare file for download + * + * @param response An instance of the Response object + * @return Prepared file for the download + * @throws java.io.IOException If fail to prepare file for download + */ + public File prepareDownloadFile(Response response) throws IOException { + String filename = null; + String contentDisposition = response.header("Content-Disposition"); + if (contentDisposition != null && !"".equals(contentDisposition)) { + // Get filename from the Content-Disposition header. + Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + Matcher matcher = pattern.matcher(contentDisposition); + if (matcher.find()) { + filename = sanitizeFilename(matcher.group(1)); + } + } + + String prefix = null; + String suffix = null; + if (filename == null) { + prefix = "download-"; + suffix = ""; + } else { + int pos = filename.lastIndexOf("."); + if (pos == -1) { + prefix = filename + "-"; + } else { + prefix = filename.substring(0, pos) + "-"; + suffix = filename.substring(pos); + } + // Files.createTempFile requires the prefix to be at least three characters long + if (prefix.length() < 3) + prefix = "download-"; + } + + if (tempFolderPath == null) + return Files.createTempFile(prefix, suffix).toFile(); + else + return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); + } + + /** + * {@link #execute(Call, Type)} + * + * @param Type + * @param call An instance of the Call object + * @return ApiResponse<T> + * @throws org.openapitools.client.ApiException If fail to execute the call + */ + public ApiResponse execute(Call call) throws ApiException { + return execute(call, null); + } + + /** + * Execute HTTP call and deserialize the HTTP response body into the given return type. + * + * @param returnType The return type used to deserialize HTTP response body + * @param The return type corresponding to (same with) returnType + * @param call Call + * @return ApiResponse object containing response status, headers and + * data, which is a Java object deserialized from response body and would be null + * when returnType is null. + * @throws org.openapitools.client.ApiException If fail to execute the call + */ + public ApiResponse execute(Call call, Type returnType) throws ApiException { + try { + Response response = call.execute(); + T data = handleResponse(response, returnType); + return new ApiResponse(response.code(), response.headers().toMultimap(), data); + } catch (IOException e) { + throw new ApiException(e); + } + } + + {{#supportStreaming}} + /** + *

    Execute stream.

    + * + * @param call a {@link okhttp3.Call} object + * @param returnType a {@link java.lang.reflect.Type} object + * @return a {@link java.io.InputStream} object + * @throws org.openapitools.client.ApiException if any. + */ + public InputStream executeStream(Call call, Type returnType) throws ApiException { + try { + Response response = call.execute(); + if (!response.isSuccessful()) { + throw new ApiException(response.code(), response.message()); + } + if (response.body() == null) { + return null; + } + return response.body().byteStream(); + } catch (IOException e) { + throw new ApiException(e); + } + } + + {{/supportStreaming}} + /** + * {@link #executeAsync(Call, Type, ApiCallback)} + * + * @param Type + * @param call An instance of the Call object + * @param callback ApiCallback<T> + */ + public void executeAsync(Call call, ApiCallback callback) { + executeAsync(call, null, callback); + } + + /** + * Execute HTTP call asynchronously. + * + * @param Type + * @param call The callback to be executed when the API call finishes + * @param returnType Return type + * @param callback ApiCallback + * @see #execute(Call, Type) + */ + @SuppressWarnings("unchecked") + public void executeAsync(Call call, final Type returnType, final ApiCallback callback) { + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, IOException e) { + callback.onFailure(new ApiException(e), 0, null); + } + + @Override + public void onResponse(Call call, Response response) throws IOException { + T result; + try { + result = (T) handleResponse(response, returnType); + } catch (ApiException e) { + callback.onFailure(e, response.code(), response.headers().toMultimap()); + return; + } catch (Exception e) { + callback.onFailure(new ApiException(e), response.code(), response.headers().toMultimap()); + return; + } + callback.onSuccess(result, response.code(), response.headers().toMultimap()); + } + }); + } + + /** + * Handle the given response, return the deserialized object when the response is successful. + * + * @param Type + * @param response Response + * @param returnType Return type + * @return Type + * @throws org.openapitools.client.ApiException If the response has an unsuccessful status code or + * fail to deserialize the response body + */ + public T handleResponse(Response response, Type returnType) throws ApiException { + if (response.isSuccessful()) { + if (returnType == null || response.code() == 204) { + // returning null if the returnType is not defined, + // or the status code is 204 (No Content) + if (response.body() != null) { + try { + response.body().close(); + } catch (Exception e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + return null; + } else { + return deserialize(response, returnType); + } + } else { + String respBody = null; + if (response.body() != null) { + try { + respBody = response.body().string(); + } catch (IOException e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody); + } + } + + /** + * Build HTTP call with the given options. + * + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param callback Callback for upload/download progress + * @return The HTTP call + * @throws org.openapitools.client.ApiException If fail to serialize the request body object + */ + public Call buildCall(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + Request request = buildRequest(path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); + + return httpClient.newCall(request); + } + + /** + * Build an HTTP request with the given options. + * + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param callback Callback for upload/download progress + * @return The HTTP request + * @throws org.openapitools.client.ApiException If fail to serialize the request body object + */ + public Request buildRequest(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentType)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentType)) { + reqBody = buildRequestBodyMultipart(formParams); + } else if (body == null) { + if ("DELETE".equals(method)) { + // allow calling DELETE without sending a request body + reqBody = null; + } else { + // use an empty request body (for POST, PUT and PATCH) + reqBody = RequestBody.create("", MediaType.parse(contentType)); + } + } else { + reqBody = serialize(body, contentType); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + processHeaderParams(headerParams, reqBuilder); + processCookieParams(cookieParams, reqBuilder); + + // Associate callback with request (if not null) so interceptor can + // access it when creating ProgressResponseBody + reqBuilder.tag(callback); + + Request request = null; + + if (callback != null && reqBody != null) { + ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, callback); + request = reqBuilder.method(method, progressRequestBody).build(); + } else { + request = reqBuilder.method(method, reqBody).build(); + } + + return request; + } + + /** + * Build full URL by concatenating base path, the given sub path and query parameters. + * + * @param path The sub path + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @return The full URL + */ + public String buildUrl(String path, List queryParams, List collectionQueryParams) { + final StringBuilder url = new StringBuilder(); + url.append(basePath).append(path); + + if (queryParams != null && !queryParams.isEmpty()) { + // support (constant) query string in `path`, e.g. "/posts?draft=1" + String prefix = path.contains("?") ? "&" : "?"; + for (Pair param : queryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + url.append(escapeString(param.getName())).append("=").append(escapeString(value)); + } + } + } + + if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { + String prefix = url.toString().contains("?") ? "&" : "?"; + for (Pair param : collectionQueryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + // collection query parameter value already escaped as part of parameterToPairs + url.append(escapeString(param.getName())).append("=").append(value); + } + } + } + + return url.toString(); + } + + /** + * Set header parameters to the request builder, including default headers. + * + * @param headerParams Header parameters in the form of Map + * @param reqBuilder Request.Builder + */ + public void processHeaderParams(Map headerParams, Request.Builder reqBuilder) { + for (Entry param : headerParams.entrySet()) { + reqBuilder.header(param.getKey(), parameterToString(param.getValue())); + } + for (Entry header : defaultHeaderMap.entrySet()) { + if (!headerParams.containsKey(header.getKey())) { + reqBuilder.header(header.getKey(), parameterToString(header.getValue())); + } + } + } + + /** + * Set cookie parameters to the request builder, including default cookies. + * + * @param cookieParams Cookie parameters in the form of Map + * @param reqBuilder Request.Builder + */ + public void processCookieParams(Map cookieParams, Request.Builder reqBuilder) { + for (Entry param : cookieParams.entrySet()) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + */ + public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, + Map cookieParams, String payload, String method, URI uri) throws ApiException { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) { + throw new RuntimeException("Authentication undefined: " + authName); + } + auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); + } + } + + /** + * Build a form-encoding request body with the given form parameters. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyFormEncoding(Map formParams) { + okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder(); + for (Entry param : formParams.entrySet()) { + formBuilder.add(param.getKey(), parameterToString(param.getValue())); + } + return formBuilder.build(); + } + + /** + * Build a multipart (file uploading) request body with the given form parameters, + * which could contain text fields and file fields. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyMultipart(Map formParams) { + MultipartBody.Builder mpBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + for (Entry param : formParams.entrySet()) { + if (param.getValue() instanceof File) { + File file = (File) param.getValue(); + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } else { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\""); + mpBuilder.addPart(partHeaders, RequestBody.create(parameterToString(param.getValue()), null)); + } + } + return mpBuilder.build(); + } + + /** + * Guess Content-Type header from the given file (defaults to "application/octet-stream"). + * + * @param file The given file + * @return The guessed Content-Type + */ + public String guessContentTypeFromFile(File file) { + String contentType = URLConnection.guessContentTypeFromName(file.getName()); + if (contentType == null) { + return "application/octet-stream"; + } else { + return contentType; + } + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + Integer.toString(index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + {{#dynamicOperations}} + + public ApiClient createOperationLookupMap(OpenAPI openAPI) { + operationLookupMap = new HashMap<>(); + for (Map.Entry pathItemEntry : openAPI.getPaths().entrySet()) { + String path = pathItemEntry.getKey(); + PathItem pathItem = pathItemEntry.getValue(); + addOperationLookupEntry(path, "GET", pathItem.getGet()); + addOperationLookupEntry(path, "PUT", pathItem.getPut()); + addOperationLookupEntry(path, "POST", pathItem.getPost()); + addOperationLookupEntry(path, "DELETE", pathItem.getDelete()); + addOperationLookupEntry(path, "OPTIONS", pathItem.getOptions()); + addOperationLookupEntry(path, "HEAD", pathItem.getHead()); + addOperationLookupEntry(path, "PATCH", pathItem.getPatch()); + addOperationLookupEntry(path, "TRACE", pathItem.getTrace()); + } + return this; + } + + private void addOperationLookupEntry(String path, String method, Operation operation) { + if ( operation != null && operation.getOperationId() != null) { + operationLookupMap.put( + operation.getOperationId(), + new ApiOperation(path, method, operation)); + } + } + + public Map getOperationLookupMap() { + return operationLookupMap; + } + + public String fillParametersFromOperation( + Operation operation, + Map paramMap, + String path, + List queryParams, + List collectionQueryParams, + Map headerParams, + Map cookieParams + ) { + for (Map.Entry entry : paramMap.entrySet()) { + Object value = entry.getValue(); + for (Parameter param : operation.getParameters()) { + if (entry.getKey().equals(param.getName())) { + switch (param.getIn()) { + case "path": + path = path.replaceAll("\\{" + param.getName() + "\\}", escapeString(value.toString())); + break; + case "query": + if (value instanceof Collection) { + collectionQueryParams.addAll(parameterToPairs(param, (Collection) value)); + } else { + queryParams.addAll(parameterToPair(param.getName(), value)); + } + break; + case "header": + headerParams.put(param.getName(), parameterToString(value)); + break; + case "cookie": + cookieParams.put(param.getName(), parameterToString(value)); + break; + default: + throw new IllegalStateException("Unexpected param in: " + param.getIn()); + } + + } + } + } + return path; + } + {{/dynamicOperations}} + + /** + * Convert the HTTP request body to a string. + * + * @param request The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ApiResponse.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ApiResponse.mustache new file mode 100644 index 000000000000..cecbaac1df27 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ApiResponse.mustache @@ -0,0 +1,75 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +import java.util.List; +import java.util.Map; +{{#caseInsensitiveResponseHeaders}} +import java.util.Map.Entry; +import java.util.TreeMap; +{{/caseInsensitiveResponseHeaders}} + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

    Constructor for ApiResponse.

    + * + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ + public ApiResponse(int statusCode, Map> headers) { + this(statusCode, headers, null); + } + + /** + *

    Constructor for ApiResponse.

    + * + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ + public ApiResponse(int statusCode, Map> headers, T data) { + this.statusCode = statusCode; + {{#caseInsensitiveResponseHeaders}} + Map> responseHeaders = new TreeMap>(String.CASE_INSENSITIVE_ORDER); + for(Entry> entry : headers.entrySet()){ + responseHeaders.put(entry.getKey().toLowerCase(), entry.getValue()); + } + {{/caseInsensitiveResponseHeaders}} + this.headers = {{#caseInsensitiveResponseHeaders}}responseHeaders{{/caseInsensitiveResponseHeaders}}{{^caseInsensitiveResponseHeaders}}headers{{/caseInsensitiveResponseHeaders}}; + this.data = data; + } + + /** + *

    Get the status code.

    + * + * @return the status code + */ + public int getStatusCode() { + return statusCode; + } + + /** + *

    Get the headers.

    + * + * @return a {@link java.util.Map} of headers + */ + public Map> getHeaders() { + return headers; + } + + /** + *

    Get the data.

    + * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/GzipRequestInterceptor.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/GzipRequestInterceptor.mustache new file mode 100644 index 000000000000..b633aa8f5864 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/GzipRequestInterceptor.mustache @@ -0,0 +1,74 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/JSON.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/JSON.mustache new file mode 100644 index 000000000000..91a7905d0bc1 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/JSON.mustache @@ -0,0 +1,553 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; +{{#joda}} +import org.joda.time.DateTime; +import org.joda.time.LocalDate; +import org.joda.time.format.DateTimeFormatter; +import org.joda.time.format.DateTimeFormatterBuilder; +import org.joda.time.format.ISODateTimeFormat; +{{/joda}} +{{#threetenbp}} +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.format.DateTimeFormatter; +{{/threetenbp}} + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +{{#java8}} +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +{{/java8}} +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private Gson gson; + private boolean isLenientOnJson = false; + private DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + {{#joda}} + private DateTimeTypeAdapter dateTimeTypeAdapter = new DateTimeTypeAdapter(); + private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + {{/joda}} + {{#jsr310}} + private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + {{/jsr310}} + private ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + {{#models}} + {{#model}} + {{#discriminator}} + .registerTypeSelector({{modelPackage}}.{{classname}}.class, new TypeSelector<{{modelPackage}}.{{classname}}>() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + {{#mappedModels}} + classByDiscriminatorValue.put("{{mappingName}}"{{^discriminatorCaseSensitive}}.toUpperCase(Locale.ROOT){{/discriminatorCaseSensitive}}, {{modelPackage}}.{{modelName}}.class); + {{/mappedModels}} + classByDiscriminatorValue.put("{{name}}"{{^discriminatorCaseSensitive}}.toUpperCase(Locale.ROOT){{/discriminatorCaseSensitive}}, {{modelPackage}}.{{classname}}.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "{{{propertyBaseName}}}")); + } + }) + {{/discriminator}} + {{/model}} + {{/models}} + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + {{#disableHtmlEscaping}} + builder.disableHtmlEscaping(); + {{/disableHtmlEscaping}} + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue{{^discriminatorCaseSensitive}}.toUpperCase(Locale.ROOT){{/discriminatorCaseSensitive}}); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + public JSON() { + gson = createGson() + .registerTypeAdapter(Date.class, dateTypeAdapter) + .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) + {{#joda}} + .registerTypeAdapter(DateTime.class, dateTimeTypeAdapter) + .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) + {{/joda}} + {{#jsr310}} + .registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter) + .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) + {{/jsr310}} + .registerTypeAdapter(byte[].class, byteArrayAdapter) + {{#models}} + {{#model}} + {{^isEnum}} + {{#oneOf}} + {{#-first}} + .registerTypeAdapterFactory(new {{modelPackage}}.{{{classname}}}.CustomTypeAdapterFactory()) + {{/-first}} + {{/oneOf}} + {{^oneOf}} + {{#anyOf}} + {{#-first}} + .registerTypeAdapterFactory(new {{modelPackage}}.{{{classname}}}.CustomTypeAdapterFactory()) + {{/-first}} + {{/anyOf}} + {{^anyOf}} + .registerTypeAdapterFactory(new {{modelPackage}}.{{{classname}}}.CustomTypeAdapterFactory()) + {{/anyOf}} + {{/oneOf}} + {{/isEnum}} + {{/model}} + {{/models}} + .create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public void setGson(Gson gson) { + this.gson = gson; + } + + public void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + {{#joda}} + /** + * Gson TypeAdapter for Joda DateTime type + */ + public class DateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public DateTimeTypeAdapter() { + this(new DateTimeFormatterBuilder() + .append(ISODateTimeFormat.dateTime().getPrinter(), ISODateTimeFormat.dateOptionalTimeParser().getParser()) + .toFormatter()); + } + + public DateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, DateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.print(date)); + } + } + + @Override + public DateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return formatter.parseDateTime(date); + } + } + } + + /** + * Gson TypeAdapter for Joda LocalDate type + */ + public class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(ISODateTimeFormat.date()); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.print(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return formatter.parseLocalDate(date); + } + } + } + + public void setDateTimeFormat(DateTimeFormatter dateFormat) { + dateTimeTypeAdapter.setFormat(dateFormat); + } + + public void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + {{/joda}} + {{#jsr310}} + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + {{/jsr310}} + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ProgressRequestBody.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ProgressRequestBody.mustache new file mode 100644 index 000000000000..71e1e2b4cbe8 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ProgressRequestBody.mustache @@ -0,0 +1,62 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ProgressResponseBody.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ProgressResponseBody.mustache new file mode 100644 index 000000000000..45115940b665 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/ProgressResponseBody.mustache @@ -0,0 +1,59 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/README.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/README.mustache new file mode 100644 index 000000000000..a1a142bd488c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/README.mustache @@ -0,0 +1,183 @@ +# {{artifactId}} + +{{appName}} +- API version: {{appVersion}} +{{^hideGenerationTimestamp}} + - Build date: {{generatedDate}} +{{/hideGenerationTimestamp}} + +{{{appDescriptionWithNewLines}}} + +{{#infoUrl}} + For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/infoUrl}} + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + {{{groupId}}} + {{{artifactId}}} + {{{artifactVersion}}} + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the '{{{artifactId}}}' jar has been published to maven central. + mavenLocal() // Needed if the '{{{artifactId}}}' jar has been published to the local maven repo. + } + + dependencies { + implementation "{{{groupId}}}:{{{artifactId}}}:{{{artifactVersion}}}" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/{{{artifactId}}}-{{{artifactVersion}}}.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java +{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} +// Import classes: +import {{{invokerPackage}}}.ApiClient; +import {{{invokerPackage}}}.ApiException; +import {{{invokerPackage}}}.Configuration;{{#hasAuthMethods}} +import {{{invokerPackage}}}.auth.*;{{/hasAuthMethods}} +import {{{invokerPackage}}}.models.*; +import {{{package}}}.{{{classname}}}; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("{{{basePath}}}"); + {{#hasAuthMethods}} + {{#authMethods}}{{#isBasic}}{{#isBasicBasic}} + // Configure HTTP basic authorization: {{{name}}} + HttpBasicAuth {{{name}}} = (HttpBasicAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setUsername("YOUR USERNAME"); + {{{name}}}.setPassword("YOUR PASSWORD");{{/isBasicBasic}}{{#isBasicBearer}} + // Configure HTTP bearer authorization: {{{name}}} + HttpBearerAuth {{{name}}} = (HttpBearerAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setBearerToken("BEARER TOKEN");{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} + // Configure API key authorization: {{{name}}} + ApiKeyAuth {{{name}}} = (ApiKeyAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}} + // Configure OAuth2 access token for authorization: {{{name}}} + OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}} + {{/authMethods}} + {{/hasAuthMethods}} + + {{{classname}}} apiInstance = new {{{classname}}}(defaultClient); + {{#allParams}} + {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} + {{/allParams}} + try { + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} + .{{{paramName}}}({{{paramName}}}){{/optionalParams}} + .execute();{{/vendorExtensions.x-group-parameters}}{{#returnType}} + System.out.println(result);{{/returnType}} + } catch (ApiException e) { + System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} +``` + +## Documentation for API Endpoints + +All URIs are relative to *{{basePath}}* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} + +## Documentation for Models + +{{#models}}{{#model}} - [{{classname}}]({{modelDocPath}}{{classname}}.md) +{{/model}}{{/models}} + +## Documentation for Authorization + +{{^authMethods}}All endpoints do not require authorization. +{{/authMethods}}Authentication schemes defined for the API: +{{#authMethods}}### {{name}} + +{{#isApiKey}}- **Type**: API key +- **API key parameter name**: {{keyParamName}} +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} +{{/isApiKey}} +{{#isBasic}}- **Type**: HTTP basic authentication +{{/isBasic}} +{{#isOAuth}}- **Type**: OAuth +- **Flow**: {{flow}} +- **Authorization URL**: {{authorizationUrl}} +- **Scopes**: {{^scopes}}N/A{{/scopes}} +{{#scopes}} - {{scope}}: {{description}} +{{/scopes}} +{{/isOAuth}} + +{{/authMethods}} + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + +{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} +{{/-last}}{{/apis}}{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache new file mode 100644 index 000000000000..a4c5c86ca2de --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache @@ -0,0 +1,183 @@ +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import {{invokerPackage}}.JSON; + +{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} +public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}}, {{{.}}}{{/vendorExtensions.x-implements}} { + private static final Logger log = Logger.getLogger({{classname}}.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!{{classname}}.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes '{{classname}}' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + {{#anyOf}} + final TypeAdapter<{{.}}> adapter{{.}} = gson.getDelegateAdapter(this, TypeToken.get({{.}}.class)); + {{/anyOf}} + + return (TypeAdapter) new TypeAdapter<{{classname}}>() { + @Override + public void write(JsonWriter out, {{classname}} value) throws IOException { + {{#anyOf}} + // check if the actual instance is of the type `{{.}}` + if (value.getActualInstance() instanceof {{.}}) { + JsonObject obj = adapter{{.}}.toJsonTree(({{.}})value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + {{/anyOf}} + throw new IOException("Failed to deserialize as the type doesn't match anyOf schemas: {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}"); + } + + @Override + public {{classname}} read(JsonReader in) throws IOException { + Object deserialized = null; + {{#useOneOfDiscriminatorLookup}} + {{#discriminator}} + // use discriminator value for faster anyOf lookup + {{classname}} new{{classname}} = new {{classname}}(); + String discriminatorValue = elementAdapter.read(in).getAsJsonObject().get("{{{propertyBaseName}}}").getAsString(); + switch (discriminatorValue) { + {{#mappedModels}} + case "{{{mappingName}}}": + deserialized = gson.fromJson(in, {{{modelName}}}.class); + new{{classname}}.setActualInstance(deserialized); + return new{{classname}}; + {{/mappedModels}} + default: + log.log(Level.WARNING, String.format("Failed to lookup discriminator value `%s` for {{classname}}. Possible values:{{#mappedModels}} {{{mappingName}}}{{/mappedModels}}", discriminatorValue)); + } + + {{/discriminator}} + {{/useOneOfDiscriminatorLookup}} + + {{#anyOf}} + // deserialize {{{.}}} + try { + deserialized = gson.fromJson(in, {{.}}.class); + log.log(Level.FINER, "Input data matches schema '{{{.}}}'"); + {{classname}} ret = new {{classname}}(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema '{{{.}}}'", e); + } + + {{/anyOf}} + throw new IOException("Failed deserialization for {{classname}}: no match found."); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in anyOf + public static final Map schemas = new HashMap(); + + public {{classname}}() { + super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); + } + + {{#anyOf}} + public {{classname}}({{{.}}} o) { + super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); + setActualInstance(o); + } + + {{/anyOf}} + static { + {{#anyOf}} + schemas.put("{{{.}}}", new GenericType<{{{.}}}>() { + }); + {{/anyOf}} + } + + @Override + public Map getSchemas() { + return {{classname}}.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check + * the instance parameter is valid against the anyOf child schemas: + * {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}} + * + * It could be an instance of the 'anyOf' schemas. + * The anyOf child schemas may themselves be a composed schema (allOf, anyOf, anyOf). + */ + @Override + public void setActualInstance(Object instance) { + {{#isNullable}} + if (instance == null) { + super.setActualInstance(instance); + return; + } + + {{/isNullable}} + {{#anyOf}} + if (instance instanceof {{{.}}}) { + super.setActualInstance(instance); + return; + } + + {{/anyOf}} + throw new RuntimeException("Invalid instance type. Must be {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}"); + } + + /** + * Get the actual instance, which can be the following: + * {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}} + * + * @return The actual instance ({{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + {{#anyOf}} + /** + * Get the actual instance of `{{{.}}}`. If the actual instance is not `{{{.}}}`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `{{{.}}}` + * @throws ClassCastException if the instance is not `{{{.}}}` + */ + public {{{.}}} get{{{.}}}() throws ClassCastException { + return ({{{.}}})super.getActualInstance(); + } + + {{/anyOf}} +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api.mustache new file mode 100644 index 000000000000..525d56fa5d51 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api.mustache @@ -0,0 +1,500 @@ +{{>licenseInfo}} + +package {{package}}; + +import {{invokerPackage}}.ApiCallback; +import {{invokerPackage}}.ApiClient; +import {{invokerPackage}}.ApiException; +{{#dynamicOperations}} +import {{invokerPackage}}.ApiOperation; +{{/dynamicOperations}} +import {{invokerPackage}}.ApiResponse; +import {{invokerPackage}}.Configuration; +import {{invokerPackage}}.Pair; +import {{invokerPackage}}.ProgressRequestBody; +import {{invokerPackage}}.ProgressResponseBody; +{{#performBeanValidation}} +import {{invokerPackage}}.BeanValidationException; +{{/performBeanValidation}} + +import com.google.gson.reflect.TypeToken; +{{#dynamicOperations}} +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.parameters.Parameter; +{{/dynamicOperations}} + +import java.io.IOException; + +{{#useBeanValidation}} +import javax.validation.constraints.*; +{{/useBeanValidation}} +{{#performBeanValidation}} +import javax.validation.ConstraintViolation; +import javax.validation.Validation; +import javax.validation.ValidatorFactory; +import javax.validation.executable.ExecutableValidator; +import java.util.Set; +import java.lang.reflect.Method; +import java.lang.reflect.Type; +{{/performBeanValidation}} + +{{#imports}}import {{import}}; +{{/imports}} + +import java.lang.reflect.Type; +{{^fullJavaUtil}} +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +{{#supportStreaming}} +import java.io.InputStream; +{{/supportStreaming}} +{{/fullJavaUtil}} + +{{#operations}} +public class {{classname}} { + private ApiClient localVarApiClient; + + public {{classname}}() { + this(Configuration.getDefaultApiClient()); + } + + public {{classname}}(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + {{#operation}} + {{^vendorExtensions.x-group-parameters}}/** + * Build call for {{operationId}}{{#allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}}{{/allParams}} + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + {{#responses.0}} + * @http.response.details + + + {{#responses}} + + {{/responses}} +
    Status Code Description Response Headers
    {{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
    {{/headers}}{{^headers.0}} - {{/headers.0}}
    + {{/responses.0}} + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} + {{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation + {{/externalDocs}} + */ + {{#isDeprecated}} + @Deprecated + {{/isDeprecated}} + public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} okhttp3.Call {{operationId}}Call({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback _callback) throws ApiException { + Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; + + // create path and map variables + {{^dynamicOperations}} + String localVarPath = "{{{path}}}"{{#pathParams}} + .replaceAll("\\{" + "{{baseName}}" + "\\}", localVarApiClient.escapeString({{#collectionFormat}}localVarApiClient.collectionPathParameterToString("{{{collectionFormat}}}", {{{paramName}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}.toString(){{/collectionFormat}})){{/pathParams}}; + {{/dynamicOperations}} + {{#dynamicOperations}} + ApiOperation apiOperation = localVarApiClient.getOperationLookupMap().get("{{{operationId}}}"); + if (apiOperation == null) { + throw new ApiException("Operation not found in OAS"); + } + Operation operation = apiOperation.getOperation(); + String localVarPath = apiOperation.getPath(); + Map paramMap = new HashMap<>(); + {{#allParams}} + {{^isFormParam}} + {{^isBodyParam}} + paramMap.put("{{baseName}}", {{paramName}}); + {{/isBodyParam}} + {{/isFormParam}} + {{/allParams}} + {{/dynamicOperations}} + + {{javaUtilPrefix}}List localVarQueryParams = new {{javaUtilPrefix}}ArrayList(); + {{javaUtilPrefix}}List localVarCollectionQueryParams = new {{javaUtilPrefix}}ArrayList(); + {{javaUtilPrefix}}Map localVarHeaderParams = new {{javaUtilPrefix}}HashMap(); + {{javaUtilPrefix}}Map localVarCookieParams = new {{javaUtilPrefix}}HashMap(); + {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}HashMap(); + + {{#formParams}} + if ({{paramName}} != null) { + localVarFormParams.put("{{baseName}}", {{paramName}}); + } + + {{/formParams}} + {{^dynamicOperations}} + {{#queryParams}} + if ({{paramName}} != null) { + {{#collectionFormat}}localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("{{{.}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(localVarApiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}})); + } + + {{/queryParams}} + {{#headerParams}} + if ({{paramName}} != null) { + localVarHeaderParams.put("{{baseName}}", localVarApiClient.parameterToString({{paramName}})); + } + + {{/headerParams}} + {{#cookieParams}} + if ({{paramName}} != null) { + localVarCookieParams.put("{{baseName}}", localVarApiClient.parameterToString({{paramName}})); + } + + {{/cookieParams}} + {{/dynamicOperations}} + {{#dynamicOperations}} + localVarPath = localVarApiClient.fillParametersFromOperation(operation, paramMap, localVarPath, localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarCookieParams); + + {{/dynamicOperations}} + final String[] localVarAccepts = { + {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; + return localVarApiClient.buildCall(localVarPath, {{^dynamicOperations}}"{{httpMethod}}"{{/dynamicOperations}}{{#dynamicOperations}}apiOperation.getMethod(){{/dynamicOperations}}, localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + {{#isDeprecated}} + @Deprecated + {{/isDeprecated}} + @SuppressWarnings("rawtypes") + private okhttp3.Call {{operationId}}ValidateBeforeCall({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback _callback) throws ApiException { + {{^performBeanValidation}} + {{#allParams}}{{#required}} + // verify the required parameter '{{paramName}}' is set + if ({{paramName}} == null) { + throw new ApiException("Missing the required parameter '{{paramName}}' when calling {{operationId}}(Async)"); + } + {{/required}}{{/allParams}} + + okhttp3.Call localVarCall = {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}_callback); + return localVarCall; + + {{/performBeanValidation}} + {{#performBeanValidation}} + try { + ValidatorFactory factory = Validation.buildDefaultValidatorFactory(); + ExecutableValidator executableValidator = factory.getValidator().forExecutables(); + + Object[] parameterValues = { {{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}} }; + Method method = this.getClass().getMethod("{{operationId}}WithHttpInfo"{{#allParams}}, {{#isArray}}java.util.List{{/isArray}}{{#isMap}}java.util.Map{{/isMap}}{{^isArray}}{{^isMap}}{{{dataType}}}{{/isMap}}{{/isArray}}.class{{/allParams}}); + Set> violations = executableValidator.validateParameters(this, method, + parameterValues); + + if (violations.size() == 0) { + okhttp3.Call localVarCall = {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}_callback); + return localVarCall; + + } else { + throw new BeanValidationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + + {{/performBeanValidation}} + } + + {{^vendorExtensions.x-group-parameters}} + /** + * {{summary}} + * {{notes}}{{#allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}}{{/allParams}}{{#returnType}} + * @return {{.}}{{/returnType}} + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + {{#responses.0}} + * @http.response.details + + + {{#responses}} + + {{/responses}} +
    Status Code Description Response Headers
    {{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
    {{/headers}}{{^headers.0}} - {{/headers.0}}
    + {{/responses.0}} + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} + {{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation + {{/externalDocs}} + */ + {{#isDeprecated}} + @Deprecated + {{/isDeprecated}} + {{#vendorExtensions.x-streaming}} + public {{#returnType}}InputStream {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { + {{#returnType}}InputStream localVarResp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + return localVarResp;{{/returnType}} + } + {{/vendorExtensions.x-streaming}} + {{^vendorExtensions.x-streaming}} + public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { + {{#returnType}}ApiResponse<{{{.}}}> localVarResp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + return localVarResp.getData();{{/returnType}} + } + {{/vendorExtensions.x-streaming}} + {{/vendorExtensions.x-group-parameters}} + + {{^vendorExtensions.x-group-parameters}}/** + * {{summary}} + * {{notes}}{{#allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}}{{/allParams}} + * @return ApiResponse<{{returnType}}{{^returnType}}Void{{/returnType}}> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + {{#responses.0}} + * @http.response.details + + + {{#responses}} + + {{/responses}} +
    Status Code Description Response Headers
    {{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
    {{/headers}}{{^headers.0}} - {{/headers.0}}
    + {{/responses.0}} + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} + {{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation + {{/externalDocs}} + */ + {{#isDeprecated}} + @Deprecated + {{/isDeprecated}} + public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-streaming}} InputStream {{operationId}}WithHttpInfo({{#allParams}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { + okhttp3.Call localVarCall = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}null); + {{#returnType}}Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); + return localVarApiClient.executeStream(localVarCall, localVarReturnType);{{/returnType}} + } + {{/vendorExtensions.x-streaming}}{{^vendorExtensions.x-streaming}} ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { + okhttp3.Call localVarCall = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}null); + {{#returnType}}Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType);{{/returnType}}{{^returnType}}return localVarApiClient.execute(localVarCall);{{/returnType}} + } + {{/vendorExtensions.x-streaming}} + + {{^vendorExtensions.x-group-parameters}}/** + * {{summary}} (asynchronously) + * {{notes}}{{#allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}}{{/allParams}} + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + {{#responses.0}} + * @http.response.details + + + {{#responses}} + + {{/responses}} +
    Status Code Description Response Headers
    {{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
    {{/headers}}{{^headers.0}} - {{/headers.0}}
    + {{/responses.0}} + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} + {{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation + {{/externalDocs}} + */ + {{#isDeprecated}} + @Deprecated + {{/isDeprecated}} + public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} okhttp3.Call {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback<{{{returnType}}}{{^returnType}}Void{{/returnType}}> _callback) throws ApiException { + + okhttp3.Call localVarCall = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}_callback); + {{#returnType}}Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);{{/returnType}}{{^returnType}}localVarApiClient.executeAsync(localVarCall, _callback);{{/returnType}} + return localVarCall; + } + {{#vendorExtensions.x-group-parameters}} + + public class API{{operationId}}Request { + {{#requiredParams}} + private final {{{dataType}}} {{paramName}}; + {{/requiredParams}} + {{#optionalParams}} + private {{{dataType}}} {{paramName}}; + {{/optionalParams}} + + private API{{operationId}}Request({{#requiredParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}) { + {{#requiredParams}} + this.{{paramName}} = {{paramName}}; + {{/requiredParams}} + } + + {{#optionalParams}} + /** + * Set {{paramName}} + * @param {{paramName}} {{description}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}) + * @return API{{operationId}}Request + */ + public API{{operationId}}Request {{paramName}}({{{dataType}}} {{paramName}}) { + this.{{paramName}} = {{paramName}}; + return this; + } + + {{/optionalParams}} + /** + * Build call for {{operationId}} + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + {{#responses.0}} + * @http.response.details + + + {{#responses}} + + {{/responses}} +
    Status Code Description Response Headers
    {{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
    {{/headers}}{{^headers.0}} - {{/headers.0}}
    + {{/responses.0}} + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} + */ + {{#isDeprecated}} + @Deprecated + {{/isDeprecated}} + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return {{operationId}}Call({{#allParams}}{{paramName}}, {{/allParams}}_callback); + } + + /** + * Execute {{operationId}} request{{#returnType}} + * @return {{.}}{{/returnType}} + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + {{#responses.0}} + * @http.response.details + + + {{#responses}} + + {{/responses}} +
    Status Code Description Response Headers
    {{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
    {{/headers}}{{^headers.0}} - {{/headers.0}}
    + {{/responses.0}} + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} + */ + {{#isDeprecated}} + @Deprecated + {{/isDeprecated}} + public {{{returnType}}}{{^returnType}}void{{/returnType}} execute() throws ApiException { + {{#returnType}}ApiResponse<{{{.}}}> localVarResp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + return localVarResp.getData();{{/returnType}} + } + + /** + * Execute {{operationId}} request with HTTP info returned + * @return ApiResponse<{{returnType}}{{^returnType}}Void{{/returnType}}> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + {{#responses.0}} + * @http.response.details + + + {{#responses}} + + {{/responses}} +
    Status Code Description Response Headers
    {{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
    {{/headers}}{{^headers.0}} - {{/headers.0}}
    + {{/responses.0}} + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} + */ + {{#isDeprecated}} + @Deprecated + {{/isDeprecated}} + public ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}> executeWithHttpInfo() throws ApiException { + return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + } + + /** + * Execute {{operationId}} request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + {{#responses.0}} + * @http.response.details + + + {{#responses}} + + {{/responses}} +
    Status Code Description Response Headers
    {{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
    {{/headers}}{{^headers.0}} - {{/headers.0}}
    + {{/responses.0}} + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} + */ + {{#isDeprecated}} + @Deprecated + {{/isDeprecated}} + public okhttp3.Call executeAsync(final ApiCallback<{{{returnType}}}{{^returnType}}Void{{/returnType}}> _callback) throws ApiException { + return {{operationId}}Async({{#allParams}}{{paramName}}, {{/allParams}}_callback); + } + } + + /** + * {{summary}} + * {{notes}}{{#requiredParams}} + * @param {{paramName}} {{description}} (required){{/requiredParams}} + * @return API{{operationId}}Request + {{#responses.0}} + * @http.response.details + + + {{#responses}} + + {{/responses}} +
    Status Code Description Response Headers
    {{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
    {{/headers}}{{^headers.0}} - {{/headers.0}}
    + {{/responses.0}} + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} + {{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation + {{/externalDocs}} + */ + {{#isDeprecated}} + @Deprecated + {{/isDeprecated}} + public API{{operationId}}Request {{operationId}}({{#requiredParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}) { + return new API{{operationId}}Request({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}); + } + {{/vendorExtensions.x-group-parameters}} + {{/operation}} +} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/apiException.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/apiException.mustache new file mode 100644 index 000000000000..4bec51da938e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/apiException.mustache @@ -0,0 +1,159 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +import java.util.Map; +import java.util.List; +{{#caseInsensitiveResponseHeaders}} +import java.util.Map.Entry; +import java.util.TreeMap; +{{/caseInsensitiveResponseHeaders}} + +/** + *

    ApiException class.

    + */ +@SuppressWarnings("serial") +{{>generatedAnnotation}} +public class ApiException extends{{#useRuntimeException}} RuntimeException {{/useRuntimeException}}{{^useRuntimeException}} Exception {{/useRuntimeException}}{ + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

    Constructor for ApiException.

    + */ + public ApiException() {} + + /** + *

    Constructor for ApiException.

    + * + * @param throwable a {@link java.lang.Throwable} object + */ + public ApiException(Throwable throwable) { + super(throwable); + } + + /** + *

    Constructor for ApiException.

    + * + * @param message the error message + */ + public ApiException(String message) { + super(message); + } + + /** + *

    Constructor for ApiException.

    + * + * @param message the error message + * @param throwable a {@link java.lang.Throwable} object + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { + super(message, throwable); + this.code = code; + {{#caseInsensitiveResponseHeaders}} + Map> headers = new TreeMap>(String.CASE_INSENSITIVE_ORDER); + for(Entry> entry : responseHeaders.entrySet()){ + headers.put(entry.getKey().toLowerCase(), entry.getValue()); + } + {{/caseInsensitiveResponseHeaders}} + this.responseHeaders = {{#caseInsensitiveResponseHeaders}}headers{{/caseInsensitiveResponseHeaders}}{{^caseInsensitiveResponseHeaders}}responseHeaders{{/caseInsensitiveResponseHeaders}}; + this.responseBody = responseBody; + } + + /** + *

    Constructor for ApiException.

    + * + * @param message the error message + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(String message, int code, Map> responseHeaders, String responseBody) { + this(message, (Throwable) null, code, responseHeaders, responseBody); + } + + /** + *

    Constructor for ApiException.

    + * + * @param message the error message + * @param throwable a {@link java.lang.Throwable} object + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + */ + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { + this(message, throwable, code, responseHeaders, null); + } + + /** + *

    Constructor for ApiException.

    + * + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, Map> responseHeaders, String responseBody) { + this((String) null, (Throwable) null, code, responseHeaders, responseBody); + } + + /** + *

    Constructor for ApiException.

    + * + * @param code HTTP status code + * @param message a {@link java.lang.String} object + */ + public ApiException(int code, String message) { + super(message); + this.code = code; + } + + /** + *

    Constructor for ApiException.

    + * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + {{#caseInsensitiveResponseHeaders}} + Map> headers = new TreeMap>(String.CASE_INSENSITIVE_ORDER); + for(Entry> entry : responseHeaders.entrySet()){ + headers.put(entry.getKey().toLowerCase(), entry.getValue()); + } + {{/caseInsensitiveResponseHeaders}} + this.responseHeaders = {{#caseInsensitiveResponseHeaders}}headers{{/caseInsensitiveResponseHeaders}}{{^caseInsensitiveResponseHeaders}}responseHeaders{{/caseInsensitiveResponseHeaders}}; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api_doc.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api_doc.mustache new file mode 100644 index 000000000000..5a4e3969c93d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api_doc.mustache @@ -0,0 +1,106 @@ +# {{classname}}{{#description}} +{{.}}{{/description}} + +All URIs are relative to *{{basePath}}* + +Method | HTTP request | Description +------------- | ------------- | ------------- +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} +{{/operation}}{{/operations}} + +{{#operations}} +{{#operation}} + +# **{{operationId}}**{{^vendorExtensions.x-group-parameters}} +> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}){{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}} +> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}}.{{paramName}}({{paramName}}){{/optionalParams}}.execute();{{/vendorExtensions.x-group-parameters}} + +{{summary}}{{#notes}} + +{{.}}{{/notes}} + +### Example +```java +// Import classes: +import {{{invokerPackage}}}.ApiClient; +import {{{invokerPackage}}}.ApiException; +import {{{invokerPackage}}}.Configuration;{{#hasAuthMethods}} +import {{{invokerPackage}}}.auth.*;{{/hasAuthMethods}} +import {{{invokerPackage}}}.models.*; +import {{{package}}}.{{{classname}}}; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("{{{basePath}}}"); + {{#hasAuthMethods}} + {{#authMethods}}{{#isBasic}}{{#isBasicBasic}} + // Configure HTTP basic authorization: {{{name}}} + HttpBasicAuth {{{name}}} = (HttpBasicAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setUsername("YOUR USERNAME"); + {{{name}}}.setPassword("YOUR PASSWORD");{{/isBasicBasic}}{{#isBasicBearer}} + // Configure HTTP bearer authorization: {{{name}}} + HttpBearerAuth {{{name}}} = (HttpBearerAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setBearerToken("BEARER TOKEN");{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} + // Configure API key authorization: {{{name}}} + ApiKeyAuth {{{name}}} = (ApiKeyAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}} + // Configure OAuth2 access token for authorization: {{{name}}} + OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}} + {{/authMethods}} + {{/hasAuthMethods}} + + {{{classname}}} apiInstance = new {{{classname}}}(defaultClient); + {{#allParams}} + {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} + {{/allParams}} + try { + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} + .{{{paramName}}}({{{paramName}}}){{/optionalParams}} + .execute();{{/vendorExtensions.x-group-parameters}}{{#returnType}} + System.out.println(result);{{/returnType}} + } catch (ApiException e) { + System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} +Name | Type | Description | Notes +------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +{{/allParams}} + +### Return type + +{{#returnType}}{{#returnTypeIsPrimitive}}**{{returnType}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{returnType}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}null (empty response body){{/returnType}} + +### Authorization + +{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{name}}](../README.md#{{name}}){{^-last}}, {{/-last}}{{/authMethods}} + +### HTTP request headers + + - **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} + - **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} + +{{#responses.0}} +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +{{#responses}} +**{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}}
    {{/headers}}{{^headers.0}} - {{/headers.0}} | +{{/responses}} +{{/responses.0}} + +{{/operation}} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api_test.mustache new file mode 100644 index 000000000000..98a30a60cd54 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api_test.mustache @@ -0,0 +1,56 @@ +{{>licenseInfo}} + +package {{package}}; + +import {{invokerPackage}}.ApiException; +{{#imports}}import {{import}}; +{{/imports}} +import org.junit.Test; +import org.junit.Ignore; + +{{^fullJavaUtil}} +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +{{#supportStreaming}} +import java.io.InputStream; +{{/supportStreaming}} +{{/fullJavaUtil}} + +/** + * API tests for {{classname}} + */ +@Ignore +public class {{classname}}Test { + + private final {{classname}} api = new {{classname}}(); + + {{#operations}}{{#operation}} + /** + * {{summary}} + * + * {{notes}} + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void {{operationId}}Test() throws ApiException { + {{#allParams}} + {{{dataType}}} {{paramName}} = null; + {{/allParams}} + {{#vendorExtensions.x-streaming}} + InputStream response = api.{{operationId}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} + .{{paramName}}({{paramName}}){{/optionalParams}} + .execute();{{/vendorExtensions.x-group-parameters}} + {{/vendorExtensions.x-streaming}} + {{^vendorExtensions.x-streaming}} + {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} + .{{paramName}}({{paramName}}){{/optionalParams}} + .execute();{{/vendorExtensions.x-group-parameters}} + {{/vendorExtensions.x-streaming}} + // TODO: test validations + } + {{/operation}}{{/operations}} +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/ApiKeyAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/ApiKeyAuth.mustache new file mode 100644 index 000000000000..a0dda669a899 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/ApiKeyAuth.mustache @@ -0,0 +1,69 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import {{invokerPackage}}.ApiException; +import {{invokerPackage}}.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +{{>generatedAnnotation}} +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/Authentication.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/Authentication.mustache new file mode 100644 index 000000000000..c4ad338c793b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/Authentication.mustache @@ -0,0 +1,25 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import {{invokerPackage}}.Pair; +import {{invokerPackage}}.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/HttpBasicAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/HttpBasicAuth.mustache new file mode 100644 index 000000000000..417a89e34ccd --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/HttpBasicAuth.mustache @@ -0,0 +1,46 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import {{invokerPackage}}.Pair; +import {{invokerPackage}}.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +import java.io.UnsupportedEncodingException; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/HttpBearerAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/HttpBearerAuth.mustache new file mode 100644 index 000000000000..c8a9fce29650 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/HttpBearerAuth.mustache @@ -0,0 +1,52 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import {{invokerPackage}}.ApiException; +import {{invokerPackage}}.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +{{>generatedAnnotation}} +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/OAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/OAuth.mustache new file mode 100644 index 000000000000..34d359857181 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/OAuth.mustache @@ -0,0 +1,31 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import {{invokerPackage}}.Pair; +import {{invokerPackage}}.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +{{>generatedAnnotation}} +public class OAuth implements Authentication { + private String accessToken; + + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (accessToken != null) { + headerParams.put("Authorization", "Bearer " + accessToken); + } + } +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/OAuthOkHttpClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/OAuthOkHttpClient.mustache new file mode 100644 index 000000000000..cb0e82505507 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/OAuthOkHttpClient.mustache @@ -0,0 +1,70 @@ +{{#hasOAuthMethods}} +package {{invokerPackage}}.auth; + +import okhttp3.OkHttpClient; +import okhttp3.MediaType; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; + +import org.apache.oltu.oauth2.client.HttpClient; +import org.apache.oltu.oauth2.client.request.OAuthClientRequest; +import org.apache.oltu.oauth2.client.response.OAuthClientResponse; +import org.apache.oltu.oauth2.client.response.OAuthClientResponseFactory; +import org.apache.oltu.oauth2.common.exception.OAuthProblemException; +import org.apache.oltu.oauth2.common.exception.OAuthSystemException; + +import java.io.IOException; +import java.util.Map; +import java.util.Map.Entry; + +public class OAuthOkHttpClient implements HttpClient { + private OkHttpClient client; + + public OAuthOkHttpClient() { + this.client = new OkHttpClient(); + } + + public OAuthOkHttpClient(OkHttpClient client) { + this.client = client; + } + + @Override + public T execute(OAuthClientRequest request, Map headers, + String requestMethod, Class responseClass) + throws OAuthSystemException, OAuthProblemException { + + MediaType mediaType = MediaType.parse("application/json"); + Request.Builder requestBuilder = new Request.Builder().url(request.getLocationUri()); + + if(headers != null) { + for (Entry entry : headers.entrySet()) { + if (entry.getKey().equalsIgnoreCase("Content-Type")) { + mediaType = MediaType.parse(entry.getValue()); + } else { + requestBuilder.addHeader(entry.getKey(), entry.getValue()); + } + } + } + + RequestBody body = request.getBody() != null ? RequestBody.create(request.getBody(), mediaType) : null; + requestBuilder.method(requestMethod, body); + + try { + Response response = client.newCall(requestBuilder.build()).execute(); + return OAuthClientResponseFactory.createCustomResponse( + response.body().string(), + response.body().contentType().toString(), + response.code(), + responseClass); + } catch (IOException e) { + throw new OAuthSystemException(e); + } + } + + @Override + public void shutdown() { + // Nothing to do here + } +} +{{/hasOAuthMethods}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/RetryingOAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/RetryingOAuth.mustache new file mode 100644 index 000000000000..137e266b5a29 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/auth/RetryingOAuth.mustache @@ -0,0 +1,184 @@ +{{#hasOAuthMethods}} +package {{invokerPackage}}.auth; + +import {{invokerPackage}}.ApiException; +import {{invokerPackage}}.Pair; + +import okhttp3.Interceptor; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; + +import org.apache.oltu.oauth2.client.OAuthClient; +import org.apache.oltu.oauth2.client.request.OAuthBearerClientRequest; +import org.apache.oltu.oauth2.client.request.OAuthClientRequest; +import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; +import org.apache.oltu.oauth2.client.response.OAuthJSONAccessTokenResponse; +import org.apache.oltu.oauth2.common.exception.OAuthProblemException; +import org.apache.oltu.oauth2.common.exception.OAuthSystemException; +import org.apache.oltu.oauth2.common.message.types.GrantType; + +import java.io.IOException; +import java.net.HttpURLConnection; +import java.net.URI; +import java.util.Map; +import java.util.List; + +public class RetryingOAuth extends OAuth implements Interceptor { + private OAuthClient oAuthClient; + + private TokenRequestBuilder tokenRequestBuilder; + + public RetryingOAuth(OkHttpClient client, TokenRequestBuilder tokenRequestBuilder) { + this.oAuthClient = new OAuthClient(new OAuthOkHttpClient(client)); + this.tokenRequestBuilder = tokenRequestBuilder; + } + + public RetryingOAuth(TokenRequestBuilder tokenRequestBuilder) { + this(new OkHttpClient(), tokenRequestBuilder); + } + + /** + @param tokenUrl The token URL to be used for this OAuth2 flow. + Applicable to the following OAuth2 flows: "password", "clientCredentials" and "authorizationCode". + The value must be an absolute URL. + @param clientId The OAuth2 client ID for the "clientCredentials" flow. + @param clientSecret The OAuth2 client secret for the "clientCredentials" flow. + */ + public RetryingOAuth( + String tokenUrl, + String clientId, + OAuthFlow flow, + String clientSecret, + Map parameters + ) { + this(OAuthClientRequest.tokenLocation(tokenUrl) + .setClientId(clientId) + .setClientSecret(clientSecret)); + setFlow(flow); + if (parameters != null) { + for (String paramName : parameters.keySet()) { + tokenRequestBuilder.setParameter(paramName, parameters.get(paramName)); + } + } + } + + public void setFlow(OAuthFlow flow) { + switch(flow) { + case accessCode: + tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE); + break; + case implicit: + tokenRequestBuilder.setGrantType(GrantType.IMPLICIT); + break; + case password: + tokenRequestBuilder.setGrantType(GrantType.PASSWORD); + break; + case application: + tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS); + break; + default: + break; + } + } + + @Override + public Response intercept(Chain chain) throws IOException { + return retryingIntercept(chain, true); + } + + private Response retryingIntercept(Chain chain, boolean updateTokenAndRetryOnAuthorizationFailure) throws IOException { + Request request = chain.request(); + + // If the request already has an authorization (e.g. Basic auth), proceed with the request as is + if (request.header("Authorization") != null) { + return chain.proceed(request); + } + + // Get the token if it has not yet been acquired + if (getAccessToken() == null) { + updateAccessToken(null); + } + + OAuthClientRequest oAuthRequest; + if (getAccessToken() != null) { + // Build the request + Request.Builder requestBuilder = request.newBuilder(); + + String requestAccessToken = getAccessToken(); + try { + oAuthRequest = + new OAuthBearerClientRequest(request.url().toString()). + setAccessToken(requestAccessToken). + buildHeaderMessage(); + } catch (OAuthSystemException e) { + throw new IOException(e); + } + + Map headers = oAuthRequest.getHeaders(); + for (String headerName : headers.keySet()) { + requestBuilder.addHeader(headerName, headers.get(headerName)); + } + requestBuilder.url(oAuthRequest.getLocationUri()); + + // Execute the request + Response response = chain.proceed(requestBuilder.build()); + + // 401/403 response codes most likely indicate an expired access token, unless it happens two times in a row + if ( + response != null && + ( response.code() == HttpURLConnection.HTTP_UNAUTHORIZED || + response.code() == HttpURLConnection.HTTP_FORBIDDEN ) && + updateTokenAndRetryOnAuthorizationFailure + ) { + try { + if (updateAccessToken(requestAccessToken)) { + response.body().close(); + return retryingIntercept(chain, false); + } + } catch (Exception e) { + response.body().close(); + throw e; + } + } + return response; + } + else { + return chain.proceed(chain.request()); + } + } + + /* + * Returns true if the access token has been updated + */ + public synchronized boolean updateAccessToken(String requestAccessToken) throws IOException { + if (getAccessToken() == null || getAccessToken().equals(requestAccessToken)) { + try { + OAuthJSONAccessTokenResponse accessTokenResponse = + oAuthClient.accessToken(tokenRequestBuilder.buildBodyMessage()); + if (accessTokenResponse != null && accessTokenResponse.getAccessToken() != null) { + setAccessToken(accessTokenResponse.getAccessToken()); + } + } catch (OAuthSystemException | OAuthProblemException e) { + throw new IOException(e); + } + } + return getAccessToken() == null || !getAccessToken().equals(requestAccessToken); + } + + public TokenRequestBuilder getTokenRequestBuilder() { + return tokenRequestBuilder; + } + + public void setTokenRequestBuilder(TokenRequestBuilder tokenRequestBuilder) { + this.tokenRequestBuilder = tokenRequestBuilder; + } + + // Applying authorization to parameters is performed in the retryingIntercept method + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + // No implementation necessary + } +} +{{/hasOAuthMethods}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/build.gradle.mustache new file mode 100644 index 000000000000..c97cb873e97b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/build.gradle.mustache @@ -0,0 +1,169 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +{{#sourceFolder}} +apply plugin: 'java' +{{/sourceFolder}} +apply plugin: 'com.diffplug.spotless' + +group = '{{groupId}}' +version = '{{artifactVersion}}' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.17.1' + } +} + +repositories { + mavenCentral() +} +{{#sourceFolder}} +sourceSets { + main.java.srcDirs = ['{{sourceFolder}}'] +} + +{{/sourceFolder}} +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task); + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = '{{artifactId}}' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.5.24' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.9.1' + implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1' + implementation 'com.google.code.gson:gson:2.8.6' + implementation 'io.gsonfire:gson-fire:1.8.4' + {{#openApiNullable}} + implementation 'org.openapitools:jackson-databind-nullable:0.2.1' + {{/openApiNullable}} + {{#hasOAuthMethods}} + implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.1' + {{/hasOAuthMethods}} + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.10' + {{#joda}} + implementation 'joda-time:joda-time:2.9.9' + {{/joda}} + {{#threetenbp}} + implementation 'org.threeten:threetenbp:1.4.3' + {{/threetenbp}} + {{#dynamicOperations}} + implementation 'io.swagger.parser.v3:swagger-parser-v3:2.0.23' + {{/dynamicOperations}} + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'junit:junit:4.13.1' + testImplementation 'org.mockito:mockito-core:3.11.2' +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/build.sbt.mustache new file mode 100644 index 000000000000..907e8a916ec9 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/build.sbt.mustache @@ -0,0 +1,39 @@ +lazy val root = (project in file(".")). + settings( + organization := "{{groupId}}", + name := "{{artifactId}}", + version := "{{artifactVersion}}", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.5.24", + "com.squareup.okhttp3" % "okhttp" % "4.9.1", + "com.squareup.okhttp3" % "logging-interceptor" % "4.9.1", + "com.google.code.gson" % "gson" % "2.8.6", + "org.apache.commons" % "commons-lang3" % "3.10", + {{#openApiNullable}} + "org.openapitools" % "jackson-databind-nullable" % "0.2.1", + {{/openApiNullable}} + {{#hasOAuthMethods}} + "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1", + {{/hasOAuthMethods}} + {{#joda}} + "joda-time" % "joda-time" % "2.9.9" % "compile", + {{/joda}} + {{#threetenbp}} + "org.threeten" % "threetenbp" % "1.4.3" % "compile", + {{/threetenbp}} + {{#dynamicOperations}} + "io.swagger.parser.v3" % "swagger-parser-v3" "2.0.23" % "compile" + {{/dynamicOperations}} + "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "junit" % "junit" % "4.13.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test" + ) + ) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/model.mustache new file mode 100644 index 000000000000..b6b0381a5cee --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/model.mustache @@ -0,0 +1,61 @@ +{{>licenseInfo}} + +package {{package}}; + +{{#useReflectionEqualsHashCode}} +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +{{/useReflectionEqualsHashCode}} +import java.util.Objects; +import java.util.Arrays; +{{#imports}} +import {{import}}; +{{/imports}} +{{#serializableModel}} +import java.io.Serializable; +{{/serializableModel}} +{{#jackson}} +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +{{#withXml}} +import com.fasterxml.jackson.dataformat.xml.annotation.*; +{{/withXml}} +{{#vendorExtensions.x-has-readonly-properties}} +import com.fasterxml.jackson.annotation.JsonCreator; +{{/vendorExtensions.x-has-readonly-properties}} +{{/jackson}} +{{#withXml}} +import javax.xml.bind.annotation.*; +{{/withXml}} +{{#jsonb}} +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; +{{#vendorExtensions.x-has-readonly-properties}} +import javax.json.bind.annotation.JsonbCreator; +{{/vendorExtensions.x-has-readonly-properties}} +{{/jsonb}} +{{#parcelableModel}} +import android.os.Parcelable; +import android.os.Parcel; +{{/parcelableModel}} +{{#useBeanValidation}} +import javax.validation.constraints.*; +import javax.validation.Valid; +{{/useBeanValidation}} +{{#performBeanValidation}} +import org.hibernate.validator.constraints.*; +{{/performBeanValidation}} + +{{#models}} +{{#model}} +{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#oneOf}}{{#-first}}{{>oneof_model}}{{/-first}}{{/oneOf}}{{^oneOf}}{{#anyOf}}{{#-first}}{{>anyof_model}}{{/-first}}{{/anyOf}}{{^anyOf}}{{>pojo}}{{/anyOf}}{{/oneOf}}{{/isEnum}} +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache new file mode 100644 index 000000000000..0b7c8b6369e1 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache @@ -0,0 +1,190 @@ +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import {{invokerPackage}}.JSON; + +{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} +public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}}, {{{.}}}{{/vendorExtensions.x-implements}} { + private static final Logger log = Logger.getLogger({{classname}}.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!{{classname}}.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes '{{classname}}' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + {{#oneOf}} + final TypeAdapter<{{.}}> adapter{{.}} = gson.getDelegateAdapter(this, TypeToken.get({{.}}.class)); + {{/oneOf}} + + return (TypeAdapter) new TypeAdapter<{{classname}}>() { + @Override + public void write(JsonWriter out, {{classname}} value) throws IOException { + {{#oneOf}} + // check if the actual instance is of the type `{{.}}` + if (value.getActualInstance() instanceof {{.}}) { + JsonObject obj = adapter{{.}}.toJsonTree(({{.}})value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + {{/oneOf}} + throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}"); + } + + @Override + public {{classname}} read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + {{#useOneOfDiscriminatorLookup}} + {{#discriminator}} + // use discriminator value for faster oneOf lookup + {{classname}} new{{classname}} = new {{classname}}(); + String discriminatorValue = elementAdapter.read(in).getAsJsonObject().get("{{{propertyBaseName}}}").getAsString(); + switch (discriminatorValue) { + {{#mappedModels}} + case "{{{mappingName}}}": + deserialized = adapter{{.}}.fromJsonTree(jsonObject); + new{{classname}}.setActualInstance(deserialized); + return new{{classname}}; + {{/mappedModels}} + default: + log.log(Level.WARNING, String.format("Failed to lookup discriminator value `%s` for {{classname}}. Possible values:{{#mappedModels}} {{{mappingName}}}{{/mappedModels}}", discriminatorValue)); + } + + {{/discriminator}} + {{/useOneOfDiscriminatorLookup}} + int match = 0; + + {{#oneOf}} + // deserialize {{{.}}} + try { + deserialized = adapter{{.}}.fromJsonTree(jsonObject); + match++; + log.log(Level.FINER, "Input data matches schema '{{{.}}}'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema '{{{.}}}'", e); + } + + {{/oneOf}} + if (match == 1) { + {{classname}} ret = new {{classname}}(); + ret.setActualInstance(deserialized); + return ret; + } + + throw new IOException(String.format("Failed deserialization for {{classname}}: %d classes match result, expected 1", match)); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public {{classname}}() { + super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); + } + + {{#oneOf}} + public {{classname}}({{{.}}} o) { + super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); + setActualInstance(o); + } + + {{/oneOf}} + static { + {{#oneOf}} + schemas.put("{{{.}}}", new GenericType<{{{.}}}>() { + }); + {{/oneOf}} + } + + @Override + public Map getSchemas() { + return {{classname}}.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}} + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + {{#isNullable}} + if (instance == null) { + super.setActualInstance(instance); + return; + } + + {{/isNullable}} + {{#oneOf}} + if (instance instanceof {{{.}}}) { + super.setActualInstance(instance); + return; + } + + {{/oneOf}} + throw new RuntimeException("Invalid instance type. Must be {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}"); + } + + /** + * Get the actual instance, which can be the following: + * {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}} + * + * @return The actual instance ({{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + {{#oneOf}} + /** + * Get the actual instance of `{{{.}}}`. If the actual instance is not `{{{.}}}`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `{{{.}}}` + * @throws ClassCastException if the instance is not `{{{.}}}` + */ + public {{{.}}} get{{{.}}}() throws ClassCastException { + return ({{{.}}})super.getActualInstance(); + } + + {{/oneOf}} +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pojo.mustache new file mode 100644 index 000000000000..df9dbc320d4e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pojo.mustache @@ -0,0 +1,445 @@ +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} + * @deprecated{{/isDeprecated}} + */{{#isDeprecated}} +@Deprecated{{/isDeprecated}}{{#description}} +@ApiModel(description = "{{{.}}}"){{/description}} +{{#jackson}} +@JsonPropertyOrder({ +{{#vars}} + {{classname}}.JSON_PROPERTY_{{nameInSnakeCase}}{{^-last}},{{/-last}} +{{/vars}} +}) +@JsonTypeName("{{name}}") +{{/jackson}} +{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} +public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ +{{#serializableModel}} + private static final long serialVersionUID = 1L; + +{{/serializableModel}} + {{#vars}} + {{#isEnum}} + {{^isContainer}} +{{>modelInnerEnum}} + {{/isContainer}} + {{#isContainer}} + {{#mostInnerItems}} +{{>modelInnerEnum}} + {{/mostInnerItems}} + {{/isContainer}} + {{/isEnum}} + {{#gson}} + public static final String SERIALIZED_NAME_{{nameInSnakeCase}} = "{{baseName}}"; + {{/gson}} + {{#jackson}} + public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; + {{/jackson}} + {{#withXml}} + {{#isXmlAttribute}} + @XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + {{/isXmlAttribute}} + {{^isXmlAttribute}} + {{^isContainer}} + @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + {{/isContainer}} + {{#isContainer}} + // Is a container wrapped={{isXmlWrapped}} + {{#items}} + // items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}} + // items.example={{example}} items.type={{dataType}} + @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + {{/items}} + {{#isXmlWrapped}} + @XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + {{/isXmlWrapped}} + {{/isContainer}} + {{/isXmlAttribute}} + {{/withXml}} + {{#gson}} + @SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}}) + {{/gson}} + {{#vendorExtensions.x-is-jackson-optional-nullable}} + {{#isContainer}} + private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined(); + {{/isContainer}} + {{^isContainer}} + private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}}; + {{/isContainer}} + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + {{#isContainer}} + private {{{datatypeWithEnum}}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}{{^required}} = null{{/required}}; + {{/isContainer}} + {{^isContainer}} + {{#isDiscriminator}}protected{{/isDiscriminator}}{{^isDiscriminator}}private{{/isDiscriminator}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; + {{/isContainer}} + {{/vendorExtensions.x-is-jackson-optional-nullable}} + + {{/vars}} + public {{classname}}() { {{#parent}}{{#parcelableModel}} + super();{{/parcelableModel}}{{/parent}}{{#gson}}{{#discriminator}} + this.{{{discriminatorName}}} = this.getClass().getSimpleName();{{/discriminator}}{{/gson}} + }{{#vendorExtensions.x-has-readonly-properties}}{{^withXml}} + + {{#jsonb}}@JsonbCreator{{/jsonb}}{{#jackson}}@JsonCreator{{/jackson}} + public {{classname}}( + {{#readOnlyVars}} + {{#jsonb}}@JsonbProperty("{{baseName}}"){{/jsonb}}{{#jackson}}@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}){{/jackson}} {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} + {{/readOnlyVars}} + ) { + this(); + {{#readOnlyVars}} + this.{{name}} = {{name}}; + {{/readOnlyVars}} + }{{/withXml}}{{/vendorExtensions.x-has-readonly-properties}} + {{#vars}} + + {{^isReadOnly}} + public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-is-jackson-optional-nullable}}this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}});{{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}}this.{{name}} = {{name}};{{/vendorExtensions.x-is-jackson-optional-nullable}} + return this; + } + {{#isArray}} + + public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + if (this.{{name}} == null || !this.{{name}}.isPresent()) { + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}); + } + try { + this.{{name}}.get().add({{name}}Item); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + {{^required}} + if (this.{{name}} == null) { + this.{{name}} = {{{defaultValue}}}; + } + {{/required}} + this.{{name}}.add({{name}}Item); + return this; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + } + {{/isArray}} + {{#isMap}} + + public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + if (this.{{name}} == null || !this.{{name}}.isPresent()) { + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}); + } + try { + this.{{name}}.get().put(key, {{name}}Item); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + {{^required}} + if (this.{{name}} == null) { + this.{{name}} = {{{defaultValue}}}; + } + {{/required}} + this.{{name}}.put(key, {{name}}Item); + return this; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + } + {{/isMap}} + + {{/isReadOnly}} + /** + {{#description}} + * {{.}} + {{/description}} + {{^description}} + * Get {{name}} + {{/description}} + {{#minimum}} + * minimum: {{.}} + {{/minimum}} + {{#maximum}} + * maximum: {{.}} + {{/maximum}} + * @return {{name}} + {{#deprecated}} + * @deprecated + {{/deprecated}} + **/ +{{#deprecated}} + @Deprecated +{{/deprecated}} +{{#required}} +{{#isNullable}} + @javax.annotation.Nullable +{{/isNullable}} +{{^isNullable}} + @javax.annotation.Nonnull +{{/isNullable}} +{{/required}} +{{^required}} + @javax.annotation.Nullable +{{/required}} +{{#jsonb}} + @JsonbProperty("{{baseName}}") +{{/jsonb}} +{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") +{{#vendorExtensions.x-extra-annotation}} + {{{vendorExtensions.x-extra-annotation}}} +{{/vendorExtensions.x-extra-annotation}} +{{#vendorExtensions.x-is-jackson-optional-nullable}} + {{!unannotated, Jackson would pick this up automatically and add it *in addition* to the _JsonNullable getter field}} + @JsonIgnore +{{/vendorExtensions.x-is-jackson-optional-nullable}} +{{^vendorExtensions.x-is-jackson-optional-nullable}}{{#jackson}}{{> jackson_annotations}}{{/jackson}}{{/vendorExtensions.x-is-jackson-optional-nullable}} + public {{{datatypeWithEnum}}} {{getter}}() { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + {{#isReadOnly}}{{! A readonly attribute doesn't have setter => jackson will set null directly if explicitly returned by API, so make sure we have an empty JsonNullable}} + if ({{name}} == null) { + {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}}; + } + {{/isReadOnly}} + return {{name}}.orElse(null); + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + return {{name}}; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + } + + {{#vendorExtensions.x-is-jackson-optional-nullable}} +{{> jackson_annotations}} + public JsonNullable<{{{datatypeWithEnum}}}> {{getter}}_JsonNullable() { + return {{name}}; + } + {{/vendorExtensions.x-is-jackson-optional-nullable}}{{#vendorExtensions.x-is-jackson-optional-nullable}} + @JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}) + {{#isReadOnly}}private{{/isReadOnly}}{{^isReadOnly}}public{{/isReadOnly}} void {{setter}}_JsonNullable(JsonNullable<{{{datatypeWithEnum}}}> {{name}}) { + {{! For getters/setters that have name differing from attribute name, we must include setter (albeit private) for jackson to be able to set the attribute}} + this.{{name}} = {{name}}; + } + {{/vendorExtensions.x-is-jackson-optional-nullable}} + + {{^isReadOnly}} +{{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}} +{{/vendorExtensions.x-setter-extra-annotation}}{{#jackson}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{> jackson_annotations}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{/jackson}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}}); + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + this.{{name}} = {{name}}; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + } + {{/isReadOnly}} + + {{/vars}} + + @Override + public boolean equals(Object o) { + {{#useReflectionEqualsHashCode}} + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + {{/useReflectionEqualsHashCode}} + {{^useReflectionEqualsHashCode}} + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + }{{#hasVars}} + {{classname}} {{classVarName}} = ({{classname}}) o; + return {{#vars}}{{#vendorExtensions.x-is-jackson-optional-nullable}}equalsNullable(this.{{name}}, {{classVarName}}.{{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{#isByteArray}}Arrays{{/isByteArray}}{{^isByteArray}}Objects{{/isByteArray}}.equals(this.{{name}}, {{classVarName}}.{{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^-last}} && + {{/-last}}{{/vars}}{{#parent}} && + super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}} + return {{#parent}}super.equals(o){{/parent}}{{^parent}}true{{/parent}};{{/hasVars}} + {{/useReflectionEqualsHashCode}} + }{{#vendorExtensions.x-jackson-optional-nullable-helpers}} + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + }{{/vendorExtensions.x-jackson-optional-nullable-helpers}} + + @Override + public int hashCode() { + {{#useReflectionEqualsHashCode}} + return HashCodeBuilder.reflectionHashCode(this); + {{/useReflectionEqualsHashCode}} + {{^useReflectionEqualsHashCode}} + return Objects.hash({{#vars}}{{#vendorExtensions.x-is-jackson-optional-nullable}}hashCodeNullable({{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{^isByteArray}}{{name}}{{/isByteArray}}{{#isByteArray}}Arrays.hashCode({{name}}){{/isByteArray}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{^-last}}, {{/-last}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}); + {{/useReflectionEqualsHashCode}} + }{{#vendorExtensions.x-jackson-optional-nullable-helpers}} + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + }{{/vendorExtensions.x-jackson-optional-nullable-helpers}} + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class {{classname}} {\n"); + {{#parent}} + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + {{/parent}} + {{#vars}} + sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n"); + {{/vars}} + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private{{#jsonb}} static{{/jsonb}} String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +{{#parcelableModel}} + + public void writeToParcel(Parcel out, int flags) { +{{#model}} +{{#isArray}} + out.writeList(this); +{{/isArray}} +{{^isArray}} +{{#parent}} + super.writeToParcel(out, flags); +{{/parent}} +{{#vars}} + out.writeValue({{name}}); +{{/vars}} +{{/isArray}} +{{/model}} + } + + {{classname}}(Parcel in) { +{{#isArray}} + in.readTypedList(this, {{arrayModelType}}.CREATOR); +{{/isArray}} +{{^isArray}} +{{#parent}} + super(in); +{{/parent}} +{{#vars}} +{{#isPrimitiveType}} + {{name}} = ({{{datatypeWithEnum}}})in.readValue(null); +{{/isPrimitiveType}} +{{^isPrimitiveType}} + {{name}} = ({{{datatypeWithEnum}}})in.readValue({{complexType}}.class.getClassLoader()); +{{/isPrimitiveType}} +{{/vars}} +{{/isArray}} + } + + public int describeContents() { + return 0; + } + + public static final Parcelable.Creator<{{classname}}> CREATOR = new Parcelable.Creator<{{classname}}>() { + public {{classname}} createFromParcel(Parcel in) { +{{#model}} +{{#isArray}} + {{classname}} result = new {{classname}}(); + result.addAll(in.readArrayList({{arrayModelType}}.class.getClassLoader())); + return result; +{{/isArray}} +{{^isArray}} + return new {{classname}}(in); +{{/isArray}} +{{/model}} + } + public {{classname}}[] newArray(int size) { + return new {{classname}}[size]; + } + }; +{{/parcelableModel}} + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + {{#allVars}} + openapiFields.add("{{baseName}}"); + {{/allVars}} + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + {{#requiredVars}} + openapiRequiredFields.add("{{baseName}}"); + {{/requiredVars}} + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!{{classname}}.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes '{{classname}}' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<{{classname}}> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get({{classname}}.class)); + + return (TypeAdapter) new TypeAdapter<{{classname}}>() { + @Override + public void write(JsonWriter out, {{classname}} value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public {{classname}} read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!{{classname}}.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `{{classname}}` properties"); + } + } + + {{#requiredVars}} + {{#-first}} + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : {{classname}}.openapiRequiredFields) { + if (obj.get(requiredField) == null) { + throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); + } + } + + {{/-first}} + {{/requiredVars}} + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pom.mustache new file mode 100644 index 000000000000..5d33c6ce25b1 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pom.mustache @@ -0,0 +1,420 @@ + + 4.0.0 + {{groupId}} + {{artifactId}} + jar + {{artifactId}} + {{artifactVersion}} + {{artifactUrl}} + {{artifactDescription}} + + {{scmConnection}} + {{scmDeveloperConnection}} + {{scmUrl}} + +{{#parentOverridden}} + + {{{parentGroupId}}} + {{{parentArtifactId}}} + {{{parentVersion}}} + +{{/parentOverridden}} + + + + {{licenseName}} + {{licenseUrl}} + repo + + + + + + {{developerName}} + {{developerEmail}} + {{developerOrganization}} + {{developerOrganizationUrl}} + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.0.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.0.0-M5 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + + test-jar + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.2.0 + + + add_sources + generate-sources + + add-source + + + + {{{sourceFolder}}} + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.3.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.0 + + + attach-sources + + jar-no-fork + + + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + io.swagger + swagger-annotations + ${swagger-core-version} + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.squareup.okhttp3 + okhttp + ${okhttp-version} + + + com.squareup.okhttp3 + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + {{#hasOAuthMethods}} + + org.apache.oltu.oauth2 + org.apache.oltu.oauth2.client + 1.0.1 + + {{/hasOAuthMethods}} + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + {{#joda}} + + joda-time + joda-time + ${jodatime-version} + + {{/joda}} + {{#threetenbp}} + + org.threeten + threetenbp + ${threetenbp-version} + + {{/threetenbp}} + {{#dynamicOperations}} + + io.swagger.parser.v3 + swagger-parser-v3 + 2.0.28 + + {{/dynamicOperations}} + {{#useBeanValidation}} + + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + provided + + {{/useBeanValidation}} + {{#performBeanValidation}} + + + org.hibernate + hibernate-validator + 5.4.3.Final + + + jakarta.el + jakarta.el-api + ${jakarta.el-version} + + {{/performBeanValidation}} + {{#parcelableModel}} + + + com.google.android + android + 4.1.1.4 + provided + + {{/parcelableModel}} + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + {{#openApiNullable}} + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + {{/openApiNullable}} + + javax.ws.rs + jsr311-api + 1.1.1 + + + javax.ws.rs + javax.ws.rs-api + 2.0 + + + + junit + junit + ${junit-version} + test + + + org.mockito + mockito-core + 3.12.4 + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.3 + 4.9.2 + 2.8.8 + 3.12.0 + {{#openApiNullable}} + 0.2.1 + {{/openApiNullable}} + {{#joda}} + 2.10.9 + {{/joda}} + {{#threetenbp}} + 1.5.0 + {{/threetenbp}} + 1.3.5 +{{#performBeanValidation}} + 3.0.3 +{{/performBeanValidation}} +{{#useBeanValidation}} + 2.0.2 +{{/useBeanValidation}} + 4.13.2 + UTF-8 + 2.17.3 + + diff --git a/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml b/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml new file mode 100644 index 000000000000..92b32a47679d --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml @@ -0,0 +1,2145 @@ +openapi: 3.0.0 +info: + description: >- + This spec is mainly for testing Petstore server and contains fake endpoints, + models. Please do not use this for any other purpose. Special characters: " + \ + version: 1.0.0 + title: OpenAPI Petstore + license: + name: Apache-2.0 + url: 'https://www.apache.org/licenses/LICENSE-2.0.html' +tags: + - name: pet + description: Everything about your Pets + - name: store + description: Access to Petstore orders + - name: user + description: Operations about user +paths: + /foo: + get: + responses: + default: + description: response + content: + application/json: + schema: + type: object + properties: + string: + $ref: '#/components/schemas/Foo' + /pet: + servers: + - url: 'http://petstore.swagger.io/v2' + - url: 'http://path-server-test.petstore.local/v2' + post: + tags: + - pet + summary: Add a new pet to the store + description: '' + operationId: addPet + responses: + '405': + description: Invalid input + security: + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + put: + tags: + - pet + summary: Update an existing pet + description: '' + operationId: updatePet + responses: + '400': + description: Invalid ID supplied + '404': + description: Pet not found + '405': + description: Validation exception + security: + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + /pet/findByStatus: + get: + tags: + - pet + summary: Finds Pets by status + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - name: status + in: query + description: Status values that need to be considered for filter + required: true + style: form + explode: false + deprecated: true + schema: + type: array + items: + type: string + enum: + - available + - pending + - sold + default: available + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid status value + security: + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + /pet/findByTags: + get: + tags: + - pet + summary: Finds Pets by tags + description: >- + Multiple tags can be provided with comma separated strings. Use tag1, + tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - name: tags + in: query + description: Tags to filter by + required: true + style: form + explode: false + schema: + type: array + items: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid tag value + security: + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + deprecated: true + '/pet/{petId}': + get: + tags: + - pet + summary: Find pet by ID + description: Returns a single pet + operationId: getPetById + parameters: + - name: petId + in: path + description: ID of pet to return + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid ID supplied + '404': + description: Pet not found + security: + - api_key: [] + post: + tags: + - pet + summary: Updates a pet in the store with form data + description: '' + operationId: updatePetWithForm + parameters: + - name: petId + in: path + description: ID of pet that needs to be updated + required: true + schema: + type: integer + format: int64 + responses: + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + delete: + tags: + - pet + summary: Deletes a pet + description: '' + operationId: deletePet + parameters: + - name: api_key + in: header + required: false + schema: + type: string + - name: petId + in: path + description: Pet id to delete + required: true + schema: + type: integer + format: int64 + responses: + '400': + description: Invalid pet value + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + '/pet/{petId}/uploadImage': + post: + tags: + - pet + summary: uploads an image + description: '' + operationId: uploadFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + type: string + format: binary + /store/inventory: + get: + tags: + - store + summary: Returns pet inventories by status + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + additionalProperties: + type: integer + format: int32 + security: + - api_key: [] + /store/order: + post: + tags: + - store + summary: Place an order for a pet + description: '' + operationId: placeOrder + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid Order + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + '/store/order/{order_id}': + get: + tags: + - store + summary: Find purchase order by ID + description: >- + For valid response try integer IDs with value <= 5 or > 10. Other values + will generated exceptions + operationId: getOrderById + parameters: + - name: order_id + in: path + description: ID of pet that needs to be fetched + required: true + schema: + type: integer + format: int64 + minimum: 1 + maximum: 5 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid ID supplied + '404': + description: Order not found + delete: + tags: + - store + summary: Delete purchase order by ID + description: >- + For valid response try integer IDs with value < 1000. Anything above + 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - name: order_id + in: path + description: ID of the order that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid ID supplied + '404': + description: Order not found + /user: + post: + tags: + - user + summary: Create user + description: This can only be done by the logged in user. + operationId: createUser + responses: + default: + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + /user/createWithArray: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithArrayInput + responses: + default: + description: successful operation + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/createWithList: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithListInput + responses: + default: + description: successful operation + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/login: + get: + tags: + - user + summary: Logs user into the system + description: '' + operationId: loginUser + parameters: + - name: username + in: query + description: The user name for login + required: true + schema: + type: string + - name: password + in: query + description: The password for login in clear text + required: true + schema: + type: string + responses: + '200': + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + type: integer + format: int32 + X-Expires-After: + description: date in UTC when token expires + schema: + type: string + format: date-time + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + '400': + description: Invalid username/password supplied + /user/logout: + get: + tags: + - user + summary: Logs out current logged in user session + description: '' + operationId: logoutUser + responses: + default: + description: successful operation + '/user/{username}': + get: + tags: + - user + summary: Get user by user name + description: '' + operationId: getUserByName + parameters: + - name: username + in: path + description: The name that needs to be fetched. Use user1 for testing. + required: true + schema: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + '400': + description: Invalid username supplied + '404': + description: User not found + put: + tags: + - user + summary: Updated user + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - name: username + in: path + description: name that need to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid user supplied + '404': + description: User not found + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + delete: + tags: + - user + summary: Delete user + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - name: username + in: path + description: The name that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid username supplied + '404': + description: User not found + /fake_classname_test: + patch: + tags: + - 'fake_classname_tags 123#$%^' + summary: To test class name in snake case + description: To test class name in snake case + operationId: testClassname + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + security: + - api_key_query: [] + requestBody: + $ref: '#/components/requestBodies/Client' + /fake: + patch: + tags: + - fake + summary: To test "client" model + description: To test "client" model + operationId: testClientModel + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + requestBody: + $ref: '#/components/requestBodies/Client' + get: + tags: + - fake + summary: To test enum parameters + description: To test enum parameters + operationId: testEnumParameters + parameters: + - name: enum_header_string_array + in: header + description: Header parameter enum test (string array) + schema: + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + - name: enum_header_string + in: header + description: Header parameter enum test (string) + schema: + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + - name: enum_query_string_array + in: query + description: Query parameter enum test (string array) + schema: + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + - name: enum_query_string + in: query + description: Query parameter enum test (string) + schema: + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + - name: enum_query_integer + in: query + description: Query parameter enum test (double) + schema: + type: integer + format: int32 + enum: + - 1 + - -2 + - name: enum_query_double + in: query + description: Query parameter enum test (double) + schema: + type: number + format: double + enum: + - 1.1 + - -1.2 + responses: + '400': + description: Invalid request + '404': + description: Not found + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + enum_form_string: + description: Form parameter enum test (string) + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + post: + tags: + - fake + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + responses: + '400': + description: Invalid username supplied + '404': + description: User not found + security: + - http_basic_test: [] + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + integer: + description: None + type: integer + minimum: 10 + maximum: 100 + int32: + description: None + type: integer + format: int32 + minimum: 20 + maximum: 200 + int64: + description: None + type: integer + format: int64 + number: + description: None + type: number + minimum: 32.1 + maximum: 543.2 + float: + description: None + type: number + format: float + maximum: 987.6 + double: + description: None + type: number + format: double + minimum: 67.8 + maximum: 123.4 + string: + description: None + type: string + pattern: '/[a-z]/i' + pattern_without_delimiter: + description: None + type: string + pattern: '^[A-Z].*' + byte: + description: None + type: string + format: byte + binary: + description: None + type: string + format: binary + date: + description: None + type: string + format: date + dateTime: + description: None + type: string + format: date-time + default: '2010-02-01T10:20:10.11111+01:00' + example: '2020-02-02T20:20:20.22222Z' + password: + description: None + type: string + format: password + minLength: 10 + maxLength: 64 + callback: + description: None + type: string + required: + - number + - double + - pattern_without_delimiter + - byte + delete: + tags: + - fake + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + x-group-parameters: true + parameters: + - name: required_string_group + in: query + description: Required String in group parameters + required: true + schema: + type: integer + - name: required_boolean_group + in: header + description: Required Boolean in group parameters + required: true + schema: + type: boolean + - name: required_int64_group + in: query + description: Required Integer in group parameters + required: true + schema: + type: integer + format: int64 + - name: string_group + in: query + description: String in group parameters + schema: + type: integer + - name: boolean_group + in: header + description: Boolean in group parameters + schema: + type: boolean + - name: int64_group + in: query + description: Integer in group parameters + schema: + type: integer + format: int64 + responses: + '400': + description: Someting wrong + /fake/outer/number: + post: + tags: + - fake + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + responses: + '200': + description: Output number + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + /fake/outer/string: + post: + tags: + - fake + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + responses: + '200': + description: Output string + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + /fake/outer/boolean: + post: + tags: + - fake + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + responses: + '200': + description: Output boolean + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + /fake/outer/composite: + post: + tags: + - fake + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + responses: + '200': + description: Output composite + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + /fake/jsonFormData: + get: + tags: + - fake + summary: test json serialization of form data + description: '' + operationId: testJsonFormData + responses: + '200': + description: successful operation + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + /fake/inline-additionalProperties: + post: + tags: + - fake + summary: test inline additionalProperties + description: '' + operationId: testInlineAdditionalProperties + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: + type: string + description: request body + required: true + /fake/body-with-query-params: + put: + tags: + - fake + operationId: testBodyWithQueryParams + parameters: + - name: query + in: query + required: true + schema: + type: string + responses: + '200': + description: Success + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + /another-fake/dummy: + patch: + tags: + - $another-fake? + summary: To test special tags + description: To test special tags and operation ID starting with number + operationId: '123_test_@#$%_special_tags' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + requestBody: + $ref: '#/components/requestBodies/Client' + /fake/body-with-file-schema: + put: + tags: + - fake + description: >- + For this test, the body for this request much reference a schema named + `File`. + operationId: testBodyWithFileSchema + responses: + '200': + description: Success + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + /fake/test-query-parameters: + put: + tags: + - fake + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - name: pipe + in: query + required: true + schema: + type: array + items: + type: string + - name: ioutil + in: query + required: true + style: form + explode: false + schema: + type: array + items: + type: string + - name: http + in: query + required: true + style: spaceDelimited + schema: + type: array + items: + type: string + - name: url + in: query + required: true + style: form + explode: false + schema: + type: array + items: + type: string + - name: context + in: query + required: true + explode: true + schema: + type: array + items: + type: string + responses: + "200": + description: Success + '/fake/{petId}/uploadImageWithRequiredFile': + post: + tags: + - pet + summary: uploads an image (required) + description: '' + operationId: uploadFileWithRequiredFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + type: string + format: binary + required: + - requiredFile + /fake/health: + get: + tags: + - fake + summary: Health check endpoint + responses: + 200: + description: The instance started successfully + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + /fake/array-of-enums: + get: + tags: + - fake + summary: Array of Enums + operationId: getArrayOfEnums + responses: + 200: + description: Got named array of enums + content: + application/json: + schema: + $ref: '#/components/schemas/ArrayOfEnums' +servers: + - url: 'http://{server}.swagger.io:{port}/v2' + description: petstore server + variables: + server: + enum: + - 'petstore' + - 'qa-petstore' + - 'dev-petstore' + default: 'petstore' + port: + enum: + - 80 + - 8080 + default: 80 + - url: https://localhost:8080/{version} + description: The local server + variables: + version: + enum: + - 'v1' + - 'v2' + default: 'v2' + - url: https://127.0.0.1/no_variable + description: The local server without variables +components: + requestBodies: + UserArray: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + examples: + simple-list: + summary: Simple list example + description: Should not get into code examples + value: + - username: foo + - username: bar + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + securitySchemes: + petstore_auth: + type: oauth2 + flows: + implicit: + authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog' + scopes: + 'write:pets': modify pets in your account + 'read:pets': read your pets + api_key: + type: apiKey + name: api_key + in: header + api_key_query: + type: apiKey + name: api_key_query + in: query + http_basic_test: + type: http + scheme: basic + bearer_test: + type: http + scheme: bearer + bearerFormat: JWT + http_signature_test: + # Test the 'HTTP signature' security scheme. + # Each HTTP request is cryptographically signed as specified + # in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ + type: http + scheme: signature + schemas: + Foo: + type: object + properties: + bar: + $ref: '#/components/schemas/Bar' + Bar: + type: string + default: bar + Order: + type: object + properties: + id: + type: integer + format: int64 + petId: + type: integer + format: int64 + quantity: + type: integer + format: int32 + shipDate: + type: string + format: date-time + example: '2020-02-02T20:20:20.000222Z' + status: + type: string + description: Order Status + enum: + - placed + - approved + - delivered + complete: + type: boolean + default: false + xml: + name: Order + Category: + type: object + required: + - name + properties: + id: + type: integer + format: int64 + name: + type: string + default: default-name + xml: + name: Category + User: + type: object + properties: + id: + type: integer + format: int64 + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + type: integer + format: int32 + description: User Status + objectWithNoDeclaredProps: + type: object + # Note: the 'additionalProperties' keyword is not specified, which is + # equivalent to allowing undeclared properties of any type. + description: test code generation for objects + Value must be a map of strings to values. It cannot be the 'null' value. + objectWithNoDeclaredPropsNullable: + type: object + # Note: the 'additionalProperties' keyword is not specified, which is + # equivalent to allowing undeclared properties of any type. + description: test code generation for nullable objects. + Value must be a map of strings to values or the 'null' value. + nullable: true + anyTypeProp: + description: test code generation for any type + Here the 'type' attribute is not specified, which means the value can be anything, + including the null value, string, number, boolean, array or object. + See https://github.com/OAI/OpenAPI-Specification/issues/1389 + # TODO: this should be supported, currently there are some issues in the code generation. + #anyTypeExceptNullProp: + # description: any type except 'null' + # Here the 'type' attribute is not specified, which means the value can be anything, + # including the null value, string, number, boolean, array or object. + # not: + # type: 'null' + anyTypePropNullable: + description: test code generation for any type + Here the 'type' attribute is not specified, which means the value can be anything, + including the null value, string, number, boolean, array or object. + The 'nullable' attribute does not change the allowed values. + nullable: true + xml: + name: User + Tag: + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + xml: + name: Tag + Pet: + type: object + required: + - name + - photoUrls + properties: + id: + type: integer + format: int64 + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + type: string + example: doggie + photoUrls: + type: array + xml: + name: photoUrl + wrapped: true + items: + type: string + tags: + type: array + xml: + name: tag + wrapped: true + items: + $ref: '#/components/schemas/Tag' + status: + type: string + description: pet status in the store + enum: + - available + - pending + - sold + xml: + name: Pet + ApiResponse: + type: object + properties: + code: + type: integer + format: int32 + type: + type: string + message: + type: string + Return: + description: Model for testing reserved words + properties: + return: + type: integer + format: int32 + xml: + name: Return + Name: + description: Model for testing model name same as property name + required: + - name + properties: + name: + type: integer + format: int32 + snake_case: + readOnly: true + type: integer + format: int32 + property: + type: string + 123Number: + type: integer + readOnly: true + xml: + name: Name + 200_response: + description: Model for testing model name starting with number + properties: + name: + type: integer + format: int32 + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - type: object + properties: + breed: + type: string + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Address' + - type: object + properties: + declawed: + type: boolean + Address: + type: object + additionalProperties: + type: integer + Animal: + type: object + discriminator: + propertyName: className + required: + - className + properties: + className: + type: string + color: + type: string + default: red + AnimalFarm: + type: array + items: + $ref: '#/components/schemas/Animal' + format_test: + type: object + required: + - number + - byte + - date + - password + properties: + integer: + type: integer + maximum: 100 + minimum: 10 + multipleOf: 2 + int32: + type: integer + format: int32 + maximum: 200 + minimum: 20 + int64: + type: integer + format: int64 + number: + maximum: 543.2 + minimum: 32.1 + type: number + multipleOf: 32.5 + float: + type: number + format: float + maximum: 987.6 + minimum: 54.3 + double: + type: number + format: double + maximum: 123.4 + minimum: 67.8 + decimal: + type: string + format: number + string: + type: string + pattern: '/[a-z]/i' + byte: + type: string + format: byte + binary: + type: string + format: binary + date: + type: string + format: date + example: '2020-02-02' + dateTime: + type: string + format: date-time + example: '2007-12-03T10:15:30+01:00' + uuid: + type: string + format: uuid + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + password: + type: string + format: password + maxLength: 64 + minLength: 10 + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + type: string + pattern: '^\d{10}$' + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + type: string + pattern: '/^image_\d{1,3}$/i' + EnumClass: + type: string + default: '-efg' + enum: + - _abc + - '-efg' + - (xyz) + Enum_Test: + type: object + required: + - enum_string_required + properties: + enum_string: + type: string + enum: + - UPPER + - lower + - '' + enum_string_required: + type: string + enum: + - UPPER + - lower + - '' + enum_integer: + type: integer + format: int32 + enum: + - 1 + - -1 + enum_integer_only: + type: integer + enum: + - 2 + - -2 + enum_number: + type: number + format: double + enum: + - 1.1 + - -1.2 + outerEnum: + $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' + AdditionalPropertiesClass: + type: object + properties: + map_property: + type: object + additionalProperties: + type: string + map_of_map_property: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + anytype_1: {} + map_with_undeclared_properties_anytype_1: + type: object + map_with_undeclared_properties_anytype_2: + type: object + properties: {} + map_with_undeclared_properties_anytype_3: + type: object + additionalProperties: true + empty_map: + type: object + description: an object with no declared properties and no undeclared + properties, hence it's an empty map. + additionalProperties: false + map_with_undeclared_properties_string: + type: object + additionalProperties: + type: string + MixedPropertiesAndAdditionalPropertiesClass: + type: object + properties: + uuid: + type: string + format: uuid + dateTime: + type: string + format: date-time + map: + type: object + additionalProperties: + $ref: '#/components/schemas/Animal' + List: + type: object + properties: + 123-list: + type: string + Client: + type: object + properties: + client: + type: string + ReadOnlyFirst: + type: object + properties: + bar: + type: string + readOnly: true + baz: + type: string + hasOnlyReadOnly: + type: object + properties: + bar: + type: string + readOnly: true + foo: + type: string + readOnly: true + Capitalization: + type: object + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + MapTest: + type: object + properties: + map_map_of_string: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + map_of_enum_string: + type: object + additionalProperties: + type: string + enum: + - UPPER + - lower + direct_map: + type: object + additionalProperties: + type: boolean + indirect_map: + $ref: '#/components/schemas/StringBooleanMap' + ArrayTest: + type: object + properties: + array_of_string: + type: array + items: + type: string + array_array_of_integer: + type: array + items: + type: array + items: + type: integer + format: int64 + array_array_of_model: + type: array + items: + type: array + items: + $ref: '#/components/schemas/ReadOnlyFirst' + NumberOnly: + type: object + properties: + JustNumber: + type: number + ArrayOfNumberOnly: + type: object + properties: + ArrayNumber: + type: array + items: + type: number + ArrayOfArrayOfNumberOnly: + type: object + properties: + ArrayArrayNumber: + type: array + items: + type: array + items: + type: number + EnumArrays: + type: object + properties: + just_symbol: + type: string + enum: + - '>=' + - $ + array_enum: + type: array + items: + type: string + enum: + - fish + - crab + OuterEnum: + nullable: true + type: string + enum: + - placed + - approved + - delivered + OuterEnumInteger: + type: integer + enum: + - 0 + - 1 + - 2 + OuterEnumDefaultValue: + type: string + enum: + - placed + - approved + - delivered + default: placed + OuterEnumIntegerDefaultValue: + type: integer + enum: + - 0 + - 1 + - 2 + default: 0 + OuterComposite: + type: object + properties: + my_number: + $ref: '#/components/schemas/OuterNumber' + my_string: + $ref: '#/components/schemas/OuterString' + my_boolean: + $ref: '#/components/schemas/OuterBoolean' + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + FileSchemaTestClass: + type: object + properties: + file: + $ref: '#/components/schemas/File' + files: + type: array + items: + $ref: '#/components/schemas/File' + File: + type: object + description: Must be named `File` for test. + properties: + sourceURI: + description: Test capitalization + type: string + _special_model.name_: + properties: + '$special[property.name]': + type: integer + format: int64 + '_special_model.name_': + type: string + xml: + name: '$special[model.name]' + HealthCheckResult: + type: object + properties: + NullableMessage: + nullable: true + type: string + description: Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + NullableClass: + type: object + properties: + integer_prop: + type: integer + nullable: true + number_prop: + type: number + nullable: true + boolean_prop: + type: boolean + nullable: true + string_prop: + type: string + nullable: true + date_prop: + type: string + format: date + nullable: true + datetime_prop: + type: string + format: date-time + nullable: true + array_nullable_prop: + type: array + nullable: true + items: + type: object + array_and_items_nullable_prop: + type: array + nullable: true + items: + type: object + nullable: true + array_items_nullable: + type: array + items: + type: object + nullable: true + object_nullable_prop: + type: object + nullable: true + additionalProperties: + type: object + object_and_items_nullable_prop: + type: object + nullable: true + additionalProperties: + type: object + nullable: true + object_items_nullable: + type: object + additionalProperties: + type: object + nullable: true + additionalProperties: + type: object + nullable: true + fruit: + properties: + color: + type: string + oneOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + # Below additionalProperties is set to false to validate the use + # case when a composed schema has additionalProperties set to false. + additionalProperties: false + apple: + type: object + properties: + cultivar: + type: string + pattern: ^[a-zA-Z\s]*$ + origin: + type: string + pattern: /^[A-Z\s]*$/i + nullable: true + banana: + type: object + properties: + lengthCm: + type: number + mammal: + oneOf: + - $ref: '#/components/schemas/whale' + - $ref: '#/components/schemas/zebra' + - $ref: '#/components/schemas/Pig' + discriminator: + propertyName: className + whale: + type: object + properties: + hasBaleen: + type: boolean + hasTeeth: + type: boolean + className: + type: string + required: + - className + zebra: + type: object + properties: + type: + type: string + enum: + - plains + - mountain + - grevys + className: + type: string + required: + - className + additionalProperties: true + Pig: + oneOf: + - $ref: '#/components/schemas/BasquePig' + - $ref: '#/components/schemas/DanishPig' + discriminator: + propertyName: className + BasquePig: + type: object + properties: + className: + type: string + required: + - className + DanishPig: + type: object + properties: + className: + type: string + required: + - className + gmFruit: + properties: + color: + type: string + anyOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + additionalProperties: false + fruitReq: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/appleReq' + - $ref: '#/components/schemas/bananaReq' + additionalProperties: false + appleReq: + type: object + properties: + cultivar: + type: string + mealy: + type: boolean + required: + - cultivar + additionalProperties: false + bananaReq: + type: object + properties: + lengthCm: + type: number + sweet: + type: boolean + required: + - lengthCm + additionalProperties: false + # go-experimental is unable to make Triangle and Quadrilateral models + # correctly https://github.com/OpenAPITools/openapi-generator/issues/6149 + Drawing: + type: object + properties: + mainShape: + # A property whose value is a 'oneOf' type, and the type is referenced instead + # of being defined inline. The value cannot be null. + $ref: '#/components/schemas/Shape' + shapeOrNull: + # A property whose value is a 'oneOf' type, and the type is referenced instead + # of being defined inline. The value may be null because ShapeOrNull has 'null' + # type as a child schema of 'oneOf'. + $ref: '#/components/schemas/ShapeOrNull' + nullableShape: + # A property whose value is a 'oneOf' type, and the type is referenced instead + # of being defined inline. The value may be null because NullableShape has the + # 'nullable: true' attribute. For this specific scenario this is exactly the + # same thing as 'shapeOrNull'. + $ref: '#/components/schemas/NullableShape' + shapes: + type: array + items: + $ref: '#/components/schemas/Shape' + additionalProperties: + # Here the additional properties are specified using a referenced schema. + # This is just to validate the generated code works when using $ref + # under 'additionalProperties'. + $ref: '#/components/schemas/fruit' + Shape: + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + discriminator: + propertyName: shapeType + ShapeOrNull: + description: The value may be a shape or the 'null' value. + This is introduced in OAS schema >= 3.1. + oneOf: + - type: 'null' + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + discriminator: + propertyName: shapeType + NullableShape: + description: The value may be a shape or the 'null' value. + The 'nullable' attribute was introduced in OAS schema >= 3.0 + and has been deprecated in OAS schema >= 3.1. + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + discriminator: + propertyName: shapeType + nullable: true + ShapeInterface: + properties: + shapeType: + type: string + required: + - shapeType + TriangleInterface: + properties: + triangleType: + type: string + required: + - triangleType + Triangle: + oneOf: + - $ref: '#/components/schemas/EquilateralTriangle' + - $ref: '#/components/schemas/IsoscelesTriangle' + - $ref: '#/components/schemas/ScaleneTriangle' + discriminator: + propertyName: triangleType + # Note: the 'additionalProperties' keyword is not specified, which is + # equivalent to allowing undeclared properties of any type. + EquilateralTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + IsoscelesTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + additionalProperties: false + ScaleneTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + QuadrilateralInterface: + properties: + quadrilateralType: + type: string + required: + - quadrilateralType + Quadrilateral: + oneOf: + - $ref: '#/components/schemas/SimpleQuadrilateral' + - $ref: '#/components/schemas/ComplexQuadrilateral' + discriminator: + propertyName: quadrilateralType + SimpleQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + ComplexQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + GrandparentAnimal: + type: object + required: + - pet_type + properties: + pet_type: + type: string + discriminator: + propertyName: pet_type + ParentPet: + type: object + allOf: + - $ref: '#/components/schemas/GrandparentAnimal' + #ChildCat: + # allOf: + # - $ref: '#/components/schemas/ParentPet' + # - type: object + # properties: + # name: + # type: string + # pet_type: + # x-enum-as-string: true + # type: string + # enum: + # - ChildCat + # default: ChildCat + ArrayOfEnums: + type: array + items: + $ref: '#/components/schemas/OuterEnum' + DateTimeTest: + type: string + default: '2010-01-01T10:10:10.000111+01:00' + example: '2010-01-01T10:10:10.000111+01:00' + format: date-time + DeprecatedObject: + type: object + deprecated: true + properties: + name: + type: string + ObjectWithDeprecatedFields: + type: object + properties: + uuid: + type: string + id: + type: number + deprecated: true + deprecatedRef: + $ref: '#/components/schemas/DeprecatedObject' + bars: + type: array + deprecated: true + items: + $ref: '#/components/schemas/Bar' diff --git a/pom.xml b/pom.xml index 01a361c803ed..bc3598547173 100644 --- a/pom.xml +++ b/pom.xml @@ -1299,6 +1299,7 @@ samples/openapi3/client/petstore/java/jersey2-java8 samples/client/others/java/okhttp-gson-streaming samples/client/petstore/java/okhttp-gson + samples/client/petstore/java/okhttp-gson-nextgen samples/client/petstore/java/retrofit2 samples/client/petstore/java/retrofit2rx2 samples/client/petstore/java/retrofit2rx3 diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 000000000000..ddda27d5fed9 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/.gitignore b/samples/client/petstore/java/okhttp-gson-nextgen/.gitignore new file mode 100644 index 000000000000..a530464afa1b --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator-ignore b/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator-ignore new file mode 100644 index 000000000000..6ba435b5655f --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator-ignore @@ -0,0 +1,14 @@ +# OpenAPI Generator Ignore +# These tests are "live" tests and should not be overwritten +src/test/java/org/openapitools/client/StringUtilTest.java +src/test/java/org/openapitools/client/ApiClientTest.java +src/test/java/org/openapitools/client/ConfigurationTest.java +src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java +src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java +src/test/java/org/openapitools/client/auth/RetryingOAuthTest.java +src/test/java/org/openapitools/client/model/EnumValueTest.java +src/test/java/org/openapitools/client/model/PetTest.java +src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +src/test/java/org/openapitools/client/JSONTest.java +src/test/java/org/openapitools/client/api/PetApiTest.java + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/FILES b/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/FILES new file mode 100644 index 000000000000..39148a7980a7 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/FILES @@ -0,0 +1,195 @@ +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +docs/AdditionalPropertiesClass.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/Apple.md +docs/AppleReq.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/Banana.md +docs/BananaReq.md +docs/BasquePig.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/ComplexQuadrilateral.md +docs/DanishPig.md +docs/DefaultApi.md +docs/DeprecatedObject.md +docs/Dog.md +docs/DogAllOf.md +docs/Drawing.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/EquilateralTriangle.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/Foo.md +docs/FormatTest.md +docs/Fruit.md +docs/FruitReq.md +docs/GmFruit.md +docs/GrandparentAnimal.md +docs/HasOnlyReadOnly.md +docs/HealthCheckResult.md +docs/InlineResponseDefault.md +docs/IsoscelesTriangle.md +docs/Mammal.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelApiResponse.md +docs/ModelReturn.md +docs/Name.md +docs/NullableClass.md +docs/NullableShape.md +docs/NumberOnly.md +docs/ObjectWithDeprecatedFields.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/OuterEnumDefaultValue.md +docs/OuterEnumInteger.md +docs/OuterEnumIntegerDefaultValue.md +docs/ParentPet.md +docs/Pet.md +docs/PetApi.md +docs/Pig.md +docs/Quadrilateral.md +docs/QuadrilateralInterface.md +docs/ReadOnlyFirst.md +docs/ScaleneTriangle.md +docs/Shape.md +docs/ShapeInterface.md +docs/ShapeOrNull.md +docs/SimpleQuadrilateral.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/Triangle.md +docs/TriangleInterface.md +docs/User.md +docs/UserApi.md +docs/Whale.md +docs/Zebra.md +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +src/main/java/org/openapitools/client/api/PetApi.java +src/main/java/org/openapitools/client/api/StoreApi.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/auth/OAuth.java +src/main/java/org/openapitools/client/auth/OAuthFlow.java +src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java +src/main/java/org/openapitools/client/auth/RetryingOAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/Apple.java +src/main/java/org/openapitools/client/model/AppleReq.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayTest.java +src/main/java/org/openapitools/client/model/Banana.java +src/main/java/org/openapitools/client/model/BananaReq.java +src/main/java/org/openapitools/client/model/BasquePig.java +src/main/java/org/openapitools/client/model/Capitalization.java +src/main/java/org/openapitools/client/model/Cat.java +src/main/java/org/openapitools/client/model/CatAllOf.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ClassModel.java +src/main/java/org/openapitools/client/model/Client.java +src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java +src/main/java/org/openapitools/client/model/DanishPig.java +src/main/java/org/openapitools/client/model/DeprecatedObject.java +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/DogAllOf.java +src/main/java/org/openapitools/client/model/Drawing.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/EquilateralTriangle.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/Foo.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/Fruit.java +src/main/java/org/openapitools/client/model/FruitReq.java +src/main/java/org/openapitools/client/model/GmFruit.java +src/main/java/org/openapitools/client/model/GrandparentAnimal.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/HealthCheckResult.java +src/main/java/org/openapitools/client/model/InlineResponseDefault.java +src/main/java/org/openapitools/client/model/IsoscelesTriangle.java +src/main/java/org/openapitools/client/model/Mammal.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NullableClass.java +src/main/java/org/openapitools/client/model/NullableShape.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java +src/main/java/org/openapitools/client/model/OuterEnumInteger.java +src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java +src/main/java/org/openapitools/client/model/ParentPet.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/Pig.java +src/main/java/org/openapitools/client/model/Quadrilateral.java +src/main/java/org/openapitools/client/model/QuadrilateralInterface.java +src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +src/main/java/org/openapitools/client/model/ScaleneTriangle.java +src/main/java/org/openapitools/client/model/Shape.java +src/main/java/org/openapitools/client/model/ShapeInterface.java +src/main/java/org/openapitools/client/model/ShapeOrNull.java +src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java +src/main/java/org/openapitools/client/model/SpecialModelName.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/Triangle.java +src/main/java/org/openapitools/client/model/TriangleInterface.java +src/main/java/org/openapitools/client/model/User.java +src/main/java/org/openapitools/client/model/Whale.java +src/main/java/org/openapitools/client/model/Zebra.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/VERSION b/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/VERSION new file mode 100644 index 000000000000..4077803655c0 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/.travis.yml b/samples/client/petstore/java/okhttp-gson-nextgen/.travis.yml new file mode 100644 index 000000000000..1b6741c083c7 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/README.md b/samples/client/petstore/java/okhttp-gson-nextgen/README.md new file mode 100644 index 000000000000..6110aea0fa04 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/README.md @@ -0,0 +1,277 @@ +# petstore-okhttp-gson-nextgen + +OpenAPI Petstore +- API version: 1.0.0 + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.7+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + petstore-okhttp-gson-nextgen + 1.0.0 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'petstore-okhttp-gson-nextgen' jar has been published to maven central. + mavenLocal() // Needed if the 'petstore-okhttp-gson-nextgen' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:petstore-okhttp-gson-nextgen:1.0.0" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/petstore-okhttp-gson-nextgen-1.0.0.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.AnotherFakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient); + Client client = new Client(); // Client | client model + try { + Client result = apiInstance.call123testSpecialTags(client); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io:80/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* | [**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 | +*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +*FakeApi* | [**getArrayOfEnums**](docs/FakeApi.md#getArrayOfEnums) | **GET** /fake/array-of-enums | Array of Enums +*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* | [**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 +*FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | +*FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case +*PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](docs/PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](docs/PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image +*PetApi* | [**uploadFileWithRequiredFile**](docs/PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID +*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](docs/UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](docs/UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](docs/UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](docs/UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](docs/UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + +## Documentation for Models + + - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [Animal](docs/Animal.md) + - [Apple](docs/Apple.md) + - [AppleReq](docs/AppleReq.md) + - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [ArrayTest](docs/ArrayTest.md) + - [Banana](docs/Banana.md) + - [BananaReq](docs/BananaReq.md) + - [BasquePig](docs/BasquePig.md) + - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) + - [CatAllOf](docs/CatAllOf.md) + - [Category](docs/Category.md) + - [ClassModel](docs/ClassModel.md) + - [Client](docs/Client.md) + - [ComplexQuadrilateral](docs/ComplexQuadrilateral.md) + - [DanishPig](docs/DanishPig.md) + - [DeprecatedObject](docs/DeprecatedObject.md) + - [Dog](docs/Dog.md) + - [DogAllOf](docs/DogAllOf.md) + - [Drawing](docs/Drawing.md) + - [EnumArrays](docs/EnumArrays.md) + - [EnumClass](docs/EnumClass.md) + - [EnumTest](docs/EnumTest.md) + - [EquilateralTriangle](docs/EquilateralTriangle.md) + - [FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [Foo](docs/Foo.md) + - [FormatTest](docs/FormatTest.md) + - [Fruit](docs/Fruit.md) + - [FruitReq](docs/FruitReq.md) + - [GmFruit](docs/GmFruit.md) + - [GrandparentAnimal](docs/GrandparentAnimal.md) + - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [HealthCheckResult](docs/HealthCheckResult.md) + - [InlineResponseDefault](docs/InlineResponseDefault.md) + - [IsoscelesTriangle](docs/IsoscelesTriangle.md) + - [Mammal](docs/Mammal.md) + - [MapTest](docs/MapTest.md) + - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model200Response](docs/Model200Response.md) + - [ModelApiResponse](docs/ModelApiResponse.md) + - [ModelReturn](docs/ModelReturn.md) + - [Name](docs/Name.md) + - [NullableClass](docs/NullableClass.md) + - [NullableShape](docs/NullableShape.md) + - [NumberOnly](docs/NumberOnly.md) + - [ObjectWithDeprecatedFields](docs/ObjectWithDeprecatedFields.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) + - [ParentPet](docs/ParentPet.md) + - [Pet](docs/Pet.md) + - [Pig](docs/Pig.md) + - [Quadrilateral](docs/Quadrilateral.md) + - [QuadrilateralInterface](docs/QuadrilateralInterface.md) + - [ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [ScaleneTriangle](docs/ScaleneTriangle.md) + - [Shape](docs/Shape.md) + - [ShapeInterface](docs/ShapeInterface.md) + - [ShapeOrNull](docs/ShapeOrNull.md) + - [SimpleQuadrilateral](docs/SimpleQuadrilateral.md) + - [SpecialModelName](docs/SpecialModelName.md) + - [Tag](docs/Tag.md) + - [Triangle](docs/Triangle.md) + - [TriangleInterface](docs/TriangleInterface.md) + - [User](docs/User.md) + - [Whale](docs/Whale.md) + - [Zebra](docs/Zebra.md) + + +## Documentation for Authorization + +Authentication schemes defined for the API: +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + +### api_key_query + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + +### bearer_test + +- **Type**: HTTP basic authentication + +### http_basic_test + +- **Type**: HTTP basic authentication + +### http_signature_test + +- **Type**: HTTP basic authentication + +### petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - write:pets: modify pets in your account + - read:pets: read your pets + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml b/samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml new file mode 100644 index 000000000000..8e64d05d5f2f --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml @@ -0,0 +1,2464 @@ +openapi: 3.0.0 +info: + description: 'This spec is mainly for testing Petstore server and contains fake + endpoints, models. Please do not use this for any other purpose. Special characters: + " \' + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +servers: +- description: petstore server + url: http://{server}.swagger.io:{port}/v2 + variables: + server: + default: petstore + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" +- description: The local server + url: https://localhost:8080/{version} + variables: + version: + default: v2 + enum: + - v1 + - v2 +- description: The local server without variables + url: https://127.0.0.1/no_variable +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /foo: + get: + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_default' + description: response + x-accepts: application/json + /pet: + post: + operationId: addPet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "405": + description: Invalid input + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-contentType: application/json + x-accepts: application/json + put: + operationId: updatePet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "400": + description: Invalid ID supplied + "404": + description: Pet not found + "405": + description: Validation exception + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + x-contentType: application/json + x-accepts: application/json + servers: + - url: http://petstore.swagger.io/v2 + - url: http://path-server-test.petstore.local/v2 + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - deprecated: true + description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid status value + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + x-accepts: application/json + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid tag value + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-accepts: application/json + /pet/{petId}: + delete: + operationId: deletePet + parameters: + - explode: false + in: header + name: api_key + required: false + schema: + type: string + style: simple + - description: Pet id to delete + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "400": + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-accepts: application/json + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-accepts: application/json + post: + 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: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + responses: + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - pet + x-contentType: application/x-www-form-urlencoded + x-accepts: application/json + /pet/{petId}/uploadImage: + post: + 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: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + x-contentType: multipart/form-data + x-accepts: application/json + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + /store/order: + post: + operationId: placeOrder + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid Order + summary: Place an order for a pet + tags: + - store + x-contentType: application/json + 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 + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + explode: false + in: path + name: order_id + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Delete purchase order by ID + tags: + - store + 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: + - description: ID of pet that needs to be fetched + explode: false + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-accepts: application/json + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + description: successful operation + summary: Create user + tags: + - user + x-contentType: application/json + x-accepts: application/json + /user/createWithArray: + post: + operationId: createUsersWithArrayInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-contentType: application/json + x-accepts: application/json + /user/createWithList: + post: + operationId: createUsersWithListInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-contentType: application/json + x-accepts: application/json + /user/login: + get: + operationId: loginUser + parameters: + - description: The user name for login + explode: true + in: query + name: username + required: true + schema: + type: string + style: form + - description: The password for login in clear text + explode: true + in: query + name: password + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + explode: false + schema: + format: int32 + type: integer + style: simple + X-Expires-After: + description: date in UTC when token expires + explode: false + schema: + format: date-time + type: string + style: simple + "400": + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-accepts: application/json + /user/logout: + get: + operationId: logoutUser + responses: + default: + description: successful operation + 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 + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Delete user + tags: + - user + x-accepts: application/json + get: + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Get user by user name + tags: + - user + x-accepts: application/json + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + description: Invalid user supplied + "404": + description: User not found + summary: Updated user + tags: + - user + x-contentType: application/json + x-accepts: application/json + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + 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 + explode: true + in: query + name: required_string_group + required: true + schema: + type: integer + style: form + - description: Required Boolean in group parameters + explode: false + in: header + name: required_boolean_group + required: true + schema: + type: boolean + style: simple + - description: Required Integer in group parameters + explode: true + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer + style: form + - description: String in group parameters + explode: true + in: query + name: string_group + required: false + schema: + type: integer + style: form + - description: Boolean in group parameters + explode: false + in: header + name: boolean_group + required: false + schema: + type: boolean + style: simple + - description: Integer in group parameters + explode: true + in: query + name: int64_group + required: false + schema: + format: int64 + type: integer + style: form + responses: + "400": + description: Someting wrong + security: + - bearer_test: [] + 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 + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + explode: false + in: header + name: enum_header_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: simple + - description: Query parameter enum test (string array) + explode: true + in: query + name: enum_query_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + explode: true + in: query + name: enum_query_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_integer + required: false + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_double + required: false + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + style: form + requestBody: + $ref: '#/components/requestBodies/inline_object_2' + content: + application/x-www-form-urlencoded: + schema: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + type: object + responses: + "400": + description: Invalid request + "404": + description: Not found + summary: To test enum parameters + tags: + - fake + x-contentType: application/x-www-form-urlencoded + x-accepts: application/json + patch: + description: To test "client" model + operationId: testClientModel + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + x-contentType: application/json + x-accepts: application/json + post: + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + $ref: '#/components/requestBodies/inline_object_3' + content: + application/x-www-form-urlencoded: + schema: + properties: + integer: + description: None + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + default: 2010-02-01T10:20:10.11111+01:00 + description: None + example: 2020-02-02T20:20:20.22222Z + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + type: object + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + security: + - http_basic_test: [] + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + tags: + - fake + x-contentType: application/x-www-form-urlencoded + x-accepts: application/json + /fake/outer/number: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + x-contentType: application/json + x-accepts: '*/*' + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + x-contentType: application/json + x-accepts: '*/*' + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + x-contentType: application/json + x-accepts: '*/*' + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + x-contentType: application/json + x-accepts: '*/*' + /fake/jsonFormData: + get: + operationId: testJsonFormData + requestBody: + $ref: '#/components/requestBodies/inline_object_4' + content: + application/x-www-form-urlencoded: + schema: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + responses: + "200": + description: successful operation + summary: test json serialization of form data + tags: + - fake + x-contentType: application/x-www-form-urlencoded + x-accepts: application/json + /fake/inline-additionalProperties: + post: + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline additionalProperties + tags: + - fake + x-contentType: application/json + x-accepts: application/json + /fake/body-with-query-params: + put: + operationId: testBodyWithQueryParams + parameters: + - explode: true + in: query + name: query + required: true + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + responses: + "200": + description: Success + tags: + - fake + x-contentType: application/json + x-accepts: application/json + /another-fake/dummy: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + 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`. + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + responses: + "200": + description: Success + tags: + - fake + x-contentType: application/json + x-accepts: application/json + /fake/test-query-parameters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: true + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: form + - explode: false + in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + style: form + - explode: false + in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + description: Success + tags: + - fake + x-accepts: application/json + /fake/{petId}/uploadImageWithRequiredFile: + post: + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + $ref: '#/components/requestBodies/inline_object_5' + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + type: object + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - pet + x-contentType: multipart/form-data + x-accepts: application/json + /fake/health: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + description: The instance started successfully + summary: Health check endpoint + tags: + - fake + x-accepts: application/json + /fake/array-of-enums: + get: + operationId: getArrayOfEnums + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ArrayOfEnums' + description: Got named array of enums + summary: Array of Enums + tags: + - fake + x-accepts: application/json +components: + requestBodies: + UserArray: + content: + application/json: + examples: + simple-list: + description: Should not get into code examples + summary: Simple list example + value: + - username: foo + - username: bar + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + 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' + inline_object_2: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object_2' + inline_object_3: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object_3' + inline_object_4: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object_4' + inline_object_5: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/inline_object_5' + schemas: + Foo: + example: + bar: bar + properties: + bar: + default: bar + type: string + type: object + Bar: + default: bar + type: string + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2020-02-02T20:20:20.000222Z + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + example: 2020-02-02T20:20:20.000222Z + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object + xml: + name: Order + Category: + example: + name: default-name + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + objectWithNoDeclaredPropsNullable: '{}' + phone: phone + objectWithNoDeclaredProps: '{}' + id: 0 + anyTypePropNullable: "" + email: email + anyTypeProp: "" + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + objectWithNoDeclaredProps: + description: test code generation for objects Value must be a map of strings + to values. It cannot be the 'null' value. + type: object + objectWithNoDeclaredPropsNullable: + description: test code generation for nullable objects. Value must be a + map of strings to values or the 'null' value. + nullable: true + type: object + anyTypeProp: + description: test code generation for any type Here the 'type' attribute + is not specified, which means the value can be anything, including the + null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 + anyTypePropNullable: + description: test code generation for any type Here the 'type' attribute + is not specified, which means the value can be anything, including the + null value, string, number, boolean, array or object. The 'nullable' attribute + does not change the allowed values. + nullable: true + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + xml: + name: Return + Name: + description: Model for testing model name same as property name + properties: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Dog_allOf' + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Address' + - $ref: '#/components/schemas/Cat_allOf' + Address: + additionalProperties: + type: integer + type: object + Animal: + discriminator: + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array + format_test: + properties: + integer: + maximum: 100 + minimum: 10 + multipleOf: 2 + type: integer + int32: + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + format: int64 + type: integer + number: + maximum: 543.2 + minimum: 32.1 + multipleOf: 32.5 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + decimal: + format: number + type: string + string: + pattern: /[a-z]/i + type: string + byte: + format: byte + type: string + binary: + format: binary + type: string + date: + example: 2020-02-02 + format: date + type: string + dateTime: + example: 2007-12-03T10:15:30+01:00 + format: date-time + type: string + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + type: string + password: + format: password + maxLength: 64 + minLength: 10 + type: string + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + pattern: ^\d{10}$ + type: string + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one + to three digits following i.e. Image_01. + pattern: /^image_\d{1,3}$/i + type: string + required: + - byte + - date + - number + - password + type: object + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + Enum_Test: + properties: + enum_string: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_integer_only: + enum: + - 2 + - -2 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_property: + additionalProperties: + type: string + type: object + map_of_map_property: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + anytype_1: {} + map_with_undeclared_properties_anytype_1: + type: object + map_with_undeclared_properties_anytype_2: + properties: {} + type: object + map_with_undeclared_properties_anytype_3: + additionalProperties: true + type: object + empty_map: + additionalProperties: false + description: an object with no declared properties and no undeclared properties, + hence it's an empty map. + type: object + map_with_undeclared_properties_string: + additionalProperties: + type: string + type: object + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object + type: object + List: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + nullable: true + type: string + OuterEnumInteger: + enum: + - 0 + - 1 + - 2 + type: integer + OuterEnumDefaultValue: + default: placed + enum: + - placed + - approved + - delivered + type: string + OuterEnumIntegerDefaultValue: + default: 0 + enum: + - 0 + - 1 + - 2 + type: integer + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + _special_model.name_: + type: string + xml: + name: $special[model.name] + HealthCheckResult: + description: Just a string to inform instance is up and running. Make it nullable + in hope to get it as pointer in generated model. + example: + NullableMessage: NullableMessage + properties: + NullableMessage: + nullable: true + type: string + type: object + NullableClass: + additionalProperties: + nullable: true + type: object + properties: + integer_prop: + nullable: true + type: integer + number_prop: + nullable: true + type: number + boolean_prop: + nullable: true + type: boolean + string_prop: + nullable: true + type: string + date_prop: + format: date + nullable: true + type: string + datetime_prop: + format: date-time + nullable: true + type: string + array_nullable_prop: + items: + type: object + nullable: true + type: array + array_and_items_nullable_prop: + items: + nullable: true + type: object + nullable: true + type: array + array_items_nullable: + items: + nullable: true + type: object + type: array + object_nullable_prop: + additionalProperties: + type: object + nullable: true + type: object + object_and_items_nullable_prop: + additionalProperties: + nullable: true + type: object + nullable: true + type: object + object_items_nullable: + additionalProperties: + nullable: true + type: object + type: object + type: object + fruit: + additionalProperties: false + oneOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + apple: + nullable: true + properties: + cultivar: + pattern: ^[a-zA-Z\s]*$ + type: string + origin: + pattern: /^[A-Z\s]*$/i + type: string + type: object + banana: + properties: + lengthCm: + type: number + type: object + mammal: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/whale' + - $ref: '#/components/schemas/zebra' + - $ref: '#/components/schemas/Pig' + whale: + properties: + hasBaleen: + type: boolean + hasTeeth: + type: boolean + className: + type: string + required: + - className + type: object + zebra: + additionalProperties: true + properties: + type: + enum: + - plains + - mountain + - grevys + type: string + className: + type: string + required: + - className + type: object + Pig: + discriminator: + propertyName: className + oneOf: + - $ref: '#/components/schemas/BasquePig' + - $ref: '#/components/schemas/DanishPig' + BasquePig: + properties: + className: + type: string + required: + - className + type: object + DanishPig: + properties: + className: + type: string + required: + - className + type: object + gmFruit: + additionalProperties: false + anyOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + fruitReq: + additionalProperties: false + oneOf: + - type: "null" + - $ref: '#/components/schemas/appleReq' + - $ref: '#/components/schemas/bananaReq' + appleReq: + additionalProperties: false + properties: + cultivar: + type: string + mealy: + type: boolean + required: + - cultivar + type: object + bananaReq: + additionalProperties: false + properties: + lengthCm: + type: number + sweet: + type: boolean + required: + - lengthCm + type: object + Drawing: + additionalProperties: + $ref: '#/components/schemas/fruit' + properties: + mainShape: + $ref: '#/components/schemas/Shape' + shapeOrNull: + $ref: '#/components/schemas/ShapeOrNull' + nullableShape: + $ref: '#/components/schemas/NullableShape' + shapes: + items: + $ref: '#/components/schemas/Shape' + type: array + type: object + Shape: + discriminator: + propertyName: shapeType + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeOrNull: + description: The value may be a shape or the 'null' value. This is introduced + in OAS schema >= 3.1. + discriminator: + propertyName: shapeType + oneOf: + - type: "null" + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + NullableShape: + description: The value may be a shape or the 'null' value. The 'nullable' attribute + was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema + >= 3.1. + discriminator: + propertyName: shapeType + nullable: true + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + ShapeInterface: + properties: + shapeType: + type: string + required: + - shapeType + TriangleInterface: + properties: + triangleType: + type: string + required: + - triangleType + Triangle: + discriminator: + propertyName: triangleType + oneOf: + - $ref: '#/components/schemas/EquilateralTriangle' + - $ref: '#/components/schemas/IsoscelesTriangle' + - $ref: '#/components/schemas/ScaleneTriangle' + EquilateralTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + IsoscelesTriangle: + additionalProperties: false + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + ScaleneTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + QuadrilateralInterface: + properties: + quadrilateralType: + type: string + required: + - quadrilateralType + Quadrilateral: + discriminator: + propertyName: quadrilateralType + oneOf: + - $ref: '#/components/schemas/SimpleQuadrilateral' + - $ref: '#/components/schemas/ComplexQuadrilateral' + SimpleQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + ComplexQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + GrandparentAnimal: + discriminator: + propertyName: pet_type + properties: + pet_type: + type: string + required: + - pet_type + type: object + ParentPet: + allOf: + - $ref: '#/components/schemas/GrandparentAnimal' + type: object + ArrayOfEnums: + items: + $ref: '#/components/schemas/OuterEnum' + type: array + DateTimeTest: + default: 2010-01-01T10:10:10.000111+01:00 + example: 2010-01-01T10:10:10.000111+01:00 + format: date-time + type: string + DeprecatedObject: + deprecated: true + properties: + name: + type: string + type: object + ObjectWithDeprecatedFields: + properties: + uuid: + type: string + id: + deprecated: true + type: number + deprecatedRef: + $ref: '#/components/schemas/DeprecatedObject' + bars: + deprecated: true + items: + $ref: '#/components/schemas/Bar' + type: array + type: object + inline_response_default: + example: + string: + bar: bar + properties: + string: + $ref: '#/components/schemas/Foo' + 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 + inline_object_2: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + type: object + inline_object_3: + properties: + integer: + description: None + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + default: 2010-02-01T10:20:10.11111+01:00 + description: None + example: 2020-02-02T20:20:20.22222Z + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + type: object + inline_object_4: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + inline_object_5: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + type: object + Dog_allOf: + properties: + breed: + type: string + type: object + Cat_allOf: + properties: + declawed: + type: boolean + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http + bearer_test: + bearerFormat: JWT + scheme: bearer + type: http + http_signature_test: + scheme: signature + type: http + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/build.gradle b/samples/client/petstore/java/okhttp-gson-nextgen/build.gradle new file mode 100644 index 000000000000..e73647ffcb63 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/build.gradle @@ -0,0 +1,153 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '1.0.0' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.17.1' + } +} + +repositories { + mavenCentral() +} +sourceSets { + main.java.srcDirs = ['src/main/java'] +} + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task); + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'petstore-okhttp-gson-nextgen' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.5.24' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.9.1' + implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1' + implementation 'com.google.code.gson:gson:2.8.6' + implementation 'io.gsonfire:gson-fire:1.8.4' + implementation 'org.openapitools:jackson-databind-nullable:0.2.1' + implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.1' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.10' + implementation 'org.threeten:threetenbp:1.4.3' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'junit:junit:4.13.1' + testImplementation 'org.mockito:mockito-core:3.11.2' +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/build.sbt b/samples/client/petstore/java/okhttp-gson-nextgen/build.sbt new file mode 100644 index 000000000000..6aebfa8e21c4 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/build.sbt @@ -0,0 +1,27 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "petstore-okhttp-gson-nextgen", + version := "1.0.0", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.5.24", + "com.squareup.okhttp3" % "okhttp" % "4.9.1", + "com.squareup.okhttp3" % "logging-interceptor" % "4.9.1", + "com.google.code.gson" % "gson" % "2.8.6", + "org.apache.commons" % "commons-lang3" % "3.10", + "org.openapitools" % "jackson-databind-nullable" % "0.2.1", + "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1", + "org.threeten" % "threetenbp" % "1.4.3" % "compile", + "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "junit" % "junit" % "4.13.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test" + ) + ) diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesAnyType.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesAnyType.md new file mode 100644 index 000000000000..7bbe63d23f80 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesAnyType.md @@ -0,0 +1,13 @@ + + +# AdditionalPropertiesAnyType + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesArray.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesArray.md new file mode 100644 index 000000000000..bdbf2962f201 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesArray.md @@ -0,0 +1,13 @@ + + +# AdditionalPropertiesArray + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesBoolean.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesBoolean.md new file mode 100644 index 000000000000..81aeb9ae1e78 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesBoolean.md @@ -0,0 +1,13 @@ + + +# AdditionalPropertiesBoolean + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesClass.md new file mode 100644 index 000000000000..3d032d4504ad --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesClass.md @@ -0,0 +1,20 @@ + + +# AdditionalPropertiesClass + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapProperty** | **Map<String, String>** | | [optional] +**mapOfMapProperty** | **Map<String, Map<String, String>>** | | [optional] +**anytype1** | **Object** | | [optional] +**mapWithUndeclaredPropertiesAnytype1** | **Object** | | [optional] +**mapWithUndeclaredPropertiesAnytype2** | **Object** | | [optional] +**mapWithUndeclaredPropertiesAnytype3** | **Map<String, Object>** | | [optional] +**emptyMap** | **Object** | an object with no declared properties and no undeclared properties, hence it's an empty map. | [optional] +**mapWithUndeclaredPropertiesString** | **Map<String, String>** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesInteger.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesInteger.md new file mode 100644 index 000000000000..ae3391237145 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesInteger.md @@ -0,0 +1,13 @@ + + +# AdditionalPropertiesInteger + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesNumber.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesNumber.md new file mode 100644 index 000000000000..8f414ad02fdc --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesNumber.md @@ -0,0 +1,13 @@ + + +# AdditionalPropertiesNumber + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesObject.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesObject.md new file mode 100644 index 000000000000..41892793f0b0 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesObject.md @@ -0,0 +1,13 @@ + + +# AdditionalPropertiesObject + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesString.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesString.md new file mode 100644 index 000000000000..a2dfbc116f9b --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AdditionalPropertiesString.md @@ -0,0 +1,13 @@ + + +# AdditionalPropertiesString + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Animal.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Animal.md new file mode 100644 index 000000000000..7edc25cd2b04 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Animal.md @@ -0,0 +1,14 @@ + + +# Animal + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AnimalFarm.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AnimalFarm.md new file mode 100644 index 000000000000..c7c7f1ddcce6 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AnimalFarm.md @@ -0,0 +1,9 @@ + +# AnimalFarm + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AnotherFakeApi.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AnotherFakeApi.md new file mode 100644 index 000000000000..149488eff9a0 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AnotherFakeApi.md @@ -0,0 +1,71 @@ +# AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + + +# **call123testSpecialTags** +> Client call123testSpecialTags(client) + +To test special tags + +To test special tags and operation ID starting with number + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.AnotherFakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient); + Client client = new Client(); // Client | client model + try { + Client result = apiInstance.call123testSpecialTags(client); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Apple.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Apple.md new file mode 100644 index 000000000000..513643aeb77f --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Apple.md @@ -0,0 +1,14 @@ + + +# Apple + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cultivar** | **String** | | [optional] +**origin** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AppleReq.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AppleReq.md new file mode 100644 index 000000000000..d2fccd5306d8 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AppleReq.md @@ -0,0 +1,14 @@ + + +# AppleReq + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cultivar** | **String** | | +**mealy** | **Boolean** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 000000000000..9b1f85869990 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,13 @@ + + +# ArrayOfArrayOfNumberOnly + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayArrayNumber** | **List<List<BigDecimal>>** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ArrayOfNumberOnly.md new file mode 100644 index 000000000000..4e95f1ae74ef --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ArrayOfNumberOnly.md @@ -0,0 +1,13 @@ + + +# ArrayOfNumberOnly + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayNumber** | **List<BigDecimal>** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ArrayTest.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ArrayTest.md new file mode 100644 index 000000000000..9b90810fc286 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ArrayTest.md @@ -0,0 +1,15 @@ + + +# ArrayTest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayOfString** | **List<String>** | | [optional] +**arrayArrayOfInteger** | **List<List<Long>>** | | [optional] +**arrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Banana.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Banana.md new file mode 100644 index 000000000000..7ddff9847aa6 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Banana.md @@ -0,0 +1,13 @@ + + +# Banana + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lengthCm** | **BigDecimal** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/BananaReq.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/BananaReq.md new file mode 100644 index 000000000000..35a773503b8e --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/BananaReq.md @@ -0,0 +1,14 @@ + + +# BananaReq + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lengthCm** | **BigDecimal** | | +**sweet** | **Boolean** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/BasquePig.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/BasquePig.md new file mode 100644 index 000000000000..05d4cf397071 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/BasquePig.md @@ -0,0 +1,13 @@ + + +# BasquePig + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/BigCat.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/BigCat.md new file mode 100644 index 000000000000..020fbc787d81 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/BigCat.md @@ -0,0 +1,24 @@ + + +# BigCat + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/BigCatAllOf.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/BigCatAllOf.md new file mode 100644 index 000000000000..2bcace910ec8 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/BigCatAllOf.md @@ -0,0 +1,24 @@ + + +# BigCatAllOf + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Capitalization.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Capitalization.md new file mode 100644 index 000000000000..ad8939b744cd --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Capitalization.md @@ -0,0 +1,18 @@ + + +# Capitalization + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**smallCamel** | **String** | | [optional] +**capitalCamel** | **String** | | [optional] +**smallSnake** | **String** | | [optional] +**capitalSnake** | **String** | | [optional] +**scAETHFlowPoints** | **String** | | [optional] +**ATT_NAME** | **String** | Name of the pet | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Cat.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Cat.md new file mode 100644 index 000000000000..87a3ab44a396 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Cat.md @@ -0,0 +1,13 @@ + + +# Cat + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **Boolean** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/CatAllOf.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/CatAllOf.md new file mode 100644 index 000000000000..3fd01aaebfc9 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/CatAllOf.md @@ -0,0 +1,13 @@ + + +# CatAllOf + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **Boolean** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Category.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Category.md new file mode 100644 index 000000000000..d03ffbfd06f9 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Category.md @@ -0,0 +1,14 @@ + + +# Category + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**name** | **String** | | + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ChildCat.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ChildCat.md new file mode 100644 index 000000000000..ca161f803720 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ChildCat.md @@ -0,0 +1,22 @@ + + +# ChildCat + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] +**petType** | [**PetTypeEnum**](#PetTypeEnum) | | + + + +## Enum: PetTypeEnum + +Name | Value +---- | ----- +CHILDCAT | "ChildCat" + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ChildCatAllOf.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ChildCatAllOf.md new file mode 100644 index 000000000000..e7ace5e06bf3 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ChildCatAllOf.md @@ -0,0 +1,22 @@ + + +# ChildCatAllOf + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] +**petType** | [**PetTypeEnum**](#PetTypeEnum) | | [optional] + + + +## Enum: PetTypeEnum + +Name | Value +---- | ----- +CHILDCAT | "ChildCat" + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ClassModel.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ClassModel.md new file mode 100644 index 000000000000..04beba3384a1 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ClassModel.md @@ -0,0 +1,14 @@ + + +# ClassModel + +Model for testing model with \"_class\" property + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**propertyClass** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Client.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Client.md new file mode 100644 index 000000000000..125a20b3fcee --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Client.md @@ -0,0 +1,13 @@ + + +# Client + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ComplexQuadrilateral.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ComplexQuadrilateral.md new file mode 100644 index 000000000000..9e7a27f8a591 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ComplexQuadrilateral.md @@ -0,0 +1,14 @@ + + +# ComplexQuadrilateral + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shapeType** | **String** | | +**quadrilateralType** | **String** | | + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/DanishPig.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/DanishPig.md new file mode 100644 index 000000000000..0e86a6716583 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/DanishPig.md @@ -0,0 +1,13 @@ + + +# DanishPig + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/DefaultApi.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/DefaultApi.md new file mode 100644 index 000000000000..311c4fa6bbc1 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/DefaultApi.md @@ -0,0 +1,65 @@ +# DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fooGet**](DefaultApi.md#fooGet) | **GET** /foo | + + + +# **fooGet** +> InlineResponseDefault fooGet() + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + try { + InlineResponseDefault result = apiInstance.fooGet(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#fooGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**InlineResponseDefault**](InlineResponseDefault.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | response | - | + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/DeprecatedObject.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/DeprecatedObject.md new file mode 100644 index 000000000000..d5128bdb84a2 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/DeprecatedObject.md @@ -0,0 +1,13 @@ + + +# DeprecatedObject + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Dog.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Dog.md new file mode 100644 index 000000000000..f4ba57fa3b86 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Dog.md @@ -0,0 +1,13 @@ + + +# Dog + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/DogAllOf.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/DogAllOf.md new file mode 100644 index 000000000000..1f7e23d981b7 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/DogAllOf.md @@ -0,0 +1,13 @@ + + +# DogAllOf + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Drawing.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Drawing.md new file mode 100644 index 000000000000..0874f4811de9 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Drawing.md @@ -0,0 +1,16 @@ + + +# Drawing + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mainShape** | [**Shape**](Shape.md) | | [optional] +**shapeOrNull** | [**ShapeOrNull**](ShapeOrNull.md) | | [optional] +**nullableShape** | [**NullableShape**](NullableShape.md) | | [optional] +**shapes** | [**List<Shape>**](Shape.md) | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/EnumArrays.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/EnumArrays.md new file mode 100644 index 000000000000..94505276726b --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/EnumArrays.md @@ -0,0 +1,32 @@ + + +# EnumArrays + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justSymbol** | [**JustSymbolEnum**](#JustSymbolEnum) | | [optional] +**arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional] + + + +## Enum: JustSymbolEnum + +Name | Value +---- | ----- +GREATER_THAN_OR_EQUAL_TO | ">=" +DOLLAR | "$" + + + +## Enum: List<ArrayEnumEnum> + +Name | Value +---- | ----- +FISH | "fish" +CRAB | "crab" + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/EnumClass.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/EnumClass.md new file mode 100644 index 000000000000..b314590a7591 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/EnumClass.md @@ -0,0 +1,15 @@ + + +# EnumClass + +## Enum + + +* `_ABC` (value: `"_abc"`) + +* `_EFG` (value: `"-efg"`) + +* `_XYZ_` (value: `"(xyz)"`) + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/EnumTest.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/EnumTest.md new file mode 100644 index 000000000000..342b462ccc06 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/EnumTest.md @@ -0,0 +1,68 @@ + + +# EnumTest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] +**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | +**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] +**enumIntegerOnly** | [**EnumIntegerOnlyEnum**](#EnumIntegerOnlyEnum) | | [optional] +**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] +**outerEnum** | **OuterEnum** | | [optional] +**outerEnumInteger** | **OuterEnumInteger** | | [optional] +**outerEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] +**outerEnumIntegerDefaultValue** | **OuterEnumIntegerDefaultValue** | | [optional] + + + +## Enum: EnumStringEnum + +Name | Value +---- | ----- +UPPER | "UPPER" +LOWER | "lower" +EMPTY | "" + + + +## Enum: EnumStringRequiredEnum + +Name | Value +---- | ----- +UPPER | "UPPER" +LOWER | "lower" +EMPTY | "" + + + +## Enum: EnumIntegerEnum + +Name | Value +---- | ----- +NUMBER_1 | 1 +NUMBER_MINUS_1 | -1 + + + +## Enum: EnumIntegerOnlyEnum + +Name | Value +---- | ----- +NUMBER_2 | 2 +NUMBER_MINUS_2 | -2 + + + +## Enum: EnumNumberEnum + +Name | Value +---- | ----- +NUMBER_1_DOT_1 | 1.1 +NUMBER_MINUS_1_DOT_2 | -1.2 + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/EquilateralTriangle.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/EquilateralTriangle.md new file mode 100644 index 000000000000..e4b49735d658 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/EquilateralTriangle.md @@ -0,0 +1,14 @@ + + +# EquilateralTriangle + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shapeType** | **String** | | +**triangleType** | **String** | | + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeApi.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeApi.md new file mode 100644 index 000000000000..3401bb6eeb03 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeApi.md @@ -0,0 +1,1006 @@ +# FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint +[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +[**getArrayOfEnums**](FakeApi.md#getArrayOfEnums) | **GET** /fake/array-of-enums | Array of Enums +[**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | +[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | +[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model +[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +[**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +[**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | + + + +# **fakeHealthGet** +> HealthCheckResult fakeHealthGet() + +Health check endpoint + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + try { + HealthCheckResult result = apiInstance.fakeHealthGet(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeHealthGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**HealthCheckResult**](HealthCheckResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The instance started successfully | - | + + +# **fakeOuterBooleanSerialize** +> Boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Boolean body = true; // Boolean | Input boolean as post body + try { + Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **Boolean**| Input boolean as post body | [optional] + +### Return type + +**Boolean** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output boolean | - | + + +# **fakeOuterCompositeSerialize** +> OuterComposite fakeOuterCompositeSerialize(outerComposite) + + + +Test serialization of object with outer number type + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + OuterComposite outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body + try { + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(outerComposite); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output composite | - | + + +# **fakeOuterNumberSerialize** +> BigDecimal fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + BigDecimal body = new BigDecimal(78); // BigDecimal | Input number as post body + try { + BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **BigDecimal**| Input number as post body | [optional] + +### Return type + +[**BigDecimal**](BigDecimal.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output number | - | + + +# **fakeOuterStringSerialize** +> String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String body = "body_example"; // String | Input string as post body + try { + String result = apiInstance.fakeOuterStringSerialize(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **String**| Input string as post body | [optional] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output string | - | + + +# **getArrayOfEnums** +> List<OuterEnum> getArrayOfEnums() + +Array of Enums + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + try { + List result = apiInstance.getArrayOfEnums(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#getArrayOfEnums"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List<OuterEnum>**](OuterEnum.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Got named array of enums | - | + + +# **testBodyWithFileSchema** +> testBodyWithFileSchema(fileSchemaTestClass) + + + +For this test, the body for this request much reference a schema named `File`. + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass | + try { + apiInstance.testBodyWithFileSchema(fileSchemaTestClass); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithFileSchema"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + + +# **testBodyWithQueryParams** +> testBodyWithQueryParams(query, user) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String query = "query_example"; // String | + User user = new User(); // User | + try { + apiInstance.testBodyWithQueryParams(query, user); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **String**| | + **user** | [**User**](User.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + + +# **testClientModel** +> Client testClientModel(client) + +To test \"client\" model + +To test \"client\" model + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Client client = new Client(); // Client | client model + try { + Client result = apiInstance.testClientModel(client); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testClientModel"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + + +# **testEndpointParameters** +> testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure HTTP basic authorization: http_basic_test + HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test"); + http_basic_test.setUsername("YOUR USERNAME"); + http_basic_test.setPassword("YOUR PASSWORD"); + + FakeApi apiInstance = new FakeApi(defaultClient); + BigDecimal number = new BigDecimal(78); // BigDecimal | None + Double _double = 3.4D; // Double | None + String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None + byte[] _byte = null; // byte[] | None + Integer integer = 56; // Integer | None + Integer int32 = 56; // Integer | None + Long int64 = 56L; // Long | None + Float _float = 3.4F; // Float | None + String string = "string_example"; // String | None + File binary = new File("/path/to/file"); // File | None + LocalDate date = LocalDate.now(); // LocalDate | None + OffsetDateTime dateTime = OffsetDateTime.parse("OffsetDateTime.parse("2010-02-01T09:20:10.111110Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()))"); // OffsetDateTime | None + String password = "password_example"; // String | None + String paramCallback = "paramCallback_example"; // String | None + try { + apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testEndpointParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **BigDecimal**| None | + **_double** | **Double**| None | + **patternWithoutDelimiter** | **String**| None | + **_byte** | **byte[]**| None | + **integer** | **Integer**| None | [optional] + **int32** | **Integer**| None | [optional] + **int64** | **Long**| None | [optional] + **_float** | **Float**| None | [optional] + **string** | **String**| None | [optional] + **binary** | **File**| None | [optional] + **date** | **LocalDate**| None | [optional] + **dateTime** | **OffsetDateTime**| None | [optional] [default to OffsetDateTime.parse("2010-02-01T09:20:10.111110Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()))] + **password** | **String**| None | [optional] + **paramCallback** | **String**| None | [optional] + +### Return type + +null (empty response body) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid username supplied | - | +**404** | User not found | - | + + +# **testEnumParameters** +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) + +To test enum parameters + +To test enum parameters + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) + String enumHeaderString = "_abc"; // String | Header parameter enum test (string) + List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) + String enumQueryString = "_abc"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double) + List enumFormStringArray = Arrays.asList("$"); // List | Form parameter enum test (string array) + String enumFormString = "_abc"; // String | Form parameter enum test (string) + try { + apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testEnumParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] + **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] + **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] + **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] + **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2] + **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] + **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] + **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid request | - | +**404** | Not found | - | + + +# **testGroupParameters** +> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group).stringGroup(stringGroup).booleanGroup(booleanGroup).int64Group(int64Group).execute(); + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure HTTP bearer authorization: bearer_test + HttpBearerAuth bearer_test = (HttpBearerAuth) defaultClient.getAuthentication("bearer_test"); + bearer_test.setBearerToken("BEARER TOKEN"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Integer requiredStringGroup = 56; // Integer | Required String in group parameters + Boolean requiredBooleanGroup = true; // Boolean | Required Boolean in group parameters + Long requiredInt64Group = 56L; // Long | Required Integer in group parameters + Integer stringGroup = 56; // Integer | String in group parameters + Boolean booleanGroup = true; // Boolean | Boolean in group parameters + Long int64Group = 56L; // Long | Integer in group parameters + try { + apiInstance.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group) + .stringGroup(stringGroup) + .booleanGroup(booleanGroup) + .int64Group(int64Group) + .execute(); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testGroupParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requiredStringGroup** | **Integer**| Required String in group parameters | + **requiredBooleanGroup** | **Boolean**| Required Boolean in group parameters | + **requiredInt64Group** | **Long**| Required Integer in group parameters | + **stringGroup** | **Integer**| String in group parameters | [optional] + **booleanGroup** | **Boolean**| Boolean in group parameters | [optional] + **int64Group** | **Long**| Integer in group parameters | [optional] + +### Return type + +null (empty response body) + +### Authorization + +[bearer_test](../README.md#bearer_test) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Someting wrong | - | + + +# **testInlineAdditionalProperties** +> testInlineAdditionalProperties(requestBody) + +test inline additionalProperties + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = new HashMap(); // Map | request body + try { + apiInstance.testInlineAdditionalProperties(requestBody); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requestBody** | [**Map<String, String>**](String.md)| request body | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + + +# **testJsonFormData** +> testJsonFormData(param, param2) + +test json serialization of form data + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String param = "param_example"; // String | field1 + String param2 = "param2_example"; // String | field2 + try { + apiInstance.testJsonFormData(param, param2); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testJsonFormData"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **String**| field1 | + **param2** | **String**| field2 | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + + +# **testQueryParameterCollectionFormat** +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeClassnameTags123Api.md new file mode 100644 index 000000000000..dbd12c37f053 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeClassnameTags123Api.md @@ -0,0 +1,78 @@ +# FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case + + + +# **testClassname** +> Client testClassname(client) + +To test class name in snake case + +To test class name in snake case + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeClassnameTags123Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure API key authorization: api_key_query + ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query"); + api_key_query.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key_query.setApiKeyPrefix("Token"); + + FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(defaultClient); + Client client = new Client(); // Client | client model + try { + Client result = apiInstance.testClassname(client); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/FileSchemaTestClass.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/FileSchemaTestClass.md new file mode 100644 index 000000000000..2602dc746104 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/FileSchemaTestClass.md @@ -0,0 +1,14 @@ + + +# FileSchemaTestClass + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file** | [**java.io.File**](java.io.File.md) | | [optional] +**files** | [**List<java.io.File>**](java.io.File.md) | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Foo.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Foo.md new file mode 100644 index 000000000000..7893cf3f4474 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Foo.md @@ -0,0 +1,13 @@ + + +# Foo + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/FormatTest.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/FormatTest.md new file mode 100644 index 000000000000..91da637f0880 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/FormatTest.md @@ -0,0 +1,28 @@ + + +# FormatTest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **Integer** | | [optional] +**int32** | **Integer** | | [optional] +**int64** | **Long** | | [optional] +**number** | **BigDecimal** | | +**_float** | **Float** | | [optional] +**_double** | **Double** | | [optional] +**decimal** | **BigDecimal** | | [optional] +**string** | **String** | | [optional] +**_byte** | **byte[]** | | +**binary** | **File** | | [optional] +**date** | **LocalDate** | | +**dateTime** | **OffsetDateTime** | | [optional] +**uuid** | **UUID** | | [optional] +**password** | **String** | | +**patternWithDigits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**patternWithDigitsAndDelimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Fruit.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Fruit.md new file mode 100644 index 000000000000..75fcaa52b2c9 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Fruit.md @@ -0,0 +1,16 @@ + + +# Fruit + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**color** | **String** | | [optional] +**cultivar** | **String** | | [optional] +**origin** | **String** | | [optional] +**lengthCm** | **BigDecimal** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/FruitReq.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/FruitReq.md new file mode 100644 index 000000000000..2f45fd6d70ec --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/FruitReq.md @@ -0,0 +1,16 @@ + + +# FruitReq + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cultivar** | **String** | | +**mealy** | **Boolean** | | [optional] +**lengthCm** | **BigDecimal** | | +**sweet** | **Boolean** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/GmFruit.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/GmFruit.md new file mode 100644 index 000000000000..1536d689689e --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/GmFruit.md @@ -0,0 +1,16 @@ + + +# GmFruit + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**color** | **String** | | [optional] +**cultivar** | **String** | | [optional] +**origin** | **String** | | [optional] +**lengthCm** | **BigDecimal** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/GrandparentAnimal.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/GrandparentAnimal.md new file mode 100644 index 000000000000..8c7632266ed1 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/GrandparentAnimal.md @@ -0,0 +1,13 @@ + + +# GrandparentAnimal + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**petType** | **String** | | + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/HasOnlyReadOnly.md new file mode 100644 index 000000000000..6416f8f37158 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/HasOnlyReadOnly.md @@ -0,0 +1,14 @@ + + +# HasOnlyReadOnly + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] [readonly] +**foo** | **String** | | [optional] [readonly] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/HealthCheckResult.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/HealthCheckResult.md new file mode 100644 index 000000000000..80ba4783bbd8 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/HealthCheckResult.md @@ -0,0 +1,14 @@ + + +# HealthCheckResult + +Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nullableMessage** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/InlineResponseDefault.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/InlineResponseDefault.md new file mode 100644 index 000000000000..1c7c639d48cb --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/InlineResponseDefault.md @@ -0,0 +1,13 @@ + + +# InlineResponseDefault + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**string** | [**Foo**](Foo.md) | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/IsoscelesTriangle.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/IsoscelesTriangle.md new file mode 100644 index 000000000000..535e9216413f --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/IsoscelesTriangle.md @@ -0,0 +1,14 @@ + + +# IsoscelesTriangle + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shapeType** | **String** | | +**triangleType** | **String** | | + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Mammal.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Mammal.md new file mode 100644 index 000000000000..891bc30d2885 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Mammal.md @@ -0,0 +1,26 @@ + + +# Mammal + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hasBaleen** | **Boolean** | | [optional] +**hasTeeth** | **Boolean** | | [optional] +**className** | **String** | | +**type** | [**TypeEnum**](#TypeEnum) | | [optional] + + + +## Enum: TypeEnum + +Name | Value +---- | ----- +PLAINS | "plains" +MOUNTAIN | "mountain" +GREVYS | "grevys" + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/MapTest.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/MapTest.md new file mode 100644 index 000000000000..16f3ab934496 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/MapTest.md @@ -0,0 +1,25 @@ + + +# MapTest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapMapOfString** | **Map<String, Map<String, String>>** | | [optional] +**mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] +**directMap** | **Map<String, Boolean>** | | [optional] +**indirectMap** | **Map<String, Boolean>** | | [optional] + + + +## Enum: Map<String, InnerEnum> + +Name | Value +---- | ----- +UPPER | "UPPER" +LOWER | "lower" + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 000000000000..8bc2ed1571fe --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,15 @@ + + +# MixedPropertiesAndAdditionalPropertiesClass + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **UUID** | | [optional] +**dateTime** | **OffsetDateTime** | | [optional] +**map** | [**Map<String, Animal>**](Animal.md) | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Model200Response.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Model200Response.md new file mode 100644 index 000000000000..91c45e494210 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Model200Response.md @@ -0,0 +1,15 @@ + + +# Model200Response + +Model for testing model name starting with number + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **Integer** | | [optional] +**propertyClass** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelApiResponse.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelApiResponse.md new file mode 100644 index 000000000000..aca98405e375 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelApiResponse.md @@ -0,0 +1,15 @@ + + +# ModelApiResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **Integer** | | [optional] +**type** | **String** | | [optional] +**message** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelReturn.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelReturn.md new file mode 100644 index 000000000000..3684358a040f --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelReturn.md @@ -0,0 +1,14 @@ + + +# ModelReturn + +Model for testing reserved words + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_return** | **Integer** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Name.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Name.md new file mode 100644 index 000000000000..219628217ca1 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Name.md @@ -0,0 +1,17 @@ + + +# Name + +Model for testing model name same as property name + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **Integer** | | +**snakeCase** | **Integer** | | [optional] [readonly] +**property** | **String** | | [optional] +**_123number** | **Integer** | | [optional] [readonly] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/NullableClass.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/NullableClass.md new file mode 100644 index 000000000000..c8152be3d314 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/NullableClass.md @@ -0,0 +1,24 @@ + + +# NullableClass + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integerProp** | **Integer** | | [optional] +**numberProp** | **BigDecimal** | | [optional] +**booleanProp** | **Boolean** | | [optional] +**stringProp** | **String** | | [optional] +**dateProp** | **LocalDate** | | [optional] +**datetimeProp** | **OffsetDateTime** | | [optional] +**arrayNullableProp** | **List<Object>** | | [optional] +**arrayAndItemsNullableProp** | **List<Object>** | | [optional] +**arrayItemsNullable** | **List<Object>** | | [optional] +**objectNullableProp** | **Map<String, Object>** | | [optional] +**objectAndItemsNullableProp** | **Map<String, Object>** | | [optional] +**objectItemsNullable** | **Map<String, Object>** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/NullableShape.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/NullableShape.md new file mode 100644 index 000000000000..0b0307116e2a --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/NullableShape.md @@ -0,0 +1,15 @@ + + +# NullableShape + +The value may be a shape or the 'null' value. The 'nullable' attribute was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema >= 3.1. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shapeType** | **String** | | +**quadrilateralType** | **String** | | + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/NumberOnly.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/NumberOnly.md new file mode 100644 index 000000000000..26c0b18032ef --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/NumberOnly.md @@ -0,0 +1,13 @@ + + +# NumberOnly + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justNumber** | **BigDecimal** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ObjectWithDeprecatedFields.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ObjectWithDeprecatedFields.md new file mode 100644 index 000000000000..be55a96c3b7c --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ObjectWithDeprecatedFields.md @@ -0,0 +1,16 @@ + + +# ObjectWithDeprecatedFields + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **String** | | [optional] +**id** | **BigDecimal** | | [optional] +**deprecatedRef** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional] +**bars** | **List<String>** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Order.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Order.md new file mode 100644 index 000000000000..fa708e882413 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Order.md @@ -0,0 +1,28 @@ + + +# Order + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**petId** | **Long** | | [optional] +**quantity** | **Integer** | | [optional] +**shipDate** | **OffsetDateTime** | | [optional] +**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional] +**complete** | **Boolean** | | [optional] + + + +## Enum: StatusEnum + +Name | Value +---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/OuterComposite.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/OuterComposite.md new file mode 100644 index 000000000000..7274cb075938 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/OuterComposite.md @@ -0,0 +1,15 @@ + + +# OuterComposite + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**myNumber** | **BigDecimal** | | [optional] +**myString** | **String** | | [optional] +**myBoolean** | **Boolean** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/OuterEnum.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/OuterEnum.md new file mode 100644 index 000000000000..1f9b723eb8e7 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/OuterEnum.md @@ -0,0 +1,15 @@ + + +# OuterEnum + +## Enum + + +* `PLACED` (value: `"placed"`) + +* `APPROVED` (value: `"approved"`) + +* `DELIVERED` (value: `"delivered"`) + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/OuterEnumDefaultValue.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..cbc7f4ba54d2 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/OuterEnumDefaultValue.md @@ -0,0 +1,15 @@ + + +# OuterEnumDefaultValue + +## Enum + + +* `PLACED` (value: `"placed"`) + +* `APPROVED` (value: `"approved"`) + +* `DELIVERED` (value: `"delivered"`) + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/OuterEnumInteger.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/OuterEnumInteger.md new file mode 100644 index 000000000000..f71dea30ad00 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/OuterEnumInteger.md @@ -0,0 +1,15 @@ + + +# OuterEnumInteger + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..99e6389f4278 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,15 @@ + + +# OuterEnumIntegerDefaultValue + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ParentPet.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ParentPet.md new file mode 100644 index 000000000000..ad7e02196658 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ParentPet.md @@ -0,0 +1,12 @@ + + +# ParentPet + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Pet.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Pet.md new file mode 100644 index 000000000000..8aab74536872 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Pet.md @@ -0,0 +1,28 @@ + + +# Pet + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**name** | **String** | | +**photoUrls** | **List<String>** | | +**tags** | [**List<Tag>**](Tag.md) | | [optional] +**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] + + + +## Enum: StatusEnum + +Name | Value +---- | ----- +AVAILABLE | "available" +PENDING | "pending" +SOLD | "sold" + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/PetApi.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/PetApi.md new file mode 100644 index 000000000000..cca26664dea0 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/PetApi.md @@ -0,0 +1,630 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store +[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet +[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID +[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet +[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image +[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) + + + +# **addPet** +> addPet(pet) + +Add a new pet to the store + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + try { + apiInstance.addPet(pet); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#addPet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +null (empty response body) + +### Authorization + +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**405** | Invalid input | - | + + +# **deletePet** +> deletePet(petId, apiKey) + +Deletes a pet + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | Pet id to delete + String apiKey = "apiKey_example"; // String | + try { + apiInstance.deletePet(petId, apiKey); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#deletePet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| Pet id to delete | + **apiKey** | **String**| | [optional] + +### Return type + +null (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid pet value | - | + + +# **findPetsByStatus** +> List<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + List status = Arrays.asList("available"); // List | Status values that need to be considered for filter + try { + List result = apiInstance.findPetsByStatus(status); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#findPetsByStatus"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid status value | - | + + +# **findPetsByTags** +> List<Pet> findPetsByTags(tags) + +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.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + List tags = Arrays.asList(); // List | Tags to filter by + try { + List result = apiInstance.findPetsByTags(tags); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#findPetsByTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**List<String>**](String.md)| Tags to filter by | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid tag value | - | + + +# **getPetById** +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to return + try { + Pet result = apiInstance.getPetById(petId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#getPetById"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid ID supplied | - | +**404** | Pet not found | - | + + +# **updatePet** +> updatePet(pet) + +Update an existing pet + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + try { + apiInstance.updatePet(pet); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#updatePet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +null (empty response body) + +### Authorization + +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid ID supplied | - | +**404** | Pet not found | - | +**405** | Validation exception | - | + + +# **updatePetWithForm** +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet that needs to be updated + String name = "name_example"; // String | Updated name of the pet + String status = "status_example"; // String | Updated status of the pet + try { + apiInstance.updatePetWithForm(petId, name, status); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#updatePetWithForm"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| ID of pet that needs to be updated | + **name** | **String**| Updated name of the pet | [optional] + **status** | **String**| Updated status of the pet | [optional] + +### Return type + +null (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**405** | Invalid input | - | + + +# **uploadFile** +> ModelApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to update + String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server + File file = new File("/path/to/file"); // File | file to upload + try { + ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#uploadFile"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| ID of pet to update | + **additionalMetadata** | **String**| Additional data to pass to server | [optional] + **file** | **File**| file to upload | [optional] + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + + +# **uploadFileWithRequiredFile** +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + +uploads an image (required) + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to update + File requiredFile = new File("/path/to/file"); // File | file to upload + String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server + try { + ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| ID of pet to update | + **requiredFile** | **File**| file to upload | + **additionalMetadata** | **String**| Additional data to pass to server | [optional] + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Pig.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Pig.md new file mode 100644 index 000000000000..b3b94d035639 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Pig.md @@ -0,0 +1,13 @@ + + +# Pig + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Quadrilateral.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Quadrilateral.md new file mode 100644 index 000000000000..208f4899d27c --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Quadrilateral.md @@ -0,0 +1,14 @@ + + +# Quadrilateral + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shapeType** | **String** | | +**quadrilateralType** | **String** | | + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/QuadrilateralInterface.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/QuadrilateralInterface.md new file mode 100644 index 000000000000..a26b27107797 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/QuadrilateralInterface.md @@ -0,0 +1,13 @@ + + +# QuadrilateralInterface + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**quadrilateralType** | **String** | | + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ReadOnlyFirst.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ReadOnlyFirst.md new file mode 100644 index 000000000000..a329bf4419a2 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ReadOnlyFirst.md @@ -0,0 +1,14 @@ + + +# ReadOnlyFirst + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] [readonly] +**baz** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ScaleneTriangle.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ScaleneTriangle.md new file mode 100644 index 000000000000..f49fe5a12f33 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ScaleneTriangle.md @@ -0,0 +1,14 @@ + + +# ScaleneTriangle + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shapeType** | **String** | | +**triangleType** | **String** | | + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Shape.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Shape.md new file mode 100644 index 000000000000..ff25b8670e9b --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Shape.md @@ -0,0 +1,14 @@ + + +# Shape + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shapeType** | **String** | | +**quadrilateralType** | **String** | | + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ShapeInterface.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ShapeInterface.md new file mode 100644 index 000000000000..f8b65a8a9720 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ShapeInterface.md @@ -0,0 +1,13 @@ + + +# ShapeInterface + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shapeType** | **String** | | + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ShapeOrNull.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ShapeOrNull.md new file mode 100644 index 000000000000..633d68d670ca --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ShapeOrNull.md @@ -0,0 +1,15 @@ + + +# ShapeOrNull + +The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shapeType** | **String** | | +**quadrilateralType** | **String** | | + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/SimpleQuadrilateral.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/SimpleQuadrilateral.md new file mode 100644 index 000000000000..c2cf751d1b8a --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/SimpleQuadrilateral.md @@ -0,0 +1,14 @@ + + +# SimpleQuadrilateral + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shapeType** | **String** | | +**quadrilateralType** | **String** | | + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/SpecialModelName.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/SpecialModelName.md new file mode 100644 index 000000000000..352611142df0 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/SpecialModelName.md @@ -0,0 +1,14 @@ + + +# SpecialModelName + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**$specialPropertyName** | **Long** | | [optional] +**specialModelName** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/StoreApi.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/StoreApi.md new file mode 100644 index 000000000000..270388f5e444 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/StoreApi.md @@ -0,0 +1,264 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID +[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet + + + +# **deleteOrder** +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + String orderId = "orderId_example"; // String | ID of the order that needs to be deleted + try { + apiInstance.deleteOrder(orderId); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#deleteOrder"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **String**| ID of the order that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid ID supplied | - | +**404** | Order not found | - | + + +# **getInventory** +> Map<String, Integer> getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); + + StoreApi apiInstance = new StoreApi(defaultClient); + try { + Map result = apiInstance.getInventory(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#getInventory"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**Map<String, Integer>** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + + +# **getOrderById** +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + Long orderId = 56L; // Long | ID of pet that needs to be fetched + try { + Order result = apiInstance.getOrderById(orderId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#getOrderById"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **Long**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid ID supplied | - | +**404** | Order not found | - | + + +# **placeOrder** +> Order placeOrder(order) + +Place an order for a pet + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + Order order = new Order(); // Order | order placed for purchasing the pet + try { + Order result = apiInstance.placeOrder(order); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#placeOrder"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid Order | - | + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/StringBooleanMap.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/StringBooleanMap.md new file mode 100644 index 000000000000..cac7afc80e07 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/StringBooleanMap.md @@ -0,0 +1,9 @@ + +# StringBooleanMap + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Tag.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Tag.md new file mode 100644 index 000000000000..70d36f5d0d4d --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Tag.md @@ -0,0 +1,14 @@ + + +# Tag + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**name** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Triangle.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Triangle.md new file mode 100644 index 000000000000..0a3af5adc4ff --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Triangle.md @@ -0,0 +1,14 @@ + + +# Triangle + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shapeType** | **String** | | +**triangleType** | **String** | | + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/TriangleInterface.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/TriangleInterface.md new file mode 100644 index 000000000000..525872029f5c --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/TriangleInterface.md @@ -0,0 +1,13 @@ + + +# TriangleInterface + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**triangleType** | **String** | | + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/TypeHolderDefault.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/TypeHolderDefault.md new file mode 100644 index 000000000000..8340befcae5c --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/TypeHolderDefault.md @@ -0,0 +1,17 @@ + + +# TypeHolderDefault + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**stringItem** | **String** | | +**numberItem** | **BigDecimal** | | +**integerItem** | **Integer** | | +**boolItem** | **Boolean** | | +**arrayItem** | **List<Integer>** | | + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/TypeHolderExample.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/TypeHolderExample.md new file mode 100644 index 000000000000..2396fdf17653 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/TypeHolderExample.md @@ -0,0 +1,18 @@ + + +# TypeHolderExample + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**stringItem** | **String** | | +**numberItem** | **BigDecimal** | | +**floatItem** | **Float** | | +**integerItem** | **Integer** | | +**boolItem** | **Boolean** | | +**arrayItem** | **List<Integer>** | | + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/User.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/User.md new file mode 100644 index 000000000000..c29bce5c1261 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/User.md @@ -0,0 +1,24 @@ + + +# User + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**username** | **String** | | [optional] +**firstName** | **String** | | [optional] +**lastName** | **String** | | [optional] +**email** | **String** | | [optional] +**password** | **String** | | [optional] +**phone** | **String** | | [optional] +**userStatus** | **Integer** | User Status | [optional] +**objectWithNoDeclaredProps** | **Object** | test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. | [optional] +**objectWithNoDeclaredPropsNullable** | **Object** | test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. | [optional] +**anyTypeProp** | **Object** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 | [optional] +**anyTypePropNullable** | **Object** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/UserApi.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/UserApi.md new file mode 100644 index 000000000000..26a0642e3235 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/UserApi.md @@ -0,0 +1,501 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserApi.md#createUser) | **POST** /user | Create user +[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + + +# **createUser** +> createUser(user) + +Create user + +This can only be done by the logged in user. + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + User user = new User(); // User | Created user object + try { + apiInstance.createUser(user); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**User**](User.md)| Created user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(user) + +Creates list of users with given input array + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + List user = Arrays.asList(); // List | List of user object + try { + apiInstance.createUsersWithArrayInput(user); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**List<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + + +# **createUsersWithListInput** +> createUsersWithListInput(user) + +Creates list of users with given input array + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + List user = Arrays.asList(); // List | List of user object + try { + apiInstance.createUsersWithListInput(user); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUsersWithListInput"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**List<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + + +# **deleteUser** +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The name that needs to be deleted + try { + apiInstance.deleteUser(username); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#deleteUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid username supplied | - | +**404** | User not found | - | + + +# **getUserByName** +> User getUserByName(username) + +Get user by user name + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. + try { + User result = apiInstance.getUserByName(username); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#getUserByName"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid username supplied | - | +**404** | User not found | - | + + +# **loginUser** +> String loginUser(username, password) + +Logs user into the system + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The user name for login + String password = "password_example"; // String | The password for login in clear text + try { + String result = apiInstance.loginUser(username, password); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#loginUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The user name for login | + **password** | **String**| The password for login in clear text | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
    * X-Expires-After - date in UTC when token expires
    | +**400** | Invalid username/password supplied | - | + + +# **logoutUser** +> logoutUser() + +Logs out current logged in user session + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + try { + apiInstance.logoutUser(); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#logoutUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + + +# **updateUser** +> updateUser(username, user) + +Updated user + +This can only be done by the logged in user. + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | name that need to be deleted + User user = new User(); // User | Updated user object + try { + apiInstance.updateUser(username, user); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#updateUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| name that need to be deleted | + **user** | [**User**](User.md)| Updated user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid user supplied | - | +**404** | User not found | - | + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Whale.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Whale.md new file mode 100644 index 000000000000..87470ae5fac7 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Whale.md @@ -0,0 +1,15 @@ + + +# Whale + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hasBaleen** | **Boolean** | | [optional] +**hasTeeth** | **Boolean** | | [optional] +**className** | **String** | | + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/XmlItem.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/XmlItem.md new file mode 100644 index 000000000000..8c184da283df --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/XmlItem.md @@ -0,0 +1,41 @@ + + +# XmlItem + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attributeString** | **String** | | [optional] +**attributeNumber** | **BigDecimal** | | [optional] +**attributeInteger** | **Integer** | | [optional] +**attributeBoolean** | **Boolean** | | [optional] +**wrappedArray** | **List<Integer>** | | [optional] +**nameString** | **String** | | [optional] +**nameNumber** | **BigDecimal** | | [optional] +**nameInteger** | **Integer** | | [optional] +**nameBoolean** | **Boolean** | | [optional] +**nameArray** | **List<Integer>** | | [optional] +**nameWrappedArray** | **List<Integer>** | | [optional] +**prefixString** | **String** | | [optional] +**prefixNumber** | **BigDecimal** | | [optional] +**prefixInteger** | **Integer** | | [optional] +**prefixBoolean** | **Boolean** | | [optional] +**prefixArray** | **List<Integer>** | | [optional] +**prefixWrappedArray** | **List<Integer>** | | [optional] +**namespaceString** | **String** | | [optional] +**namespaceNumber** | **BigDecimal** | | [optional] +**namespaceInteger** | **Integer** | | [optional] +**namespaceBoolean** | **Boolean** | | [optional] +**namespaceArray** | **List<Integer>** | | [optional] +**namespaceWrappedArray** | **List<Integer>** | | [optional] +**prefixNsString** | **String** | | [optional] +**prefixNsNumber** | **BigDecimal** | | [optional] +**prefixNsInteger** | **Integer** | | [optional] +**prefixNsBoolean** | **Boolean** | | [optional] +**prefixNsArray** | **List<Integer>** | | [optional] +**prefixNsWrappedArray** | **List<Integer>** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Zebra.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Zebra.md new file mode 100644 index 000000000000..eafe1861f2be --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Zebra.md @@ -0,0 +1,24 @@ + + +# Zebra + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**TypeEnum**](#TypeEnum) | | [optional] +**className** | **String** | | + + + +## Enum: TypeEnum + +Name | Value +---- | ----- +PLAINS | "plains" +MOUNTAIN | "mountain" +GREVYS | "grevys" + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/git_push.sh b/samples/client/petstore/java/okhttp-gson-nextgen/git_push.sh new file mode 100644 index 000000000000..f53a75d4fabe --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/gradle.properties b/samples/client/petstore/java/okhttp-gson-nextgen/gradle.properties new file mode 100644 index 000000000000..a3408578278a --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/okhttp-gson-nextgen/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..7454180f2ae8848c63b8b4dea2cb829da983f2fa GIT binary patch literal 59536 zcma&NbC71ylI~qywr$(CZQJHswz}-9F59+k+g;UV+cs{`J?GrGXYR~=-ydruB3JCa zB64N^cILAcWk5iofq)<(fq;O7{th4@;QxID0)qN`mJ?GIqLY#rX8-|G{5M0pdVW5^ zzXk$-2kQTAC?_N@B`&6-N-rmVFE=$QD?>*=4<|!MJu@}isLc4AW#{m2if&A5T5g&~ ziuMQeS*U5sL6J698wOd)K@oK@1{peP5&Esut<#VH^u)gp`9H4)`uE!2$>RTctN+^u z=ASkePDZA-X8)rp%D;p*~P?*a_=*Kwc<^>QSH|^<0>o37lt^+Mj1;4YvJ(JR-Y+?%Nu}JAYj5 z_Qc5%Ao#F?q32i?ZaN2OSNhWL;2oDEw_({7ZbgUjna!Fqn3NzLM@-EWFPZVmc>(fZ z0&bF-Ch#p9C{YJT9Rcr3+Y_uR^At1^BxZ#eo>$PLJF3=;t_$2|t+_6gg5(j{TmjYU zK12c&lE?Eh+2u2&6Gf*IdKS&6?rYbSEKBN!rv{YCm|Rt=UlPcW9j`0o6{66#y5t9C zruFA2iKd=H%jHf%ypOkxLnO8#H}#Zt{8p!oi6)7#NqoF({t6|J^?1e*oxqng9Q2Cc zg%5Vu!em)}Yuj?kaP!D?b?(C*w!1;>R=j90+RTkyEXz+9CufZ$C^umX^+4|JYaO<5 zmIM3#dv`DGM;@F6;(t!WngZSYzHx?9&$xEF70D1BvfVj<%+b#)vz)2iLCrTeYzUcL z(OBnNoG6Le%M+@2oo)&jdOg=iCszzv59e zDRCeaX8l1hC=8LbBt|k5?CXgep=3r9BXx1uR8!p%Z|0+4Xro=xi0G!e{c4U~1j6!) zH6adq0}#l{%*1U(Cb%4AJ}VLWKBPi0MoKFaQH6x?^hQ!6em@993xdtS%_dmevzeNl z(o?YlOI=jl(`L9^ z0O+H9k$_@`6L13eTT8ci-V0ljDMD|0ifUw|Q-Hep$xYj0hTO@0%IS^TD4b4n6EKDG z??uM;MEx`s98KYN(K0>c!C3HZdZ{+_53DO%9k5W%pr6yJusQAv_;IA}925Y%;+!tY z%2k!YQmLLOr{rF~!s<3-WEUs)`ix_mSU|cNRBIWxOox_Yb7Z=~Q45ZNe*u|m^|)d* zog=i>`=bTe!|;8F+#H>EjIMcgWcG2ORD`w0WD;YZAy5#s{65~qfI6o$+Ty&-hyMyJ z3Ra~t>R!p=5ZpxA;QkDAoPi4sYOP6>LT+}{xp}tk+<0k^CKCFdNYG(Es>p0gqD)jP zWOeX5G;9(m@?GOG7g;e74i_|SmE?`B2i;sLYwRWKLy0RLW!Hx`=!LH3&k=FuCsM=9M4|GqzA)anEHfxkB z?2iK-u(DC_T1};KaUT@3nP~LEcENT^UgPvp!QC@Dw&PVAhaEYrPey{nkcn(ro|r7XUz z%#(=$7D8uP_uU-oPHhd>>^adbCSQetgSG`e$U|7mr!`|bU0aHl_cmL)na-5x1#OsVE#m*+k84Y^+UMeSAa zbrVZHU=mFwXEaGHtXQq`2ZtjfS!B2H{5A<3(nb-6ARVV8kEmOkx6D2x7~-6hl;*-*}2Xz;J#a8Wn;_B5=m zl3dY;%krf?i-Ok^Pal-}4F`{F@TYPTwTEhxpZK5WCpfD^UmM_iYPe}wpE!Djai6_{ z*pGO=WB47#Xjb7!n2Ma)s^yeR*1rTxp`Mt4sfA+`HwZf%!7ZqGosPkw69`Ix5Ku6G z@Pa;pjzV&dn{M=QDx89t?p?d9gna*}jBly*#1!6}5K<*xDPJ{wv4& zM$17DFd~L*Te3A%yD;Dp9UGWTjRxAvMu!j^Tbc}2v~q^59d4bz zvu#!IJCy(BcWTc`;v$9tH;J%oiSJ_i7s;2`JXZF+qd4C)vY!hyCtl)sJIC{ebI*0> z@x>;EzyBv>AI-~{D6l6{ST=em*U( z(r$nuXY-#CCi^8Z2#v#UXOt`dbYN1z5jzNF2 z411?w)whZrfA20;nl&C1Gi+gk<`JSm+{|*2o<< zqM#@z_D`Cn|0H^9$|Tah)0M_X4c37|KQ*PmoT@%xHc3L1ZY6(p(sNXHa&49Frzto& zR`c~ClHpE~4Z=uKa5S(-?M8EJ$zt0&fJk~p$M#fGN1-y$7!37hld`Uw>Urri(DxLa;=#rK0g4J)pXMC zxzraOVw1+kNWpi#P=6(qxf`zSdUC?D$i`8ZI@F>k6k zz21?d+dw7b&i*>Kv5L(LH-?J%@WnqT7j#qZ9B>|Zl+=> z^U-pV@1y_ptHo4hl^cPRWewbLQ#g6XYQ@EkiP z;(=SU!yhjHp%1&MsU`FV1Z_#K1&(|5n(7IHbx&gG28HNT)*~-BQi372@|->2Aw5It z0CBpUcMA*QvsPy)#lr!lIdCi@1k4V2m!NH)%Px(vu-r(Q)HYc!p zJ^$|)j^E#q#QOgcb^pd74^JUi7fUmMiNP_o*lvx*q%_odv49Dsv$NV;6J z9GOXKomA{2Pb{w}&+yHtH?IkJJu~}Z?{Uk++2mB8zyvh*xhHKE``99>y#TdD z&(MH^^JHf;g(Tbb^&8P*;_i*2&fS$7${3WJtV7K&&(MBV2~)2KB3%cWg#1!VE~k#C z!;A;?p$s{ihyojEZz+$I1)L}&G~ml=udD9qh>Tu(ylv)?YcJT3ihapi!zgPtWb*CP zlLLJSRCj-^w?@;RU9aL2zDZY1`I3d<&OMuW=c3$o0#STpv_p3b9Wtbql>w^bBi~u4 z3D8KyF?YE?=HcKk!xcp@Cigvzy=lnFgc^9c%(^F22BWYNAYRSho@~*~S)4%AhEttv zvq>7X!!EWKG?mOd9&n>vvH1p4VzE?HCuxT-u+F&mnsfDI^}*-d00-KAauEaXqg3k@ zy#)MGX!X;&3&0s}F3q40ZmVM$(H3CLfpdL?hB6nVqMxX)q=1b}o_PG%r~hZ4gUfSp zOH4qlEOW4OMUc)_m)fMR_rl^pCfXc{$fQbI*E&mV77}kRF z&{<06AJyJ!e863o-V>FA1a9Eemx6>^F$~9ppt()ZbPGfg_NdRXBWoZnDy2;#ODgf! zgl?iOcF7Meo|{AF>KDwTgYrJLb$L2%%BEtO>T$C?|9bAB&}s;gI?lY#^tttY&hfr# zKhC+&b-rpg_?~uVK%S@mQleU#_xCsvIPK*<`E0fHE1&!J7!xD#IB|SSPW6-PyuqGn3^M^Rz%WT{e?OI^svARX&SAdU77V(C~ zM$H{Kg59op{<|8ry9ecfP%=kFm(-!W&?U0@<%z*+!*<e0XesMxRFu9QnGqun6R_%T+B%&9Dtk?*d$Q zb~>84jEAPi@&F@3wAa^Lzc(AJz5gsfZ7J53;@D<;Klpl?sK&u@gie`~vTsbOE~Cd4 z%kr56mI|#b(Jk&;p6plVwmNB0H@0SmgdmjIn5Ne@)}7Vty(yb2t3ev@22AE^s!KaN zyQ>j+F3w=wnx7w@FVCRe+`vUH)3gW%_72fxzqX!S&!dchdkRiHbXW1FMrIIBwjsai8`CB2r4mAbwp%rrO>3B$Zw;9=%fXI9B{d(UzVap7u z6piC-FQ)>}VOEuPpuqznpY`hN4dGa_1Xz9rVg(;H$5Te^F0dDv*gz9JS<|>>U0J^# z6)(4ICh+N_Q`Ft0hF|3fSHs*?a=XC;e`sJaU9&d>X4l?1W=|fr!5ShD|nv$GK;j46@BV6+{oRbWfqOBRb!ir88XD*SbC(LF}I1h#6@dvK%Toe%@ zhDyG$93H8Eu&gCYddP58iF3oQH*zLbNI;rN@E{T9%A8!=v#JLxKyUe}e}BJpB{~uN zqgxRgo0*-@-iaHPV8bTOH(rS(huwK1Xg0u+e!`(Irzu@Bld&s5&bWgVc@m7;JgELd zimVs`>vQ}B_1(2#rv#N9O`fJpVfPc7V2nv34PC);Dzbb;p!6pqHzvy?2pD&1NE)?A zt(t-ucqy@wn9`^MN5apa7K|L=9>ISC>xoc#>{@e}m#YAAa1*8-RUMKwbm|;5p>T`Z zNf*ph@tnF{gmDa3uwwN(g=`Rh)4!&)^oOy@VJaK4lMT&5#YbXkl`q?<*XtsqD z9PRK6bqb)fJw0g-^a@nu`^?71k|m3RPRjt;pIkCo1{*pdqbVs-Yl>4E>3fZx3Sv44grW=*qdSoiZ9?X0wWyO4`yDHh2E!9I!ZFi zVL8|VtW38}BOJHW(Ax#KL_KQzarbuE{(%TA)AY)@tY4%A%P%SqIU~8~-Lp3qY;U-} z`h_Gel7;K1h}7$_5ZZT0&%$Lxxr-<89V&&TCsu}LL#!xpQ1O31jaa{U34~^le*Y%L za?7$>Jk^k^pS^_M&cDs}NgXlR>16AHkSK-4TRaJSh#h&p!-!vQY%f+bmn6x`4fwTp z$727L^y`~!exvmE^W&#@uY!NxJi`g!i#(++!)?iJ(1)2Wk;RN zFK&O4eTkP$Xn~4bB|q8y(btx$R#D`O@epi4ofcETrx!IM(kWNEe42Qh(8*KqfP(c0 zouBl6>Fc_zM+V;F3znbo{x#%!?mH3`_ANJ?y7ppxS@glg#S9^MXu|FM&ynpz3o&Qh z2ujAHLF3($pH}0jXQsa#?t--TnF1P73b?4`KeJ9^qK-USHE)4!IYgMn-7z|=ALF5SNGkrtPG@Y~niUQV2?g$vzJN3nZ{7;HZHzWAeQ;5P|@Tl3YHpyznGG4-f4=XflwSJY+58-+wf?~Fg@1p1wkzuu-RF3j2JX37SQUc? zQ4v%`V8z9ZVZVqS8h|@@RpD?n0W<=hk=3Cf8R?d^9YK&e9ZybFY%jdnA)PeHvtBe- zhMLD+SSteHBq*q)d6x{)s1UrsO!byyLS$58WK;sqip$Mk{l)Y(_6hEIBsIjCr5t>( z7CdKUrJTrW%qZ#1z^n*Lb8#VdfzPw~OIL76aC+Rhr<~;4Tl!sw?Rj6hXj4XWa#6Tp z@)kJ~qOV)^Rh*-?aG>ic2*NlC2M7&LUzc9RT6WM%Cpe78`iAowe!>(T0jo&ivn8-7 zs{Qa@cGy$rE-3AY0V(l8wjI^uB8Lchj@?L}fYal^>T9z;8juH@?rG&g-t+R2dVDBe zq!K%{e-rT5jX19`(bP23LUN4+_zh2KD~EAYzhpEO3MUG8@}uBHH@4J zd`>_(K4q&>*k82(dDuC)X6JuPrBBubOg7qZ{?x!r@{%0);*`h*^F|%o?&1wX?Wr4b z1~&cy#PUuES{C#xJ84!z<1tp9sfrR(i%Tu^jnXy;4`Xk;AQCdFC@?V%|; zySdC7qS|uQRcH}EFZH%mMB~7gi}a0utE}ZE_}8PQH8f;H%PN41Cb9R%w5Oi5el^fd z$n{3SqLCnrF##x?4sa^r!O$7NX!}&}V;0ZGQ&K&i%6$3C_dR%I7%gdQ;KT6YZiQrW zk%q<74oVBV>@}CvJ4Wj!d^?#Zwq(b$E1ze4$99DuNg?6t9H}k_|D7KWD7i0-g*EO7 z;5{hSIYE4DMOK3H%|f5Edx+S0VI0Yw!tsaRS2&Il2)ea^8R5TG72BrJue|f_{2UHa z@w;^c|K3da#$TB0P3;MPlF7RuQeXT$ zS<<|C0OF(k)>fr&wOB=gP8!Qm>F41u;3esv7_0l%QHt(~+n; zf!G6%hp;Gfa9L9=AceiZs~tK+Tf*Wof=4!u{nIO90jH@iS0l+#%8=~%ASzFv7zqSB^?!@N7)kp0t&tCGLmzXSRMRyxCmCYUD2!B`? zhs$4%KO~m=VFk3Buv9osha{v+mAEq=ik3RdK@;WWTV_g&-$U4IM{1IhGX{pAu%Z&H zFfwCpUsX%RKg);B@7OUzZ{Hn{q6Vv!3#8fAg!P$IEx<0vAx;GU%}0{VIsmFBPq_mb zpe^BChDK>sc-WLKl<6 zwbW|e&d&dv9Wu0goueyu>(JyPx1mz0v4E?cJjFuKF71Q1)AL8jHO$!fYT3(;U3Re* zPPOe%*O+@JYt1bW`!W_1!mN&=w3G9ru1XsmwfS~BJ))PhD(+_J_^N6j)sx5VwbWK| zwRyC?W<`pOCY)b#AS?rluxuuGf-AJ=D!M36l{ua?@SJ5>e!IBr3CXIxWw5xUZ@Xrw z_R@%?{>d%Ld4p}nEsiA@v*nc6Ah!MUs?GA7e5Q5lPpp0@`%5xY$C;{%rz24$;vR#* zBP=a{)K#CwIY%p} zXVdxTQ^HS@O&~eIftU+Qt^~(DGxrdi3k}DdT^I7Iy5SMOp$QuD8s;+93YQ!OY{eB24%xY7ml@|M7I(Nb@K_-?F;2?et|CKkuZK_>+>Lvg!>JE~wN`BI|_h6$qi!P)+K-1Hh(1;a`os z55)4Q{oJiA(lQM#;w#Ta%T0jDNXIPM_bgESMCDEg6rM33anEr}=|Fn6)|jBP6Y}u{ zv9@%7*#RI9;fv;Yii5CI+KrRdr0DKh=L>)eO4q$1zmcSmglsV`*N(x=&Wx`*v!!hn6X-l0 zP_m;X??O(skcj+oS$cIdKhfT%ABAzz3w^la-Ucw?yBPEC+=Pe_vU8nd-HV5YX6X8r zZih&j^eLU=%*;VzhUyoLF;#8QsEfmByk+Y~caBqSvQaaWf2a{JKB9B>V&r?l^rXaC z8)6AdR@Qy_BxQrE2Fk?ewD!SwLuMj@&d_n5RZFf7=>O>hzVE*seW3U?_p|R^CfoY`?|#x9)-*yjv#lo&zP=uI`M?J zbzC<^3x7GfXA4{FZ72{PE*-mNHyy59Q;kYG@BB~NhTd6pm2Oj=_ zizmD?MKVRkT^KmXuhsk?eRQllPo2Ubk=uCKiZ&u3Xjj~<(!M94c)Tez@9M1Gfs5JV z->@II)CDJOXTtPrQudNjE}Eltbjq>6KiwAwqvAKd^|g!exgLG3;wP+#mZYr`cy3#39e653d=jrR-ulW|h#ddHu(m9mFoW~2yE zz5?dB%6vF}+`-&-W8vy^OCxm3_{02royjvmwjlp+eQDzFVEUiyO#gLv%QdDSI#3W* z?3!lL8clTaNo-DVJw@ynq?q!%6hTQi35&^>P85G$TqNt78%9_sSJt2RThO|JzM$iL zg|wjxdMC2|Icc5rX*qPL(coL!u>-xxz-rFiC!6hD1IR%|HSRsV3>Kq~&vJ=s3M5y8SG%YBQ|{^l#LGlg!D?E>2yR*eV%9m$_J6VGQ~AIh&P$_aFbh zULr0Z$QE!QpkP=aAeR4ny<#3Fwyw@rZf4?Ewq`;mCVv}xaz+3ni+}a=k~P+yaWt^L z@w67!DqVf7D%7XtXX5xBW;Co|HvQ8WR1k?r2cZD%U;2$bsM%u8{JUJ5Z0k= zZJARv^vFkmWx15CB=rb=D4${+#DVqy5$C%bf`!T0+epLJLnh1jwCdb*zuCL}eEFvE z{rO1%gxg>1!W(I!owu*mJZ0@6FM(?C+d*CeceZRW_4id*D9p5nzMY&{mWqrJomjIZ z97ZNnZ3_%Hx8dn;H>p8m7F#^2;T%yZ3H;a&N7tm=Lvs&lgJLW{V1@h&6Vy~!+Ffbb zv(n3+v)_D$}dqd!2>Y2B)#<+o}LH#%ogGi2-?xRIH)1!SD)u-L65B&bsJTC=LiaF+YOCif2dUX6uAA|#+vNR z>U+KQekVGon)Yi<93(d!(yw1h3&X0N(PxN2{%vn}cnV?rYw z$N^}_o!XUB!mckL`yO1rnUaI4wrOeQ(+&k?2mi47hzxSD`N#-byqd1IhEoh!PGq>t z_MRy{5B0eKY>;Ao3z$RUU7U+i?iX^&r739F)itdrTpAi-NN0=?^m%?{A9Ly2pVv>Lqs6moTP?T2-AHqFD-o_ znVr|7OAS#AEH}h8SRPQ@NGG47dO}l=t07__+iK8nHw^(AHx&Wb<%jPc$$jl6_p(b$ z)!pi(0fQodCHfM)KMEMUR&UID>}m^(!{C^U7sBDOA)$VThRCI0_+2=( zV8mMq0R(#z;C|7$m>$>`tX+T|xGt(+Y48@ZYu#z;0pCgYgmMVbFb!$?%yhZqP_nhn zy4<#3P1oQ#2b51NU1mGnHP$cf0j-YOgAA}A$QoL6JVLcmExs(kU{4z;PBHJD%_=0F z>+sQV`mzijSIT7xn%PiDKHOujX;n|M&qr1T@rOxTdxtZ!&u&3HHFLYD5$RLQ=heur zb>+AFokUVQeJy-#LP*^)spt{mb@Mqe=A~-4p0b+Bt|pZ+@CY+%x}9f}izU5;4&QFE zO1bhg&A4uC1)Zb67kuowWY4xbo&J=%yoXlFB)&$d*-}kjBu|w!^zbD1YPc0-#XTJr z)pm2RDy%J3jlqSMq|o%xGS$bPwn4AqitC6&e?pqWcjWPt{3I{>CBy;hg0Umh#c;hU3RhCUX=8aR>rmd` z7Orw(5tcM{|-^J?ZAA9KP|)X6n9$-kvr#j5YDecTM6n z&07(nD^qb8hpF0B^z^pQ*%5ePYkv&FabrlI61ntiVp!!C8y^}|<2xgAd#FY=8b*y( zuQOuvy2`Ii^`VBNJB&R!0{hABYX55ooCAJSSevl4RPqEGb)iy_0H}v@vFwFzD%>#I>)3PsouQ+_Kkbqy*kKdHdfkN7NBcq%V{x^fSxgXpg7$bF& zj!6AQbDY(1u#1_A#1UO9AxiZaCVN2F0wGXdY*g@x$ByvUA?ePdide0dmr#}udE%K| z3*k}Vv2Ew2u1FXBaVA6aerI36R&rzEZeDDCl5!t0J=ug6kuNZzH>3i_VN`%BsaVB3 zQYw|Xub_SGf{)F{$ZX5`Jc!X!;eybjP+o$I{Z^Hsj@D=E{MnnL+TbC@HEU2DjG{3-LDGIbq()U87x4eS;JXnSh;lRlJ z>EL3D>wHt-+wTjQF$fGyDO$>d+(fq@bPpLBS~xA~R=3JPbS{tzN(u~m#Po!?H;IYv zE;?8%^vle|%#oux(Lj!YzBKv+Fd}*Ur-dCBoX*t{KeNM*n~ZPYJ4NNKkI^MFbz9!v z4(Bvm*Kc!-$%VFEewYJKz-CQN{`2}KX4*CeJEs+Q(!kI%hN1!1P6iOq?ovz}X0IOi z)YfWpwW@pK08^69#wSyCZkX9?uZD?C^@rw^Y?gLS_xmFKkooyx$*^5#cPqntNTtSG zlP>XLMj2!VF^0k#ole7`-c~*~+_T5ls?x4)ah(j8vo_ zwb%S8qoaZqY0-$ZI+ViIA_1~~rAH7K_+yFS{0rT@eQtTAdz#8E5VpwnW!zJ_^{Utv zlW5Iar3V5t&H4D6A=>?mq;G92;1cg9a2sf;gY9pJDVKn$DYdQlvfXq}zz8#LyPGq@ z+`YUMD;^-6w&r-82JL7mA8&M~Pj@aK!m{0+^v<|t%APYf7`}jGEhdYLqsHW-Le9TL z_hZZ1gbrz7$f9^fAzVIP30^KIz!!#+DRLL+qMszvI_BpOSmjtl$hh;&UeM{ER@INV zcI}VbiVTPoN|iSna@=7XkP&-4#06C};8ajbxJ4Gcq8(vWv4*&X8bM^T$mBk75Q92j z1v&%a;OSKc8EIrodmIiw$lOES2hzGDcjjB`kEDfJe{r}yE6`eZL zEB`9u>Cl0IsQ+t}`-cx}{6jqcANucqIB>Qmga_&<+80E2Q|VHHQ$YlAt{6`Qu`HA3 z03s0-sSlwbvgi&_R8s={6<~M^pGvBNjKOa>tWenzS8s zR>L7R5aZ=mSU{f?ib4Grx$AeFvtO5N|D>9#)ChH#Fny2maHWHOf2G=#<9Myot#+4u zWVa6d^Vseq_0=#AYS(-m$Lp;*8nC_6jXIjEM`omUmtH@QDs3|G)i4j*#_?#UYVZvJ z?YjT-?!4Q{BNun;dKBWLEw2C-VeAz`%?A>p;)PL}TAZn5j~HK>v1W&anteARlE+~+ zj>c(F;?qO3pXBb|#OZdQnm<4xWmn~;DR5SDMxt0UK_F^&eD|KZ=O;tO3vy4@4h^;2 zUL~-z`-P1aOe?|ZC1BgVsL)2^J-&vIFI%q@40w0{jjEfeVl)i9(~bt2z#2Vm)p`V_ z1;6$Ae7=YXk#=Qkd24Y23t&GvRxaOoad~NbJ+6pxqzJ>FY#Td7@`N5xp!n(c!=RE& z&<<@^a$_Ys8jqz4|5Nk#FY$~|FPC0`*a5HH!|Gssa9=~66&xG9)|=pOOJ2KE5|YrR zw!w6K2aC=J$t?L-;}5hn6mHd%hC;p8P|Dgh6D>hGnXPgi;6r+eA=?f72y9(Cf_ho{ zH6#)uD&R=73^$$NE;5piWX2bzR67fQ)`b=85o0eOLGI4c-Tb@-KNi2pz=Ke@SDcPn za$AxXib84`!Sf;Z3B@TSo`Dz7GM5Kf(@PR>Ghzi=BBxK8wRp>YQoXm+iL>H*Jo9M3 z6w&E?BC8AFTFT&Tv8zf+m9<&S&%dIaZ)Aoqkak_$r-2{$d~0g2oLETx9Y`eOAf14QXEQw3tJne;fdzl@wV#TFXSLXM2428F-Q}t+n2g%vPRMUzYPvzQ9f# zu(liiJem9P*?0%V@RwA7F53r~|I!Ty)<*AsMX3J{_4&}{6pT%Tpw>)^|DJ)>gpS~1rNEh z0$D?uO8mG?H;2BwM5a*26^7YO$XjUm40XmBsb63MoR;bJh63J;OngS5sSI+o2HA;W zdZV#8pDpC9Oez&L8loZO)MClRz!_!WD&QRtQxnazhT%Vj6Wl4G11nUk8*vSeVab@N#oJ}`KyJv+8Mo@T1-pqZ1t|?cnaVOd;1(h9 z!$DrN=jcGsVYE-0-n?oCJ^4x)F}E;UaD-LZUIzcD?W^ficqJWM%QLy6QikrM1aKZC zi{?;oKwq^Vsr|&`i{jIphA8S6G4)$KGvpULjH%9u(Dq247;R#l&I0{IhcC|oBF*Al zvLo7Xte=C{aIt*otJD}BUq)|_pdR>{zBMT< z(^1RpZv*l*m*OV^8>9&asGBo8h*_4q*)-eCv*|Pq=XNGrZE)^(SF7^{QE_~4VDB(o zVcPA_!G+2CAtLbl+`=Q~9iW`4ZRLku!uB?;tWqVjB0lEOf}2RD7dJ=BExy=<9wkb- z9&7{XFA%n#JsHYN8t5d~=T~5DcW4$B%3M+nNvC2`0!#@sckqlzo5;hhGi(D9=*A4` z5ynobawSPRtWn&CDLEs3Xf`(8^zDP=NdF~F^s&={l7(aw&EG}KWpMjtmz7j_VLO;@ zM2NVLDxZ@GIv7*gzl1 zjq78tv*8#WSY`}Su0&C;2F$Ze(q>F(@Wm^Gw!)(j;dk9Ad{STaxn)IV9FZhm*n+U} zi;4y*3v%A`_c7a__DJ8D1b@dl0Std3F||4Wtvi)fCcBRh!X9$1x!_VzUh>*S5s!oq z;qd{J_r79EL2wIeiGAqFstWtkfIJpjVh%zFo*=55B9Zq~y0=^iqHWfQl@O!Ak;(o*m!pZqe9 z%U2oDOhR)BvW8&F70L;2TpkzIutIvNQaTjjs5V#8mV4!NQ}zN=i`i@WI1z0eN-iCS z;vL-Wxc^Vc_qK<5RPh(}*8dLT{~GzE{w2o$2kMFaEl&q zP{V=>&3kW7tWaK-Exy{~`v4J0U#OZBk{a9{&)&QG18L@6=bsZ1zC_d{{pKZ-Ey>I> z;8H0t4bwyQqgu4hmO`3|4K{R*5>qnQ&gOfdy?z`XD%e5+pTDzUt3`k^u~SaL&XMe= z9*h#kT(*Q9jO#w2Hd|Mr-%DV8i_1{J1MU~XJ3!WUplhXDYBpJH><0OU`**nIvPIof z|N8@I=wA)sf45SAvx||f?Z5uB$kz1qL3Ky_{%RPdP5iN-D2!p5scq}buuC00C@jom zhfGKm3|f?Z0iQ|K$Z~!`8{nmAS1r+fp6r#YDOS8V*;K&Gs7Lc&f^$RC66O|)28oh`NHy&vq zJh+hAw8+ybTB0@VhWN^0iiTnLsCWbS_y`^gs!LX!Lw{yE``!UVzrV24tP8o;I6-65 z1MUiHw^{bB15tmrVT*7-#sj6cs~z`wk52YQJ*TG{SE;KTm#Hf#a~|<(|ImHH17nNM z`Ub{+J3dMD!)mzC8b(2tZtokKW5pAwHa?NFiso~# z1*iaNh4lQ4TS)|@G)H4dZV@l*Vd;Rw;-;odDhW2&lJ%m@jz+Panv7LQm~2Js6rOW3 z0_&2cW^b^MYW3)@o;neZ<{B4c#m48dAl$GCc=$>ErDe|?y@z`$uq3xd(%aAsX)D%l z>y*SQ%My`yDP*zof|3@_w#cjaW_YW4BdA;#Glg1RQcJGY*CJ9`H{@|D+*e~*457kd z73p<%fB^PV!Ybw@)Dr%(ZJbX}xmCStCYv#K3O32ej{$9IzM^I{6FJ8!(=azt7RWf4 z7ib0UOPqN40X!wOnFOoddd8`!_IN~9O)#HRTyjfc#&MCZ zZAMzOVB=;qwt8gV?{Y2?b=iSZG~RF~uyx18K)IDFLl})G1v@$(s{O4@RJ%OTJyF+Cpcx4jmy|F3euCnMK!P2WTDu5j z{{gD$=M*pH!GGzL%P)V2*ROm>!$Y=z|D`!_yY6e7SU$~a5q8?hZGgaYqaiLnkK%?0 zs#oI%;zOxF@g*@(V4p!$7dS1rOr6GVs6uYCTt2h)eB4?(&w8{#o)s#%gN@BBosRUe z)@P@8_Zm89pr~)b>e{tbPC~&_MR--iB{=)y;INU5#)@Gix-YpgP<-c2Ms{9zuCX|3 z!p(?VaXww&(w&uBHzoT%!A2=3HAP>SDxcljrego7rY|%hxy3XlODWffO_%g|l+7Y_ zqV(xbu)s4lV=l7M;f>vJl{`6qBm>#ZeMA}kXb97Z)?R97EkoI?x6Lp0yu1Z>PS?2{ z0QQ(8D)|lc9CO3B~e(pQM&5(1y&y=e>C^X$`)_&XuaI!IgDTVqt31wX#n+@!a_A0ZQkA zCJ2@M_4Gb5MfCrm5UPggeyh)8 zO9?`B0J#rkoCx(R0I!ko_2?iO@|oRf1;3r+i)w-2&j?=;NVIdPFsB)`|IC0zk6r9c zRrkfxWsiJ(#8QndNJj@{@WP2Ackr|r1VxV{7S&rSU(^)-M8gV>@UzOLXu9K<{6e{T zXJ6b92r$!|lwjhmgqkdswY&}c)KW4A)-ac%sU;2^fvq7gfUW4Bw$b!i@duy1CAxSn z(pyh$^Z=&O-q<{bZUP+$U}=*#M9uVc>CQVgDs4swy5&8RAHZ~$)hrTF4W zPsSa~qYv_0mJnF89RnnJTH`3}w4?~epFl=D(35$ zWa07ON$`OMBOHgCmfO(9RFc<)?$x)N}Jd2A(<*Ll7+4jrRt9w zwGxExUXd9VB#I|DwfxvJ;HZ8Q{37^wDhaZ%O!oO(HpcqfLH%#a#!~;Jl7F5>EX_=8 z{()l2NqPz>La3qJR;_v+wlK>GsHl;uRA8%j`A|yH@k5r%55S9{*Cp%uw6t`qc1!*T za2OeqtQj7sAp#Q~=5Fs&aCR9v>5V+s&RdNvo&H~6FJOjvaj--2sYYBvMq;55%z8^o z|BJDA4vzfow#DO#ZQHh;Oq_{r+qP{R9ox2TOgwQiv7Ow!zjN+A@BN;0tA2lUb#+zO z(^b89eV)D7UVE+h{mcNc6&GtpOqDn_?VAQ)Vob$hlFwW%xh>D#wml{t&Ofmm_d_+; zKDxzdr}`n2Rw`DtyIjrG)eD0vut$}dJAZ0AohZ+ZQdWXn_Z@dI_y=7t3q8x#pDI-K z2VVc&EGq445Rq-j0=U=Zx`oBaBjsefY;%)Co>J3v4l8V(T8H?49_@;K6q#r~Wwppc z4XW0(4k}cP=5ex>-Xt3oATZ~bBWKv)aw|I|Lx=9C1s~&b77idz({&q3T(Y(KbWO?+ zmcZ6?WeUsGk6>km*~234YC+2e6Zxdl~<_g2J|IE`GH%n<%PRv-50; zH{tnVts*S5*_RxFT9eM0z-pksIb^drUq4>QSww=u;UFCv2AhOuXE*V4z?MM`|ABOC4P;OfhS(M{1|c%QZ=!%rQTDFx`+}?Kdx$&FU?Y<$x;j7z=(;Lyz+?EE>ov!8vvMtSzG!nMie zsBa9t8as#2nH}n8xzN%W%U$#MHNXmDUVr@GX{?(=yI=4vks|V)!-W5jHsU|h_&+kY zS_8^kd3jlYqOoiI`ZqBVY!(UfnAGny!FowZWY_@YR0z!nG7m{{)4OS$q&YDyw6vC$ zm4!$h>*|!2LbMbxS+VM6&DIrL*X4DeMO!@#EzMVfr)e4Tagn~AQHIU8?e61TuhcKD zr!F4(kEebk(Wdk-?4oXM(rJwanS>Jc%<>R(siF+>+5*CqJLecP_we33iTFTXr6W^G z7M?LPC-qFHK;E!fxCP)`8rkxZyFk{EV;G-|kwf4b$c1k0atD?85+|4V%YATWMG|?K zLyLrws36p%Qz6{}>7b>)$pe>mR+=IWuGrX{3ZPZXF3plvuv5Huax86}KX*lbPVr}L z{C#lDjdDeHr~?l|)Vp_}T|%$qF&q#U;ClHEPVuS+Jg~NjC1RP=17=aQKGOcJ6B3mp z8?4*-fAD~}sX*=E6!}^u8)+m2j<&FSW%pYr_d|p_{28DZ#Cz0@NF=gC-o$MY?8Ca8 zr5Y8DSR^*urS~rhpX^05r30Ik#2>*dIOGxRm0#0YX@YQ%Mg5b6dXlS!4{7O_kdaW8PFSdj1=ryI-=5$fiieGK{LZ+SX(1b=MNL!q#lN zv98?fqqTUH8r8C7v(cx#BQ5P9W>- zmW93;eH6T`vuJ~rqtIBg%A6>q>gnWb3X!r0wh_q;211+Om&?nvYzL1hhtjB zK_7G3!n7PL>d!kj){HQE zE8(%J%dWLh1_k%gVXTZt zEdT09XSKAx27Ncaq|(vzL3gm83q>6CAw<$fTnMU05*xAe&rDfCiu`u^1)CD<>sx0i z*hr^N_TeN89G(nunZoLBf^81#pmM}>JgD@Nn1l*lN#a=B=9pN%tmvYFjFIoKe_(GF z-26x{(KXdfsQL7Uv6UtDuYwV`;8V3w>oT_I<`Ccz3QqK9tYT5ZQzbop{=I=!pMOCb zCU68`n?^DT%^&m>A%+-~#lvF!7`L7a{z<3JqIlk1$<||_J}vW1U9Y&eX<}l8##6i( zZcTT@2`9(Mecptm@{3A_Y(X`w9K0EwtPq~O!16bq{7c0f7#(3wn-^)h zxV&M~iiF!{-6A@>o;$RzQ5A50kxXYj!tcgme=Qjrbje~;5X2xryU;vH|6bE(8z^<7 zQ>BG7_c*JG8~K7Oe68i#0~C$v?-t@~@r3t2inUnLT(c=URpA9kA8uq9PKU(Ps(LVH zqgcqW>Gm?6oV#AldDPKVRcEyQIdTT`Qa1j~vS{<;SwyTdr&3*t?J)y=M7q*CzucZ&B0M=joT zBbj@*SY;o2^_h*>R0e({!QHF0=)0hOj^B^d*m>SnRrwq>MolNSgl^~r8GR#mDWGYEIJA8B<|{{j?-7p zVnV$zancW3&JVDtVpIlI|5djKq0(w$KxEFzEiiL=h5Jw~4Le23@s(mYyXWL9SX6Ot zmb)sZaly_P%BeX_9 zw&{yBef8tFm+%=--m*J|o~+Xg3N+$IH)t)=fqD+|fEk4AAZ&!wcN5=mi~Vvo^i`}> z#_3ahR}Ju)(Px7kev#JGcSwPXJ2id9%Qd2A#Uc@t8~egZ8;iC{e! z%=CGJOD1}j!HW_sgbi_8suYnn4#Ou}%9u)dXd3huFIb!ytlX>Denx@pCS-Nj$`VO&j@(z!kKSP0hE4;YIP#w9ta=3DO$7f*x zc9M4&NK%IrVmZAe=r@skWD`AEWH=g+r|*13Ss$+{c_R!b?>?UaGXlw*8qDmY#xlR= z<0XFbs2t?8i^G~m?b|!Hal^ZjRjt<@a? z%({Gn14b4-a|#uY^=@iiKH+k?~~wTj5K1A&hU z2^9-HTC)7zpoWK|$JXaBL6C z#qSNYtY>65T@Zs&-0cHeu|RX(Pxz6vTITdzJdYippF zC-EB+n4}#lM7`2Ry~SO>FxhKboIAF#Z{1wqxaCb{#yEFhLuX;Rx(Lz%T`Xo1+a2M}7D+@wol2)OJs$TwtRNJ={( zD@#zTUEE}#Fz#&(EoD|SV#bayvr&E0vzmb%H?o~46|FAcx?r4$N z&67W3mdip-T1RIxwSm_&(%U|+WvtGBj*}t69XVd&ebn>KOuL(7Y8cV?THd-(+9>G7*Nt%T zcH;`p={`SOjaf7hNd(=37Lz3-51;58JffzIPgGs_7xIOsB5p2t&@v1mKS$2D$*GQ6 zM(IR*j4{nri7NMK9xlDy-hJW6sW|ZiDRaFiayj%;(%51DN!ZCCCXz+0Vm#};70nOx zJ#yA0P3p^1DED;jGdPbQWo0WATN=&2(QybbVdhd=Vq*liDk`c7iZ?*AKEYC#SY&2g z&Q(Ci)MJ{mEat$ZdSwTjf6h~roanYh2?9j$CF@4hjj_f35kTKuGHvIs9}Re@iKMxS-OI*`0S z6s)fOtz}O$T?PLFVSeOjSO26$@u`e<>k(OSP!&YstH3ANh>)mzmKGNOwOawq-MPXe zy4xbeUAl6tamnx))-`Gi2uV5>9n(73yS)Ukma4*7fI8PaEwa)dWHs6QA6>$}7?(L8 ztN8M}?{Tf!Zu22J5?2@95&rQ|F7=FK-hihT-vDp!5JCcWrVogEnp;CHenAZ)+E+K5 z$Cffk5sNwD_?4+ymgcHR(5xgt20Z8M`2*;MzOM#>yhk{r3x=EyM226wb&!+j`W<%* zSc&|`8!>dn9D@!pYow~(DsY_naSx7(Z4i>cu#hA5=;IuI88}7f%)bRkuY2B;+9Uep zpXcvFWkJ!mQai63BgNXG26$5kyhZ2&*3Q_tk)Ii4M>@p~_~q_cE!|^A;_MHB;7s#9 zKzMzK{lIxotjc};k67^Xsl-gS!^*m*m6kn|sbdun`O?dUkJ{0cmI0-_2y=lTAfn*Y zKg*A-2sJq)CCJgY0LF-VQvl&6HIXZyxo2#!O&6fOhbHXC?%1cMc6y^*dOS{f$=137Ds1m01qs`>iUQ49JijsaQ( zksqV9@&?il$|4Ua%4!O15>Zy&%gBY&wgqB>XA3!EldQ%1CRSM(pp#k~-pkcCg4LAT zXE=puHbgsw)!xtc@P4r~Z}nTF=D2~j(6D%gTBw$(`Fc=OOQ0kiW$_RDd=hcO0t97h zb86S5r=>(@VGy1&#S$Kg_H@7G^;8Ue)X5Y+IWUi`o;mpvoV)`fcVk4FpcT|;EG!;? zHG^zrVVZOm>1KFaHlaogcWj(v!S)O(Aa|Vo?S|P z5|6b{qkH(USa*Z7-y_Uvty_Z1|B{rTS^qmEMLEYUSk03_Fg&!O3BMo{b^*`3SHvl0 zhnLTe^_vVIdcSHe)SQE}r~2dq)VZJ!aSKR?RS<(9lzkYo&dQ?mubnWmgMM37Nudwo z3Vz@R{=m2gENUE3V4NbIzAA$H1z0pagz94-PTJyX{b$yndsdKptmlKQKaaHj@3=ED zc7L?p@%ui|RegVYutK$64q4pe9+5sv34QUpo)u{1ci?)_7gXQd{PL>b0l(LI#rJmN zGuO+%GO`xneFOOr4EU(Wg}_%bhzUf;d@TU+V*2#}!2OLwg~%D;1FAu=Un>OgjPb3S z7l(riiCwgghC=Lm5hWGf5NdGp#01xQ59`HJcLXbUR3&n%P(+W2q$h2Qd z*6+-QXJ*&Kvk9ht0f0*rO_|FMBALen{j7T1l%=Q>gf#kma zQlg#I9+HB+z*5BMxdesMND`_W;q5|FaEURFk|~&{@qY32N$G$2B=&Po{=!)x5b!#n zxLzblkq{yj05#O7(GRuT39(06FJlalyv<#K4m}+vs>9@q-&31@1(QBv82{}Zkns~K ze{eHC_RDX0#^A*JQTwF`a=IkE6Ze@j#-8Q`tTT?k9`^ZhA~3eCZJ-Jr{~7Cx;H4A3 zcZ+Zj{mzFZbVvQ6U~n>$U2ZotGsERZ@}VKrgGh0xM;Jzt29%TX6_&CWzg+YYMozrM z`nutuS)_0dCM8UVaKRj804J4i%z2BA_8A4OJRQ$N(P9Mfn-gF;4#q788C@9XR0O3< zsoS4wIoyt046d+LnSCJOy@B@Uz*#GGd#+Ln1ek5Dv>(ZtD@tgZlPnZZJGBLr^JK+!$$?A_fA3LOrkoDRH&l7 zcMcD$Hsjko3`-{bn)jPL6E9Ds{WskMrivsUu5apD z?grQO@W7i5+%X&E&p|RBaEZ(sGLR@~(y^BI@lDMot^Ll?!`90KT!JXUhYS`ZgX3jnu@Ja^seA*M5R@f`=`ynQV4rc$uT1mvE?@tz)TN<=&H1%Z?5yjxcpO+6y_R z6EPuPKM5uxKpmZfT(WKjRRNHs@ib)F5WAP7QCADvmCSD#hPz$V10wiD&{NXyEwx5S z6NE`3z!IS^$s7m}PCwQutVQ#~w+V z=+~->DI*bR2j0^@dMr9`p>q^Ny~NrAVxrJtX2DUveic5vM%#N*XO|?YAWwNI$Q)_) zvE|L(L1jP@F%gOGtnlXtIv2&1i8q<)Xfz8O3G^Ea~e*HJsQgBxWL(yuLY+jqUK zRE~`-zklrGog(X}$9@ZVUw!8*=l`6mzYLtsg`AvBYz(cxmAhr^j0~(rzXdiOEeu_p zE$sf2(w(BPAvO5DlaN&uQ$4@p-b?fRs}d7&2UQ4Fh?1Hzu*YVjcndqJLw0#q@fR4u zJCJ}>_7-|QbvOfylj+e^_L`5Ep9gqd>XI3-O?Wp z-gt*P29f$Tx(mtS`0d05nHH=gm~Po_^OxxUwV294BDKT>PHVlC5bndncxGR!n(OOm znsNt@Q&N{TLrmsoKFw0&_M9$&+C24`sIXGWgQaz=kY;S{?w`z^Q0JXXBKFLj0w0U6P*+jPKyZHX9F#b0D1$&(- zrm8PJd?+SrVf^JlfTM^qGDK&-p2Kdfg?f>^%>1n8bu&byH(huaocL>l@f%c*QkX2i znl}VZ4R1en4S&Bcqw?$=Zi7ohqB$Jw9x`aM#>pHc0x z0$!q7iFu zZ`tryM70qBI6JWWTF9EjgG@>6SRzsd}3h+4D8d~@CR07P$LJ}MFsYi-*O%XVvD@yT|rJ+Mk zDllJ7$n0V&A!0flbOf)HE6P_afPWZmbhpliqJuw=-h+r;WGk|ntkWN(8tKlYpq5Ow z(@%s>IN8nHRaYb*^d;M(D$zGCv5C|uqmsDjwy4g=Lz>*OhO3z=)VD}C<65;`89Ye} zSCxrv#ILzIpEx1KdLPlM&%Cctf@FqTKvNPXC&`*H9=l=D3r!GLM?UV zOxa(8ZsB`&+76S-_xuj?G#wXBfDY@Z_tMpXJS7^mp z@YX&u0jYw2A+Z+bD#6sgVK5ZgdPSJV3>{K^4~%HV?rn~4D)*2H!67Y>0aOmzup`{D zzDp3c9yEbGCY$U<8biJ_gB*`jluz1ShUd!QUIQJ$*1;MXCMApJ^m*Fiv88RZ zFopLViw}{$Tyhh_{MLGIE2~sZ)t0VvoW%=8qKZ>h=adTe3QM$&$PO2lfqH@brt!9j ziePM8$!CgE9iz6B<6_wyTQj?qYa;eC^{x_0wuwV~W+^fZmFco-o%wsKSnjXFEx02V zF5C2t)T6Gw$Kf^_c;Ei3G~uC8SM-xyycmXyC2hAVi-IfXqhu$$-C=*|X?R0~hu z8`J6TdgflslhrmDZq1f?GXF7*ALeMmOEpRDg(s*H`4>_NAr`2uqF;k;JQ+8>A|_6ZNsNLECC%NNEb1Y1dP zbIEmNpK)#XagtL4R6BC{C5T(+=yA-(Z|Ap}U-AfZM#gwVpus3(gPn}Q$CExObJ5AC z)ff9Yk?wZ}dZ-^)?cbb9Fw#EjqQ8jxF4G3=L?Ra zg_)0QDMV1y^A^>HRI$x?Op@t;oj&H@1xt4SZ9(kifQ zb59B*`M99Td7@aZ3UWvj1rD0sE)d=BsBuW*KwkCds7ay(7*01_+L}b~7)VHI>F_!{ zyxg-&nCO?v#KOUec0{OOKy+sjWA;8rTE|Lv6I9H?CI?H(mUm8VXGwU$49LGpz&{nQp2}dinE1@lZ1iox6{ghN&v^GZv9J${7WaXj)<0S4g_uiJ&JCZ zr8-hsu`U%N;+9N^@&Q0^kVPB3)wY(rr}p7{p0qFHb3NUUHJb672+wRZs`gd1UjKPX z4o6zljKKA+Kkj?H>Ew63o%QjyBk&1!P22;MkD>sM0=z_s-G{mTixJCT9@_|*(p^bz zJ8?ZZ&;pzV+7#6Mn`_U-)k8Pjg?a;|Oe^us^PoPY$Va~yi8|?+&=y$f+lABT<*pZr zP}D{~Pq1Qyni+@|aP;ixO~mbEW9#c0OU#YbDZIaw=_&$K%Ep2f%hO^&P67hApZe`x zv8b`Mz@?M_7-)b!lkQKk)JXXUuT|B8kJlvqRmRpxtQDgvrHMXC1B$M@Y%Me!BSx3P z#2Eawl$HleZhhTS6Txm>lN_+I`>eV$&v9fOg)%zVn3O5mI*lAl>QcHuW6!Kixmq`X zBCZ*Ck6OYtDiK!N47>jxI&O2a9x7M|i^IagRr-fmrmikEQGgw%J7bO|)*$2FW95O4 zeBs>KR)izRG1gRVL;F*sr8A}aRHO0gc$$j&ds8CIO1=Gwq1%_~E)CWNn9pCtBE}+`Jelk4{>S)M)`Ll=!~gnn1yq^EX(+y*ik@3Ou0qU`IgYi3*doM+5&dU!cho$pZ zn%lhKeZkS72P?Cf68<#kll_6OAO26bIbueZx**j6o;I0cS^XiL`y+>{cD}gd%lux} z)3N>MaE24WBZ}s0ApfdM;5J_Ny}rfUyxfkC``Awo2#sgLnGPewK};dORuT?@I6(5~ z?kE)Qh$L&fwJXzK){iYx!l5$Tt|^D~MkGZPA}(o6f7w~O2G6Vvzdo*a;iXzk$B66$ zwF#;wM7A+(;uFG4+UAY(2`*3XXx|V$K8AYu#ECJYSl@S=uZW$ksfC$~qrrbQj4??z-)uz0QL}>k^?fPnJTPw% zGz)~?B4}u0CzOf@l^um}HZzbaIwPmb<)< zi_3@E9lc)Qe2_`*Z^HH;1CXOceL=CHpHS{HySy3T%<^NrWQ}G0i4e1xm_K3(+~oi$ zoHl9wzb?Z4j#90DtURtjtgvi7uw8DzHYmtPb;?%8vb9n@bszT=1qr)V_>R%s!92_` zfnHQPANx z<#hIjIMm#*(v*!OXtF+w8kLu`o?VZ5k7{`vw{Yc^qYclpUGIM_PBN1+c{#Vxv&E*@ zxg=W2W~JuV{IuRYw3>LSI1)a!thID@R=bU+cU@DbR^_SXY`MC7HOsCN z!dO4OKV7(E_Z8T#8MA1H`99?Z!r0)qKW_#|29X3#Jb+5+>qUidbeP1NJ@)(qi2S-X zao|f0_tl(O+$R|Qwd$H{_ig|~I1fbp_$NkI!0E;Y z6JrnU{1Ra6^on{9gUUB0mwzP3S%B#h0fjo>JvV~#+X0P~JV=IG=yHG$O+p5O3NUgG zEQ}z6BTp^Fie)Sg<){Z&I8NwPR(=mO4joTLHkJ>|Tnk23E(Bo`FSbPc05lF2-+)X? z6vV3*m~IBHTy*^E!<0nA(tCOJW2G4DsH7)BxLV8kICn5lu6@U*R`w)o9;Ro$i8=Q^V%uH8n3q=+Yf;SFRZu z!+F&PKcH#8cG?aSK_Tl@K9P#8o+jry@gdexz&d(Q=47<7nw@e@FFfIRNL9^)1i@;A z28+$Z#rjv-wj#heI|<&J_DiJ*s}xd-f!{J8jfqOHE`TiHHZVIA8CjkNQ_u;Ery^^t zl1I75&u^`1_q)crO+JT4rx|z2ToSC>)Or@-D zy3S>jW*sNIZR-EBsfyaJ+Jq4BQE4?SePtD2+jY8*%FsSLZ9MY>+wk?}}}AFAw)vr{ml)8LUG-y9>^t!{~|sgpxYc0Gnkg`&~R z-pilJZjr@y5$>B=VMdZ73svct%##v%wdX~9fz6i3Q-zOKJ9wso+h?VME7}SjL=!NUG{J?M&i!>ma`eoEa@IX`5G>B1(7;%}M*%-# zfhJ(W{y;>MRz!Ic8=S}VaBKqh;~7KdnGEHxcL$kA-6E~=!hrN*zw9N+_=odt<$_H_8dbo;0=42wcAETPCVGUr~v(`Uai zb{=D!Qc!dOEU6v)2eHSZq%5iqK?B(JlCq%T6av$Cb4Rko6onlG&?CqaX7Y_C_cOC3 zYZ;_oI(}=>_07}Oep&Ws7x7-R)cc8zfe!SYxJYP``pi$FDS)4Fvw5HH=FiU6xfVqIM!hJ;Rx8c0cB7~aPtNH(Nmm5Vh{ibAoU#J6 zImRCr?(iyu_4W_6AWo3*vxTPUw@vPwy@E0`(>1Qi=%>5eSIrp^`` zK*Y?fK_6F1W>-7UsB)RPC4>>Ps9)f+^MqM}8AUm@tZ->j%&h1M8s*s!LX5&WxQcAh z8mciQej@RPm?660%>{_D+7er>%zX_{s|$Z+;G7_sfNfBgY(zLB4Ey}J9F>zX#K0f6 z?dVNIeEh?EIShmP6>M+d|0wMM85Sa4diw1hrg|ITJ}JDg@o8y>(rF9mXk5M z2@D|NA)-7>wD&wF;S_$KS=eE84`BGw3g0?6wGxu8ys4rwI?9U=*^VF22t3%mbGeOh z`!O-OpF7#Vceu~F`${bW0nYVU9ecmk31V{tF%iv&5hWofC>I~cqAt@u6|R+|HLMMX zVxuSlMFOK_EQ86#E8&KwxIr8S9tj_goWtLv4f@!&h8;Ov41{J~496vp9vX=(LK#j! zAwi*21RAV-LD>9Cw3bV_9X(X3)Kr0-UaB*7Y>t82EQ%!)(&(XuAYtTsYy-dz+w=$ir)VJpe!_$ z6SGpX^i(af3{o=VlFPC);|J8#(=_8#vdxDe|Cok+ANhYwbE*FO`Su2m1~w+&9<_9~ z-|tTU_ACGN`~CNW5WYYBn^B#SwZ(t4%3aPp z;o)|L6Rk569KGxFLUPx@!6OOa+5OjQLK5w&nAmwxkC5rZ|m&HT8G%GVZxB_@ME z>>{rnXUqyiJrT(8GMj_ap#yN_!9-lO5e8mR3cJiK3NE{_UM&=*vIU`YkiL$1%kf+1 z4=jk@7EEj`u(jy$HnzE33ZVW_J4bj}K;vT?T91YlO(|Y0FU4r+VdbmQ97%(J5 zkK*Bed8+C}FcZ@HIgdCMioV%A<*4pw_n}l*{Cr4}a(lq|injK#O?$tyvyE`S%(1`H z_wwRvk#13ElkZvij2MFGOj`fhy?nC^8`Zyo%yVcUAfEr8x&J#A{|moUBAV_^f$hpaUuyQeY3da^ zS9iRgf87YBwfe}>BO+T&Fl%rfpZh#+AM?Dq-k$Bq`vG6G_b4z%Kbd&v>qFjow*mBl z-OylnqOpLg}or7_VNwRg2za3VBK6FUfFX{|TD z`Wt0Vm2H$vdlRWYQJqDmM?JUbVqL*ZQY|5&sY*?!&%P8qhA~5+Af<{MaGo(dl&C5t zE%t!J0 zh6jqANt4ABdPxSTrVV}fLsRQal*)l&_*rFq(Ez}ClEH6LHv{J#v?+H-BZ2)Wy{K@9 z+ovXHq~DiDvm>O~r$LJo!cOuwL+Oa--6;UFE2q@g3N8Qkw5E>ytz^(&($!O47+i~$ zKM+tkAd-RbmP{s_rh+ugTD;lriL~`Xwkad#;_aM?nQ7L_muEFI}U_4$phjvYgleK~`Fo`;GiC07&Hq1F<%p;9Q;tv5b?*QnR%8DYJH3P>Svmv47Y>*LPZJy8_{9H`g6kQpyZU{oJ`m%&p~D=K#KpfoJ@ zn-3cqmHsdtN!f?~w+(t+I`*7GQA#EQC^lUA9(i6=i1PqSAc|ha91I%X&nXzjYaM{8$s&wEx@aVkQ6M{E2 zfzId#&r(XwUNtPcq4Ngze^+XaJA1EK-%&C9j>^9(secqe{}z>hR5CFNveMsVA)m#S zk)_%SidkY-XmMWlVnQ(mNJ>)ooszQ#vaK;!rPmGKXV7am^_F!Lz>;~{VrIO$;!#30XRhE1QqO_~#+Ux;B_D{Nk=grn z8Y0oR^4RqtcYM)7a%@B(XdbZCOqnX#fD{BQTeLvRHd(irHKq=4*jq34`6@VAQR8WG z^%)@5CXnD_T#f%@-l${>y$tfb>2LPmc{~5A82|16mH)R?&r#KKLs7xpN-D`=&Cm^R zvMA6#Ahr<3X>Q7|-qfTY)}32HkAz$_mibYV!I)u>bmjK`qwBe(>za^0Kt*HnFbSdO z1>+ryKCNxmm^)*$XfiDOF2|{-v3KKB?&!(S_Y=Ht@|ir^hLd978xuI&N{k>?(*f8H z=ClxVJK_%_z1TH0eUwm2J+2To7FK4o+n_na)&#VLn1m;!+CX+~WC+qg1?PA~KdOlC zW)C@pw75_xoe=w7i|r9KGIvQ$+3K?L{7TGHwrQM{dCp=Z*D}3kX7E-@sZnup!BImw z*T#a=+WcTwL78exTgBn|iNE3#EsOorO z*kt)gDzHiPt07fmisA2LWN?AymkdqTgr?=loT7z@d`wnlr6oN}@o|&JX!yPzC*Y8d zu6kWlTzE1)ckyBn+0Y^HMN+GA$wUO_LN6W>mxCo!0?oiQvT`z$jbSEu&{UHRU0E8# z%B^wOc@S!yhMT49Y)ww(Xta^8pmPCe@eI5C*ed96)AX9<>))nKx0(sci8gwob_1}4 z0DIL&vsJ1_s%<@y%U*-eX z5rN&(zef-5G~?@r79oZGW1d!WaTqQn0F6RIOa9tJ=0(kdd{d1{<*tHT#cCvl*i>YY zH+L7jq8xZNcTUBqj(S)ztTU!TM!RQ}In*n&Gn<>(60G7}4%WQL!o>hbJqNDSGwl#H z`4k+twp0cj%PsS+NKaxslAEu9!#U3xT1|_KB6`h=PI0SW`P9GTa7caD1}vKEglV8# zjKZR`pluCW19c2fM&ZG)c3T3Um;ir3y(tSCJ7Agl6|b524dy5El{^EQBG?E61H0XY z`bqg!;zhGhyMFl&(o=JWEJ8n~z)xI}A@C0d2hQGvw7nGv)?POU@(kS1m=%`|+^ika zXl8zjS?xqW$WlO?Ewa;vF~XbybHBor$f<%I&*t$F5fynwZlTGj|IjZtVfGa7l&tK} zW>I<69w(cZLu)QIVG|M2xzW@S+70NinQzk&Y0+3WT*cC)rx~04O-^<{JohU_&HL5XdUKW!uFy|i$FB|EMu0eUyW;gsf`XfIc!Z0V zeK&*hPL}f_cX=@iv>K%S5kL;cl_$v?n(Q9f_cChk8Lq$glT|=e+T*8O4H2n<=NGmn z+2*h+v;kBvF>}&0RDS>)B{1!_*XuE8A$Y=G8w^qGMtfudDBsD5>T5SB;Qo}fSkkiV ze^K^M(UthkwrD!&*tTsu>Dacdj_q`~V%r_twr$(Ct&_dKeeXE?fA&4&yASJWJ*}~- zel=@W)tusynfC_YqH4ll>4Eg`Xjs5F7Tj>tTLz<0N3)X<1px_d2yUY>X~y>>93*$) z5PuNMQLf9Bu?AAGO~a_|J2akO1M*@VYN^VxvP0F$2>;Zb9;d5Yfd8P%oFCCoZE$ z4#N$^J8rxYjUE_6{T%Y>MmWfHgScpuGv59#4u6fpTF%~KB^Ae`t1TD_^Ud#DhL+Dm zbY^VAM#MrAmFj{3-BpVSWph2b_Y6gCnCAombVa|1S@DU)2r9W<> zT5L8BB^er3zxKt1v(y&OYk!^aoQisqU zH(g@_o)D~BufUXcPt!Ydom)e|aW{XiMnes2z&rE?og>7|G+tp7&^;q?Qz5S5^yd$i z8lWr4g5nctBHtigX%0%XzIAB8U|T6&JsC4&^hZBw^*aIcuNO47de?|pGXJ4t}BB`L^d8tD`H`i zqrP8?#J@8T#;{^B!KO6J=@OWKhAerih(phML`(Rg7N1XWf1TN>=Z3Do{l_!d~DND&)O)D>ta20}@Lt77qSnVsA7>)uZAaT9bsB>u&aUQl+7GiY2|dAEg@%Al3i316y;&IhQL^8fw_nwS>f60M_-m+!5)S_6EPM7Y)(Nq^8gL7(3 zOiot`6Wy6%vw~a_H?1hLVzIT^i1;HedHgW9-P#)}Y6vF%C=P70X0Tk^z9Te@kPILI z_(gk!k+0%CG)%!WnBjjw*kAKs_lf#=5HXC00s-}oM-Q1aXYLj)(1d!_a7 z*Gg4Fe6F$*ujVjI|79Z5+Pr`us%zW@ln++2l+0hsngv<{mJ%?OfSo_3HJXOCys{Ug z00*YR-(fv<=&%Q!j%b-_ppA$JsTm^_L4x`$k{VpfLI(FMCap%LFAyq;#ns5bR7V+x zO!o;c5y~DyBPqdVQX)8G^G&jWkBy2|oWTw>)?5u}SAsI$RjT#)lTV&Rf8;>u*qXnb z8F%Xb=7#$m)83z%`E;49)t3fHInhtc#kx4wSLLms!*~Z$V?bTyUGiS&m>1P(952(H zuHdv=;o*{;5#X-uAyon`hP}d#U{uDlV?W?_5UjJvf%11hKwe&(&9_~{W)*y1nR5f_ z!N(R74nNK`y8>B!0Bt_Vr!;nc3W>~RiKtGSBkNlsR#-t^&;$W#)f9tTlZz>n*+Fjz z3zXZ;jf(sTM(oDzJt4FJS*8c&;PLTW(IQDFs_5QPy+7yhi1syPCarvqrHFcf&yTy)^O<1EBx;Ir`5W{TIM>{8w&PB>ro4;YD<5LF^TjTb0!zAP|QijA+1Vg>{Afv^% zmrkc4o6rvBI;Q8rj4*=AZacy*n8B{&G3VJc)so4$XUoie0)vr;qzPZVbb<#Fc=j+8CGBWe$n|3K& z_@%?{l|TzKSlUEO{U{{%Fz_pVDxs7i9H#bnbCw7@4DR=}r_qV!Zo~CvD4ZI*+j3kO zW6_=|S`)(*gM0Z;;}nj`73OigF4p6_NPZQ-Od~e$c_);;4-7sR>+2u$6m$Gf%T{aq zle>e3(*Rt(TPD}03n5)!Ca8Pu!V}m6v0o1;5<1h$*|7z|^(3$Y&;KHKTT}hV056wuF0Xo@mK-52~r=6^SI1NC%c~CC?n>yX6wPTgiWYVz!Sx^atLby9YNn1Rk{g?|pJaxD4|9cUf|V1_I*w zzxK)hRh9%zOl=*$?XUjly5z8?jPMy%vEN)f%T*|WO|bp5NWv@B(K3D6LMl!-6dQg0 zXNE&O>Oyf%K@`ngCvbGPR>HRg5!1IV$_}m@3dWB7x3t&KFyOJn9pxRXCAzFr&%37wXG;z^xaO$ekR=LJG ztIHpY8F5xBP{mtQidqNRoz= z@){+N3(VO5bD+VrmS^YjG@+JO{EOIW)9=F4v_$Ed8rZtHvjpiEp{r^c4F6Ic#ChlC zJX^DtSK+v(YdCW)^EFcs=XP7S>Y!4=xgmv>{S$~@h=xW-G4FF9?I@zYN$e5oF9g$# zb!eVU#J+NjLyX;yb)%SY)xJdvGhsnE*JEkuOVo^k5PyS=o#vq!KD46UTW_%R=Y&0G zFj6bV{`Y6)YoKgqnir2&+sl+i6foAn-**Zd1{_;Zb7Ki=u394C5J{l^H@XN`_6XTKY%X1AgQM6KycJ+= zYO=&t#5oSKB^pYhNdzPgH~aEGW2=ec1O#s-KG z71}LOg@4UEFtp3GY1PBemXpNs6UK-ax*)#$J^pC_me;Z$Je(OqLoh|ZrW*mAMBFn< zHttjwC&fkVfMnQeen8`Rvy^$pNRFVaiEN4Pih*Y3@jo!T0nsClN)pdrr9AYLcZxZ| zJ5Wlj+4q~($hbtuY zVQ7hl>4-+@6g1i`1a)rvtp-;b0>^`Dloy(#{z~ytgv=j4q^Kl}wD>K_Y!l~ zp(_&7sh`vfO(1*MO!B%<6E_bx1)&s+Ae`O)a|X=J9y~XDa@UB`m)`tSG4AUhoM=5& znWoHlA-(z@3n0=l{E)R-p8sB9XkV zZ#D8wietfHL?J5X0%&fGg@MH~(rNS2`GHS4xTo7L$>TPme+Is~!|79=^}QbPF>m%J zFMkGzSndiPO|E~hrhCeo@&Ea{M(ieIgRWMf)E}qeTxT8Q#g-!Lu*x$v8W^M^>?-g= zwMJ$dThI|~M06rG$Sv@C@tWR>_YgaG&!BAbkGggVQa#KdtDB)lMLNVLN|51C@F^y8 zCRvMB^{GO@j=cHfmy}_pCGbP%xb{pNN>? z?7tBz$1^zVaP|uaatYaIN+#xEN4jBzwZ|YI_)p(4CUAz1ZEbDk>J~Y|63SZaak~#0 zoYKruYsWHoOlC1(MhTnsdUOwQfz5p6-D0}4;DO$B;7#M{3lSE^jnTT;ns`>!G%i*F?@pR1JO{QTuD0U+~SlZxcc8~>IB{)@8p`P&+nDxNj`*gh|u?yrv$phpQcW)Us)bi`kT%qLj(fi{dWRZ%Es2!=3mI~UxiW0$-v3vUl?#g{p6eF zMEUAqo5-L0Ar(s{VlR9g=j7+lt!gP!UN2ICMokAZ5(Agd>})#gkA2w|5+<%-CuEP# zqgcM}u@3(QIC^Gx<2dbLj?cFSws_f3e%f4jeR?4M^M3cx1f+Qr6ydQ>n)kz1s##2w zk}UyQc+Z5G-d-1}{WzjkLXgS-2P7auWSJ%pSnD|Uivj5u!xk0 z_^-N9r9o;(rFDt~q1PvE#iJZ_f>J3gcP$)SOqhE~pD2|$=GvpL^d!r z6u=sp-CrMoF7;)}Zd7XO4XihC4ji?>V&(t^?@3Q&t9Mx=qex6C9d%{FE6dvU6%d94 zIE;hJ1J)cCqjv?F``7I*6bc#X)JW2b4f$L^>j{*$R`%5VHFi*+Q$2;nyieduE}qdS{L8y8F08yLs?w}{>8>$3236T-VMh@B zq-nujsb_1aUv_7g#)*rf9h%sFj*^mIcImRV*k~Vmw;%;YH(&ylYpy!&UjUVqqtfG` zox3esju?`unJJA_zKXRJP)rA3nXc$m^{S&-p|v|-0x9LHJm;XIww7C#R$?00l&Yyj z=e}gKUOpsImwW?N)+E(awoF@HyP^EhL+GlNB#k?R<2>95hz!h9sF@U20DHSB3~WMa zk90+858r@-+vWwkawJ)8ougd(i#1m3GLN{iSTylYz$brAsP%=&m$mQQrH$g%3-^VR zE%B`Vi&m8f3T~&myTEK28BDWCVzfWir1I?03;pX))|kY5ClO^+bae z*7E?g=3g7EiisYOrE+lA)2?Ln6q2*HLNpZEWMB|O-JI_oaHZB%CvYB(%=tU= zE*OY%QY58fW#RG5=gm0NR#iMB=EuNF@)%oZJ}nmm=tsJ?eGjia{e{yuU0l3{d^D@)kVDt=1PE)&tf_hHC%0MB znL|CRCPC}SeuVTdf>-QV70`0(EHizc21s^sU>y%hW0t!0&y<7}Wi-wGy>m%(-jsDj zP?mF|>p_K>liZ6ZP(w5(|9Ga%>tLgb$|doDDfkdW>Z z`)>V2XC?NJT26mL^@ zf+IKr27TfM!UbZ@?zRddC7#6ss1sw%CXJ4FWC+t3lHZupzM77m^=9 z&(a?-LxIq}*nvv)y?27lZ{j zifdl9hyJudyP2LpU$-kXctshbJDKS{WfulP5Dk~xU4Le4c#h^(YjJit4#R8_khheS z|8(>2ibaHES4+J|DBM7I#QF5u-*EdN{n=Kt@4Zt?@Tv{JZA{`4 zU#kYOv{#A&gGPwT+$Ud}AXlK3K7hYzo$(fBSFjrP{QQ zeaKg--L&jh$9N}`pu{Bs>?eDFPaWY4|9|foN%}i;3%;@4{dc+iw>m}{3rELqH21G! z`8@;w-zsJ1H(N3%|1B@#ioLOjib)j`EiJqPQVSbPSPVHCj6t5J&(NcWzBrzCiDt{4 zdlPAUKldz%6x5II1H_+jv)(xVL+a;P+-1hv_pM>gMRr%04@k;DTokASSKKhU1Qms| zrWh3a!b(J3n0>-tipg{a?UaKsP7?+|@A+1WPDiQIW1Sf@qDU~M_P65_s}7(gjTn0X zucyEm)o;f8UyshMy&>^SC3I|C6jR*R_GFwGranWZe*I>K+0k}pBuET&M~ z;Odo*ZcT?ZpduHyrf8E%IBFtv;JQ!N_m>!sV6ly$_1D{(&nO~w)G~Y`7sD3#hQk%^ zp}ucDF_$!6DAz*PM8yE(&~;%|=+h(Rn-=1Wykas_-@d&z#=S}rDf`4w(rVlcF&lF! z=1)M3YVz7orwk^BXhslJ8jR);sh^knJW(Qmm(QdSgIAIdlN4Te5KJisifjr?eB{FjAX1a0AB>d?qY4Wx>BZ8&}5K0fA+d{l8 z?^s&l8#j7pR&ijD?0b%;lL9l$P_mi2^*_OL+b}4kuLR$GAf85sOo02?Y#90}CCDiS zZ%rbCw>=H~CBO=C_JVV=xgDe%b4FaEFtuS7Q1##y686r%F6I)s-~2(}PWK|Z8M+Gu zl$y~5@#0Ka%$M<&Cv%L`a8X^@tY&T7<0|(6dNT=EsRe0%kp1Qyq!^43VAKYnr*A5~ zsI%lK1ewqO;0TpLrT9v}!@vJK{QoVa_+N4FYT#h?Y8rS1S&-G+m$FNMP?(8N`MZP zels(*?kK{{^g9DOzkuZXJ2;SrOQsp9T$hwRB1(phw1c7`!Q!by?Q#YsSM#I12RhU{$Q+{xj83axHcftEc$mNJ8_T7A-BQc*k(sZ+~NsO~xAA zxnbb%dam_fZlHvW7fKXrB~F&jS<4FD2FqY?VG?ix*r~MDXCE^WQ|W|WM;gsIA4lQP zJ2hAK@CF*3*VqPr2eeg6GzWFlICi8S>nO>5HvWzyZTE)hlkdC_>pBej*>o0EOHR|) z$?};&I4+_?wvL*g#PJ9)!bc#9BJu1(*RdNEn>#Oxta(VWeM40ola<0aOe2kSS~{^P zDJBd}0L-P#O-CzX*%+$#v;(x%<*SPgAje=F{Zh-@ucd2DA(yC|N_|ocs*|-!H%wEw z@Q!>siv2W;C^^j^59OAX03&}&D*W4EjCvfi(ygcL#~t8XGa#|NPO+*M@Y-)ctFA@I z-p7npT1#5zOLo>7q?aZpCZ=iecn3QYklP;gF0bq@>oyBq94f6C=;Csw3PkZ|5q=(c zfs`aw?II0e(h=|7o&T+hq&m$; zBrE09Twxd9BJ2P+QPN}*OdZ-JZV7%av@OM7v!!NL8R;%WFq*?{9T3{ct@2EKgc8h) zMxoM$SaF#p<`65BwIDfmXG6+OiK0e)`I=!A3E`+K@61f}0e z!2a*FOaDrOe>U`q%K!QN`&=&0C~)CaL3R4VY(NDt{Xz(Xpqru5=r#uQN1L$Je1*dkdqQ*=lofQaN%lO!<5z9ZlHgxt|`THd>2 zsWfU$9=p;yLyJyM^t zS2w9w?Bpto`@H^xJpZDKR1@~^30Il6oFGfk5%g6w*C+VM)+%R@gfIwNprOV5{F^M2 zO?n3DEzpT+EoSV-%OdvZvNF+pDd-ZVZ&d8 zKeIyrrfPN=EcFRCPEDCVflX#3-)Ik_HCkL(ejmY8vzcf-MTA{oHk!R2*36`O68$7J zf}zJC+bbQk--9Xm!u#lgLvx8TXx2J258E5^*IZ(FXMpq$2LUUvhWQPs((z1+2{Op% z?J}9k5^N=z;7ja~zi8a_-exIqWUBJwohe#4QJ`|FF*$C{lM18z^#hX6!5B8KAkLUX ziP=oti-gpV(BsLD{0(3*dw}4JxK23Y7M{BeFPucw!sHpY&l%Ws4pSm`+~V7;bZ%Dx zeI)MK=4vC&5#;2MT7fS?^ch9?2;%<8Jlu-IB&N~gg8t;6S-#C@!NU{`p7M8@2iGc& zg|JPg%@gCoCQ&s6JvDU&`X2S<57f(k8nJ1wvBu{8r?;q3_kpZZ${?|( z+^)UvR33sjSd)aT!UPkA;ylO6{aE3MQa{g%Mcf$1KONcjO@&g5zPHWtzM1rYC{_K> zgQNcs<{&X{OA=cEWw5JGqpr0O>x*Tfak2PE9?FuWtz^DDNI}rwAaT0(bdo-<+SJ6A z&}S%boGMWIS0L}=S>|-#kRX;e^sUsotry(MjE|3_9duvfc|nwF#NHuM-w7ZU!5ei8 z6Mkf>2)WunY2eU@C-Uj-A zG(z0Tz2YoBk>zCz_9-)4a>T46$(~kF+Y{#sA9MWH%5z#zNoz)sdXq7ZR_+`RZ%0(q zC7&GyS_|BGHNFl8Xa%@>iWh%Gr?=J5<(!OEjauj5jyrA-QXBjn0OAhJJ9+v=!LK`` z@g(`^*84Q4jcDL`OA&ZV60djgwG`|bcD*i50O}Q{9_noRg|~?dj%VtKOnyRs$Uzqg z191aWoR^rDX#@iSq0n z?9Sg$WSRPqSeI<}&n1T3!6%Wj@5iw5`*`Btni~G=&;J+4`7g#OQTa>u`{4ZZ(c@s$ zK0y;ySOGD-UTjREKbru{QaS>HjN<2)R%Nn-TZiQ(Twe4p@-saNa3~p{?^V9Nixz@a zykPv~<@lu6-Ng9i$Lrk(xi2Tri3q=RW`BJYOPC;S0Yly%77c727Yj-d1vF!Fuk{Xh z)lMbA69y7*5ufET>P*gXQrxsW+ zz)*MbHZv*eJPEXYE<6g6_M7N%#%mR{#awV3i^PafNv(zyI)&bH?F}2s8_rR(6%!V4SOWlup`TKAb@ee>!9JKPM=&8g#BeYRH9FpFybxBXQI2|g}FGJfJ+ zY-*2hB?o{TVL;Wt_ek;AP5PBqfDR4@Z->_182W z{P@Mc27j6jE*9xG{R$>6_;i=y{qf(c`5w9fa*`rEzX6t!KJ(p1H|>J1pC-2zqWENF zmm=Z5B4u{cY2XYl(PfrInB*~WGWik3@1oRhiMOS|D;acnf-Bs(QCm#wR;@Vf!hOPJ zgjhDCfDj$HcyVLJ=AaTbQ{@vIv14LWWF$=i-BDoC11}V;2V8A`S>_x)vIq44-VB-v z*w-d}$G+Ql?En8j!~ZkCpQ$|cA0|+rrY>tiCeWxkRGPoarxlGU2?7%k#F693RHT24 z-?JsiXlT2PTqZqNb&sSc>$d;O4V@|b6VKSWQb~bUaWn1Cf0+K%`Q&Wc<>mQ>*iEGB zbZ;aYOotBZ{vH3y<0A*L0QVM|#rf*LIsGx(O*-7)r@yyBIzJnBFSKBUSl1e|8lxU* zzFL+YDVVkIuzFWeJ8AbgN&w(4-7zbiaMn{5!JQXu)SELk*CNL+Fro|2v|YO)1l15t zs(0^&EB6DPMyaqvY>=KL>)tEpsn;N5Q#yJj<9}ImL((SqErWN3Q=;tBO~ExTCs9hB z2E$7eN#5wX4<3m^5pdjm#5o>s#eS_Q^P)tm$@SawTqF*1dj_i#)3};JslbLKHXl_N z)Fxzf>FN)EK&Rz&*|6&%Hs-^f{V|+_vL1S;-1K-l$5xiC@}%uDuwHYhmsV?YcOUlk zOYkG5v2+`+UWqpn0aaaqrD3lYdh0*!L`3FAsNKu=Q!vJu?Yc8n|CoYyDo_`r0mPoo z8>XCo$W4>l(==h?2~PoRR*kEe)&IH{1sM41mO#-36`02m#nTX{r*r`Q5rZ2-sE|nA zhnn5T#s#v`52T5|?GNS`%HgS2;R(*|^egNPDzzH_z^W)-Q98~$#YAe)cEZ%vge965AS_am#DK#pjPRr-!^za8>`kksCAUj(Xr*1NW5~e zpypt_eJpD&4_bl_y?G%>^L}=>xAaV>KR6;^aBytqpiHe%!j;&MzI_>Sx7O%F%D*8s zSN}cS^<{iiK)=Ji`FpO#^zY!_|D)qeRNAtgmH)m;qC|mq^j(|hL`7uBz+ULUj37gj zksdbnU+LSVo35riSX_4z{UX=%n&}7s0{WuZYoSfwAP`8aKN9P@%e=~1`~1ASL-z%# zw>DO&ixr}c9%4InGc*_y42bdEk)ZdG7-mTu0bD@_vGAr*NcFoMW;@r?@LUhRI zCUJgHb`O?M3!w)|CPu~ej%fddw20lod?Ufp8Dmt0PbnA0J%KE^2~AIcnKP()025V> zG>noSM3$5Btmc$GZoyP^v1@Poz0FD(6YSTH@aD0}BXva?LphAiSz9f&Y(aDAzBnUh z?d2m``~{z;{}kZJ>a^wYI?ry(V9hIoh;|EFc0*-#*`$T0DRQ1;WsqInG;YPS+I4{g zJGpKk%%Sdc5xBa$Q^_I~(F97eqDO7AN3EN0u)PNBAb+n+ zWBTxQx^;O9o0`=g+Zrt_{lP!sgWZHW?8bLYS$;1a@&7w9rD9|Ge;Gb?sEjFoF9-6v z#!2)t{DMHZ2@0W*fCx;62d#;jouz`R5Y(t{BT=$N4yr^^o$ON8d{PQ=!O zX17^CrdM~7D-;ZrC!||<+FEOxI_WI3CA<35va%4v>gc zEX-@h8esj=a4szW7x{0g$hwoWRQG$yK{@3mqd-jYiVofJE!Wok1* znV7Gm&Ssq#hFuvj1sRyHg(6PFA5U*Q8Rx>-blOs=lb`qa{zFy&n4xY;sd$fE+<3EI z##W$P9M{B3c3Si9gw^jlPU-JqD~Cye;wr=XkV7BSv#6}DrsXWFJ3eUNrc%7{=^sP> zrp)BWKA9<}^R9g!0q7yWlh;gr_TEOD|#BmGq<@IV;ueg+D2}cjpp+dPf&Q(36sFU&K8}hA85U61faW&{ zlB`9HUl-WWCG|<1XANN3JVAkRYvr5U4q6;!G*MTdSUt*Mi=z_y3B1A9j-@aK{lNvx zK%p23>M&=KTCgR!Ee8c?DAO2_R?B zkaqr6^BSP!8dHXxj%N1l+V$_%vzHjqvu7p@%Nl6;>y*S}M!B=pz=aqUV#`;h%M0rU zHfcog>kv3UZAEB*g7Er@t6CF8kHDmKTjO@rejA^ULqn!`LwrEwOVmHx^;g|5PHm#B zZ+jjWgjJ!043F+&#_;D*mz%Q60=L9Ove|$gU&~As5^uz@2-BfQ!bW)Khn}G+Wyjw- z19qI#oB(RSNydn0t~;tAmK!P-d{b-@@E5|cdgOS#!>%#Rj6ynkMvaW@37E>@hJP^8 z2zk8VXx|>#R^JCcWdBCy{0nPmYFOxN55#^-rlqobe0#L6)bi?E?SPymF*a5oDDeSd zO0gx?#KMoOd&G(2O@*W)HgX6y_aa6iMCl^~`{@UR`nMQE`>n_{_aY5nA}vqU8mt8H z`oa=g0SyiLd~BxAj2~l$zRSDHxvDs;I4>+M$W`HbJ|g&P+$!U7-PHX4RAcR0szJ*( ze-417=bO2q{492SWrqDK+L3#ChUHtz*@MP)e^%@>_&#Yk^1|tv@j4%3T)diEX zATx4K*hcO`sY$jk#jN5WD<=C3nvuVsRh||qDHnc~;Kf59zr0;c7VkVSUPD%NnnJC_ zl3F^#f_rDu8l}l8qcAz0FFa)EAt32IUy_JLIhU_J^l~FRH&6-ivSpG2PRqzDdMWft>Zc(c)#tb%wgmWN%>IOPm zZi-noqS!^Ftb81pRcQi`X#UhWK70hy4tGW1mz|+vI8c*h@ zfFGJtW3r>qV>1Z0r|L>7I3un^gcep$AAWfZHRvB|E*kktY$qQP_$YG60C@X~tTQjB3%@`uz!qxtxF+LE!+=nrS^07hn` zEgAp!h|r03h7B!$#OZW#ACD+M;-5J!W+{h|6I;5cNnE(Y863%1(oH}_FTW})8zYb$7czP zg~Szk1+_NTm6SJ0MS_|oSz%e(S~P-&SFp;!k?uFayytV$8HPwuyELSXOs^27XvK-D zOx-Dl!P|28DK6iX>p#Yb%3`A&CG0X2S43FjN%IB}q(!hC$fG}yl1y9W&W&I@KTg6@ zK^kpH8=yFuP+vI^+59|3%Zqnb5lTDAykf z9S#X`3N(X^SpdMyWQGOQRjhiwlj!0W-yD<3aEj^&X%=?`6lCy~?`&WSWt z?U~EKFcCG_RJ(Qp7j=$I%H8t)Z@6VjA#>1f@EYiS8MRHZphp zMA_5`znM=pzUpBPO)pXGYpQ6gkine{6u_o!P@Q+NKJ}k!_X7u|qfpAyIJb$_#3@wJ z<1SE2Edkfk9C!0t%}8Yio09^F`YGzpaJHGk*-ffsn85@)%4@`;Fv^8q(-Wk7r=Q8p zT&hD`5(f?M{gfzGbbwh8(}G#|#fDuk7v1W)5H9wkorE0ZZjL0Q1=NRGY>zwgfm81DdoaVwNH;or{{eSyybt)m<=zXoA^RALYG-2t zouH|L*BLvmm9cdMmn+KGopyR@4*=&0&4g|FLoreZOhRmh=)R0bg~ zT2(8V_q7~42-zvb)+y959OAv!V$u(O3)%Es0M@CRFmG{5sovIq4%8Ahjk#*5w{+)+ zMWQoJI_r$HxL5km1#6(e@{lK3Udc~n0@g`g$s?VrnQJ$!oPnb?IHh-1qA`Rz$)Ai< z6w$-MJW-gKNvOhL+XMbE7&mFt`x1KY>k4(!KbbpZ`>`K@1J<(#vVbjx@Z@(6Q}MF# zMnbr-f55(cTa^q4+#)=s+ThMaV~E`B8V=|W_fZWDwiso8tNMTNse)RNBGi=gVwgg% zbOg8>mbRN%7^Um-7oj4=6`$|(K7!+t^90a{$18Z>}<#!bm%ZEFQ{X(yBZMc>lCz0f1I2w9Sq zuGh<9<=AO&g6BZte6hn>Qmvv;Rt)*cJfTr2=~EnGD8P$v3R|&1RCl&7)b+`=QGapi zPbLg_pxm`+HZurtFZ;wZ=`Vk*do~$wB zxoW&=j0OTbQ=Q%S8XJ%~qoa3Ea|au5o}_(P;=!y-AjFrERh%8la!z6Fn@lR?^E~H12D?8#ht=1F;7@o4$Q8GDj;sSC%Jfn01xgL&%F2 zwG1|5ikb^qHv&9hT8w83+yv&BQXOQyMVJSBL(Ky~p)gU3#%|blG?IR9rP^zUbs7rOA0X52Ao=GRt@C&zlyjNLv-} z9?*x{y(`509qhCV*B47f2hLrGl^<@SuRGR!KwHei?!CM10Tq*YDIoBNyRuO*>3FU? zHjipIE#B~y3FSfOsMfj~F9PNr*H?0oHyYB^G(YyNh{SxcE(Y-`x5jFMKb~HO*m+R% zrq|ic4fzJ#USpTm;X7K+E%xsT_3VHKe?*uc4-FsILUH;kL>_okY(w`VU*8+l>o>Jm ziU#?2^`>arnsl#)*R&nf_%>A+qwl%o{l(u)M?DK1^mf260_oteV3#E_>6Y4!_hhVD zM8AI6MM2V*^_M^sQ0dmHu11fy^kOqXqzpr?K$`}BKWG`=Es(9&S@K@)ZjA{lj3ea7_MBP zk(|hBFRjHVMN!sNUkrB;(cTP)T97M$0Dtc&UXSec<+q?y>5=)}S~{Z@ua;1xt@=T5 zI7{`Z=z_X*no8s>mY;>BvEXK%b`a6(DTS6t&b!vf_z#HM{Uoy_5fiB(zpkF{})ruka$iX*~pq1ZxD?q68dIo zIZSVls9kFGsTwvr4{T_LidcWtt$u{kJlW7moRaH6+A5hW&;;2O#$oKyEN8kx`LmG)Wfq4ykh+q{I3|RfVpkR&QH_x;t41Uw z`P+tft^E2B$domKT@|nNW`EHwyj>&}K;eDpe z1bNOh=fvIfk`&B61+S8ND<(KC%>y&?>opCnY*r5M+!UrWKxv0_QvTlJc>X#AaI^xo zaRXL}t5Ej_Z$y*|w*$6D+A?Lw-CO-$itm^{2Ct82-<0IW)0KMNvJHgBrdsIR0v~=H z?n6^}l{D``Me90`^o|q!olsF?UX3YSq^6Vu>Ijm>>PaZI8G@<^NGw{Cx&%|PwYrfw zR!gX_%AR=L3BFsf8LxI|K^J}deh0ZdV?$3r--FEX`#INxsOG6_=!v)DI>0q|BxT)z z-G6kzA01M?rba+G_mwNMQD1mbVbNTWmBi*{s_v_Ft9m2Avg!^78(QFu&n6mbRJ2bA zv!b;%yo{g*9l2)>tsZJOOp}U~8VUH`}$ z8p_}t*XIOehezolNa-a2x0BS})Y9}&*TPgua{Ewn-=wVrmJUeU39EKx+%w%=ixQWK zDLpwaNJs65#6o7Ln7~~X+p_o2BR1g~VCfxLzxA{HlWAI6^H;`juI=&r1jQrUv_q0Z z1Ja-tjdktrrP>GOC*#p?*xfQU5MqjMsBe!9lh(u8)w$e@Z|>aUHI5o;MGw*|Myiz3 z-f0;pHg~Q#%*Kx8MxH%AluVXjG2C$)WL-K63@Q`#y9_k_+}eR(x4~dp7oV-ek0H>I zgy8p#i4GN{>#v=pFYUQT(g&b$OeTy-X_#FDgNF8XyfGY6R!>inYn8IR2RDa&O!(6< znXs{W!bkP|s_YI*Yx%4stI`=ZO45IK6rBs`g7sP40ic}GZ58s?Mc$&i`kq_tfci>N zIHrC0H+Qpam1bNa=(`SRKjixBTtm&e`j9porEci!zdlg1RI0Jw#b(_Tb@RQK1Zxr_ z%7SUeH6=TrXt3J@js`4iDD0=IoHhK~I7^W8^Rcp~Yaf>2wVe|Hh1bUpX9ATD#moByY57-f2Ef1TP^lBi&p5_s7WGG9|0T}dlfxOx zXvScJO1Cnq`c`~{Dp;{;l<-KkCDE+pmexJkd}zCgE{eF=)K``-qC~IT6GcRog_)!X z?fK^F8UDz$(zFUrwuR$qro5>qqn>+Z%<5>;_*3pZ8QM|yv9CAtrAx;($>4l^_$_-L z*&?(77!-=zvnCVW&kUcZMb6;2!83si518Y%R*A3JZ8Is|kUCMu`!vxDgaWjs7^0j( ziTaS4HhQ)ldR=r)_7vYFUr%THE}cPF{0H45FJ5MQW^+W>P+eEX2kLp3zzFe*-pFVA zdDZRybv?H|>`9f$AKVjFWJ=wegO7hOOIYCtd?Vj{EYLT*^gl35|HQ`R=ti+ADm{jyQE7K@kdjuqJhWVSks>b^ zxha88-h3s;%3_5b1TqFCPTxVjvuB5U>v=HyZ$?JSk+&I%)M7KE*wOg<)1-Iy)8-K! z^XpIt|0ibmk9RtMmlUd7#Ap3Q!q9N4atQy)TmrhrFhfx1DAN`^vq@Q_SRl|V z#lU<~n67$mT)NvHh`%als+G-)x1`Y%4Bp*6Un5Ri9h=_Db zA-AdP!f>f0m@~>7X#uBM?diI@)Egjuz@jXKvm zJo+==juc9_<;CqeRaU9_Mz@;3e=E4=6TK+c`|uu#pIqhSyNm`G(X)&)B`8q0RBv#> z`gGlw(Q=1Xmf55VHj%C#^1lpc>LY8kfA@|rlC1EA<1#`iuyNO z(=;irt{_&K=i4)^x%;U(Xv<)+o=dczC5H3W~+e|f~{*ucxj@{Yi-cw^MqYr3fN zF5D+~!wd$#al?UfMnz(@K#wn`_5na@rRr8XqN@&M&FGEC@`+OEv}sI1hw>Up0qAWf zL#e4~&oM;TVfjRE+10B_gFlLEP9?Q-dARr3xi6nQqnw>k-S;~b z;!0s2VS4}W8b&pGuK=7im+t(`nz@FnT#VD|!)eQNp-W6)@>aA+j~K*H{$G`y2|QHY z|Hmy+CR@#jWY4~)lr1qBJB_RfHJFfP<}pK5(#ZZGSqcpyS&}01LnTWk5fzmXMGHkJ zTP6L^B+uj;lmB_W<~4=${+v0>z31M!-_O@o-O9GyW)j_mjx}!0@br_LE-7SIuPP84 z;5=O(U*g_um0tyG|61N@d9lEuOeiRd+#NY^{nd5;-CVlw&Ap7J?qwM^?E29wvS}2d zbzar4Fz&RSR(-|s!Z6+za&Z zY#D<5q_JUktIzvL0)yq_kLWG6DO{ri=?c!y!f(Dk%G{8)k`Gym%j#!OgXVDD3;$&v@qy#ISJfp=Vm>pls@9-mapVQChAHHd-x+OGx)(*Yr zC1qDUTZ6mM(b_hi!TuFF2k#8uI2;kD70AQ&di$L*4P*Y-@p`jdm%_c3f)XhYD^6M8&#Y$ZpzQMcR|6nsH>b=*R_Von!$BTRj7yGCXokoAQ z&ANvx0-Epw`QIEPgI(^cS2f(Y85yV@ygI{ewyv5Frng)e}KCZF7JbR(&W618_dcEh(#+^zZFY;o<815<5sOHQdeax9_!PyM&;{P zkBa5xymca0#)c#tke@3KNEM8a_mT&1gm;p&&JlMGH(cL(b)BckgMQ^9&vRwj!~3@l zY?L5}=Jzr080OGKb|y`ee(+`flQg|!lo6>=H)X4`$Gz~hLmu2a%kYW_Uu8x09Pa0J zKZ`E$BKJ=2GPj_3l*TEcZ*uYRr<*J^#5pILTT;k_cgto1ZL-%slyc16J~OH-(RgDA z%;EjEnoUkZ&acS{Q8`{i6T5^nywgqQI5bDIymoa7CSZG|WWVk>GM9)zy*bNih|QIm z%0+(Nnc*a_xo;$=!HQYaapLms>J1ToyjtFByY`C2H1wT#178#4+|{H0BBqtCdd$L% z_3Hc60j@{t9~MjM@LBalR&6@>B;9?r<7J~F+WXyYu*y3?px*=8MAK@EA+jRX8{CG?GI-< z54?Dc9CAh>QTAvyOEm0^+x;r2BWX|{3$Y7)L5l*qVE*y0`7J>l2wCmW zL1?|a`pJ-l{fb_N;R(Z9UMiSj6pQjOvQ^%DvhIJF!+Th7jO2~1f1N+(-TyCFYQZYw z4)>7caf^Ki_KJ^Zx2JUb z&$3zJy!*+rCV4%jqwyuNY3j1ZEiltS0xTzd+=itTb;IPYpaf?8Y+RSdVdpacB(bVQ zC(JupLfFp8y43%PMj2}T|VS@%LVp>hv4Y!RPMF?pp8U_$xCJ)S zQx!69>bphNTIb9yn*_yfj{N%bY)t{L1cs8<8|!f$;UQ*}IN=2<6lA;x^(`8t?;+ST zh)z4qeYYgZkIy{$4x28O-pugO&gauRh3;lti9)9Pvw+^)0!h~%m&8Q!AKX%urEMnl z?yEz?g#ODn$UM`+Q#$Q!6|zsq_`dLO5YK-6bJM6ya>}H+vnW^h?o$z;V&wvuM$dR& zeEq;uUUh$XR`TWeC$$c&Jjau2it3#%J-y}Qm>nW*s?En?R&6w@sDXMEr#8~$=b(gk zwDC3)NtAP;M2BW_lL^5ShpK$D%@|BnD{=!Tq)o(5@z3i7Z){} zGr}Exom_qDO{kAVkZ*MbLNHE666Kina#D{&>Jy%~w7yX$oj;cYCd^p9zy z8*+wgSEcj$4{WxKmCF(5o7U4jqwEvO&dm1H#7z}%VXAbW&W24v-tS6N3}qrm1OnE)fUkoE8yMMn9S$?IswS88tQWm4#Oid#ckgr6 zRtHm!mfNl-`d>O*1~d7%;~n+{Rph6BBy^95zqI{K((E!iFQ+h*C3EsbxNo_aRm5gj zKYug($r*Q#W9`p%Bf{bi6;IY0v`pB^^qu)gbg9QHQ7 zWBj(a1YSu)~2RK8Pi#C>{DMlrqFb9e_RehEHyI{n?e3vL_}L>kYJC z_ly$$)zFi*SFyNrnOt(B*7E$??s67EO%DgoZL2XNk8iVx~X_)o++4oaK1M|ou73vA0K^503j@uuVmLcHH4ya-kOIDfM%5%(E z+Xpt~#7y2!KB&)PoyCA+$~DXqxPxxALy!g-O?<9+9KTk4Pgq4AIdUkl`1<1#j^cJg zgU3`0hkHj_jxV>`Y~%LAZl^3o0}`Sm@iw7kwff{M%VwtN)|~!p{AsfA6vB5UolF~d zHWS%*uBDt<9y!9v2Xe|au&1j&iR1HXCdyCjxSgG*L{wmTD4(NQ=mFjpa~xooc6kju z`~+d{j7$h-;HAB04H!Zscu^hZffL#9!p$)9>sRI|Yovm)g@F>ZnosF2EgkU3ln0bR zTA}|+E(tt)!SG)-bEJi_0m{l+(cAz^pi}`9=~n?y&;2eG;d9{M6nj>BHGn(KA2n|O zt}$=FPq!j`p&kQ8>cirSzkU0c08%8{^Qyqi-w2LoO8)^E7;;I1;HQ6B$u0nNaX2CY zSmfi)F`m94zL8>#zu;8|{aBui@RzRKBlP1&mfFxEC@%cjl?NBs`cr^nm){>;$g?rhKr$AO&6qV_Wbn^}5tfFBry^e1`%du2~o zs$~dN;S_#%iwwA_QvmMjh%Qo?0?rR~6liyN5Xmej8(*V9ym*T`xAhHih-v$7U}8=dfXi2i*aAB!xM(Xekg*ix@r|ymDw*{*s0?dlVys2e)z62u1 z+k3esbJE=-P5S$&KdFp+2H7_2e=}OKDrf( z9-207?6$@f4m4B+9E*e((Y89!q?zH|mz_vM>kp*HGXldO0Hg#!EtFhRuOm$u8e~a9 z5(roy7m$Kh+zjW6@zw{&20u?1f2uP&boD}$#Zy)4o&T;vyBoqFiF2t;*g=|1=)PxB z8eM3Mp=l_obbc?I^xyLz?4Y1YDWPa+nm;O<$Cn;@ane616`J9OO2r=rZr{I_Kizyc zP#^^WCdIEp*()rRT+*YZK>V@^Zs=ht32x>Kwe zab)@ZEffz;VM4{XA6e421^h~`ji5r%)B{wZu#hD}f3$y@L0JV9f3g{-RK!A?vBUA}${YF(vO4)@`6f1 z-A|}e#LN{)(eXloDnX4Vs7eH|<@{r#LodP@Nz--$Dg_Par%DCpu2>2jUnqy~|J?eZ zBG4FVsz_A+ibdwv>mLp>P!(t}E>$JGaK$R~;fb{O3($y1ssQQo|5M;^JqC?7qe|hg zu0ZOqeFcp?qVn&Qu7FQJ4hcFi&|nR!*j)MF#b}QO^lN%5)4p*D^H+B){n8%VPUzi! zDihoGcP71a6!ab`l^hK&*dYrVYzJ0)#}xVrp!e;lI!+x+bfCN0KXwUAPU9@#l7@0& QuEJmfE|#`Dqx|px0L@K;Y5)KL literal 0 HcmV?d00001 diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/okhttp-gson-nextgen/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 000000000000..ffed3a254e91 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/gradlew b/samples/client/petstore/java/okhttp-gson-nextgen/gradlew new file mode 100644 index 000000000000..005bcde04284 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/gradlew.bat b/samples/client/petstore/java/okhttp-gson-nextgen/gradlew.bat new file mode 100644 index 000000000000..6a68175eb70f --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/hello.txt b/samples/client/petstore/java/okhttp-gson-nextgen/hello.txt new file mode 100644 index 000000000000..6769dd60bdf5 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/hello.txt @@ -0,0 +1 @@ +Hello world! \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/pom.xml b/samples/client/petstore/java/okhttp-gson-nextgen/pom.xml new file mode 100644 index 000000000000..931f95599d35 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/pom.xml @@ -0,0 +1,349 @@ + + 4.0.0 + org.openapitools + petstore-okhttp-gson-nextgen + jar + petstore-okhttp-gson-nextgen + 1.0.0 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.0.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.0.0-M5 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + + test-jar + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.2.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.3.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.0 + + + attach-sources + + jar-no-fork + + + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + io.swagger + swagger-annotations + ${swagger-core-version} + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.squareup.okhttp3 + okhttp + ${okhttp-version} + + + com.squareup.okhttp3 + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.apache.oltu.oauth2 + org.apache.oltu.oauth2.client + 1.0.1 + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + org.threeten + threetenbp + ${threetenbp-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + javax.ws.rs + jsr311-api + 1.1.1 + + + javax.ws.rs + javax.ws.rs-api + 2.0 + + + + junit + junit + ${junit-version} + test + + + org.mockito + mockito-core + 3.12.4 + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.3 + 4.9.2 + 2.8.8 + 3.12.0 + 0.2.1 + 1.5.0 + 1.3.5 + 4.13.2 + UTF-8 + 2.17.3 + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/settings.gradle b/samples/client/petstore/java/okhttp-gson-nextgen/settings.gradle new file mode 100644 index 000000000000..db500510c406 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "petstore-okhttp-gson-nextgen" \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/AndroidManifest.xml b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/AndroidManifest.xml new file mode 100644 index 000000000000..54fbcb3da1e8 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiCallback.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 000000000000..e9ab7a8d7a60 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 000000000000..7e3cf65e18cf --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1552 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.format.DateTimeFormatter; +import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; +import org.apache.oltu.oauth2.common.message.types.GrantType; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; +import org.openapitools.client.auth.OAuth; +import org.openapitools.client.auth.RetryingOAuth; +import org.openapitools.client.auth.OAuthFlow; + +/** + *

    ApiClient class.

    + */ +public class ApiClient { + + private String basePath = "http://petstore.swagger.io:80/v2"; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + authentications.put("api_key", new ApiKeyAuth("header", "api_key")); + authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query")); + authentications.put("bearer_test", new HttpBearerAuth("bearer")); + authentications.put("http_basic_test", new HttpBasicAuth()); + authentications.put("http_signature_test", new HttpBearerAuth("signature")); + authentications.put("petstore_auth", new OAuth()); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /** + * Basic constructor with custom OkHttpClient + * + * @param client a {@link okhttp3.OkHttpClient} object + */ + public ApiClient(OkHttpClient client) { + init(); + + httpClient = client; + + // Setup authentications (key: authentication name, value: authentication). + authentications.put("api_key", new ApiKeyAuth("header", "api_key")); + authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query")); + authentications.put("bearer_test", new HttpBearerAuth("bearer")); + authentications.put("http_basic_test", new HttpBasicAuth()); + authentications.put("http_signature_test", new HttpBearerAuth("signature")); + authentications.put("petstore_auth", new OAuth()); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /** + * Constructor for ApiClient to support access token retry on 401/403 configured with client ID + * + * @param clientId client ID + */ + public ApiClient(String clientId) { + this(clientId, null, null); + } + + /** + * Constructor for ApiClient to support access token retry on 401/403 configured with client ID and additional parameters + * + * @param clientId client ID + * @param parameters a {@link java.util.Map} of parameters + */ + public ApiClient(String clientId, Map parameters) { + this(clientId, null, parameters); + } + + /** + * Constructor for ApiClient to support access token retry on 401/403 configured with client ID, secret, and additional parameters + * + * @param clientId client ID + * @param clientSecret client secret + * @param parameters a {@link java.util.Map} of parameters + */ + public ApiClient(String clientId, String clientSecret, Map parameters) { + this(null, clientId, clientSecret, parameters); + } + + /** + * Constructor for ApiClient to support access token retry on 401/403 configured with base path, client ID, secret, and additional parameters + * + * @param basePath base path + * @param clientId client ID + * @param clientSecret client secret + * @param parameters a {@link java.util.Map} of parameters + */ + public ApiClient(String basePath, String clientId, String clientSecret, Map parameters) { + init(); + if (basePath != null) { + this.basePath = basePath; + } + + String tokenUrl = ""; + if (!"".equals(tokenUrl) && !URI.create(tokenUrl).isAbsolute()) { + URI uri = URI.create(getBasePath()); + tokenUrl = uri.getScheme() + ":" + + (uri.getAuthority() != null ? "//" + uri.getAuthority() : "") + + tokenUrl; + if (!URI.create(tokenUrl).isAbsolute()) { + throw new IllegalArgumentException("OAuth2 token URL must be an absolute URL"); + } + } + RetryingOAuth retryingOAuth = new RetryingOAuth(tokenUrl, clientId, OAuthFlow.implicit, clientSecret, parameters); + authentications.put( + "petstore_auth", + retryingOAuth + ); + initHttpClient(Collections.singletonList(retryingOAuth)); + // Setup authentications (key: authentication name, value: authentication). + authentications.put("api_key", new ApiKeyAuth("header", "api_key")); + authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query")); + authentications.put("bearer_test", new HttpBearerAuth("bearer")); + authentications.put("http_basic_test", new HttpBasicAuth()); + authentications.put("http_signature_test", new HttpBearerAuth("signature")); + + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1.0.0/java"); + + authentications = new HashMap(); + } + + /** + * Get base path + * + * @return Base path + */ + public String getBasePath() { + return basePath; + } + + /** + * Set base path + * + * @param basePath Base path of the URL (e.g http://petstore.swagger.io:80/v2 + * @return An instance of OkHttpClient + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + return this; + } + + /** + * Get HTTP client + * + * @return An instance of OkHttpClient + */ + public OkHttpClient getHttpClient() { + return httpClient; + } + + /** + * Set HTTP client, which must never be null. + * + * @param newHttpClient An instance of OkHttpClient + * @return Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

    Getter for the field keyManagers.

    + * + * @return an array of {@link javax.net.ssl.KeyManager} objects + */ + public KeyManager[] getKeyManagers() { + return keyManagers; + } + + /** + * Configure client keys to use for authorization in an SSL session. + * Use null to reset to default. + * + * @param managers The KeyManagers to use + * @return ApiClient + */ + public ApiClient setKeyManagers(KeyManager[] managers) { + this.keyManagers = managers; + applySslSettings(); + return this; + } + + /** + *

    Getter for the field dateFormat.

    + * + * @return a {@link java.text.DateFormat} object + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + *

    Setter for the field dateFormat.

    + * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link org.openapitools.client.ApiClient} object + */ + public ApiClient setDateFormat(DateFormat dateFormat) { + this.json.setDateFormat(dateFormat); + return this; + } + + /** + *

    Set SqlDateFormat.

    + * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link org.openapitools.client.ApiClient} object + */ + public ApiClient setSqlDateFormat(DateFormat dateFormat) { + this.json.setSqlDateFormat(dateFormat); + return this; + } + + /** + *

    Set OffsetDateTimeFormat.

    + * + * @param dateFormat a {@link org.threeten.bp.format.DateTimeFormatter} object + * @return a {@link org.openapitools.client.ApiClient} object + */ + public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + this.json.setOffsetDateTimeFormat(dateFormat); + return this; + } + + /** + *

    Set LocalDateFormat.

    + * + * @param dateFormat a {@link org.threeten.bp.format.DateTimeFormatter} object + * @return a {@link org.openapitools.client.ApiClient} object + */ + public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { + this.json.setLocalDateFormat(dateFormat); + return this; + } + + /** + *

    Set LenientOnJson.

    + * + * @param lenientOnJson a boolean + * @return a {@link org.openapitools.client.ApiClient} object + */ + public ApiClient setLenientOnJson(boolean lenientOnJson) { + this.json.setLenientOnJson(lenientOnJson); + return this; + } + + /** + * Get authentications (key: authentication name, value: authentication). + * + * @return Map of authentication objects + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + /** + * Helper method to set access token for the first Bearer authentication. + * @param bearerToken Bearer token + */ + public void setBearerToken(String bearerToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBearerAuth) { + ((HttpBearerAuth) auth).setBearerToken(bearerToken); + return; + } + } + throw new RuntimeException("No Bearer authentication configured!"); + } + + /** + * Helper method to set username for the first HTTP basic authentication. + * + * @param username Username + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * + * @param password Password + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + * + * @param apiKey API key + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * + * @param apiKeyPrefix API key prefix + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set access token for the first OAuth2 authentication. + * + * @param accessToken Access token + */ + public void setAccessToken(String accessToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setAccessToken(accessToken); + return; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Set the User-Agent header's value (by adding to the default header map). + * + * @param userAgent HTTP request's user agent + * @return ApiClient + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Add a default header. + * + * @param key The header's key + * @param value The header's value + * @return ApiClient + */ + public ApiClient addDefaultHeader(String key, String value) { + defaultHeaderMap.put(key, value); + return this; + } + + /** + * Add a default cookie. + * + * @param key The cookie's key + * @param value The cookie's value + * @return ApiClient + */ + public ApiClient addDefaultCookie(String key, String value) { + defaultCookieMap.put(key, value); + return this; + } + + /** + * Check that whether debugging is enabled for this API client. + * + * @return True if debugging is enabled, false otherwise. + */ + public boolean isDebugging() { + return debugging; + } + + /** + * Enable/disable debugging for this API client. + * + * @param debugging To enable (true) or disable (false) debugging + * @return ApiClient + */ + public ApiClient setDebugging(boolean debugging) { + if (debugging != this.debugging) { + if (debugging) { + loggingInterceptor = new HttpLoggingInterceptor(); + loggingInterceptor.setLevel(Level.BODY); + httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build(); + } else { + final OkHttpClient.Builder builder = httpClient.newBuilder(); + builder.interceptors().remove(loggingInterceptor); + httpClient = builder.build(); + loggingInterceptor = null; + } + } + this.debugging = debugging; + return this; + } + + /** + * The path of temporary folder used to store downloaded files from endpoints + * with file response. The default value is null, i.e. using + * the system's default temporary folder. + * + * @see
    createTempFile + * @return Temporary folder path + */ + public String getTempFolderPath() { + return tempFolderPath; + } + + /** + * Set the temporary folder path (for downloading files) + * + * @param tempFolderPath Temporary folder path + * @return ApiClient + */ + public ApiClient setTempFolderPath(String tempFolderPath) { + this.tempFolderPath = tempFolderPath; + return this; + } + + /** + * Get connection timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getConnectTimeout() { + return httpClient.connectTimeoutMillis(); + } + + /** + * Sets the connect timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param connectionTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setConnectTimeout(int connectionTimeout) { + httpClient = httpClient.newBuilder().connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Get read timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getReadTimeout() { + return httpClient.readTimeoutMillis(); + } + + /** + * Sets the read timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param readTimeout read timeout in milliseconds + * @return Api client + */ + public ApiClient setReadTimeout(int readTimeout) { + httpClient = httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Get write timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getWriteTimeout() { + return httpClient.writeTimeoutMillis(); + } + + /** + * Sets the write timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param writeTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setWriteTimeout(int writeTimeout) { + httpClient = httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) + * + * @return Token request builder + */ + public TokenRequestBuilder getTokenEndPoint() { + for (Authentication apiAuth : authentications.values()) { + if (apiAuth instanceof RetryingOAuth) { + RetryingOAuth retryingOAuth = (RetryingOAuth) apiAuth; + return retryingOAuth.getTokenRequestBuilder(); + } + } + return null; + } + + /** + * Format the given parameter object into string. + * + * @param param Parameter + * @return String representation of the parameter + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) { + //Serialize to json string and remove the " enclosing characters + String jsonStr = json.serialize(param); + return jsonStr.substring(1, jsonStr.length() - 1); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for (Object o : (Collection) param) { + if (b.length() > 0) { + b.append(","); + } + b.append(String.valueOf(o)); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /** + * Formats the specified query parameter to a list containing a single {@code Pair} object. + * + * Note that {@code value} must not be a collection. + * + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list containing a single {@code Pair} object. + */ + public List parameterToPair(String name, Object value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value instanceof Collection) { + return params; + } + + params.add(new Pair(name, parameterToString(value))); + return params; + } + + /** + * Formats the specified collection query parameters to a list of {@code Pair} objects. + * + * Note that the values of each of the returned Pair objects are percent-encoded. + * + * @param collectionFormat The collection format of the parameter. + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list of {@code Pair} objects. + */ + public List parameterToPairs(String collectionFormat, String name, Collection value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value.isEmpty()) { + return params; + } + + // create the params based on the collection format + if ("multi".equals(collectionFormat)) { + for (Object item : value) { + params.add(new Pair(name, escapeString(parameterToString(item)))); + } + return params; + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + // escape all delimiters except commas, which are URI reserved + // characters + if ("ssv".equals(collectionFormat)) { + delimiter = escapeString(" "); + } else if ("tsv".equals(collectionFormat)) { + delimiter = escapeString("\t"); + } else if ("pipes".equals(collectionFormat)) { + delimiter = escapeString("|"); + } + + StringBuilder sb = new StringBuilder(); + for (Object item : value) { + sb.append(delimiter); + sb.append(escapeString(parameterToString(item))); + } + + params.add(new Pair(name, sb.substring(delimiter.length()))); + + return params; + } + + /** + * Formats the specified collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param Type + * @param response HTTP response + * @param returnType The type of the Java object + * @return The deserialized Java object + * @throws org.openapitools.client.ApiException If fail to deserialize response body, i.e. cannot read response body + * or the Content-Type of the response is not supported. + */ + @SuppressWarnings("unchecked") + public T deserialize(Response response, Type returnType) throws ApiException { + if (response == null || returnType == null) { + return null; + } + + if ("byte[]".equals(returnType.toString())) { + // Handle binary response (byte array). + try { + return (T) response.body().bytes(); + } catch (IOException e) { + throw new ApiException(e); + } + } else if (returnType.equals(File.class)) { + // Handle file downloading. + return (T) downloadFileFromResponse(response); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return json.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws org.openapitools.client.ApiException If fail to serialize the given object + */ + public RequestBody serialize(Object obj, String contentType) throws ApiException { + if (obj instanceof byte[]) { + // Binary (byte array) body parameter support. + return RequestBody.create((byte[]) obj, MediaType.parse(contentType)); + } else if (obj instanceof File) { + // File body parameter support. + return RequestBody.create((File) obj, MediaType.parse(contentType)); + } else if (isJsonMime(contentType)) { + String content; + if (obj != null) { + content = json.serialize(obj); + } else { + content = null; + } + return RequestBody.create(content, MediaType.parse(contentType)); + } else { + throw new ApiException("Content type \"" + contentType + "\" is not supported"); + } + } + + /** + * Download file from the given response. + * + * @param response An instance of the Response object + * @throws org.openapitools.client.ApiException If fail to read file content from response and write to disk + * @return Downloaded file + */ + public File downloadFileFromResponse(Response response) throws ApiException { + try { + File file = prepareDownloadFile(response); + BufferedSink sink = Okio.buffer(Okio.sink(file)); + sink.writeAll(response.body().source()); + sink.close(); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * Prepare file for download + * + * @param response An instance of the Response object + * @return Prepared file for the download + * @throws java.io.IOException If fail to prepare file for download + */ + public File prepareDownloadFile(Response response) throws IOException { + String filename = null; + String contentDisposition = response.header("Content-Disposition"); + if (contentDisposition != null && !"".equals(contentDisposition)) { + // Get filename from the Content-Disposition header. + Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + Matcher matcher = pattern.matcher(contentDisposition); + if (matcher.find()) { + filename = sanitizeFilename(matcher.group(1)); + } + } + + String prefix = null; + String suffix = null; + if (filename == null) { + prefix = "download-"; + suffix = ""; + } else { + int pos = filename.lastIndexOf("."); + if (pos == -1) { + prefix = filename + "-"; + } else { + prefix = filename.substring(0, pos) + "-"; + suffix = filename.substring(pos); + } + // Files.createTempFile requires the prefix to be at least three characters long + if (prefix.length() < 3) + prefix = "download-"; + } + + if (tempFolderPath == null) + return Files.createTempFile(prefix, suffix).toFile(); + else + return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); + } + + /** + * {@link #execute(Call, Type)} + * + * @param Type + * @param call An instance of the Call object + * @return ApiResponse<T> + * @throws org.openapitools.client.ApiException If fail to execute the call + */ + public ApiResponse execute(Call call) throws ApiException { + return execute(call, null); + } + + /** + * Execute HTTP call and deserialize the HTTP response body into the given return type. + * + * @param returnType The return type used to deserialize HTTP response body + * @param The return type corresponding to (same with) returnType + * @param call Call + * @return ApiResponse object containing response status, headers and + * data, which is a Java object deserialized from response body and would be null + * when returnType is null. + * @throws org.openapitools.client.ApiException If fail to execute the call + */ + public ApiResponse execute(Call call, Type returnType) throws ApiException { + try { + Response response = call.execute(); + T data = handleResponse(response, returnType); + return new ApiResponse(response.code(), response.headers().toMultimap(), data); + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * {@link #executeAsync(Call, Type, ApiCallback)} + * + * @param Type + * @param call An instance of the Call object + * @param callback ApiCallback<T> + */ + public void executeAsync(Call call, ApiCallback callback) { + executeAsync(call, null, callback); + } + + /** + * Execute HTTP call asynchronously. + * + * @param Type + * @param call The callback to be executed when the API call finishes + * @param returnType Return type + * @param callback ApiCallback + * @see #execute(Call, Type) + */ + @SuppressWarnings("unchecked") + public void executeAsync(Call call, final Type returnType, final ApiCallback callback) { + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, IOException e) { + callback.onFailure(new ApiException(e), 0, null); + } + + @Override + public void onResponse(Call call, Response response) throws IOException { + T result; + try { + result = (T) handleResponse(response, returnType); + } catch (ApiException e) { + callback.onFailure(e, response.code(), response.headers().toMultimap()); + return; + } catch (Exception e) { + callback.onFailure(new ApiException(e), response.code(), response.headers().toMultimap()); + return; + } + callback.onSuccess(result, response.code(), response.headers().toMultimap()); + } + }); + } + + /** + * Handle the given response, return the deserialized object when the response is successful. + * + * @param Type + * @param response Response + * @param returnType Return type + * @return Type + * @throws org.openapitools.client.ApiException If the response has an unsuccessful status code or + * fail to deserialize the response body + */ + public T handleResponse(Response response, Type returnType) throws ApiException { + if (response.isSuccessful()) { + if (returnType == null || response.code() == 204) { + // returning null if the returnType is not defined, + // or the status code is 204 (No Content) + if (response.body() != null) { + try { + response.body().close(); + } catch (Exception e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + return null; + } else { + return deserialize(response, returnType); + } + } else { + String respBody = null; + if (response.body() != null) { + try { + respBody = response.body().string(); + } catch (IOException e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody); + } + } + + /** + * Build HTTP call with the given options. + * + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param callback Callback for upload/download progress + * @return The HTTP call + * @throws org.openapitools.client.ApiException If fail to serialize the request body object + */ + public Call buildCall(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + Request request = buildRequest(path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); + + return httpClient.newCall(request); + } + + /** + * Build an HTTP request with the given options. + * + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param callback Callback for upload/download progress + * @return The HTTP request + * @throws org.openapitools.client.ApiException If fail to serialize the request body object + */ + public Request buildRequest(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentType)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentType)) { + reqBody = buildRequestBodyMultipart(formParams); + } else if (body == null) { + if ("DELETE".equals(method)) { + // allow calling DELETE without sending a request body + reqBody = null; + } else { + // use an empty request body (for POST, PUT and PATCH) + reqBody = RequestBody.create("", MediaType.parse(contentType)); + } + } else { + reqBody = serialize(body, contentType); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + processHeaderParams(headerParams, reqBuilder); + processCookieParams(cookieParams, reqBuilder); + + // Associate callback with request (if not null) so interceptor can + // access it when creating ProgressResponseBody + reqBuilder.tag(callback); + + Request request = null; + + if (callback != null && reqBody != null) { + ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, callback); + request = reqBuilder.method(method, progressRequestBody).build(); + } else { + request = reqBuilder.method(method, reqBody).build(); + } + + return request; + } + + /** + * Build full URL by concatenating base path, the given sub path and query parameters. + * + * @param path The sub path + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @return The full URL + */ + public String buildUrl(String path, List queryParams, List collectionQueryParams) { + final StringBuilder url = new StringBuilder(); + url.append(basePath).append(path); + + if (queryParams != null && !queryParams.isEmpty()) { + // support (constant) query string in `path`, e.g. "/posts?draft=1" + String prefix = path.contains("?") ? "&" : "?"; + for (Pair param : queryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + url.append(escapeString(param.getName())).append("=").append(escapeString(value)); + } + } + } + + if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { + String prefix = url.toString().contains("?") ? "&" : "?"; + for (Pair param : collectionQueryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + // collection query parameter value already escaped as part of parameterToPairs + url.append(escapeString(param.getName())).append("=").append(value); + } + } + } + + return url.toString(); + } + + /** + * Set header parameters to the request builder, including default headers. + * + * @param headerParams Header parameters in the form of Map + * @param reqBuilder Request.Builder + */ + public void processHeaderParams(Map headerParams, Request.Builder reqBuilder) { + for (Entry param : headerParams.entrySet()) { + reqBuilder.header(param.getKey(), parameterToString(param.getValue())); + } + for (Entry header : defaultHeaderMap.entrySet()) { + if (!headerParams.containsKey(header.getKey())) { + reqBuilder.header(header.getKey(), parameterToString(header.getValue())); + } + } + } + + /** + * Set cookie parameters to the request builder, including default cookies. + * + * @param cookieParams Cookie parameters in the form of Map + * @param reqBuilder Request.Builder + */ + public void processCookieParams(Map cookieParams, Request.Builder reqBuilder) { + for (Entry param : cookieParams.entrySet()) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + */ + public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, + Map cookieParams, String payload, String method, URI uri) throws ApiException { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) { + throw new RuntimeException("Authentication undefined: " + authName); + } + auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); + } + } + + /** + * Build a form-encoding request body with the given form parameters. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyFormEncoding(Map formParams) { + okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder(); + for (Entry param : formParams.entrySet()) { + formBuilder.add(param.getKey(), parameterToString(param.getValue())); + } + return formBuilder.build(); + } + + /** + * Build a multipart (file uploading) request body with the given form parameters, + * which could contain text fields and file fields. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyMultipart(Map formParams) { + MultipartBody.Builder mpBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + for (Entry param : formParams.entrySet()) { + if (param.getValue() instanceof File) { + File file = (File) param.getValue(); + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } else { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\""); + mpBuilder.addPart(partHeaders, RequestBody.create(parameterToString(param.getValue()), null)); + } + } + return mpBuilder.build(); + } + + /** + * Guess Content-Type header from the given file (defaults to "application/octet-stream"). + * + * @param file The given file + * @return The guessed Content-Type + */ + public String guessContentTypeFromFile(File file) { + String contentType = URLConnection.guessContentTypeFromName(file.getName()); + if (contentType == null) { + return "application/octet-stream"; + } else { + return contentType; + } + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + Integer.toString(index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param request The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiException.java new file mode 100644 index 000000000000..5851f0405ade --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiException.java @@ -0,0 +1,154 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Map; +import java.util.List; + +/** + *

    ApiException class.

    + */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

    Constructor for ApiException.

    + */ + public ApiException() {} + + /** + *

    Constructor for ApiException.

    + * + * @param throwable a {@link java.lang.Throwable} object + */ + public ApiException(Throwable throwable) { + super(throwable); + } + + /** + *

    Constructor for ApiException.

    + * + * @param message the error message + */ + public ApiException(String message) { + super(message); + } + + /** + *

    Constructor for ApiException.

    + * + * @param message the error message + * @param throwable a {@link java.lang.Throwable} object + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { + super(message, throwable); + this.code = code; + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + *

    Constructor for ApiException.

    + * + * @param message the error message + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(String message, int code, Map> responseHeaders, String responseBody) { + this(message, (Throwable) null, code, responseHeaders, responseBody); + } + + /** + *

    Constructor for ApiException.

    + * + * @param message the error message + * @param throwable a {@link java.lang.Throwable} object + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + */ + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { + this(message, throwable, code, responseHeaders, null); + } + + /** + *

    Constructor for ApiException.

    + * + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, Map> responseHeaders, String responseBody) { + this((String) null, (Throwable) null, code, responseHeaders, responseBody); + } + + /** + *

    Constructor for ApiException.

    + * + * @param code HTTP status code + * @param message a {@link java.lang.String} object + */ + public ApiException(int code, String message) { + super(message); + this.code = code; + } + + /** + *

    Constructor for ApiException.

    + * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiResponse.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 000000000000..fb13945bd775 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

    Constructor for ApiResponse.

    + * + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ + public ApiResponse(int statusCode, Map> headers) { + this(statusCode, headers, null); + } + + /** + *

    Constructor for ApiResponse.

    + * + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ + public ApiResponse(int statusCode, Map> headers, T data) { + this.statusCode = statusCode; + this.headers = headers; + this.data = data; + } + + /** + *

    Get the status code.

    + * + * @return the status code + */ + public int getStatusCode() { + return statusCode; + } + + /** + *

    Get the headers.

    + * + * @return a {@link java.util.Map} of headers + */ + public Map> getHeaders() { + return headers; + } + + /** + *

    Get the data.

    + * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/Configuration.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 000000000000..476456fd4ed6 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,39 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Configuration { + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 000000000000..63442a34f40a --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 000000000000..53717e8ac51b --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,594 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.format.DateTimeFormatter; + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private Gson gson; + private boolean isLenientOnJson = false; + private DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + .registerTypeSelector(org.openapitools.client.model.Animal.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("Cat", org.openapitools.client.model.Cat.class); + classByDiscriminatorValue.put("Dog", org.openapitools.client.model.Dog.class); + classByDiscriminatorValue.put("Animal", org.openapitools.client.model.Animal.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "className")); + } + }) + .registerTypeSelector(org.openapitools.client.model.Cat.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("Cat", org.openapitools.client.model.Cat.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "className")); + } + }) + .registerTypeSelector(org.openapitools.client.model.Dog.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("Dog", org.openapitools.client.model.Dog.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "className")); + } + }) + .registerTypeSelector(org.openapitools.client.model.GrandparentAnimal.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("ParentPet", org.openapitools.client.model.ParentPet.class); + classByDiscriminatorValue.put("GrandparentAnimal", org.openapitools.client.model.GrandparentAnimal.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "pet_type")); + } + }) + .registerTypeSelector(org.openapitools.client.model.Mammal.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("Pig", org.openapitools.client.model.Pig.class); + classByDiscriminatorValue.put("whale", org.openapitools.client.model.Whale.class); + classByDiscriminatorValue.put("zebra", org.openapitools.client.model.Zebra.class); + classByDiscriminatorValue.put("mammal", org.openapitools.client.model.Mammal.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "className")); + } + }) + .registerTypeSelector(org.openapitools.client.model.NullableShape.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("Quadrilateral", org.openapitools.client.model.Quadrilateral.class); + classByDiscriminatorValue.put("Triangle", org.openapitools.client.model.Triangle.class); + classByDiscriminatorValue.put("NullableShape", org.openapitools.client.model.NullableShape.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "shapeType")); + } + }) + .registerTypeSelector(org.openapitools.client.model.ParentPet.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("ParentPet", org.openapitools.client.model.ParentPet.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "pet_type")); + } + }) + .registerTypeSelector(org.openapitools.client.model.Pig.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("BasquePig", org.openapitools.client.model.BasquePig.class); + classByDiscriminatorValue.put("DanishPig", org.openapitools.client.model.DanishPig.class); + classByDiscriminatorValue.put("Pig", org.openapitools.client.model.Pig.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "className")); + } + }) + .registerTypeSelector(org.openapitools.client.model.Quadrilateral.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("ComplexQuadrilateral", org.openapitools.client.model.ComplexQuadrilateral.class); + classByDiscriminatorValue.put("SimpleQuadrilateral", org.openapitools.client.model.SimpleQuadrilateral.class); + classByDiscriminatorValue.put("Quadrilateral", org.openapitools.client.model.Quadrilateral.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "quadrilateralType")); + } + }) + .registerTypeSelector(org.openapitools.client.model.Shape.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("Quadrilateral", org.openapitools.client.model.Quadrilateral.class); + classByDiscriminatorValue.put("Triangle", org.openapitools.client.model.Triangle.class); + classByDiscriminatorValue.put("Shape", org.openapitools.client.model.Shape.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "shapeType")); + } + }) + .registerTypeSelector(org.openapitools.client.model.ShapeOrNull.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("Quadrilateral", org.openapitools.client.model.Quadrilateral.class); + classByDiscriminatorValue.put("Triangle", org.openapitools.client.model.Triangle.class); + classByDiscriminatorValue.put("ShapeOrNull", org.openapitools.client.model.ShapeOrNull.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "shapeType")); + } + }) + .registerTypeSelector(org.openapitools.client.model.Triangle.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("EquilateralTriangle", org.openapitools.client.model.EquilateralTriangle.class); + classByDiscriminatorValue.put("IsoscelesTriangle", org.openapitools.client.model.IsoscelesTriangle.class); + classByDiscriminatorValue.put("ScaleneTriangle", org.openapitools.client.model.ScaleneTriangle.class); + classByDiscriminatorValue.put("Triangle", org.openapitools.client.model.Triangle.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "triangleType")); + } + }) + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + public JSON() { + gson = createGson() + .registerTypeAdapter(Date.class, dateTypeAdapter) + .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) + .registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter) + .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) + .registerTypeAdapter(byte[].class, byteArrayAdapter) + .registerTypeAdapterFactory(new org.openapitools.client.model.AdditionalPropertiesClass.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Animal.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Apple.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.AppleReq.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ArrayOfArrayOfNumberOnly.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ArrayOfNumberOnly.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ArrayTest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Banana.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.BananaReq.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.BasquePig.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Capitalization.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Cat.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.CatAllOf.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Category.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ClassModel.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Client.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ComplexQuadrilateral.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.DanishPig.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.DeprecatedObject.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Dog.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.DogAllOf.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Drawing.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.EnumArrays.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.EnumTest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.EquilateralTriangle.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.FileSchemaTestClass.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Foo.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.FormatTest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Fruit.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.FruitReq.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.GmFruit.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.GrandparentAnimal.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.HasOnlyReadOnly.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.HealthCheckResult.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.InlineResponseDefault.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.IsoscelesTriangle.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Mammal.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.MapTest.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.MixedPropertiesAndAdditionalPropertiesClass.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Model200Response.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ModelApiResponse.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ModelReturn.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Name.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.NullableClass.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.NullableShape.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.NumberOnly.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ObjectWithDeprecatedFields.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Order.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.OuterComposite.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ParentPet.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Pet.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Pig.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Quadrilateral.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.QuadrilateralInterface.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ReadOnlyFirst.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ScaleneTriangle.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Shape.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ShapeInterface.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.ShapeOrNull.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.SimpleQuadrilateral.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.SpecialModelName.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Tag.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Triangle.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.TriangleInterface.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.User.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Whale.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Zebra.CustomTypeAdapterFactory()) + .create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public void setGson(Gson gson) { + this.gson = gson; + } + + public void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/Pair.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 000000000000..8352d84046a7 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + if (arg.trim().isEmpty()) { + return false; + } + + return true; + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ProgressRequestBody.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 000000000000..924dd8668973 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ProgressResponseBody.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 000000000000..eee56669a4a3 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 000000000000..e08da9aac7dd --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new RuntimeException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replaceAll("\\{" + name + "\\}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ServerVariable.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 000000000000..c2f13e216662 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/StringUtil.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 000000000000..4dc60597910a --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

    + * Note: This might be replaced by utility method from commons-lang or guava someday + * if one of those libraries is added as dependency. + *

    + * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/AnotherFakeApi.java new file mode 100644 index 000000000000..e258256633e4 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -0,0 +1,170 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.Client; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class AnotherFakeApi { + private ApiClient localVarApiClient; + + public AnotherFakeApi() { + this(Configuration.getDefaultApiClient()); + } + + public AnotherFakeApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + /** + * Build call for call123testSpecialTags + * @param client client model (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public okhttp3.Call call123testSpecialTagsCall(Client client, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = client; + + // create path and map variables + String localVarPath = "/another-fake/dummy"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call call123testSpecialTagsValidateBeforeCall(Client client, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException("Missing the required parameter 'client' when calling call123testSpecialTags(Async)"); + } + + + okhttp3.Call localVarCall = call123testSpecialTagsCall(client, _callback); + return localVarCall; + + } + + /** + * To test special tags + * To test special tags and operation ID starting with number + * @param client client model (required) + * @return Client + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public Client call123testSpecialTags(Client client) throws ApiException { + ApiResponse localVarResp = call123testSpecialTagsWithHttpInfo(client); + return localVarResp.getData(); + } + + /** + * To test special tags + * To test special tags and operation ID starting with number + * @param client client model (required) + * @return ApiResponse<Client> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public ApiResponse call123testSpecialTagsWithHttpInfo(Client client) throws ApiException { + okhttp3.Call localVarCall = call123testSpecialTagsValidateBeforeCall(client, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * To test special tags (asynchronously) + * To test special tags and operation ID starting with number + * @param client client model (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public okhttp3.Call call123testSpecialTagsAsync(Client client, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = call123testSpecialTagsValidateBeforeCall(client, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 000000000000..c4e26ea2b1cd --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,161 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.InlineResponseDefault; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class DefaultApi { + private ApiClient localVarApiClient; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + /** + * Build call for fooGet + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    0 response -
    + */ + public okhttp3.Call fooGetCall(final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/foo"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call fooGetValidateBeforeCall(final ApiCallback _callback) throws ApiException { + + + okhttp3.Call localVarCall = fooGetCall(_callback); + return localVarCall; + + } + + /** + * + * + * @return InlineResponseDefault + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    0 response -
    + */ + public InlineResponseDefault fooGet() throws ApiException { + ApiResponse localVarResp = fooGetWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * + * + * @return ApiResponse<InlineResponseDefault> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    0 response -
    + */ + public ApiResponse fooGetWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = fooGetValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    0 response -
    + */ + public okhttp3.Call fooGetAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = fooGetValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeApi.java new file mode 100644 index 000000000000..3c5114fef1b4 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeApi.java @@ -0,0 +1,2065 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import java.math.BigDecimal; +import org.openapitools.client.model.Client; +import java.io.File; +import org.openapitools.client.model.FileSchemaTestClass; +import org.openapitools.client.model.HealthCheckResult; +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; +import org.openapitools.client.model.OuterComposite; +import org.openapitools.client.model.OuterEnum; +import org.openapitools.client.model.User; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class FakeApi { + private ApiClient localVarApiClient; + + public FakeApi() { + this(Configuration.getDefaultApiClient()); + } + + public FakeApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + /** + * Build call for fakeHealthGet + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 The instance started successfully -
    + */ + public okhttp3.Call fakeHealthGetCall(final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/fake/health"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call fakeHealthGetValidateBeforeCall(final ApiCallback _callback) throws ApiException { + + + okhttp3.Call localVarCall = fakeHealthGetCall(_callback); + return localVarCall; + + } + + /** + * Health check endpoint + * + * @return HealthCheckResult + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 The instance started successfully -
    + */ + public HealthCheckResult fakeHealthGet() throws ApiException { + ApiResponse localVarResp = fakeHealthGetWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Health check endpoint + * + * @return ApiResponse<HealthCheckResult> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 The instance started successfully -
    + */ + public ApiResponse fakeHealthGetWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = fakeHealthGetValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Health check endpoint (asynchronously) + * + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 The instance started successfully -
    + */ + public okhttp3.Call fakeHealthGetAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = fakeHealthGetValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for fakeOuterBooleanSerialize + * @param body Input boolean as post body (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Output boolean -
    + */ + public okhttp3.Call fakeOuterBooleanSerializeCall(Boolean body, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/boolean"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "*/*" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call fakeOuterBooleanSerializeValidateBeforeCall(Boolean body, final ApiCallback _callback) throws ApiException { + + + okhttp3.Call localVarCall = fakeOuterBooleanSerializeCall(body, _callback); + return localVarCall; + + } + + /** + * + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @return Boolean + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Output boolean -
    + */ + public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException { + ApiResponse localVarResp = fakeOuterBooleanSerializeWithHttpInfo(body); + return localVarResp.getData(); + } + + /** + * + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @return ApiResponse<Boolean> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Output boolean -
    + */ + public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(Boolean body) throws ApiException { + okhttp3.Call localVarCall = fakeOuterBooleanSerializeValidateBeforeCall(body, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Output boolean -
    + */ + public okhttp3.Call fakeOuterBooleanSerializeAsync(Boolean body, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = fakeOuterBooleanSerializeValidateBeforeCall(body, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for fakeOuterCompositeSerialize + * @param outerComposite Input composite as post body (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Output composite -
    + */ + public okhttp3.Call fakeOuterCompositeSerializeCall(OuterComposite outerComposite, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = outerComposite; + + // create path and map variables + String localVarPath = "/fake/outer/composite"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "*/*" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call fakeOuterCompositeSerializeValidateBeforeCall(OuterComposite outerComposite, final ApiCallback _callback) throws ApiException { + + + okhttp3.Call localVarCall = fakeOuterCompositeSerializeCall(outerComposite, _callback); + return localVarCall; + + } + + /** + * + * Test serialization of object with outer number type + * @param outerComposite Input composite as post body (optional) + * @return OuterComposite + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Output composite -
    + */ + public OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite) throws ApiException { + ApiResponse localVarResp = fakeOuterCompositeSerializeWithHttpInfo(outerComposite); + return localVarResp.getData(); + } + + /** + * + * Test serialization of object with outer number type + * @param outerComposite Input composite as post body (optional) + * @return ApiResponse<OuterComposite> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Output composite -
    + */ + public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(OuterComposite outerComposite) throws ApiException { + okhttp3.Call localVarCall = fakeOuterCompositeSerializeValidateBeforeCall(outerComposite, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Test serialization of object with outer number type + * @param outerComposite Input composite as post body (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Output composite -
    + */ + public okhttp3.Call fakeOuterCompositeSerializeAsync(OuterComposite outerComposite, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = fakeOuterCompositeSerializeValidateBeforeCall(outerComposite, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for fakeOuterNumberSerialize + * @param body Input number as post body (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Output number -
    + */ + public okhttp3.Call fakeOuterNumberSerializeCall(BigDecimal body, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/number"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "*/*" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call fakeOuterNumberSerializeValidateBeforeCall(BigDecimal body, final ApiCallback _callback) throws ApiException { + + + okhttp3.Call localVarCall = fakeOuterNumberSerializeCall(body, _callback); + return localVarCall; + + } + + /** + * + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @return BigDecimal + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Output number -
    + */ + public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException { + ApiResponse localVarResp = fakeOuterNumberSerializeWithHttpInfo(body); + return localVarResp.getData(); + } + + /** + * + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @return ApiResponse<BigDecimal> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Output number -
    + */ + public ApiResponse fakeOuterNumberSerializeWithHttpInfo(BigDecimal body) throws ApiException { + okhttp3.Call localVarCall = fakeOuterNumberSerializeValidateBeforeCall(body, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Output number -
    + */ + public okhttp3.Call fakeOuterNumberSerializeAsync(BigDecimal body, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = fakeOuterNumberSerializeValidateBeforeCall(body, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for fakeOuterStringSerialize + * @param body Input string as post body (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Output string -
    + */ + public okhttp3.Call fakeOuterStringSerializeCall(String body, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/string"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "*/*" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call fakeOuterStringSerializeValidateBeforeCall(String body, final ApiCallback _callback) throws ApiException { + + + okhttp3.Call localVarCall = fakeOuterStringSerializeCall(body, _callback); + return localVarCall; + + } + + /** + * + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Output string -
    + */ + public String fakeOuterStringSerialize(String body) throws ApiException { + ApiResponse localVarResp = fakeOuterStringSerializeWithHttpInfo(body); + return localVarResp.getData(); + } + + /** + * + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Output string -
    + */ + public ApiResponse fakeOuterStringSerializeWithHttpInfo(String body) throws ApiException { + okhttp3.Call localVarCall = fakeOuterStringSerializeValidateBeforeCall(body, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Output string -
    + */ + public okhttp3.Call fakeOuterStringSerializeAsync(String body, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = fakeOuterStringSerializeValidateBeforeCall(body, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getArrayOfEnums + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Got named array of enums -
    + */ + public okhttp3.Call getArrayOfEnumsCall(final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/fake/array-of-enums"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getArrayOfEnumsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + + + okhttp3.Call localVarCall = getArrayOfEnumsCall(_callback); + return localVarCall; + + } + + /** + * Array of Enums + * + * @return List<OuterEnum> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Got named array of enums -
    + */ + public List getArrayOfEnums() throws ApiException { + ApiResponse> localVarResp = getArrayOfEnumsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Array of Enums + * + * @return ApiResponse<List<OuterEnum>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Got named array of enums -
    + */ + public ApiResponse> getArrayOfEnumsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getArrayOfEnumsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Array of Enums (asynchronously) + * + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Got named array of enums -
    + */ + public okhttp3.Call getArrayOfEnumsAsync(final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = getArrayOfEnumsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for testBodyWithFileSchema + * @param fileSchemaTestClass (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public okhttp3.Call testBodyWithFileSchemaCall(FileSchemaTestClass fileSchemaTestClass, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = fileSchemaTestClass; + + // create path and map variables + String localVarPath = "/fake/body-with-file-schema"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call testBodyWithFileSchemaValidateBeforeCall(FileSchemaTestClass fileSchemaTestClass, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'fileSchemaTestClass' is set + if (fileSchemaTestClass == null) { + throw new ApiException("Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema(Async)"); + } + + + okhttp3.Call localVarCall = testBodyWithFileSchemaCall(fileSchemaTestClass, _callback); + return localVarCall; + + } + + /** + * + * For this test, the body for this request much reference a schema named `File`. + * @param fileSchemaTestClass (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws ApiException { + testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass); + } + + /** + * + * For this test, the body for this request much reference a schema named `File`. + * @param fileSchemaTestClass (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public ApiResponse testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass fileSchemaTestClass) throws ApiException { + okhttp3.Call localVarCall = testBodyWithFileSchemaValidateBeforeCall(fileSchemaTestClass, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * For this test, the body for this request much reference a schema named `File`. + * @param fileSchemaTestClass (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public okhttp3.Call testBodyWithFileSchemaAsync(FileSchemaTestClass fileSchemaTestClass, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = testBodyWithFileSchemaValidateBeforeCall(fileSchemaTestClass, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for testBodyWithQueryParams + * @param query (required) + * @param user (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public okhttp3.Call testBodyWithQueryParamsCall(String query, User user, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = user; + + // create path and map variables + String localVarPath = "/fake/body-with-query-params"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (query != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("query", query)); + } + + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call testBodyWithQueryParamsValidateBeforeCall(String query, User user, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'query' is set + if (query == null) { + throw new ApiException("Missing the required parameter 'query' when calling testBodyWithQueryParams(Async)"); + } + + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException("Missing the required parameter 'user' when calling testBodyWithQueryParams(Async)"); + } + + + okhttp3.Call localVarCall = testBodyWithQueryParamsCall(query, user, _callback); + return localVarCall; + + } + + /** + * + * + * @param query (required) + * @param user (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public void testBodyWithQueryParams(String query, User user) throws ApiException { + testBodyWithQueryParamsWithHttpInfo(query, user); + } + + /** + * + * + * @param query (required) + * @param user (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public ApiResponse testBodyWithQueryParamsWithHttpInfo(String query, User user) throws ApiException { + okhttp3.Call localVarCall = testBodyWithQueryParamsValidateBeforeCall(query, user, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param query (required) + * @param user (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public okhttp3.Call testBodyWithQueryParamsAsync(String query, User user, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = testBodyWithQueryParamsValidateBeforeCall(query, user, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for testClientModel + * @param client client model (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public okhttp3.Call testClientModelCall(Client client, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = client; + + // create path and map variables + String localVarPath = "/fake"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call testClientModelValidateBeforeCall(Client client, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException("Missing the required parameter 'client' when calling testClientModel(Async)"); + } + + + okhttp3.Call localVarCall = testClientModelCall(client, _callback); + return localVarCall; + + } + + /** + * To test \"client\" model + * To test \"client\" model + * @param client client model (required) + * @return Client + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public Client testClientModel(Client client) throws ApiException { + ApiResponse localVarResp = testClientModelWithHttpInfo(client); + return localVarResp.getData(); + } + + /** + * To test \"client\" model + * To test \"client\" model + * @param client client model (required) + * @return ApiResponse<Client> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public ApiResponse testClientModelWithHttpInfo(Client client) throws ApiException { + okhttp3.Call localVarCall = testClientModelValidateBeforeCall(client, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * To test \"client\" model (asynchronously) + * To test \"client\" model + * @param client client model (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public okhttp3.Call testClientModelAsync(Client client, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = testClientModelValidateBeforeCall(client, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for testEndpointParameters + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional, default to OffsetDateTime.parse("2010-02-01T09:20:10.111110Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()))) + * @param password None (optional) + * @param paramCallback None (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid username supplied -
    404 User not found -
    + */ + public okhttp3.Call testEndpointParametersCall(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/fake"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (integer != null) { + localVarFormParams.put("integer", integer); + } + + if (int32 != null) { + localVarFormParams.put("int32", int32); + } + + if (int64 != null) { + localVarFormParams.put("int64", int64); + } + + if (number != null) { + localVarFormParams.put("number", number); + } + + if (_float != null) { + localVarFormParams.put("float", _float); + } + + if (_double != null) { + localVarFormParams.put("double", _double); + } + + if (string != null) { + localVarFormParams.put("string", string); + } + + if (patternWithoutDelimiter != null) { + localVarFormParams.put("pattern_without_delimiter", patternWithoutDelimiter); + } + + if (_byte != null) { + localVarFormParams.put("byte", _byte); + } + + if (binary != null) { + localVarFormParams.put("binary", binary); + } + + if (date != null) { + localVarFormParams.put("date", date); + } + + if (dateTime != null) { + localVarFormParams.put("dateTime", dateTime); + } + + if (password != null) { + localVarFormParams.put("password", password); + } + + if (paramCallback != null) { + localVarFormParams.put("callback", paramCallback); + } + + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/x-www-form-urlencoded" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "http_basic_test" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call testEndpointParametersValidateBeforeCall(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'number' is set + if (number == null) { + throw new ApiException("Missing the required parameter 'number' when calling testEndpointParameters(Async)"); + } + + // verify the required parameter '_double' is set + if (_double == null) { + throw new ApiException("Missing the required parameter '_double' when calling testEndpointParameters(Async)"); + } + + // verify the required parameter 'patternWithoutDelimiter' is set + if (patternWithoutDelimiter == null) { + throw new ApiException("Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters(Async)"); + } + + // verify the required parameter '_byte' is set + if (_byte == null) { + throw new ApiException("Missing the required parameter '_byte' when calling testEndpointParameters(Async)"); + } + + + okhttp3.Call localVarCall = testEndpointParametersCall(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, _callback); + return localVarCall; + + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional, default to OffsetDateTime.parse("2010-02-01T09:20:10.111110Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()))) + * @param password None (optional) + * @param paramCallback None (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid username supplied -
    404 User not found -
    + */ + public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { + testEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional, default to OffsetDateTime.parse("2010-02-01T09:20:10.111110Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()))) + * @param password None (optional) + * @param paramCallback None (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid username supplied -
    404 User not found -
    + */ + public ApiResponse testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { + okhttp3.Call localVarCall = testEndpointParametersValidateBeforeCall(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 (asynchronously) + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional, default to OffsetDateTime.parse("2010-02-01T09:20:10.111110Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()))) + * @param password None (optional) + * @param paramCallback None (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid username supplied -
    404 User not found -
    + */ + public okhttp3.Call testEndpointParametersAsync(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = testEndpointParametersValidateBeforeCall(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for testEnumParameters + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid request -
    404 Not found -
    + */ + public okhttp3.Call testEnumParametersCall(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/fake"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (enumFormStringArray != null) { + localVarFormParams.put("enum_form_string_array", enumFormStringArray); + } + + if (enumFormString != null) { + localVarFormParams.put("enum_form_string", enumFormString); + } + + if (enumQueryStringArray != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "enum_query_string_array", enumQueryStringArray)); + } + + if (enumQueryString != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("enum_query_string", enumQueryString)); + } + + if (enumQueryInteger != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("enum_query_integer", enumQueryInteger)); + } + + if (enumQueryDouble != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("enum_query_double", enumQueryDouble)); + } + + if (enumHeaderStringArray != null) { + localVarHeaderParams.put("enum_header_string_array", localVarApiClient.parameterToString(enumHeaderStringArray)); + } + + if (enumHeaderString != null) { + localVarHeaderParams.put("enum_header_string", localVarApiClient.parameterToString(enumHeaderString)); + } + + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/x-www-form-urlencoded" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call testEnumParametersValidateBeforeCall(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, final ApiCallback _callback) throws ApiException { + + + okhttp3.Call localVarCall = testEnumParametersCall(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, _callback); + return localVarCall; + + } + + /** + * To test enum parameters + * To test enum parameters + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid request -
    404 Not found -
    + */ + public void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { + testEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + } + + /** + * To test enum parameters + * To test enum parameters + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid request -
    404 Not found -
    + */ + public ApiResponse testEnumParametersWithHttpInfo(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { + okhttp3.Call localVarCall = testEnumParametersValidateBeforeCall(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * To test enum parameters (asynchronously) + * To test enum parameters + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid request -
    404 Not found -
    + */ + public okhttp3.Call testEnumParametersAsync(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = testEnumParametersValidateBeforeCall(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + private okhttp3.Call testGroupParametersCall(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/fake"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (requiredStringGroup != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("required_string_group", requiredStringGroup)); + } + + if (requiredInt64Group != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("required_int64_group", requiredInt64Group)); + } + + if (stringGroup != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("string_group", stringGroup)); + } + + if (int64Group != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("int64_group", int64Group)); + } + + if (requiredBooleanGroup != null) { + localVarHeaderParams.put("required_boolean_group", localVarApiClient.parameterToString(requiredBooleanGroup)); + } + + if (booleanGroup != null) { + localVarHeaderParams.put("boolean_group", localVarApiClient.parameterToString(booleanGroup)); + } + + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_test" }; + return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call testGroupParametersValidateBeforeCall(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'requiredStringGroup' is set + if (requiredStringGroup == null) { + throw new ApiException("Missing the required parameter 'requiredStringGroup' when calling testGroupParameters(Async)"); + } + + // verify the required parameter 'requiredBooleanGroup' is set + if (requiredBooleanGroup == null) { + throw new ApiException("Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters(Async)"); + } + + // verify the required parameter 'requiredInt64Group' is set + if (requiredInt64Group == null) { + throw new ApiException("Missing the required parameter 'requiredInt64Group' when calling testGroupParameters(Async)"); + } + + + okhttp3.Call localVarCall = testGroupParametersCall(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, _callback); + return localVarCall; + + } + + + private ApiResponse testGroupParametersWithHttpInfo(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { + okhttp3.Call localVarCall = testGroupParametersValidateBeforeCall(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, null); + return localVarApiClient.execute(localVarCall); + } + + private okhttp3.Call testGroupParametersAsync(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = testGroupParametersValidateBeforeCall(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + + public class APItestGroupParametersRequest { + private final Integer requiredStringGroup; + private final Boolean requiredBooleanGroup; + private final Long requiredInt64Group; + private Integer stringGroup; + private Boolean booleanGroup; + private Long int64Group; + + private APItestGroupParametersRequest(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group) { + this.requiredStringGroup = requiredStringGroup; + this.requiredBooleanGroup = requiredBooleanGroup; + this.requiredInt64Group = requiredInt64Group; + } + + /** + * Set stringGroup + * @param stringGroup String in group parameters (optional) + * @return APItestGroupParametersRequest + */ + public APItestGroupParametersRequest stringGroup(Integer stringGroup) { + this.stringGroup = stringGroup; + return this; + } + + /** + * Set booleanGroup + * @param booleanGroup Boolean in group parameters (optional) + * @return APItestGroupParametersRequest + */ + public APItestGroupParametersRequest booleanGroup(Boolean booleanGroup) { + this.booleanGroup = booleanGroup; + return this; + } + + /** + * Set int64Group + * @param int64Group Integer in group parameters (optional) + * @return APItestGroupParametersRequest + */ + public APItestGroupParametersRequest int64Group(Long int64Group) { + this.int64Group = int64Group; + return this; + } + + /** + * Build call for testGroupParameters + * @param _callback ApiCallback API callback + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    400 Someting wrong -
    + */ + public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { + return testGroupParametersCall(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, _callback); + } + + /** + * Execute testGroupParameters request + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    400 Someting wrong -
    + */ + public void execute() throws ApiException { + testGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + } + + /** + * Execute testGroupParameters request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    400 Someting wrong -
    + */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return testGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + } + + /** + * Execute testGroupParameters request (asynchronously) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    400 Someting wrong -
    + */ + public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { + return testGroupParametersAsync(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, _callback); + } + } + + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @return APItestGroupParametersRequest + * @http.response.details + + + +
    Status Code Description Response Headers
    400 Someting wrong -
    + */ + public APItestGroupParametersRequest testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group) { + return new APItestGroupParametersRequest(requiredStringGroup, requiredBooleanGroup, requiredInt64Group); + } + /** + * Build call for testInlineAdditionalProperties + * @param requestBody request body (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public okhttp3.Call testInlineAdditionalPropertiesCall(Map requestBody, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = requestBody; + + // create path and map variables + String localVarPath = "/fake/inline-additionalProperties"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call testInlineAdditionalPropertiesValidateBeforeCall(Map requestBody, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new ApiException("Missing the required parameter 'requestBody' when calling testInlineAdditionalProperties(Async)"); + } + + + okhttp3.Call localVarCall = testInlineAdditionalPropertiesCall(requestBody, _callback); + return localVarCall; + + } + + /** + * test inline additionalProperties + * + * @param requestBody request body (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public void testInlineAdditionalProperties(Map requestBody) throws ApiException { + testInlineAdditionalPropertiesWithHttpInfo(requestBody); + } + + /** + * test inline additionalProperties + * + * @param requestBody request body (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(Map requestBody) throws ApiException { + okhttp3.Call localVarCall = testInlineAdditionalPropertiesValidateBeforeCall(requestBody, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * test inline additionalProperties (asynchronously) + * + * @param requestBody request body (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public okhttp3.Call testInlineAdditionalPropertiesAsync(Map requestBody, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = testInlineAdditionalPropertiesValidateBeforeCall(requestBody, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for testJsonFormData + * @param param field1 (required) + * @param param2 field2 (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public okhttp3.Call testJsonFormDataCall(String param, String param2, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/fake/jsonFormData"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (param != null) { + localVarFormParams.put("param", param); + } + + if (param2 != null) { + localVarFormParams.put("param2", param2); + } + + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/x-www-form-urlencoded" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call testJsonFormDataValidateBeforeCall(String param, String param2, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'param' is set + if (param == null) { + throw new ApiException("Missing the required parameter 'param' when calling testJsonFormData(Async)"); + } + + // verify the required parameter 'param2' is set + if (param2 == null) { + throw new ApiException("Missing the required parameter 'param2' when calling testJsonFormData(Async)"); + } + + + okhttp3.Call localVarCall = testJsonFormDataCall(param, param2, _callback); + return localVarCall; + + } + + /** + * test json serialization of form data + * + * @param param field1 (required) + * @param param2 field2 (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public void testJsonFormData(String param, String param2) throws ApiException { + testJsonFormDataWithHttpInfo(param, param2); + } + + /** + * test json serialization of form data + * + * @param param field1 (required) + * @param param2 field2 (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public ApiResponse testJsonFormDataWithHttpInfo(String param, String param2) throws ApiException { + okhttp3.Call localVarCall = testJsonFormDataValidateBeforeCall(param, param2, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * test json serialization of form data (asynchronously) + * + * @param param field1 (required) + * @param param2 field2 (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public okhttp3.Call testJsonFormDataAsync(String param, String param2, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = testJsonFormDataValidateBeforeCall(param, param2, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for testQueryParameterCollectionFormat + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public okhttp3.Call testQueryParameterCollectionFormatCall(List pipe, List ioutil, List http, List url, List context, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/fake/test-query-parameters"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (pipe != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "pipe", pipe)); + } + + if (ioutil != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "ioutil", ioutil)); + } + + if (http != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("ssv", "http", http)); + } + + if (url != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "url", url)); + } + + if (context != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "context", context)); + } + + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call testQueryParameterCollectionFormatValidateBeforeCall(List pipe, List ioutil, List http, List url, List context, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'pipe' is set + if (pipe == null) { + throw new ApiException("Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat(Async)"); + } + + // verify the required parameter 'ioutil' is set + if (ioutil == null) { + throw new ApiException("Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat(Async)"); + } + + // verify the required parameter 'http' is set + if (http == null) { + throw new ApiException("Missing the required parameter 'http' when calling testQueryParameterCollectionFormat(Async)"); + } + + // verify the required parameter 'url' is set + if (url == null) { + throw new ApiException("Missing the required parameter 'url' when calling testQueryParameterCollectionFormat(Async)"); + } + + // verify the required parameter 'context' is set + if (context == null) { + throw new ApiException("Missing the required parameter 'context' when calling testQueryParameterCollectionFormat(Async)"); + } + + + okhttp3.Call localVarCall = testQueryParameterCollectionFormatCall(pipe, ioutil, http, url, context, _callback); + return localVarCall; + + } + + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) throws ApiException { + testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context); + } + + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context) throws ApiException { + okhttp3.Call localVarCall = testQueryParameterCollectionFormatValidateBeforeCall(pipe, ioutil, http, url, context, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public okhttp3.Call testQueryParameterCollectionFormatAsync(List pipe, List ioutil, List http, List url, List context, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = testQueryParameterCollectionFormatValidateBeforeCall(pipe, ioutil, http, url, context, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java new file mode 100644 index 000000000000..f9449ed44204 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -0,0 +1,170 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.Client; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class FakeClassnameTags123Api { + private ApiClient localVarApiClient; + + public FakeClassnameTags123Api() { + this(Configuration.getDefaultApiClient()); + } + + public FakeClassnameTags123Api(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + /** + * Build call for testClassname + * @param client client model (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public okhttp3.Call testClassnameCall(Client client, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = client; + + // create path and map variables + String localVarPath = "/fake_classname_test"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "api_key_query" }; + return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call testClassnameValidateBeforeCall(Client client, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException("Missing the required parameter 'client' when calling testClassname(Async)"); + } + + + okhttp3.Call localVarCall = testClassnameCall(client, _callback); + return localVarCall; + + } + + /** + * To test class name in snake case + * To test class name in snake case + * @param client client model (required) + * @return Client + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public Client testClassname(Client client) throws ApiException { + ApiResponse localVarResp = testClassnameWithHttpInfo(client); + return localVarResp.getData(); + } + + /** + * To test class name in snake case + * To test class name in snake case + * @param client client model (required) + * @return ApiResponse<Client> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public ApiResponse testClassnameWithHttpInfo(Client client) throws ApiException { + okhttp3.Call localVarCall = testClassnameValidateBeforeCall(client, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * To test class name in snake case (asynchronously) + * To test class name in snake case + * @param client client model (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public okhttp3.Call testClassnameAsync(Client client, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = testClassnameValidateBeforeCall(client, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/PetApi.java new file mode 100644 index 000000000000..d88ee6f9c316 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/PetApi.java @@ -0,0 +1,1167 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import java.io.File; +import org.openapitools.client.model.ModelApiResponse; +import org.openapitools.client.model.Pet; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class PetApi { + private ApiClient localVarApiClient; + + public PetApi() { + this(Configuration.getDefaultApiClient()); + } + + public PetApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + /** + * Build call for addPet + * @param pet Pet object that needs to be added to the store (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    405 Invalid input -
    + */ + public okhttp3.Call addPetCall(Pet pet, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = pet; + + // create path and map variables + String localVarPath = "/pet"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", "application/xml" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "http_signature_test", "petstore_auth" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call addPetValidateBeforeCall(Pet pet, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException("Missing the required parameter 'pet' when calling addPet(Async)"); + } + + + okhttp3.Call localVarCall = addPetCall(pet, _callback); + return localVarCall; + + } + + /** + * Add a new pet to the store + * + * @param pet Pet object that needs to be added to the store (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    405 Invalid input -
    + */ + public void addPet(Pet pet) throws ApiException { + addPetWithHttpInfo(pet); + } + + /** + * Add a new pet to the store + * + * @param pet Pet object that needs to be added to the store (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    405 Invalid input -
    + */ + public ApiResponse addPetWithHttpInfo(Pet pet) throws ApiException { + okhttp3.Call localVarCall = addPetValidateBeforeCall(pet, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Add a new pet to the store (asynchronously) + * + * @param pet Pet object that needs to be added to the store (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    405 Invalid input -
    + */ + public okhttp3.Call addPetAsync(Pet pet, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = addPetValidateBeforeCall(pet, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for deletePet + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    400 Invalid pet value -
    + */ + public okhttp3.Call deletePetCall(Long petId, String apiKey, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pet/{petId}" + .replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (apiKey != null) { + localVarHeaderParams.put("api_key", localVarApiClient.parameterToString(apiKey)); + } + + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deletePetValidateBeforeCall(Long petId, String apiKey, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException("Missing the required parameter 'petId' when calling deletePet(Async)"); + } + + + okhttp3.Call localVarCall = deletePetCall(petId, apiKey, _callback); + return localVarCall; + + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    400 Invalid pet value -
    + */ + public void deletePet(Long petId, String apiKey) throws ApiException { + deletePetWithHttpInfo(petId, apiKey); + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    400 Invalid pet value -
    + */ + public ApiResponse deletePetWithHttpInfo(Long petId, String apiKey) throws ApiException { + okhttp3.Call localVarCall = deletePetValidateBeforeCall(petId, apiKey, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Deletes a pet (asynchronously) + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    400 Invalid pet value -
    + */ + public okhttp3.Call deletePetAsync(Long petId, String apiKey, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deletePetValidateBeforeCall(petId, apiKey, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for findPetsByStatus + * @param status Status values that need to be considered for filter (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid status value -
    + */ + public okhttp3.Call findPetsByStatusCall(List status, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pet/findByStatus"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (status != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "status", status)); + } + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "http_signature_test", "petstore_auth" }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call findPetsByStatusValidateBeforeCall(List status, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'status' is set + if (status == null) { + throw new ApiException("Missing the required parameter 'status' when calling findPetsByStatus(Async)"); + } + + + okhttp3.Call localVarCall = findPetsByStatusCall(status, _callback); + return localVarCall; + + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter (required) + * @return List<Pet> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid status value -
    + */ + public List findPetsByStatus(List status) throws ApiException { + ApiResponse> localVarResp = findPetsByStatusWithHttpInfo(status); + return localVarResp.getData(); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter (required) + * @return ApiResponse<List<Pet>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid status value -
    + */ + public ApiResponse> findPetsByStatusWithHttpInfo(List status) throws ApiException { + okhttp3.Call localVarCall = findPetsByStatusValidateBeforeCall(status, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Finds Pets by status (asynchronously) + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid status value -
    + */ + public okhttp3.Call findPetsByStatusAsync(List status, final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = findPetsByStatusValidateBeforeCall(status, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for findPetsByTags + * @param tags Tags to filter by (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid tag value -
    + * @deprecated + */ + @Deprecated + public okhttp3.Call findPetsByTagsCall(List tags, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pet/findByTags"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (tags != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "tags", tags)); + } + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "http_signature_test", "petstore_auth" }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @Deprecated + @SuppressWarnings("rawtypes") + private okhttp3.Call findPetsByTagsValidateBeforeCall(List tags, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'tags' is set + if (tags == null) { + throw new ApiException("Missing the required parameter 'tags' when calling findPetsByTags(Async)"); + } + + + okhttp3.Call localVarCall = findPetsByTagsCall(tags, _callback); + return localVarCall; + + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by (required) + * @return List<Pet> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid tag value -
    + * @deprecated + */ + @Deprecated + public List findPetsByTags(List tags) throws ApiException { + ApiResponse> localVarResp = findPetsByTagsWithHttpInfo(tags); + return localVarResp.getData(); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by (required) + * @return ApiResponse<List<Pet>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid tag value -
    + * @deprecated + */ + @Deprecated + public ApiResponse> findPetsByTagsWithHttpInfo(List tags) throws ApiException { + okhttp3.Call localVarCall = findPetsByTagsValidateBeforeCall(tags, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Finds Pets by tags (asynchronously) + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid tag value -
    + * @deprecated + */ + @Deprecated + public okhttp3.Call findPetsByTagsAsync(List tags, final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = findPetsByTagsValidateBeforeCall(tags, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPetById + * @param petId ID of pet to return (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Pet not found -
    + */ + public okhttp3.Call getPetByIdCall(Long petId, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pet/{petId}" + .replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "api_key" }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPetByIdValidateBeforeCall(Long petId, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException("Missing the required parameter 'petId' when calling getPetById(Async)"); + } + + + okhttp3.Call localVarCall = getPetByIdCall(petId, _callback); + return localVarCall; + + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return (required) + * @return Pet + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Pet not found -
    + */ + public Pet getPetById(Long petId) throws ApiException { + ApiResponse localVarResp = getPetByIdWithHttpInfo(petId); + return localVarResp.getData(); + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return (required) + * @return ApiResponse<Pet> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Pet not found -
    + */ + public ApiResponse getPetByIdWithHttpInfo(Long petId) throws ApiException { + okhttp3.Call localVarCall = getPetByIdValidateBeforeCall(petId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Find pet by ID (asynchronously) + * Returns a single pet + * @param petId ID of pet to return (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Pet not found -
    + */ + public okhttp3.Call getPetByIdAsync(Long petId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPetByIdValidateBeforeCall(petId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updatePet + * @param pet Pet object that needs to be added to the store (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
    Status Code Description Response Headers
    400 Invalid ID supplied -
    404 Pet not found -
    405 Validation exception -
    + */ + public okhttp3.Call updatePetCall(Pet pet, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = pet; + + // create path and map variables + String localVarPath = "/pet"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", "application/xml" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "http_signature_test", "petstore_auth" }; + return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updatePetValidateBeforeCall(Pet pet, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException("Missing the required parameter 'pet' when calling updatePet(Async)"); + } + + + okhttp3.Call localVarCall = updatePetCall(pet, _callback); + return localVarCall; + + } + + /** + * Update an existing pet + * + * @param pet Pet object that needs to be added to the store (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
    Status Code Description Response Headers
    400 Invalid ID supplied -
    404 Pet not found -
    405 Validation exception -
    + */ + public void updatePet(Pet pet) throws ApiException { + updatePetWithHttpInfo(pet); + } + + /** + * Update an existing pet + * + * @param pet Pet object that needs to be added to the store (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
    Status Code Description Response Headers
    400 Invalid ID supplied -
    404 Pet not found -
    405 Validation exception -
    + */ + public ApiResponse updatePetWithHttpInfo(Pet pet) throws ApiException { + okhttp3.Call localVarCall = updatePetValidateBeforeCall(pet, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Update an existing pet (asynchronously) + * + * @param pet Pet object that needs to be added to the store (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
    Status Code Description Response Headers
    400 Invalid ID supplied -
    404 Pet not found -
    405 Validation exception -
    + */ + public okhttp3.Call updatePetAsync(Pet pet, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updatePetValidateBeforeCall(pet, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for updatePetWithForm + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    405 Invalid input -
    + */ + public okhttp3.Call updatePetWithFormCall(Long petId, String name, String status, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pet/{petId}" + .replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (name != null) { + localVarFormParams.put("name", name); + } + + if (status != null) { + localVarFormParams.put("status", status); + } + + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/x-www-form-urlencoded" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updatePetWithFormValidateBeforeCall(Long petId, String name, String status, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException("Missing the required parameter 'petId' when calling updatePetWithForm(Async)"); + } + + + okhttp3.Call localVarCall = updatePetWithFormCall(petId, name, status, _callback); + return localVarCall; + + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    405 Invalid input -
    + */ + public void updatePetWithForm(Long petId, String name, String status) throws ApiException { + updatePetWithFormWithHttpInfo(petId, name, status); + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    405 Invalid input -
    + */ + public ApiResponse updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws ApiException { + okhttp3.Call localVarCall = updatePetWithFormValidateBeforeCall(petId, name, status, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Updates a pet in the store with form data (asynchronously) + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    405 Invalid input -
    + */ + public okhttp3.Call updatePetWithFormAsync(Long petId, String name, String status, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updatePetWithFormValidateBeforeCall(petId, name, status, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for uploadFile + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public okhttp3.Call uploadFileCall(Long petId, String additionalMetadata, File file, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pet/{petId}/uploadImage" + .replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (additionalMetadata != null) { + localVarFormParams.put("additionalMetadata", additionalMetadata); + } + + if (file != null) { + localVarFormParams.put("file", file); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "multipart/form-data" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call uploadFileValidateBeforeCall(Long petId, String additionalMetadata, File file, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException("Missing the required parameter 'petId' when calling uploadFile(Async)"); + } + + + okhttp3.Call localVarCall = uploadFileCall(petId, additionalMetadata, file, _callback); + return localVarCall; + + } + + /** + * uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return ModelApiResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file) throws ApiException { + ApiResponse localVarResp = uploadFileWithHttpInfo(petId, additionalMetadata, file); + return localVarResp.getData(); + } + + /** + * uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return ApiResponse<ModelApiResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public ApiResponse uploadFileWithHttpInfo(Long petId, String additionalMetadata, File file) throws ApiException { + okhttp3.Call localVarCall = uploadFileValidateBeforeCall(petId, additionalMetadata, file, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * uploads an image (asynchronously) + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public okhttp3.Call uploadFileAsync(Long petId, String additionalMetadata, File file, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = uploadFileValidateBeforeCall(petId, additionalMetadata, file, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for uploadFileWithRequiredFile + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public okhttp3.Call uploadFileWithRequiredFileCall(Long petId, File requiredFile, String additionalMetadata, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile" + .replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (additionalMetadata != null) { + localVarFormParams.put("additionalMetadata", additionalMetadata); + } + + if (requiredFile != null) { + localVarFormParams.put("requiredFile", requiredFile); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "multipart/form-data" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call uploadFileWithRequiredFileValidateBeforeCall(Long petId, File requiredFile, String additionalMetadata, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException("Missing the required parameter 'petId' when calling uploadFileWithRequiredFile(Async)"); + } + + // verify the required parameter 'requiredFile' is set + if (requiredFile == null) { + throw new ApiException("Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile(Async)"); + } + + + okhttp3.Call localVarCall = uploadFileWithRequiredFileCall(petId, requiredFile, additionalMetadata, _callback); + return localVarCall; + + } + + /** + * uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @return ModelApiResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws ApiException { + ApiResponse localVarResp = uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata); + return localVarResp.getData(); + } + + /** + * uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @return ApiResponse<ModelApiResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws ApiException { + okhttp3.Call localVarCall = uploadFileWithRequiredFileValidateBeforeCall(petId, requiredFile, additionalMetadata, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * uploads an image (required) (asynchronously) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public okhttp3.Call uploadFileWithRequiredFileAsync(Long petId, File requiredFile, String additionalMetadata, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = uploadFileWithRequiredFileValidateBeforeCall(petId, requiredFile, additionalMetadata, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/StoreApi.java new file mode 100644 index 000000000000..d9a068df9e9a --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/StoreApi.java @@ -0,0 +1,514 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.Order; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class StoreApi { + private ApiClient localVarApiClient; + + public StoreApi() { + this(Configuration.getDefaultApiClient()); + } + + public StoreApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + /** + * Build call for deleteOrder + * @param orderId ID of the order that needs to be deleted (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid ID supplied -
    404 Order not found -
    + */ + public okhttp3.Call deleteOrderCall(String orderId, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/store/order/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", localVarApiClient.escapeString(orderId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteOrderValidateBeforeCall(String orderId, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'orderId' is set + if (orderId == null) { + throw new ApiException("Missing the required parameter 'orderId' when calling deleteOrder(Async)"); + } + + + okhttp3.Call localVarCall = deleteOrderCall(orderId, _callback); + return localVarCall; + + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid ID supplied -
    404 Order not found -
    + */ + public void deleteOrder(String orderId) throws ApiException { + deleteOrderWithHttpInfo(orderId); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid ID supplied -
    404 Order not found -
    + */ + public ApiResponse deleteOrderWithHttpInfo(String orderId) throws ApiException { + okhttp3.Call localVarCall = deleteOrderValidateBeforeCall(orderId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete purchase order by ID (asynchronously) + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid ID supplied -
    404 Order not found -
    + */ + public okhttp3.Call deleteOrderAsync(String orderId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteOrderValidateBeforeCall(orderId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getInventory + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public okhttp3.Call getInventoryCall(final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/store/inventory"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "api_key" }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getInventoryValidateBeforeCall(final ApiCallback _callback) throws ApiException { + + + okhttp3.Call localVarCall = getInventoryCall(_callback); + return localVarCall; + + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return Map<String, Integer> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public Map getInventory() throws ApiException { + ApiResponse> localVarResp = getInventoryWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return ApiResponse<Map<String, Integer>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public ApiResponse> getInventoryWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getInventoryValidateBeforeCall(null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Returns pet inventories by status (asynchronously) + * Returns a map of status codes to quantities + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public okhttp3.Call getInventoryAsync(final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = getInventoryValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getOrderById + * @param orderId ID of pet that needs to be fetched (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Order not found -
    + */ + public okhttp3.Call getOrderByIdCall(Long orderId, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/store/order/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", localVarApiClient.escapeString(orderId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOrderByIdValidateBeforeCall(Long orderId, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'orderId' is set + if (orderId == null) { + throw new ApiException("Missing the required parameter 'orderId' when calling getOrderById(Async)"); + } + + + okhttp3.Call localVarCall = getOrderByIdCall(orderId, _callback); + return localVarCall; + + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched (required) + * @return Order + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Order not found -
    + */ + public Order getOrderById(Long orderId) throws ApiException { + ApiResponse localVarResp = getOrderByIdWithHttpInfo(orderId); + return localVarResp.getData(); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched (required) + * @return ApiResponse<Order> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Order not found -
    + */ + public ApiResponse getOrderByIdWithHttpInfo(Long orderId) throws ApiException { + okhttp3.Call localVarCall = getOrderByIdValidateBeforeCall(orderId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Find purchase order by ID (asynchronously) + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Order not found -
    + */ + public okhttp3.Call getOrderByIdAsync(Long orderId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getOrderByIdValidateBeforeCall(orderId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for placeOrder + * @param order order placed for purchasing the pet (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid Order -
    + */ + public okhttp3.Call placeOrderCall(Order order, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = order; + + // create path and map variables + String localVarPath = "/store/order"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call placeOrderValidateBeforeCall(Order order, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'order' is set + if (order == null) { + throw new ApiException("Missing the required parameter 'order' when calling placeOrder(Async)"); + } + + + okhttp3.Call localVarCall = placeOrderCall(order, _callback); + return localVarCall; + + } + + /** + * Place an order for a pet + * + * @param order order placed for purchasing the pet (required) + * @return Order + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid Order -
    + */ + public Order placeOrder(Order order) throws ApiException { + ApiResponse localVarResp = placeOrderWithHttpInfo(order); + return localVarResp.getData(); + } + + /** + * Place an order for a pet + * + * @param order order placed for purchasing the pet (required) + * @return ApiResponse<Order> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid Order -
    + */ + public ApiResponse placeOrderWithHttpInfo(Order order) throws ApiException { + okhttp3.Call localVarCall = placeOrderValidateBeforeCall(order, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Place an order for a pet (asynchronously) + * + * @param order order placed for purchasing the pet (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid Order -
    + */ + public okhttp3.Call placeOrderAsync(Order order, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = placeOrderValidateBeforeCall(order, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/UserApi.java new file mode 100644 index 000000000000..0f4f2d294a48 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/UserApi.java @@ -0,0 +1,977 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.User; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class UserApi { + private ApiClient localVarApiClient; + + public UserApi() { + this(Configuration.getDefaultApiClient()); + } + + public UserApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + /** + * Build call for createUser + * @param user Created user object (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public okhttp3.Call createUserCall(User user, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = user; + + // create path and map variables + String localVarPath = "/user"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createUserValidateBeforeCall(User user, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException("Missing the required parameter 'user' when calling createUser(Async)"); + } + + + okhttp3.Call localVarCall = createUserCall(user, _callback); + return localVarCall; + + } + + /** + * Create user + * This can only be done by the logged in user. + * @param user Created user object (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public void createUser(User user) throws ApiException { + createUserWithHttpInfo(user); + } + + /** + * Create user + * This can only be done by the logged in user. + * @param user Created user object (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public ApiResponse createUserWithHttpInfo(User user) throws ApiException { + okhttp3.Call localVarCall = createUserValidateBeforeCall(user, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Create user (asynchronously) + * This can only be done by the logged in user. + * @param user Created user object (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public okhttp3.Call createUserAsync(User user, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createUserValidateBeforeCall(user, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for createUsersWithArrayInput + * @param user List of user object (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public okhttp3.Call createUsersWithArrayInputCall(List user, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = user; + + // create path and map variables + String localVarPath = "/user/createWithArray"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createUsersWithArrayInputValidateBeforeCall(List user, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException("Missing the required parameter 'user' when calling createUsersWithArrayInput(Async)"); + } + + + okhttp3.Call localVarCall = createUsersWithArrayInputCall(user, _callback); + return localVarCall; + + } + + /** + * Creates list of users with given input array + * + * @param user List of user object (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public void createUsersWithArrayInput(List user) throws ApiException { + createUsersWithArrayInputWithHttpInfo(user); + } + + /** + * Creates list of users with given input array + * + * @param user List of user object (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public ApiResponse createUsersWithArrayInputWithHttpInfo(List user) throws ApiException { + okhttp3.Call localVarCall = createUsersWithArrayInputValidateBeforeCall(user, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Creates list of users with given input array (asynchronously) + * + * @param user List of user object (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public okhttp3.Call createUsersWithArrayInputAsync(List user, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createUsersWithArrayInputValidateBeforeCall(user, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for createUsersWithListInput + * @param user List of user object (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public okhttp3.Call createUsersWithListInputCall(List user, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = user; + + // create path and map variables + String localVarPath = "/user/createWithList"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createUsersWithListInputValidateBeforeCall(List user, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException("Missing the required parameter 'user' when calling createUsersWithListInput(Async)"); + } + + + okhttp3.Call localVarCall = createUsersWithListInputCall(user, _callback); + return localVarCall; + + } + + /** + * Creates list of users with given input array + * + * @param user List of user object (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public void createUsersWithListInput(List user) throws ApiException { + createUsersWithListInputWithHttpInfo(user); + } + + /** + * Creates list of users with given input array + * + * @param user List of user object (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public ApiResponse createUsersWithListInputWithHttpInfo(List user) throws ApiException { + okhttp3.Call localVarCall = createUsersWithListInputValidateBeforeCall(user, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Creates list of users with given input array (asynchronously) + * + * @param user List of user object (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public okhttp3.Call createUsersWithListInputAsync(List user, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createUsersWithListInputValidateBeforeCall(user, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for deleteUser + * @param username The name that needs to be deleted (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid username supplied -
    404 User not found -
    + */ + public okhttp3.Call deleteUserCall(String username, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/user/{username}" + .replaceAll("\\{" + "username" + "\\}", localVarApiClient.escapeString(username.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteUserValidateBeforeCall(String username, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'username' is set + if (username == null) { + throw new ApiException("Missing the required parameter 'username' when calling deleteUser(Async)"); + } + + + okhttp3.Call localVarCall = deleteUserCall(username, _callback); + return localVarCall; + + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid username supplied -
    404 User not found -
    + */ + public void deleteUser(String username) throws ApiException { + deleteUserWithHttpInfo(username); + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid username supplied -
    404 User not found -
    + */ + public ApiResponse deleteUserWithHttpInfo(String username) throws ApiException { + okhttp3.Call localVarCall = deleteUserValidateBeforeCall(username, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete user (asynchronously) + * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid username supplied -
    404 User not found -
    + */ + public okhttp3.Call deleteUserAsync(String username, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteUserValidateBeforeCall(username, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getUserByName + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid username supplied -
    404 User not found -
    + */ + public okhttp3.Call getUserByNameCall(String username, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/user/{username}" + .replaceAll("\\{" + "username" + "\\}", localVarApiClient.escapeString(username.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getUserByNameValidateBeforeCall(String username, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'username' is set + if (username == null) { + throw new ApiException("Missing the required parameter 'username' when calling getUserByName(Async)"); + } + + + okhttp3.Call localVarCall = getUserByNameCall(username, _callback); + return localVarCall; + + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return User + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid username supplied -
    404 User not found -
    + */ + public User getUserByName(String username) throws ApiException { + ApiResponse localVarResp = getUserByNameWithHttpInfo(username); + return localVarResp.getData(); + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return ApiResponse<User> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid username supplied -
    404 User not found -
    + */ + public ApiResponse getUserByNameWithHttpInfo(String username) throws ApiException { + okhttp3.Call localVarCall = getUserByNameValidateBeforeCall(username, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get user by user name (asynchronously) + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid username supplied -
    404 User not found -
    + */ + public okhttp3.Call getUserByNameAsync(String username, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getUserByNameValidateBeforeCall(username, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for loginUser + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation * X-Rate-Limit - calls per hour allowed by the user
    * X-Expires-After - date in UTC when token expires
    400 Invalid username/password supplied -
    + */ + public okhttp3.Call loginUserCall(String username, String password, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/user/login"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (username != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("username", username)); + } + + if (password != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("password", password)); + } + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call loginUserValidateBeforeCall(String username, String password, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'username' is set + if (username == null) { + throw new ApiException("Missing the required parameter 'username' when calling loginUser(Async)"); + } + + // verify the required parameter 'password' is set + if (password == null) { + throw new ApiException("Missing the required parameter 'password' when calling loginUser(Async)"); + } + + + okhttp3.Call localVarCall = loginUserCall(username, password, _callback); + return localVarCall; + + } + + /** + * Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation * X-Rate-Limit - calls per hour allowed by the user
    * X-Expires-After - date in UTC when token expires
    400 Invalid username/password supplied -
    + */ + public String loginUser(String username, String password) throws ApiException { + ApiResponse localVarResp = loginUserWithHttpInfo(username, password); + return localVarResp.getData(); + } + + /** + * Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation * X-Rate-Limit - calls per hour allowed by the user
    * X-Expires-After - date in UTC when token expires
    400 Invalid username/password supplied -
    + */ + public ApiResponse loginUserWithHttpInfo(String username, String password) throws ApiException { + okhttp3.Call localVarCall = loginUserValidateBeforeCall(username, password, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Logs user into the system (asynchronously) + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation * X-Rate-Limit - calls per hour allowed by the user
    * X-Expires-After - date in UTC when token expires
    400 Invalid username/password supplied -
    + */ + public okhttp3.Call loginUserAsync(String username, String password, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = loginUserValidateBeforeCall(username, password, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for logoutUser + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public okhttp3.Call logoutUserCall(final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/user/logout"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call logoutUserValidateBeforeCall(final ApiCallback _callback) throws ApiException { + + + okhttp3.Call localVarCall = logoutUserCall(_callback); + return localVarCall; + + } + + /** + * Logs out current logged in user session + * + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public void logoutUser() throws ApiException { + logoutUserWithHttpInfo(); + } + + /** + * Logs out current logged in user session + * + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public ApiResponse logoutUserWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = logoutUserValidateBeforeCall(null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Logs out current logged in user session (asynchronously) + * + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public okhttp3.Call logoutUserAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = logoutUserValidateBeforeCall(_callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for updateUser + * @param username name that need to be deleted (required) + * @param user Updated user object (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid user supplied -
    404 User not found -
    + */ + public okhttp3.Call updateUserCall(String username, User user, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = user; + + // create path and map variables + String localVarPath = "/user/{username}" + .replaceAll("\\{" + "username" + "\\}", localVarApiClient.escapeString(username.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarHeaderParams != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateUserValidateBeforeCall(String username, User user, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'username' is set + if (username == null) { + throw new ApiException("Missing the required parameter 'username' when calling updateUser(Async)"); + } + + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException("Missing the required parameter 'user' when calling updateUser(Async)"); + } + + + okhttp3.Call localVarCall = updateUserCall(username, user, _callback); + return localVarCall; + + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted (required) + * @param user Updated user object (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid user supplied -
    404 User not found -
    + */ + public void updateUser(String username, User user) throws ApiException { + updateUserWithHttpInfo(username, user); + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted (required) + * @param user Updated user object (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid user supplied -
    404 User not found -
    + */ + public ApiResponse updateUserWithHttpInfo(String username, User user) throws ApiException { + okhttp3.Call localVarCall = updateUserValidateBeforeCall(username, user, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Updated user (asynchronously) + * 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 _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid user supplied -
    404 User not found -
    + */ + public okhttp3.Call updateUserAsync(String username, User user, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateUserValidateBeforeCall(username, user, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 000000000000..35aa7184d26b --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/Authentication.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 000000000000..c59d11e0ce99 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 000000000000..b4641c4217c0 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +import java.io.UnsupportedEncodingException; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 000000000000..460ad224963c --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/OAuth.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/OAuth.java new file mode 100644 index 000000000000..08a855ec5f92 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/OAuth.java @@ -0,0 +1,42 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class OAuth implements Authentication { + private String accessToken; + + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (accessToken != null) { + headerParams.put("Authorization", "Bearer " + accessToken); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/OAuthFlow.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/OAuthFlow.java new file mode 100644 index 000000000000..ac3ecef00206 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/OAuthFlow.java @@ -0,0 +1,22 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public enum OAuthFlow { + accessCode, //called authorizationCode in OpenAPI 3.0 + implicit, + password, + application //called clientCredentials in OpenAPI 3.0 +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java new file mode 100644 index 000000000000..1c8ac2dc0cce --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java @@ -0,0 +1,68 @@ +package org.openapitools.client.auth; + +import okhttp3.OkHttpClient; +import okhttp3.MediaType; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; + +import org.apache.oltu.oauth2.client.HttpClient; +import org.apache.oltu.oauth2.client.request.OAuthClientRequest; +import org.apache.oltu.oauth2.client.response.OAuthClientResponse; +import org.apache.oltu.oauth2.client.response.OAuthClientResponseFactory; +import org.apache.oltu.oauth2.common.exception.OAuthProblemException; +import org.apache.oltu.oauth2.common.exception.OAuthSystemException; + +import java.io.IOException; +import java.util.Map; +import java.util.Map.Entry; + +public class OAuthOkHttpClient implements HttpClient { + private OkHttpClient client; + + public OAuthOkHttpClient() { + this.client = new OkHttpClient(); + } + + public OAuthOkHttpClient(OkHttpClient client) { + this.client = client; + } + + @Override + public T execute(OAuthClientRequest request, Map headers, + String requestMethod, Class responseClass) + throws OAuthSystemException, OAuthProblemException { + + MediaType mediaType = MediaType.parse("application/json"); + Request.Builder requestBuilder = new Request.Builder().url(request.getLocationUri()); + + if(headers != null) { + for (Entry entry : headers.entrySet()) { + if (entry.getKey().equalsIgnoreCase("Content-Type")) { + mediaType = MediaType.parse(entry.getValue()); + } else { + requestBuilder.addHeader(entry.getKey(), entry.getValue()); + } + } + } + + RequestBody body = request.getBody() != null ? RequestBody.create(request.getBody(), mediaType) : null; + requestBuilder.method(requestMethod, body); + + try { + Response response = client.newCall(requestBuilder.build()).execute(); + return OAuthClientResponseFactory.createCustomResponse( + response.body().string(), + response.body().contentType().toString(), + response.code(), + responseClass); + } catch (IOException e) { + throw new OAuthSystemException(e); + } + } + + @Override + public void shutdown() { + // Nothing to do here + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/RetryingOAuth.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/RetryingOAuth.java new file mode 100644 index 000000000000..911df8d3a37d --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/auth/RetryingOAuth.java @@ -0,0 +1,182 @@ +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import okhttp3.Interceptor; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; + +import org.apache.oltu.oauth2.client.OAuthClient; +import org.apache.oltu.oauth2.client.request.OAuthBearerClientRequest; +import org.apache.oltu.oauth2.client.request.OAuthClientRequest; +import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; +import org.apache.oltu.oauth2.client.response.OAuthJSONAccessTokenResponse; +import org.apache.oltu.oauth2.common.exception.OAuthProblemException; +import org.apache.oltu.oauth2.common.exception.OAuthSystemException; +import org.apache.oltu.oauth2.common.message.types.GrantType; + +import java.io.IOException; +import java.net.HttpURLConnection; +import java.net.URI; +import java.util.Map; +import java.util.List; + +public class RetryingOAuth extends OAuth implements Interceptor { + private OAuthClient oAuthClient; + + private TokenRequestBuilder tokenRequestBuilder; + + public RetryingOAuth(OkHttpClient client, TokenRequestBuilder tokenRequestBuilder) { + this.oAuthClient = new OAuthClient(new OAuthOkHttpClient(client)); + this.tokenRequestBuilder = tokenRequestBuilder; + } + + public RetryingOAuth(TokenRequestBuilder tokenRequestBuilder) { + this(new OkHttpClient(), tokenRequestBuilder); + } + + /** + @param tokenUrl The token URL to be used for this OAuth2 flow. + Applicable to the following OAuth2 flows: "password", "clientCredentials" and "authorizationCode". + The value must be an absolute URL. + @param clientId The OAuth2 client ID for the "clientCredentials" flow. + @param clientSecret The OAuth2 client secret for the "clientCredentials" flow. + */ + public RetryingOAuth( + String tokenUrl, + String clientId, + OAuthFlow flow, + String clientSecret, + Map parameters + ) { + this(OAuthClientRequest.tokenLocation(tokenUrl) + .setClientId(clientId) + .setClientSecret(clientSecret)); + setFlow(flow); + if (parameters != null) { + for (String paramName : parameters.keySet()) { + tokenRequestBuilder.setParameter(paramName, parameters.get(paramName)); + } + } + } + + public void setFlow(OAuthFlow flow) { + switch(flow) { + case accessCode: + tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE); + break; + case implicit: + tokenRequestBuilder.setGrantType(GrantType.IMPLICIT); + break; + case password: + tokenRequestBuilder.setGrantType(GrantType.PASSWORD); + break; + case application: + tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS); + break; + default: + break; + } + } + + @Override + public Response intercept(Chain chain) throws IOException { + return retryingIntercept(chain, true); + } + + private Response retryingIntercept(Chain chain, boolean updateTokenAndRetryOnAuthorizationFailure) throws IOException { + Request request = chain.request(); + + // If the request already has an authorization (e.g. Basic auth), proceed with the request as is + if (request.header("Authorization") != null) { + return chain.proceed(request); + } + + // Get the token if it has not yet been acquired + if (getAccessToken() == null) { + updateAccessToken(null); + } + + OAuthClientRequest oAuthRequest; + if (getAccessToken() != null) { + // Build the request + Request.Builder requestBuilder = request.newBuilder(); + + String requestAccessToken = getAccessToken(); + try { + oAuthRequest = + new OAuthBearerClientRequest(request.url().toString()). + setAccessToken(requestAccessToken). + buildHeaderMessage(); + } catch (OAuthSystemException e) { + throw new IOException(e); + } + + Map headers = oAuthRequest.getHeaders(); + for (String headerName : headers.keySet()) { + requestBuilder.addHeader(headerName, headers.get(headerName)); + } + requestBuilder.url(oAuthRequest.getLocationUri()); + + // Execute the request + Response response = chain.proceed(requestBuilder.build()); + + // 401/403 response codes most likely indicate an expired access token, unless it happens two times in a row + if ( + response != null && + ( response.code() == HttpURLConnection.HTTP_UNAUTHORIZED || + response.code() == HttpURLConnection.HTTP_FORBIDDEN ) && + updateTokenAndRetryOnAuthorizationFailure + ) { + try { + if (updateAccessToken(requestAccessToken)) { + response.body().close(); + return retryingIntercept(chain, false); + } + } catch (Exception e) { + response.body().close(); + throw e; + } + } + return response; + } + else { + return chain.proceed(chain.request()); + } + } + + /* + * Returns true if the access token has been updated + */ + public synchronized boolean updateAccessToken(String requestAccessToken) throws IOException { + if (getAccessToken() == null || getAccessToken().equals(requestAccessToken)) { + try { + OAuthJSONAccessTokenResponse accessTokenResponse = + oAuthClient.accessToken(tokenRequestBuilder.buildBodyMessage()); + if (accessTokenResponse != null && accessTokenResponse.getAccessToken() != null) { + setAccessToken(accessTokenResponse.getAccessToken()); + } + } catch (OAuthSystemException | OAuthProblemException e) { + throw new IOException(e); + } + } + return getAccessToken() == null || !getAccessToken().equals(requestAccessToken); + } + + public TokenRequestBuilder getTokenRequestBuilder() { + return tokenRequestBuilder; + } + + public void setTokenRequestBuilder(TokenRequestBuilder tokenRequestBuilder) { + this.tokenRequestBuilder = tokenRequestBuilder; + } + + // Applying authorization to parameters is performed in the retryingIntercept method + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + // No implementation necessary + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 000000000000..ddda27d5fed9 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java new file mode 100644 index 000000000000..5c1d5c3fd664 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -0,0 +1,419 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * AdditionalPropertiesClass + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AdditionalPropertiesClass { + public static final String SERIALIZED_NAME_MAP_PROPERTY = "map_property"; + @SerializedName(SERIALIZED_NAME_MAP_PROPERTY) + private Map mapProperty = null; + + public static final String SERIALIZED_NAME_MAP_OF_MAP_PROPERTY = "map_of_map_property"; + @SerializedName(SERIALIZED_NAME_MAP_OF_MAP_PROPERTY) + private Map> mapOfMapProperty = null; + + public static final String SERIALIZED_NAME_ANYTYPE1 = "anytype_1"; + @SerializedName(SERIALIZED_NAME_ANYTYPE1) + private Object anytype1 = null; + + public static final String SERIALIZED_NAME_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1 = "map_with_undeclared_properties_anytype_1"; + @SerializedName(SERIALIZED_NAME_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1) + private Object mapWithUndeclaredPropertiesAnytype1; + + public static final String SERIALIZED_NAME_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2 = "map_with_undeclared_properties_anytype_2"; + @SerializedName(SERIALIZED_NAME_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2) + private Object mapWithUndeclaredPropertiesAnytype2; + + public static final String SERIALIZED_NAME_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3 = "map_with_undeclared_properties_anytype_3"; + @SerializedName(SERIALIZED_NAME_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3) + private Map mapWithUndeclaredPropertiesAnytype3 = null; + + public static final String SERIALIZED_NAME_EMPTY_MAP = "empty_map"; + @SerializedName(SERIALIZED_NAME_EMPTY_MAP) + private Object emptyMap; + + public static final String SERIALIZED_NAME_MAP_WITH_UNDECLARED_PROPERTIES_STRING = "map_with_undeclared_properties_string"; + @SerializedName(SERIALIZED_NAME_MAP_WITH_UNDECLARED_PROPERTIES_STRING) + private Map mapWithUndeclaredPropertiesString = null; + + public AdditionalPropertiesClass() { + } + + public AdditionalPropertiesClass mapProperty(Map mapProperty) { + + this.mapProperty = mapProperty; + return this; + } + + public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap(); + } + this.mapProperty.put(key, mapPropertyItem); + return this; + } + + /** + * Get mapProperty + * @return mapProperty + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Map getMapProperty() { + return mapProperty; + } + + + public void setMapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + } + + + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { + + this.mapOfMapProperty = mapOfMapProperty; + return this; + } + + public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap>(); + } + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); + return this; + } + + /** + * Get mapOfMapProperty + * @return mapOfMapProperty + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Map> getMapOfMapProperty() { + return mapOfMapProperty; + } + + + public void setMapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + } + + + public AdditionalPropertiesClass anytype1(Object anytype1) { + + this.anytype1 = anytype1; + return this; + } + + /** + * Get anytype1 + * @return anytype1 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Object getAnytype1() { + return anytype1; + } + + + public void setAnytype1(Object anytype1) { + this.anytype1 = anytype1; + } + + + public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype1(Object mapWithUndeclaredPropertiesAnytype1) { + + this.mapWithUndeclaredPropertiesAnytype1 = mapWithUndeclaredPropertiesAnytype1; + return this; + } + + /** + * Get mapWithUndeclaredPropertiesAnytype1 + * @return mapWithUndeclaredPropertiesAnytype1 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Object getMapWithUndeclaredPropertiesAnytype1() { + return mapWithUndeclaredPropertiesAnytype1; + } + + + public void setMapWithUndeclaredPropertiesAnytype1(Object mapWithUndeclaredPropertiesAnytype1) { + this.mapWithUndeclaredPropertiesAnytype1 = mapWithUndeclaredPropertiesAnytype1; + } + + + public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype2(Object mapWithUndeclaredPropertiesAnytype2) { + + this.mapWithUndeclaredPropertiesAnytype2 = mapWithUndeclaredPropertiesAnytype2; + return this; + } + + /** + * Get mapWithUndeclaredPropertiesAnytype2 + * @return mapWithUndeclaredPropertiesAnytype2 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Object getMapWithUndeclaredPropertiesAnytype2() { + return mapWithUndeclaredPropertiesAnytype2; + } + + + public void setMapWithUndeclaredPropertiesAnytype2(Object mapWithUndeclaredPropertiesAnytype2) { + this.mapWithUndeclaredPropertiesAnytype2 = mapWithUndeclaredPropertiesAnytype2; + } + + + public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype3(Map mapWithUndeclaredPropertiesAnytype3) { + + this.mapWithUndeclaredPropertiesAnytype3 = mapWithUndeclaredPropertiesAnytype3; + return this; + } + + public AdditionalPropertiesClass putMapWithUndeclaredPropertiesAnytype3Item(String key, Object mapWithUndeclaredPropertiesAnytype3Item) { + if (this.mapWithUndeclaredPropertiesAnytype3 == null) { + this.mapWithUndeclaredPropertiesAnytype3 = new HashMap(); + } + this.mapWithUndeclaredPropertiesAnytype3.put(key, mapWithUndeclaredPropertiesAnytype3Item); + return this; + } + + /** + * Get mapWithUndeclaredPropertiesAnytype3 + * @return mapWithUndeclaredPropertiesAnytype3 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Map getMapWithUndeclaredPropertiesAnytype3() { + return mapWithUndeclaredPropertiesAnytype3; + } + + + public void setMapWithUndeclaredPropertiesAnytype3(Map mapWithUndeclaredPropertiesAnytype3) { + this.mapWithUndeclaredPropertiesAnytype3 = mapWithUndeclaredPropertiesAnytype3; + } + + + public AdditionalPropertiesClass emptyMap(Object emptyMap) { + + this.emptyMap = emptyMap; + return this; + } + + /** + * an object with no declared properties and no undeclared properties, hence it's an empty map. + * @return emptyMap + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "an object with no declared properties and no undeclared properties, hence it's an empty map.") + + public Object getEmptyMap() { + return emptyMap; + } + + + public void setEmptyMap(Object emptyMap) { + this.emptyMap = emptyMap; + } + + + public AdditionalPropertiesClass mapWithUndeclaredPropertiesString(Map mapWithUndeclaredPropertiesString) { + + this.mapWithUndeclaredPropertiesString = mapWithUndeclaredPropertiesString; + return this; + } + + public AdditionalPropertiesClass putMapWithUndeclaredPropertiesStringItem(String key, String mapWithUndeclaredPropertiesStringItem) { + if (this.mapWithUndeclaredPropertiesString == null) { + this.mapWithUndeclaredPropertiesString = new HashMap(); + } + this.mapWithUndeclaredPropertiesString.put(key, mapWithUndeclaredPropertiesStringItem); + return this; + } + + /** + * Get mapWithUndeclaredPropertiesString + * @return mapWithUndeclaredPropertiesString + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Map getMapWithUndeclaredPropertiesString() { + return mapWithUndeclaredPropertiesString; + } + + + public void setMapWithUndeclaredPropertiesString(Map mapWithUndeclaredPropertiesString) { + this.mapWithUndeclaredPropertiesString = mapWithUndeclaredPropertiesString; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; + return Objects.equals(this.mapProperty, additionalPropertiesClass.mapProperty) && + Objects.equals(this.mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty) && + Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && + Objects.equals(this.mapWithUndeclaredPropertiesAnytype1, additionalPropertiesClass.mapWithUndeclaredPropertiesAnytype1) && + Objects.equals(this.mapWithUndeclaredPropertiesAnytype2, additionalPropertiesClass.mapWithUndeclaredPropertiesAnytype2) && + Objects.equals(this.mapWithUndeclaredPropertiesAnytype3, additionalPropertiesClass.mapWithUndeclaredPropertiesAnytype3) && + Objects.equals(this.emptyMap, additionalPropertiesClass.emptyMap) && + Objects.equals(this.mapWithUndeclaredPropertiesString, additionalPropertiesClass.mapWithUndeclaredPropertiesString); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(mapProperty, mapOfMapProperty, anytype1, mapWithUndeclaredPropertiesAnytype1, mapWithUndeclaredPropertiesAnytype2, mapWithUndeclaredPropertiesAnytype3, emptyMap, mapWithUndeclaredPropertiesString); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesClass {\n"); + sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); + sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); + sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n"); + sb.append(" mapWithUndeclaredPropertiesAnytype1: ").append(toIndentedString(mapWithUndeclaredPropertiesAnytype1)).append("\n"); + sb.append(" mapWithUndeclaredPropertiesAnytype2: ").append(toIndentedString(mapWithUndeclaredPropertiesAnytype2)).append("\n"); + sb.append(" mapWithUndeclaredPropertiesAnytype3: ").append(toIndentedString(mapWithUndeclaredPropertiesAnytype3)).append("\n"); + sb.append(" emptyMap: ").append(toIndentedString(emptyMap)).append("\n"); + sb.append(" mapWithUndeclaredPropertiesString: ").append(toIndentedString(mapWithUndeclaredPropertiesString)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("map_property"); + openapiFields.add("map_of_map_property"); + openapiFields.add("anytype_1"); + openapiFields.add("map_with_undeclared_properties_anytype_1"); + openapiFields.add("map_with_undeclared_properties_anytype_2"); + openapiFields.add("map_with_undeclared_properties_anytype_3"); + openapiFields.add("empty_map"); + openapiFields.add("map_with_undeclared_properties_string"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdditionalPropertiesClass.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdditionalPropertiesClass' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AdditionalPropertiesClass.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AdditionalPropertiesClass value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AdditionalPropertiesClass read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!AdditionalPropertiesClass.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `AdditionalPropertiesClass` properties"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Animal.java new file mode 100644 index 000000000000..cf1f00de64ff --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Animal.java @@ -0,0 +1,203 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.Cat; +import org.openapitools.client.model.Dog; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * Animal + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Animal { + public static final String SERIALIZED_NAME_CLASS_NAME = "className"; + @SerializedName(SERIALIZED_NAME_CLASS_NAME) + protected String className; + + public static final String SERIALIZED_NAME_COLOR = "color"; + @SerializedName(SERIALIZED_NAME_COLOR) + private String color = "red"; + + public Animal() { + this.className = this.getClass().getSimpleName(); + } + + public Animal className(String className) { + + this.className = className; + return this; + } + + /** + * Get className + * @return className + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getClassName() { + return className; + } + + + public void setClassName(String className) { + this.className = className; + } + + + public Animal color(String color) { + + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getColor() { + return color; + } + + + public void setColor(String color) { + this.color = color; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Animal animal = (Animal) o; + return Objects.equals(this.className, animal.className) && + Objects.equals(this.color, animal.color); + } + + @Override + public int hashCode() { + return Objects.hash(className, color); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Animal {\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("className"); + openapiFields.add("color"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("className"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Animal.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Animal' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Animal.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Animal value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Animal read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!Animal.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Animal` properties"); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Animal.openapiRequiredFields) { + if (obj.get(requiredField) == null) { + throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Apple.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Apple.java new file mode 100644 index 000000000000..03e3cc0f9c8d --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Apple.java @@ -0,0 +1,192 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * Apple + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Apple { + public static final String SERIALIZED_NAME_CULTIVAR = "cultivar"; + @SerializedName(SERIALIZED_NAME_CULTIVAR) + private String cultivar; + + public static final String SERIALIZED_NAME_ORIGIN = "origin"; + @SerializedName(SERIALIZED_NAME_ORIGIN) + private String origin; + + public Apple() { + } + + public Apple cultivar(String cultivar) { + + this.cultivar = cultivar; + return this; + } + + /** + * Get cultivar + * @return cultivar + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getCultivar() { + return cultivar; + } + + + public void setCultivar(String cultivar) { + this.cultivar = cultivar; + } + + + public Apple origin(String origin) { + + this.origin = origin; + return this; + } + + /** + * Get origin + * @return origin + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getOrigin() { + return origin; + } + + + public void setOrigin(String origin) { + this.origin = origin; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Apple apple = (Apple) o; + return Objects.equals(this.cultivar, apple.cultivar) && + Objects.equals(this.origin, apple.origin); + } + + @Override + public int hashCode() { + return Objects.hash(cultivar, origin); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Apple {\n"); + sb.append(" cultivar: ").append(toIndentedString(cultivar)).append("\n"); + sb.append(" origin: ").append(toIndentedString(origin)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("cultivar"); + openapiFields.add("origin"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Apple.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Apple' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Apple.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Apple value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Apple read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!Apple.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Apple` properties"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AppleReq.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AppleReq.java new file mode 100644 index 000000000000..dbf822795342 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AppleReq.java @@ -0,0 +1,200 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * AppleReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AppleReq { + public static final String SERIALIZED_NAME_CULTIVAR = "cultivar"; + @SerializedName(SERIALIZED_NAME_CULTIVAR) + private String cultivar; + + public static final String SERIALIZED_NAME_MEALY = "mealy"; + @SerializedName(SERIALIZED_NAME_MEALY) + private Boolean mealy; + + public AppleReq() { + } + + public AppleReq cultivar(String cultivar) { + + this.cultivar = cultivar; + return this; + } + + /** + * Get cultivar + * @return cultivar + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getCultivar() { + return cultivar; + } + + + public void setCultivar(String cultivar) { + this.cultivar = cultivar; + } + + + public AppleReq mealy(Boolean mealy) { + + this.mealy = mealy; + return this; + } + + /** + * Get mealy + * @return mealy + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Boolean getMealy() { + return mealy; + } + + + public void setMealy(Boolean mealy) { + this.mealy = mealy; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AppleReq appleReq = (AppleReq) o; + return Objects.equals(this.cultivar, appleReq.cultivar) && + Objects.equals(this.mealy, appleReq.mealy); + } + + @Override + public int hashCode() { + return Objects.hash(cultivar, mealy); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AppleReq {\n"); + sb.append(" cultivar: ").append(toIndentedString(cultivar)).append("\n"); + sb.append(" mealy: ").append(toIndentedString(mealy)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("cultivar"); + openapiFields.add("mealy"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("cultivar"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AppleReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AppleReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AppleReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AppleReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AppleReq read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!AppleReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `AppleReq` properties"); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AppleReq.openapiRequiredFields) { + if (obj.get(requiredField) == null) { + throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java new file mode 100644 index 000000000000..2dc3a6954049 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -0,0 +1,173 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * ArrayOfArrayOfNumberOnly + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ArrayOfArrayOfNumberOnly { + public static final String SERIALIZED_NAME_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; + @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_NUMBER) + private List> arrayArrayNumber = null; + + public ArrayOfArrayOfNumberOnly() { + } + + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + + this.arrayArrayNumber = arrayArrayNumber; + return this; + } + + public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList>(); + } + this.arrayArrayNumber.add(arrayArrayNumberItem); + return this; + } + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List> getArrayArrayNumber() { + return arrayArrayNumber; + } + + + public void setArrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; + return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayArrayNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfArrayOfNumberOnly {\n"); + sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ArrayArrayNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ArrayOfArrayOfNumberOnly.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ArrayOfArrayOfNumberOnly' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ArrayOfArrayOfNumberOnly.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ArrayOfArrayOfNumberOnly value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ArrayOfArrayOfNumberOnly read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!ArrayOfArrayOfNumberOnly.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ArrayOfArrayOfNumberOnly` properties"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java new file mode 100644 index 000000000000..384759be851e --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -0,0 +1,173 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * ArrayOfNumberOnly + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ArrayOfNumberOnly { + public static final String SERIALIZED_NAME_ARRAY_NUMBER = "ArrayNumber"; + @SerializedName(SERIALIZED_NAME_ARRAY_NUMBER) + private List arrayNumber = null; + + public ArrayOfNumberOnly() { + } + + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + + this.arrayNumber = arrayNumber; + return this; + } + + public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList(); + } + this.arrayNumber.add(arrayNumberItem); + return this; + } + + /** + * Get arrayNumber + * @return arrayNumber + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getArrayNumber() { + return arrayNumber; + } + + + public void setArrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; + return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfNumberOnly {\n"); + sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ArrayNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ArrayOfNumberOnly.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ArrayOfNumberOnly' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ArrayOfNumberOnly.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ArrayOfNumberOnly value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ArrayOfNumberOnly read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!ArrayOfNumberOnly.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ArrayOfNumberOnly` properties"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayTest.java new file mode 100644 index 000000000000..23c8d4fbd1b2 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -0,0 +1,249 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ReadOnlyFirst; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * ArrayTest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ArrayTest { + public static final String SERIALIZED_NAME_ARRAY_OF_STRING = "array_of_string"; + @SerializedName(SERIALIZED_NAME_ARRAY_OF_STRING) + private List arrayOfString = null; + + public static final String SERIALIZED_NAME_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; + @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_OF_INTEGER) + private List> arrayArrayOfInteger = null; + + public static final String SERIALIZED_NAME_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; + @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_OF_MODEL) + private List> arrayArrayOfModel = null; + + public ArrayTest() { + } + + public ArrayTest arrayOfString(List arrayOfString) { + + this.arrayOfString = arrayOfString; + return this; + } + + public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList(); + } + this.arrayOfString.add(arrayOfStringItem); + return this; + } + + /** + * Get arrayOfString + * @return arrayOfString + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getArrayOfString() { + return arrayOfString; + } + + + public void setArrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + } + + + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + + this.arrayArrayOfInteger = arrayArrayOfInteger; + return this; + } + + public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList>(); + } + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); + return this; + } + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List> getArrayArrayOfInteger() { + return arrayArrayOfInteger; + } + + + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + } + + + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + + this.arrayArrayOfModel = arrayArrayOfModel; + return this; + } + + public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList>(); + } + this.arrayArrayOfModel.add(arrayArrayOfModelItem); + return this; + } + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List> getArrayArrayOfModel() { + return arrayArrayOfModel; + } + + + public void setArrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayTest arrayTest = (ArrayTest) o; + return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && + Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && + Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); + } + + @Override + public int hashCode() { + return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayTest {\n"); + sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); + sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); + sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("array_of_string"); + openapiFields.add("array_array_of_integer"); + openapiFields.add("array_array_of_model"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ArrayTest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ArrayTest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ArrayTest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ArrayTest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ArrayTest read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!ArrayTest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ArrayTest` properties"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Banana.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Banana.java new file mode 100644 index 000000000000..e409ac6907a0 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Banana.java @@ -0,0 +1,163 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * Banana + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Banana { + public static final String SERIALIZED_NAME_LENGTH_CM = "lengthCm"; + @SerializedName(SERIALIZED_NAME_LENGTH_CM) + private BigDecimal lengthCm; + + public Banana() { + } + + public Banana lengthCm(BigDecimal lengthCm) { + + this.lengthCm = lengthCm; + return this; + } + + /** + * Get lengthCm + * @return lengthCm + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public BigDecimal getLengthCm() { + return lengthCm; + } + + + public void setLengthCm(BigDecimal lengthCm) { + this.lengthCm = lengthCm; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Banana banana = (Banana) o; + return Objects.equals(this.lengthCm, banana.lengthCm); + } + + @Override + public int hashCode() { + return Objects.hash(lengthCm); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Banana {\n"); + sb.append(" lengthCm: ").append(toIndentedString(lengthCm)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("lengthCm"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Banana.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Banana' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Banana.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Banana value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Banana read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!Banana.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Banana` properties"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/BananaReq.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/BananaReq.java new file mode 100644 index 000000000000..7955096b5d3c --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/BananaReq.java @@ -0,0 +1,201 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * BananaReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class BananaReq { + public static final String SERIALIZED_NAME_LENGTH_CM = "lengthCm"; + @SerializedName(SERIALIZED_NAME_LENGTH_CM) + private BigDecimal lengthCm; + + public static final String SERIALIZED_NAME_SWEET = "sweet"; + @SerializedName(SERIALIZED_NAME_SWEET) + private Boolean sweet; + + public BananaReq() { + } + + public BananaReq lengthCm(BigDecimal lengthCm) { + + this.lengthCm = lengthCm; + return this; + } + + /** + * Get lengthCm + * @return lengthCm + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public BigDecimal getLengthCm() { + return lengthCm; + } + + + public void setLengthCm(BigDecimal lengthCm) { + this.lengthCm = lengthCm; + } + + + public BananaReq sweet(Boolean sweet) { + + this.sweet = sweet; + return this; + } + + /** + * Get sweet + * @return sweet + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Boolean getSweet() { + return sweet; + } + + + public void setSweet(Boolean sweet) { + this.sweet = sweet; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BananaReq bananaReq = (BananaReq) o; + return Objects.equals(this.lengthCm, bananaReq.lengthCm) && + Objects.equals(this.sweet, bananaReq.sweet); + } + + @Override + public int hashCode() { + return Objects.hash(lengthCm, sweet); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BananaReq {\n"); + sb.append(" lengthCm: ").append(toIndentedString(lengthCm)).append("\n"); + sb.append(" sweet: ").append(toIndentedString(sweet)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("lengthCm"); + openapiFields.add("sweet"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("lengthCm"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BananaReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BananaReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BananaReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BananaReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BananaReq read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!BananaReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `BananaReq` properties"); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BananaReq.openapiRequiredFields) { + if (obj.get(requiredField) == null) { + throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/BasquePig.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/BasquePig.java new file mode 100644 index 000000000000..93fc4cad0b9e --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/BasquePig.java @@ -0,0 +1,170 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * BasquePig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class BasquePig { + public static final String SERIALIZED_NAME_CLASS_NAME = "className"; + @SerializedName(SERIALIZED_NAME_CLASS_NAME) + private String className; + + public BasquePig() { + } + + public BasquePig className(String className) { + + this.className = className; + return this; + } + + /** + * Get className + * @return className + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getClassName() { + return className; + } + + + public void setClassName(String className) { + this.className = className; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BasquePig basquePig = (BasquePig) o; + return Objects.equals(this.className, basquePig.className); + } + + @Override + public int hashCode() { + return Objects.hash(className); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BasquePig {\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("className"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("className"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BasquePig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BasquePig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BasquePig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BasquePig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BasquePig read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!BasquePig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `BasquePig` properties"); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BasquePig.openapiRequiredFields) { + if (obj.get(requiredField) == null) { + throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Capitalization.java new file mode 100644 index 000000000000..eceb83bbfeb0 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Capitalization.java @@ -0,0 +1,312 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * Capitalization + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Capitalization { + public static final String SERIALIZED_NAME_SMALL_CAMEL = "smallCamel"; + @SerializedName(SERIALIZED_NAME_SMALL_CAMEL) + private String smallCamel; + + public static final String SERIALIZED_NAME_CAPITAL_CAMEL = "CapitalCamel"; + @SerializedName(SERIALIZED_NAME_CAPITAL_CAMEL) + private String capitalCamel; + + public static final String SERIALIZED_NAME_SMALL_SNAKE = "small_Snake"; + @SerializedName(SERIALIZED_NAME_SMALL_SNAKE) + private String smallSnake; + + public static final String SERIALIZED_NAME_CAPITAL_SNAKE = "Capital_Snake"; + @SerializedName(SERIALIZED_NAME_CAPITAL_SNAKE) + private String capitalSnake; + + public static final String SERIALIZED_NAME_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; + @SerializedName(SERIALIZED_NAME_SC_A_E_T_H_FLOW_POINTS) + private String scAETHFlowPoints; + + public static final String SERIALIZED_NAME_A_T_T_N_A_M_E = "ATT_NAME"; + @SerializedName(SERIALIZED_NAME_A_T_T_N_A_M_E) + private String ATT_NAME; + + public Capitalization() { + } + + public Capitalization smallCamel(String smallCamel) { + + this.smallCamel = smallCamel; + return this; + } + + /** + * Get smallCamel + * @return smallCamel + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getSmallCamel() { + return smallCamel; + } + + + public void setSmallCamel(String smallCamel) { + this.smallCamel = smallCamel; + } + + + public Capitalization capitalCamel(String capitalCamel) { + + this.capitalCamel = capitalCamel; + return this; + } + + /** + * Get capitalCamel + * @return capitalCamel + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getCapitalCamel() { + return capitalCamel; + } + + + public void setCapitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + } + + + public Capitalization smallSnake(String smallSnake) { + + this.smallSnake = smallSnake; + return this; + } + + /** + * Get smallSnake + * @return smallSnake + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getSmallSnake() { + return smallSnake; + } + + + public void setSmallSnake(String smallSnake) { + this.smallSnake = smallSnake; + } + + + public Capitalization capitalSnake(String capitalSnake) { + + this.capitalSnake = capitalSnake; + return this; + } + + /** + * Get capitalSnake + * @return capitalSnake + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getCapitalSnake() { + return capitalSnake; + } + + + public void setCapitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + } + + + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + + this.scAETHFlowPoints = scAETHFlowPoints; + return this; + } + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getScAETHFlowPoints() { + return scAETHFlowPoints; + } + + + public void setScAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + } + + + public Capitalization ATT_NAME(String ATT_NAME) { + + this.ATT_NAME = ATT_NAME; + return this; + } + + /** + * Name of the pet + * @return ATT_NAME + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Name of the pet ") + + public String getATTNAME() { + return ATT_NAME; + } + + + public void setATTNAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Capitalization capitalization = (Capitalization) o; + return Objects.equals(this.smallCamel, capitalization.smallCamel) && + Objects.equals(this.capitalCamel, capitalization.capitalCamel) && + Objects.equals(this.smallSnake, capitalization.smallSnake) && + Objects.equals(this.capitalSnake, capitalization.capitalSnake) && + Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) && + Objects.equals(this.ATT_NAME, capitalization.ATT_NAME); + } + + @Override + public int hashCode() { + return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Capitalization {\n"); + sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); + sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); + sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); + sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); + sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); + sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("smallCamel"); + openapiFields.add("CapitalCamel"); + openapiFields.add("small_Snake"); + openapiFields.add("Capital_Snake"); + openapiFields.add("SCA_ETH_Flow_Points"); + openapiFields.add("ATT_NAME"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Capitalization.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Capitalization' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Capitalization.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Capitalization value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Capitalization read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!Capitalization.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Capitalization` properties"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Cat.java new file mode 100644 index 000000000000..426511dc3c0a --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Cat.java @@ -0,0 +1,177 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.Animal; +import org.openapitools.client.model.CatAllOf; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * Cat + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Cat extends Animal { + public static final String SERIALIZED_NAME_DECLAWED = "declawed"; + @SerializedName(SERIALIZED_NAME_DECLAWED) + private Boolean declawed; + + public Cat() { + this.className = this.getClass().getSimpleName(); + } + + public Cat declawed(Boolean declawed) { + + this.declawed = declawed; + return this; + } + + /** + * Get declawed + * @return declawed + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Boolean getDeclawed() { + return declawed; + } + + + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Cat cat = (Cat) o; + return Objects.equals(this.declawed, cat.declawed) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(declawed, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Cat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("className"); + openapiFields.add("color"); + openapiFields.add("declawed"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("className"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Cat.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Cat' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Cat.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Cat value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Cat read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!Cat.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Cat` properties"); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Cat.openapiRequiredFields) { + if (obj.get(requiredField) == null) { + throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/CatAllOf.java new file mode 100644 index 000000000000..8d9affba3dc7 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -0,0 +1,162 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * CatAllOf + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CatAllOf { + public static final String SERIALIZED_NAME_DECLAWED = "declawed"; + @SerializedName(SERIALIZED_NAME_DECLAWED) + private Boolean declawed; + + public CatAllOf() { + } + + public CatAllOf declawed(Boolean declawed) { + + this.declawed = declawed; + return this; + } + + /** + * Get declawed + * @return declawed + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Boolean getDeclawed() { + return declawed; + } + + + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatAllOf catAllOf = (CatAllOf) o; + return Objects.equals(this.declawed, catAllOf.declawed); + } + + @Override + public int hashCode() { + return Objects.hash(declawed); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatAllOf {\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("declawed"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CatAllOf.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CatAllOf' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CatAllOf.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CatAllOf value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CatAllOf read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!CatAllOf.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `CatAllOf` properties"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Category.java new file mode 100644 index 000000000000..85eb92c71b2a --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Category.java @@ -0,0 +1,200 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * Category + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Category { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private Long id; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name = "default-name"; + + public Category() { + } + + public Category id(Long id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Long getId() { + return id; + } + + + public void setId(Long id) { + this.id = id; + } + + + public Category name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Category category = (Category) o; + return Objects.equals(this.id, category.id) && + Objects.equals(this.name, category.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Category.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Category' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Category.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Category value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Category read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!Category.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Category` properties"); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Category.openapiRequiredFields) { + if (obj.get(requiredField) == null) { + throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ChildCatAllOf.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ChildCatAllOf.java new file mode 100644 index 000000000000..6932fbcef5a6 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ChildCatAllOf.java @@ -0,0 +1,216 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * ChildCatAllOf + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ChildCatAllOf { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + /** + * Gets or Sets petType + */ + @JsonAdapter(PetTypeEnum.Adapter.class) + public enum PetTypeEnum { + CHILDCAT("ChildCat"); + + private String value; + + PetTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PetTypeEnum fromValue(String value) { + for (PetTypeEnum b : PetTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PetTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PetTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PetTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_PET_TYPE = "pet_type"; + @SerializedName(SERIALIZED_NAME_PET_TYPE) + private PetTypeEnum petType = PetTypeEnum.CHILDCAT; + + public ChildCatAllOf() { + } + + public ChildCatAllOf name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public ChildCatAllOf petType(PetTypeEnum petType) { + + this.petType = petType; + return this; + } + + /** + * Get petType + * @return petType + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public PetTypeEnum getPetType() { + return petType; + } + + + public void setPetType(PetTypeEnum petType) { + this.petType = petType; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChildCatAllOf childCatAllOf = (ChildCatAllOf) o; + return Objects.equals(this.name, childCatAllOf.name) && + Objects.equals(this.petType, childCatAllOf.petType); + } + + @Override + public int hashCode() { + return Objects.hash(name, petType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChildCatAllOf {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" petType: ").append(toIndentedString(petType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("pet_type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomDeserializer implements JsonDeserializer { + @Override + public ChildCatAllOf deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { + JsonObject obj = json.getAsJsonObject(); //since you know it's a JsonObject + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!ChildCatAllOf.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ChildCatAllOf` properties"); + } + } + + // all checks passed, return using the original implementation of deserialize + return new Gson().fromJson(json, ChildCatAllOf.class); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ClassModel.java new file mode 100644 index 000000000000..da8517ec7b90 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ClassModel.java @@ -0,0 +1,163 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * Model for testing model with \"_class\" property + */ +@ApiModel(description = "Model for testing model with \"_class\" property") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ClassModel { + public static final String SERIALIZED_NAME_PROPERTY_CLASS = "_class"; + @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) + private String propertyClass; + + public ClassModel() { + } + + public ClassModel propertyClass(String propertyClass) { + + this.propertyClass = propertyClass; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getPropertyClass() { + return propertyClass; + } + + + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClassModel classModel = (ClassModel) o; + return Objects.equals(this.propertyClass, classModel.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(propertyClass); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClassModel {\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("_class"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ClassModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ClassModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ClassModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ClassModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ClassModel read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!ClassModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ClassModel` properties"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Client.java new file mode 100644 index 000000000000..2a7cf96170ca --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Client.java @@ -0,0 +1,162 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * Client + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Client { + public static final String SERIALIZED_NAME_CLIENT = "client"; + @SerializedName(SERIALIZED_NAME_CLIENT) + private String client; + + public Client() { + } + + public Client client(String client) { + + this.client = client; + return this; + } + + /** + * Get client + * @return client + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getClient() { + return client; + } + + + public void setClient(String client) { + this.client = client; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Client client = (Client) o; + return Objects.equals(this.client, client.client); + } + + @Override + public int hashCode() { + return Objects.hash(client); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Client {\n"); + sb.append(" client: ").append(toIndentedString(client)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("client"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Client.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Client' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Client.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Client value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Client read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!Client.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Client` properties"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java new file mode 100644 index 000000000000..197a8ca0a229 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java @@ -0,0 +1,203 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.QuadrilateralInterface; +import org.openapitools.client.model.ShapeInterface; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * ComplexQuadrilateral + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ComplexQuadrilateral { + public static final String SERIALIZED_NAME_SHAPE_TYPE = "shapeType"; + @SerializedName(SERIALIZED_NAME_SHAPE_TYPE) + private String shapeType; + + public static final String SERIALIZED_NAME_QUADRILATERAL_TYPE = "quadrilateralType"; + @SerializedName(SERIALIZED_NAME_QUADRILATERAL_TYPE) + private String quadrilateralType; + + public ComplexQuadrilateral() { + } + + public ComplexQuadrilateral shapeType(String shapeType) { + + this.shapeType = shapeType; + return this; + } + + /** + * Get shapeType + * @return shapeType + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getShapeType() { + return shapeType; + } + + + public void setShapeType(String shapeType) { + this.shapeType = shapeType; + } + + + public ComplexQuadrilateral quadrilateralType(String quadrilateralType) { + + this.quadrilateralType = quadrilateralType; + return this; + } + + /** + * Get quadrilateralType + * @return quadrilateralType + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getQuadrilateralType() { + return quadrilateralType; + } + + + public void setQuadrilateralType(String quadrilateralType) { + this.quadrilateralType = quadrilateralType; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ComplexQuadrilateral complexQuadrilateral = (ComplexQuadrilateral) o; + return Objects.equals(this.shapeType, complexQuadrilateral.shapeType) && + Objects.equals(this.quadrilateralType, complexQuadrilateral.quadrilateralType); + } + + @Override + public int hashCode() { + return Objects.hash(shapeType, quadrilateralType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ComplexQuadrilateral {\n"); + sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); + sb.append(" quadrilateralType: ").append(toIndentedString(quadrilateralType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("shapeType"); + openapiFields.add("quadrilateralType"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("shapeType"); + openapiRequiredFields.add("quadrilateralType"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ComplexQuadrilateral.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ComplexQuadrilateral' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ComplexQuadrilateral.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ComplexQuadrilateral value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ComplexQuadrilateral read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!ComplexQuadrilateral.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ComplexQuadrilateral` properties"); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ComplexQuadrilateral.openapiRequiredFields) { + if (obj.get(requiredField) == null) { + throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DanishPig.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DanishPig.java new file mode 100644 index 000000000000..c9bdd6fb478b --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DanishPig.java @@ -0,0 +1,170 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * DanishPig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DanishPig { + public static final String SERIALIZED_NAME_CLASS_NAME = "className"; + @SerializedName(SERIALIZED_NAME_CLASS_NAME) + private String className; + + public DanishPig() { + } + + public DanishPig className(String className) { + + this.className = className; + return this; + } + + /** + * Get className + * @return className + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getClassName() { + return className; + } + + + public void setClassName(String className) { + this.className = className; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DanishPig danishPig = (DanishPig) o; + return Objects.equals(this.className, danishPig.className); + } + + @Override + public int hashCode() { + return Objects.hash(className); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DanishPig {\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("className"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("className"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DanishPig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DanishPig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DanishPig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DanishPig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DanishPig read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!DanishPig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `DanishPig` properties"); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DanishPig.openapiRequiredFields) { + if (obj.get(requiredField) == null) { + throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DeprecatedObject.java new file mode 100644 index 000000000000..1ebdc75845ba --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -0,0 +1,164 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * DeprecatedObject + * @deprecated + */ +@Deprecated +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeprecatedObject { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public DeprecatedObject() { + } + + public DeprecatedObject name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeprecatedObject deprecatedObject = (DeprecatedObject) o; + return Objects.equals(this.name, deprecatedObject.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeprecatedObject {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeprecatedObject.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeprecatedObject' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeprecatedObject.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeprecatedObject value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeprecatedObject read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!DeprecatedObject.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `DeprecatedObject` properties"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Dog.java new file mode 100644 index 000000000000..407d20c326a9 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Dog.java @@ -0,0 +1,177 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.Animal; +import org.openapitools.client.model.DogAllOf; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * Dog + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Dog extends Animal { + public static final String SERIALIZED_NAME_BREED = "breed"; + @SerializedName(SERIALIZED_NAME_BREED) + private String breed; + + public Dog() { + this.className = this.getClass().getSimpleName(); + } + + public Dog breed(String breed) { + + this.breed = breed; + return this; + } + + /** + * Get breed + * @return breed + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getBreed() { + return breed; + } + + + public void setBreed(String breed) { + this.breed = breed; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Dog dog = (Dog) o; + return Objects.equals(this.breed, dog.breed) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(breed, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Dog {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("className"); + openapiFields.add("color"); + openapiFields.add("breed"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("className"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Dog.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Dog' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Dog.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Dog value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Dog read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!Dog.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Dog` properties"); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Dog.openapiRequiredFields) { + if (obj.get(requiredField) == null) { + throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DogAllOf.java new file mode 100644 index 000000000000..4305b501e06d --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -0,0 +1,162 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * DogAllOf + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DogAllOf { + public static final String SERIALIZED_NAME_BREED = "breed"; + @SerializedName(SERIALIZED_NAME_BREED) + private String breed; + + public DogAllOf() { + } + + public DogAllOf breed(String breed) { + + this.breed = breed; + return this; + } + + /** + * Get breed + * @return breed + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getBreed() { + return breed; + } + + + public void setBreed(String breed) { + this.breed = breed; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DogAllOf dogAllOf = (DogAllOf) o; + return Objects.equals(this.breed, dogAllOf.breed); + } + + @Override + public int hashCode() { + return Objects.hash(breed); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DogAllOf {\n"); + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("breed"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DogAllOf.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DogAllOf' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DogAllOf.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DogAllOf value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DogAllOf read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!DogAllOf.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `DogAllOf` properties"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Drawing.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Drawing.java new file mode 100644 index 000000000000..b880f4c49dd7 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Drawing.java @@ -0,0 +1,282 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.client.model.Fruit; +import org.openapitools.client.model.NullableShape; +import org.openapitools.client.model.Shape; +import org.openapitools.client.model.ShapeOrNull; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * Drawing + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Drawing extends HashMap { + public static final String SERIALIZED_NAME_MAIN_SHAPE = "mainShape"; + @SerializedName(SERIALIZED_NAME_MAIN_SHAPE) + private Shape mainShape; + + public static final String SERIALIZED_NAME_SHAPE_OR_NULL = "shapeOrNull"; + @SerializedName(SERIALIZED_NAME_SHAPE_OR_NULL) + private ShapeOrNull shapeOrNull; + + public static final String SERIALIZED_NAME_NULLABLE_SHAPE = "nullableShape"; + @SerializedName(SERIALIZED_NAME_NULLABLE_SHAPE) + private NullableShape nullableShape; + + public static final String SERIALIZED_NAME_SHAPES = "shapes"; + @SerializedName(SERIALIZED_NAME_SHAPES) + private List shapes = null; + + public Drawing() { + } + + public Drawing mainShape(Shape mainShape) { + + this.mainShape = mainShape; + return this; + } + + /** + * Get mainShape + * @return mainShape + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Shape getMainShape() { + return mainShape; + } + + + public void setMainShape(Shape mainShape) { + this.mainShape = mainShape; + } + + + public Drawing shapeOrNull(ShapeOrNull shapeOrNull) { + + this.shapeOrNull = shapeOrNull; + return this; + } + + /** + * Get shapeOrNull + * @return shapeOrNull + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public ShapeOrNull getShapeOrNull() { + return shapeOrNull; + } + + + public void setShapeOrNull(ShapeOrNull shapeOrNull) { + this.shapeOrNull = shapeOrNull; + } + + + public Drawing nullableShape(NullableShape nullableShape) { + + this.nullableShape = nullableShape; + return this; + } + + /** + * Get nullableShape + * @return nullableShape + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public NullableShape getNullableShape() { + return nullableShape; + } + + + public void setNullableShape(NullableShape nullableShape) { + this.nullableShape = nullableShape; + } + + + public Drawing shapes(List shapes) { + + this.shapes = shapes; + return this; + } + + public Drawing addShapesItem(Shape shapesItem) { + if (this.shapes == null) { + this.shapes = new ArrayList(); + } + this.shapes.add(shapesItem); + return this; + } + + /** + * Get shapes + * @return shapes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getShapes() { + return shapes; + } + + + public void setShapes(List shapes) { + this.shapes = shapes; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Drawing drawing = (Drawing) o; + return Objects.equals(this.mainShape, drawing.mainShape) && + Objects.equals(this.shapeOrNull, drawing.shapeOrNull) && + Objects.equals(this.nullableShape, drawing.nullableShape) && + Objects.equals(this.shapes, drawing.shapes) && + super.equals(o); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(mainShape, shapeOrNull, nullableShape, shapes, super.hashCode()); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Drawing {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" mainShape: ").append(toIndentedString(mainShape)).append("\n"); + sb.append(" shapeOrNull: ").append(toIndentedString(shapeOrNull)).append("\n"); + sb.append(" nullableShape: ").append(toIndentedString(nullableShape)).append("\n"); + sb.append(" shapes: ").append(toIndentedString(shapes)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("mainShape"); + openapiFields.add("shapeOrNull"); + openapiFields.add("nullableShape"); + openapiFields.add("shapes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Drawing.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Drawing' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Drawing.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Drawing value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Drawing read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!Drawing.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Drawing` properties"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumArrays.java new file mode 100644 index 000000000000..87675e4eef79 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -0,0 +1,296 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * EnumArrays + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EnumArrays { + /** + * Gets or Sets justSymbol + */ + @JsonAdapter(JustSymbolEnum.Adapter.class) + public enum JustSymbolEnum { + GREATER_THAN_OR_EQUAL_TO(">="), + + DOLLAR("$"); + + private String value; + + JustSymbolEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static JustSymbolEnum fromValue(String value) { + for (JustSymbolEnum b : JustSymbolEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final JustSymbolEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public JustSymbolEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return JustSymbolEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_JUST_SYMBOL = "just_symbol"; + @SerializedName(SERIALIZED_NAME_JUST_SYMBOL) + private JustSymbolEnum justSymbol; + + /** + * Gets or Sets arrayEnum + */ + @JsonAdapter(ArrayEnumEnum.Adapter.class) + public enum ArrayEnumEnum { + FISH("fish"), + + CRAB("crab"); + + private String value; + + ArrayEnumEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ArrayEnumEnum fromValue(String value) { + for (ArrayEnumEnum b : ArrayEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ArrayEnumEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ArrayEnumEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ArrayEnumEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_ARRAY_ENUM = "array_enum"; + @SerializedName(SERIALIZED_NAME_ARRAY_ENUM) + private List arrayEnum = null; + + public EnumArrays() { + } + + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + + this.justSymbol = justSymbol; + return this; + } + + /** + * Get justSymbol + * @return justSymbol + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public JustSymbolEnum getJustSymbol() { + return justSymbol; + } + + + public void setJustSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + } + + + public EnumArrays arrayEnum(List arrayEnum) { + + this.arrayEnum = arrayEnum; + return this; + } + + public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList(); + } + this.arrayEnum.add(arrayEnumItem); + return this; + } + + /** + * Get arrayEnum + * @return arrayEnum + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getArrayEnum() { + return arrayEnum; + } + + + public void setArrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumArrays enumArrays = (EnumArrays) o; + return Objects.equals(this.justSymbol, enumArrays.justSymbol) && + Objects.equals(this.arrayEnum, enumArrays.arrayEnum); + } + + @Override + public int hashCode() { + return Objects.hash(justSymbol, arrayEnum); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumArrays {\n"); + sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); + sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("just_symbol"); + openapiFields.add("array_enum"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EnumArrays.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EnumArrays' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EnumArrays.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EnumArrays value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EnumArrays read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!EnumArrays.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `EnumArrays` properties"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumClass.java new file mode 100644 index 000000000000..b9a78241a5a7 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumClass.java @@ -0,0 +1,75 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets EnumClass + */ +@JsonAdapter(EnumClass.Adapter.class) +public enum EnumClass { + + _ABC("_abc"), + + _EFG("-efg"), + + _XYZ_("(xyz)"); + + private String value; + + EnumClass(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EnumClass fromValue(String value) { + for (EnumClass b : EnumClass.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EnumClass enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EnumClass read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EnumClass.fromValue(value); + } + } +} + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumTest.java new file mode 100644 index 000000000000..8bb57d811f05 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumTest.java @@ -0,0 +1,665 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.OuterEnum; +import org.openapitools.client.model.OuterEnumDefaultValue; +import org.openapitools.client.model.OuterEnumInteger; +import org.openapitools.client.model.OuterEnumIntegerDefaultValue; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * EnumTest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EnumTest { + /** + * Gets or Sets enumString + */ + @JsonAdapter(EnumStringEnum.Adapter.class) + public enum EnumStringEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EnumStringEnum fromValue(String value) { + for (EnumStringEnum b : EnumStringEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EnumStringEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EnumStringEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EnumStringEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_ENUM_STRING = "enum_string"; + @SerializedName(SERIALIZED_NAME_ENUM_STRING) + private EnumStringEnum enumString; + + /** + * Gets or Sets enumStringRequired + */ + @JsonAdapter(EnumStringRequiredEnum.Adapter.class) + public enum EnumStringRequiredEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringRequiredEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EnumStringRequiredEnum fromValue(String value) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EnumStringRequiredEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EnumStringRequiredEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EnumStringRequiredEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_ENUM_STRING_REQUIRED = "enum_string_required"; + @SerializedName(SERIALIZED_NAME_ENUM_STRING_REQUIRED) + private EnumStringRequiredEnum enumStringRequired; + + /** + * Gets or Sets enumInteger + */ + @JsonAdapter(EnumIntegerEnum.Adapter.class) + public enum EnumIntegerEnum { + NUMBER_1(1), + + NUMBER_MINUS_1(-1); + + private Integer value; + + EnumIntegerEnum(Integer value) { + this.value = value; + } + + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EnumIntegerEnum fromValue(Integer value) { + for (EnumIntegerEnum b : EnumIntegerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EnumIntegerEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EnumIntegerEnum read(final JsonReader jsonReader) throws IOException { + Integer value = jsonReader.nextInt(); + return EnumIntegerEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_ENUM_INTEGER = "enum_integer"; + @SerializedName(SERIALIZED_NAME_ENUM_INTEGER) + private EnumIntegerEnum enumInteger; + + /** + * Gets or Sets enumIntegerOnly + */ + @JsonAdapter(EnumIntegerOnlyEnum.Adapter.class) + public enum EnumIntegerOnlyEnum { + NUMBER_2(2), + + NUMBER_MINUS_2(-2); + + private Integer value; + + EnumIntegerOnlyEnum(Integer value) { + this.value = value; + } + + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EnumIntegerOnlyEnum fromValue(Integer value) { + for (EnumIntegerOnlyEnum b : EnumIntegerOnlyEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EnumIntegerOnlyEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EnumIntegerOnlyEnum read(final JsonReader jsonReader) throws IOException { + Integer value = jsonReader.nextInt(); + return EnumIntegerOnlyEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_ENUM_INTEGER_ONLY = "enum_integer_only"; + @SerializedName(SERIALIZED_NAME_ENUM_INTEGER_ONLY) + private EnumIntegerOnlyEnum enumIntegerOnly; + + /** + * Gets or Sets enumNumber + */ + @JsonAdapter(EnumNumberEnum.Adapter.class) + public enum EnumNumberEnum { + NUMBER_1_DOT_1(1.1), + + NUMBER_MINUS_1_DOT_2(-1.2); + + private Double value; + + EnumNumberEnum(Double value) { + this.value = value; + } + + public Double getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EnumNumberEnum fromValue(Double value) { + for (EnumNumberEnum b : EnumNumberEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EnumNumberEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { + Double value = jsonReader.nextDouble(); + return EnumNumberEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_ENUM_NUMBER = "enum_number"; + @SerializedName(SERIALIZED_NAME_ENUM_NUMBER) + private EnumNumberEnum enumNumber; + + public static final String SERIALIZED_NAME_OUTER_ENUM = "outerEnum"; + @SerializedName(SERIALIZED_NAME_OUTER_ENUM) + private OuterEnum outerEnum; + + public static final String SERIALIZED_NAME_OUTER_ENUM_INTEGER = "outerEnumInteger"; + @SerializedName(SERIALIZED_NAME_OUTER_ENUM_INTEGER) + private OuterEnumInteger outerEnumInteger; + + public static final String SERIALIZED_NAME_OUTER_ENUM_DEFAULT_VALUE = "outerEnumDefaultValue"; + @SerializedName(SERIALIZED_NAME_OUTER_ENUM_DEFAULT_VALUE) + private OuterEnumDefaultValue outerEnumDefaultValue = OuterEnumDefaultValue.PLACED; + + public static final String SERIALIZED_NAME_OUTER_ENUM_INTEGER_DEFAULT_VALUE = "outerEnumIntegerDefaultValue"; + @SerializedName(SERIALIZED_NAME_OUTER_ENUM_INTEGER_DEFAULT_VALUE) + private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0; + + public EnumTest() { + } + + public EnumTest enumString(EnumStringEnum enumString) { + + this.enumString = enumString; + return this; + } + + /** + * Get enumString + * @return enumString + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public EnumStringEnum getEnumString() { + return enumString; + } + + + public void setEnumString(EnumStringEnum enumString) { + this.enumString = enumString; + } + + + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + + + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + + this.enumInteger = enumInteger; + return this; + } + + /** + * Get enumInteger + * @return enumInteger + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + + + public void setEnumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + + public EnumTest enumIntegerOnly(EnumIntegerOnlyEnum enumIntegerOnly) { + + this.enumIntegerOnly = enumIntegerOnly; + return this; + } + + /** + * Get enumIntegerOnly + * @return enumIntegerOnly + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public EnumIntegerOnlyEnum getEnumIntegerOnly() { + return enumIntegerOnly; + } + + + public void setEnumIntegerOnly(EnumIntegerOnlyEnum enumIntegerOnly) { + this.enumIntegerOnly = enumIntegerOnly; + } + + + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + + this.enumNumber = enumNumber; + return this; + } + + /** + * Get enumNumber + * @return enumNumber + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public EnumNumberEnum getEnumNumber() { + return enumNumber; + } + + + public void setEnumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + + public EnumTest outerEnum(OuterEnum outerEnum) { + + this.outerEnum = outerEnum; + return this; + } + + /** + * Get outerEnum + * @return outerEnum + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public OuterEnum getOuterEnum() { + return outerEnum; + } + + + public void setOuterEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + } + + + public EnumTest outerEnumInteger(OuterEnumInteger outerEnumInteger) { + + this.outerEnumInteger = outerEnumInteger; + return this; + } + + /** + * Get outerEnumInteger + * @return outerEnumInteger + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public OuterEnumInteger getOuterEnumInteger() { + return outerEnumInteger; + } + + + public void setOuterEnumInteger(OuterEnumInteger outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + } + + + public EnumTest outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + + this.outerEnumDefaultValue = outerEnumDefaultValue; + return this; + } + + /** + * Get outerEnumDefaultValue + * @return outerEnumDefaultValue + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public OuterEnumDefaultValue getOuterEnumDefaultValue() { + return outerEnumDefaultValue; + } + + + public void setOuterEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + } + + + public EnumTest outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + return this; + } + + /** + * Get outerEnumIntegerDefaultValue + * @return outerEnumIntegerDefaultValue + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { + return outerEnumIntegerDefaultValue; + } + + + public void setOuterEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumTest enumTest = (EnumTest) o; + return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && + Objects.equals(this.enumInteger, enumTest.enumInteger) && + Objects.equals(this.enumIntegerOnly, enumTest.enumIntegerOnly) && + Objects.equals(this.enumNumber, enumTest.enumNumber) && + Objects.equals(this.outerEnum, enumTest.outerEnum) && + Objects.equals(this.outerEnumInteger, enumTest.outerEnumInteger) && + Objects.equals(this.outerEnumDefaultValue, enumTest.outerEnumDefaultValue) && + Objects.equals(this.outerEnumIntegerDefaultValue, enumTest.outerEnumIntegerDefaultValue); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(enumString, enumStringRequired, enumInteger, enumIntegerOnly, enumNumber, outerEnum, outerEnumInteger, outerEnumDefaultValue, outerEnumIntegerDefaultValue); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumTest {\n"); + sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); + sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); + sb.append(" enumIntegerOnly: ").append(toIndentedString(enumIntegerOnly)).append("\n"); + sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); + sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); + sb.append(" outerEnumInteger: ").append(toIndentedString(outerEnumInteger)).append("\n"); + sb.append(" outerEnumDefaultValue: ").append(toIndentedString(outerEnumDefaultValue)).append("\n"); + sb.append(" outerEnumIntegerDefaultValue: ").append(toIndentedString(outerEnumIntegerDefaultValue)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("enum_string"); + openapiFields.add("enum_string_required"); + openapiFields.add("enum_integer"); + openapiFields.add("enum_integer_only"); + openapiFields.add("enum_number"); + openapiFields.add("outerEnum"); + openapiFields.add("outerEnumInteger"); + openapiFields.add("outerEnumDefaultValue"); + openapiFields.add("outerEnumIntegerDefaultValue"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("enum_string_required"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EnumTest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EnumTest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EnumTest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EnumTest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EnumTest read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!EnumTest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `EnumTest` properties"); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EnumTest.openapiRequiredFields) { + if (obj.get(requiredField) == null) { + throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EquilateralTriangle.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EquilateralTriangle.java new file mode 100644 index 000000000000..d0d2a26dab70 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EquilateralTriangle.java @@ -0,0 +1,203 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.ShapeInterface; +import org.openapitools.client.model.TriangleInterface; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * EquilateralTriangle + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EquilateralTriangle { + public static final String SERIALIZED_NAME_SHAPE_TYPE = "shapeType"; + @SerializedName(SERIALIZED_NAME_SHAPE_TYPE) + private String shapeType; + + public static final String SERIALIZED_NAME_TRIANGLE_TYPE = "triangleType"; + @SerializedName(SERIALIZED_NAME_TRIANGLE_TYPE) + private String triangleType; + + public EquilateralTriangle() { + } + + public EquilateralTriangle shapeType(String shapeType) { + + this.shapeType = shapeType; + return this; + } + + /** + * Get shapeType + * @return shapeType + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getShapeType() { + return shapeType; + } + + + public void setShapeType(String shapeType) { + this.shapeType = shapeType; + } + + + public EquilateralTriangle triangleType(String triangleType) { + + this.triangleType = triangleType; + return this; + } + + /** + * Get triangleType + * @return triangleType + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getTriangleType() { + return triangleType; + } + + + public void setTriangleType(String triangleType) { + this.triangleType = triangleType; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EquilateralTriangle equilateralTriangle = (EquilateralTriangle) o; + return Objects.equals(this.shapeType, equilateralTriangle.shapeType) && + Objects.equals(this.triangleType, equilateralTriangle.triangleType); + } + + @Override + public int hashCode() { + return Objects.hash(shapeType, triangleType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EquilateralTriangle {\n"); + sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); + sb.append(" triangleType: ").append(toIndentedString(triangleType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("shapeType"); + openapiFields.add("triangleType"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("shapeType"); + openapiRequiredFields.add("triangleType"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EquilateralTriangle.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EquilateralTriangle' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EquilateralTriangle.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EquilateralTriangle value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EquilateralTriangle read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!EquilateralTriangle.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `EquilateralTriangle` properties"); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EquilateralTriangle.openapiRequiredFields) { + if (obj.get(requiredField) == null) { + throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java new file mode 100644 index 000000000000..9b7eb55c7484 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -0,0 +1,202 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * FileSchemaTestClass + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class FileSchemaTestClass { + public static final String SERIALIZED_NAME_FILE = "file"; + @SerializedName(SERIALIZED_NAME_FILE) + private java.io.File file; + + public static final String SERIALIZED_NAME_FILES = "files"; + @SerializedName(SERIALIZED_NAME_FILES) + private List files = null; + + public FileSchemaTestClass() { + } + + public FileSchemaTestClass file(java.io.File file) { + + this.file = file; + return this; + } + + /** + * Get file + * @return file + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public java.io.File getFile() { + return file; + } + + + public void setFile(java.io.File file) { + this.file = file; + } + + + public FileSchemaTestClass files(List files) { + + this.files = files; + return this; + } + + public FileSchemaTestClass addFilesItem(java.io.File filesItem) { + if (this.files == null) { + this.files = new ArrayList(); + } + this.files.add(filesItem); + return this; + } + + /** + * Get files + * @return files + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getFiles() { + return files; + } + + + public void setFiles(List files) { + this.files = files; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; + return Objects.equals(this.file, fileSchemaTestClass.file) && + Objects.equals(this.files, fileSchemaTestClass.files); + } + + @Override + public int hashCode() { + return Objects.hash(file, files); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileSchemaTestClass {\n"); + sb.append(" file: ").append(toIndentedString(file)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("file"); + openapiFields.add("files"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FileSchemaTestClass.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FileSchemaTestClass' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FileSchemaTestClass.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FileSchemaTestClass value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FileSchemaTestClass read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!FileSchemaTestClass.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `FileSchemaTestClass` properties"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Foo.java new file mode 100644 index 000000000000..61d7be45d63d --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Foo.java @@ -0,0 +1,162 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * Foo + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Foo { + public static final String SERIALIZED_NAME_BAR = "bar"; + @SerializedName(SERIALIZED_NAME_BAR) + private String bar = "bar"; + + public Foo() { + } + + public Foo bar(String bar) { + + this.bar = bar; + return this; + } + + /** + * Get bar + * @return bar + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getBar() { + return bar; + } + + + public void setBar(String bar) { + this.bar = bar; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Foo foo = (Foo) o; + return Objects.equals(this.bar, foo.bar); + } + + @Override + public int hashCode() { + return Objects.hash(bar); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Foo {\n"); + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("bar"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Foo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Foo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Foo.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Foo value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Foo read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!Foo.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Foo` properties"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FormatTest.java new file mode 100644 index 000000000000..a5b0cbf197f5 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FormatTest.java @@ -0,0 +1,638 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.File; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.UUID; +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * FormatTest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class FormatTest { + public static final String SERIALIZED_NAME_INTEGER = "integer"; + @SerializedName(SERIALIZED_NAME_INTEGER) + private Integer integer; + + public static final String SERIALIZED_NAME_INT32 = "int32"; + @SerializedName(SERIALIZED_NAME_INT32) + private Integer int32; + + public static final String SERIALIZED_NAME_INT64 = "int64"; + @SerializedName(SERIALIZED_NAME_INT64) + private Long int64; + + public static final String SERIALIZED_NAME_NUMBER = "number"; + @SerializedName(SERIALIZED_NAME_NUMBER) + private BigDecimal number; + + public static final String SERIALIZED_NAME_FLOAT = "float"; + @SerializedName(SERIALIZED_NAME_FLOAT) + private Float _float; + + public static final String SERIALIZED_NAME_DOUBLE = "double"; + @SerializedName(SERIALIZED_NAME_DOUBLE) + private Double _double; + + public static final String SERIALIZED_NAME_DECIMAL = "decimal"; + @SerializedName(SERIALIZED_NAME_DECIMAL) + private BigDecimal decimal; + + public static final String SERIALIZED_NAME_STRING = "string"; + @SerializedName(SERIALIZED_NAME_STRING) + private String string; + + public static final String SERIALIZED_NAME_BYTE = "byte"; + @SerializedName(SERIALIZED_NAME_BYTE) + private byte[] _byte; + + public static final String SERIALIZED_NAME_BINARY = "binary"; + @SerializedName(SERIALIZED_NAME_BINARY) + private File binary; + + public static final String SERIALIZED_NAME_DATE = "date"; + @SerializedName(SERIALIZED_NAME_DATE) + private LocalDate date; + + public static final String SERIALIZED_NAME_DATE_TIME = "dateTime"; + @SerializedName(SERIALIZED_NAME_DATE_TIME) + private OffsetDateTime dateTime; + + public static final String SERIALIZED_NAME_UUID = "uuid"; + @SerializedName(SERIALIZED_NAME_UUID) + private UUID uuid; + + public static final String SERIALIZED_NAME_PASSWORD = "password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + private String password; + + public static final String SERIALIZED_NAME_PATTERN_WITH_DIGITS = "pattern_with_digits"; + @SerializedName(SERIALIZED_NAME_PATTERN_WITH_DIGITS) + private String patternWithDigits; + + public static final String SERIALIZED_NAME_PATTERN_WITH_DIGITS_AND_DELIMITER = "pattern_with_digits_and_delimiter"; + @SerializedName(SERIALIZED_NAME_PATTERN_WITH_DIGITS_AND_DELIMITER) + private String patternWithDigitsAndDelimiter; + + public FormatTest() { + } + + public FormatTest integer(Integer integer) { + + this.integer = integer; + return this; + } + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Integer getInteger() { + return integer; + } + + + public void setInteger(Integer integer) { + this.integer = integer; + } + + + public FormatTest int32(Integer int32) { + + this.int32 = int32; + return this; + } + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Integer getInt32() { + return int32; + } + + + public void setInt32(Integer int32) { + this.int32 = int32; + } + + + public FormatTest int64(Long int64) { + + this.int64 = int64; + return this; + } + + /** + * Get int64 + * @return int64 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Long getInt64() { + return int64; + } + + + public void setInt64(Long int64) { + this.int64 = int64; + } + + + public FormatTest number(BigDecimal number) { + + this.number = number; + return this; + } + + /** + * Get number + * minimum: 32.1 + * maximum: 543.2 + * @return number + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public BigDecimal getNumber() { + return number; + } + + + public void setNumber(BigDecimal number) { + this.number = number; + } + + + public FormatTest _float(Float _float) { + + this._float = _float; + return this; + } + + /** + * Get _float + * minimum: 54.3 + * maximum: 987.6 + * @return _float + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Float getFloat() { + return _float; + } + + + public void setFloat(Float _float) { + this._float = _float; + } + + + public FormatTest _double(Double _double) { + + this._double = _double; + return this; + } + + /** + * Get _double + * minimum: 67.8 + * maximum: 123.4 + * @return _double + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Double getDouble() { + return _double; + } + + + public void setDouble(Double _double) { + this._double = _double; + } + + + public FormatTest decimal(BigDecimal decimal) { + + this.decimal = decimal; + return this; + } + + /** + * Get decimal + * @return decimal + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public BigDecimal getDecimal() { + return decimal; + } + + + public void setDecimal(BigDecimal decimal) { + this.decimal = decimal; + } + + + public FormatTest string(String string) { + + this.string = string; + return this; + } + + /** + * Get string + * @return string + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getString() { + return string; + } + + + public void setString(String string) { + this.string = string; + } + + + public FormatTest _byte(byte[] _byte) { + + this._byte = _byte; + return this; + } + + /** + * Get _byte + * @return _byte + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public byte[] getByte() { + return _byte; + } + + + public void setByte(byte[] _byte) { + this._byte = _byte; + } + + + public FormatTest binary(File binary) { + + this.binary = binary; + return this; + } + + /** + * Get binary + * @return binary + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public File getBinary() { + return binary; + } + + + public void setBinary(File binary) { + this.binary = binary; + } + + + public FormatTest date(LocalDate date) { + + this.date = date; + return this; + } + + /** + * Get date + * @return date + **/ + @javax.annotation.Nonnull + @ApiModelProperty(example = "Sun Feb 02 00:00:00 UTC 2020", required = true, value = "") + + public LocalDate getDate() { + return date; + } + + + public void setDate(LocalDate date) { + this.date = date; + } + + + public FormatTest dateTime(OffsetDateTime dateTime) { + + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "2007-12-03T10:15:30+01:00", value = "") + + public OffsetDateTime getDateTime() { + return dateTime; + } + + + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + + public FormatTest uuid(UUID uuid) { + + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + + public UUID getUuid() { + return uuid; + } + + + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + + public FormatTest password(String password) { + + this.password = password; + return this; + } + + /** + * Get password + * @return password + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getPassword() { + return password; + } + + + public void setPassword(String password) { + this.password = password; + } + + + public FormatTest patternWithDigits(String patternWithDigits) { + + this.patternWithDigits = patternWithDigits; + return this; + } + + /** + * A string that is a 10 digit number. Can have leading zeros. + * @return patternWithDigits + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "A string that is a 10 digit number. Can have leading zeros.") + + public String getPatternWithDigits() { + return patternWithDigits; + } + + + public void setPatternWithDigits(String patternWithDigits) { + this.patternWithDigits = patternWithDigits; + } + + + public FormatTest patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + return this; + } + + /** + * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + * @return patternWithDigitsAndDelimiter + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.") + + public String getPatternWithDigitsAndDelimiter() { + return patternWithDigitsAndDelimiter; + } + + + public void setPatternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FormatTest formatTest = (FormatTest) o; + return Objects.equals(this.integer, formatTest.integer) && + Objects.equals(this.int32, formatTest.int32) && + Objects.equals(this.int64, formatTest.int64) && + Objects.equals(this.number, formatTest.number) && + Objects.equals(this._float, formatTest._float) && + Objects.equals(this._double, formatTest._double) && + Objects.equals(this.decimal, formatTest.decimal) && + Objects.equals(this.string, formatTest.string) && + Arrays.equals(this._byte, formatTest._byte) && + Objects.equals(this.binary, formatTest.binary) && + Objects.equals(this.date, formatTest.date) && + Objects.equals(this.dateTime, formatTest.dateTime) && + Objects.equals(this.uuid, formatTest.uuid) && + Objects.equals(this.password, formatTest.password) && + Objects.equals(this.patternWithDigits, formatTest.patternWithDigits) && + Objects.equals(this.patternWithDigitsAndDelimiter, formatTest.patternWithDigitsAndDelimiter); + } + + @Override + public int hashCode() { + return Objects.hash(integer, int32, int64, number, _float, _double, decimal, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, patternWithDigits, patternWithDigitsAndDelimiter); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FormatTest {\n"); + sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); + sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); + sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); + sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); + sb.append(" decimal: ").append(toIndentedString(decimal)).append("\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); + sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" patternWithDigits: ").append(toIndentedString(patternWithDigits)).append("\n"); + sb.append(" patternWithDigitsAndDelimiter: ").append(toIndentedString(patternWithDigitsAndDelimiter)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("integer"); + openapiFields.add("int32"); + openapiFields.add("int64"); + openapiFields.add("number"); + openapiFields.add("float"); + openapiFields.add("double"); + openapiFields.add("decimal"); + openapiFields.add("string"); + openapiFields.add("byte"); + openapiFields.add("binary"); + openapiFields.add("date"); + openapiFields.add("dateTime"); + openapiFields.add("uuid"); + openapiFields.add("password"); + openapiFields.add("pattern_with_digits"); + openapiFields.add("pattern_with_digits_and_delimiter"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("number"); + openapiRequiredFields.add("byte"); + openapiRequiredFields.add("date"); + openapiRequiredFields.add("password"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FormatTest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FormatTest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FormatTest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FormatTest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FormatTest read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!FormatTest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `FormatTest` properties"); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FormatTest.openapiRequiredFields) { + if (obj.get(requiredField) == null) { + throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java new file mode 100644 index 000000000000..6f907a92f0ae --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java @@ -0,0 +1,221 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.Apple; +import org.openapitools.client.model.Banana; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Fruit extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Fruit.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Fruit.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Fruit' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterApple = gson.getDelegateAdapter(this, TypeToken.get(Apple.class)); + final TypeAdapter adapterBanana = gson.getDelegateAdapter(this, TypeToken.get(Banana.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Fruit value) throws IOException { + // check if the actual instance is of the type `Apple` + if (value.getActualInstance() instanceof Apple) { + JsonObject obj = adapterApple.toJsonTree((Apple)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + // check if the actual instance is of the type `Banana` + if (value.getActualInstance() instanceof Banana) { + JsonObject obj = adapterBanana.toJsonTree((Banana)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: Apple, Banana"); + } + + @Override + public Fruit read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + + // deserialize Apple + try { + deserialized = adapterApple.fromJsonTree(jsonObject); + match++; + log.log(Level.FINER, "Input data matches schema 'Apple'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Apple'", e); + } + + // deserialize Banana + try { + deserialized = adapterBanana.fromJsonTree(jsonObject); + match++; + log.log(Level.FINER, "Input data matches schema 'Banana'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Banana'", e); + } + + if (match == 1) { + Fruit ret = new Fruit(); + ret.setActualInstance(deserialized); + return ret; + } + + throw new IOException(String.format("Failed deserialization for Fruit: %d classes match result, expected 1", match)); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public Fruit() { + super("oneOf", Boolean.FALSE); + } + + public Fruit(Apple o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Fruit(Banana o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Apple", new GenericType() { + }); + schemas.put("Banana", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return Fruit.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Apple, Banana + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Apple) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Banana) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Apple, Banana"); + } + + /** + * Get the actual instance, which can be the following: + * Apple, Banana + * + * @return The actual instance (Apple, Banana) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Apple`. If the actual instance is not `Apple`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Apple` + * @throws ClassCastException if the instance is not `Apple` + */ + public Apple getApple() throws ClassCastException { + return (Apple)super.getActualInstance(); + } + + /** + * Get the actual instance of `Banana`. If the actual instance is not `Banana`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Banana` + * @throws ClassCastException if the instance is not `Banana` + */ + public Banana getBanana() throws ClassCastException { + return (Banana)super.getActualInstance(); + } + +} + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java new file mode 100644 index 000000000000..303049b6007b --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java @@ -0,0 +1,226 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.AppleReq; +import org.openapitools.client.model.BananaReq; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class FruitReq extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(FruitReq.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FruitReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FruitReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterAppleReq = gson.getDelegateAdapter(this, TypeToken.get(AppleReq.class)); + final TypeAdapter adapterBananaReq = gson.getDelegateAdapter(this, TypeToken.get(BananaReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FruitReq value) throws IOException { + // check if the actual instance is of the type `AppleReq` + if (value.getActualInstance() instanceof AppleReq) { + JsonObject obj = adapterAppleReq.toJsonTree((AppleReq)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + // check if the actual instance is of the type `BananaReq` + if (value.getActualInstance() instanceof BananaReq) { + JsonObject obj = adapterBananaReq.toJsonTree((BananaReq)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: AppleReq, BananaReq"); + } + + @Override + public FruitReq read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + + // deserialize AppleReq + try { + deserialized = adapterAppleReq.fromJsonTree(jsonObject); + match++; + log.log(Level.FINER, "Input data matches schema 'AppleReq'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'AppleReq'", e); + } + + // deserialize BananaReq + try { + deserialized = adapterBananaReq.fromJsonTree(jsonObject); + match++; + log.log(Level.FINER, "Input data matches schema 'BananaReq'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'BananaReq'", e); + } + + if (match == 1) { + FruitReq ret = new FruitReq(); + ret.setActualInstance(deserialized); + return ret; + } + + throw new IOException(String.format("Failed deserialization for FruitReq: %d classes match result, expected 1", match)); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public FruitReq() { + super("oneOf", Boolean.TRUE); + } + + public FruitReq(AppleReq o) { + super("oneOf", Boolean.TRUE); + setActualInstance(o); + } + + public FruitReq(BananaReq o) { + super("oneOf", Boolean.TRUE); + setActualInstance(o); + } + + static { + schemas.put("AppleReq", new GenericType() { + }); + schemas.put("BananaReq", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return FruitReq.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * AppleReq, BananaReq + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance == null) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof AppleReq) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof BananaReq) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be AppleReq, BananaReq"); + } + + /** + * Get the actual instance, which can be the following: + * AppleReq, BananaReq + * + * @return The actual instance (AppleReq, BananaReq) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `AppleReq`. If the actual instance is not `AppleReq`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `AppleReq` + * @throws ClassCastException if the instance is not `AppleReq` + */ + public AppleReq getAppleReq() throws ClassCastException { + return (AppleReq)super.getActualInstance(); + } + + /** + * Get the actual instance of `BananaReq`. If the actual instance is not `BananaReq`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `BananaReq` + * @throws ClassCastException if the instance is not `BananaReq` + */ + public BananaReq getBananaReq() throws ClassCastException { + return (BananaReq)super.getActualInstance(); + } + +} + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java new file mode 100644 index 000000000000..441f0330de61 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java @@ -0,0 +1,216 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.Apple; +import org.openapitools.client.model.Banana; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GmFruit extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(GmFruit.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GmFruit.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GmFruit' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterApple = gson.getDelegateAdapter(this, TypeToken.get(Apple.class)); + final TypeAdapter adapterBanana = gson.getDelegateAdapter(this, TypeToken.get(Banana.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GmFruit value) throws IOException { + // check if the actual instance is of the type `Apple` + if (value.getActualInstance() instanceof Apple) { + JsonObject obj = adapterApple.toJsonTree((Apple)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + // check if the actual instance is of the type `Banana` + if (value.getActualInstance() instanceof Banana) { + JsonObject obj = adapterBanana.toJsonTree((Banana)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + throw new IOException("Failed to deserialize as the type doesn't match anyOf schemas: Apple, Banana"); + } + + @Override + public GmFruit read(JsonReader in) throws IOException { + Object deserialized = null; + + // deserialize Apple + try { + deserialized = gson.fromJson(in, Apple.class); + log.log(Level.FINER, "Input data matches schema 'Apple'"); + GmFruit ret = new GmFruit(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Apple'", e); + } + + // deserialize Banana + try { + deserialized = gson.fromJson(in, Banana.class); + log.log(Level.FINER, "Input data matches schema 'Banana'"); + GmFruit ret = new GmFruit(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Banana'", e); + } + + throw new IOException("Failed deserialization for GmFruit: no match found."); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in anyOf + public static final Map schemas = new HashMap(); + + public GmFruit() { + super("anyOf", Boolean.FALSE); + } + + public GmFruit(Apple o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + public GmFruit(Banana o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Apple", new GenericType() { + }); + schemas.put("Banana", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return GmFruit.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check + * the instance parameter is valid against the anyOf child schemas: + * Apple, Banana + * + * It could be an instance of the 'anyOf' schemas. + * The anyOf child schemas may themselves be a composed schema (allOf, anyOf, anyOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Apple) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Banana) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Apple, Banana"); + } + + /** + * Get the actual instance, which can be the following: + * Apple, Banana + * + * @return The actual instance (Apple, Banana) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Apple`. If the actual instance is not `Apple`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Apple` + * @throws ClassCastException if the instance is not `Apple` + */ + public Apple getApple() throws ClassCastException { + return (Apple)super.getActualInstance(); + } + + /** + * Get the actual instance of `Banana`. If the actual instance is not `Banana`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Banana` + * @throws ClassCastException if the instance is not `Banana` + */ + public Banana getBanana() throws ClassCastException { + return (Banana)super.getActualInstance(); + } + +} + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GrandparentAnimal.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GrandparentAnimal.java new file mode 100644 index 000000000000..df924fe5f33d --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GrandparentAnimal.java @@ -0,0 +1,172 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.ParentPet; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * GrandparentAnimal + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GrandparentAnimal { + public static final String SERIALIZED_NAME_PET_TYPE = "pet_type"; + @SerializedName(SERIALIZED_NAME_PET_TYPE) + protected String petType; + + public GrandparentAnimal() { + this.petType = this.getClass().getSimpleName(); + } + + public GrandparentAnimal petType(String petType) { + + this.petType = petType; + return this; + } + + /** + * Get petType + * @return petType + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getPetType() { + return petType; + } + + + public void setPetType(String petType) { + this.petType = petType; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GrandparentAnimal grandparentAnimal = (GrandparentAnimal) o; + return Objects.equals(this.petType, grandparentAnimal.petType); + } + + @Override + public int hashCode() { + return Objects.hash(petType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GrandparentAnimal {\n"); + sb.append(" petType: ").append(toIndentedString(petType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("pet_type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("pet_type"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GrandparentAnimal.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GrandparentAnimal' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GrandparentAnimal.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GrandparentAnimal value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GrandparentAnimal read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!GrandparentAnimal.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `GrandparentAnimal` properties"); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GrandparentAnimal.openapiRequiredFields) { + if (obj.get(requiredField) == null) { + throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java new file mode 100644 index 000000000000..31a4a05a3d5c --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -0,0 +1,184 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * HasOnlyReadOnly + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HasOnlyReadOnly { + public static final String SERIALIZED_NAME_BAR = "bar"; + @SerializedName(SERIALIZED_NAME_BAR) + private String bar; + + public static final String SERIALIZED_NAME_FOO = "foo"; + @SerializedName(SERIALIZED_NAME_FOO) + private String foo; + + public HasOnlyReadOnly() { + } + + + public HasOnlyReadOnly( + String bar, + String foo + ) { + this(); + this.bar = bar; + this.foo = foo; + } + + /** + * Get bar + * @return bar + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getBar() { + return bar; + } + + + + + /** + * Get foo + * @return foo + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getFoo() { + return foo; + } + + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; + return Objects.equals(this.bar, hasOnlyReadOnly.bar) && + Objects.equals(this.foo, hasOnlyReadOnly.foo); + } + + @Override + public int hashCode() { + return Objects.hash(bar, foo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasOnlyReadOnly {\n"); + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("bar"); + openapiFields.add("foo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasOnlyReadOnly.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasOnlyReadOnly' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasOnlyReadOnly.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasOnlyReadOnly value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasOnlyReadOnly read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!HasOnlyReadOnly.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `HasOnlyReadOnly` properties"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/HealthCheckResult.java new file mode 100644 index 000000000000..8af6fca3706a --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -0,0 +1,175 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + */ +@ApiModel(description = "Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HealthCheckResult { + public static final String SERIALIZED_NAME_NULLABLE_MESSAGE = "NullableMessage"; + @SerializedName(SERIALIZED_NAME_NULLABLE_MESSAGE) + private String nullableMessage; + + public HealthCheckResult() { + } + + public HealthCheckResult nullableMessage(String nullableMessage) { + + this.nullableMessage = nullableMessage; + return this; + } + + /** + * Get nullableMessage + * @return nullableMessage + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getNullableMessage() { + return nullableMessage; + } + + + public void setNullableMessage(String nullableMessage) { + this.nullableMessage = nullableMessage; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HealthCheckResult healthCheckResult = (HealthCheckResult) o; + return Objects.equals(this.nullableMessage, healthCheckResult.nullableMessage); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(nullableMessage); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HealthCheckResult {\n"); + sb.append(" nullableMessage: ").append(toIndentedString(nullableMessage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("NullableMessage"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HealthCheckResult.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HealthCheckResult' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HealthCheckResult.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HealthCheckResult value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HealthCheckResult read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!HealthCheckResult.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `HealthCheckResult` properties"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/InlineResponseDefault.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/InlineResponseDefault.java new file mode 100644 index 000000000000..925d6c646c99 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/InlineResponseDefault.java @@ -0,0 +1,163 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.Foo; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * InlineResponseDefault + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InlineResponseDefault { + public static final String SERIALIZED_NAME_STRING = "string"; + @SerializedName(SERIALIZED_NAME_STRING) + private Foo string; + + public InlineResponseDefault() { + } + + public InlineResponseDefault string(Foo string) { + + this.string = string; + return this; + } + + /** + * Get string + * @return string + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Foo getString() { + return string; + } + + + public void setString(Foo string) { + this.string = string; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InlineResponseDefault inlineResponseDefault = (InlineResponseDefault) o; + return Objects.equals(this.string, inlineResponseDefault.string); + } + + @Override + public int hashCode() { + return Objects.hash(string); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineResponseDefault {\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("string"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InlineResponseDefault.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InlineResponseDefault' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InlineResponseDefault.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InlineResponseDefault value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InlineResponseDefault read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!InlineResponseDefault.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `InlineResponseDefault` properties"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java new file mode 100644 index 000000000000..2c2a44565513 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java @@ -0,0 +1,203 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.ShapeInterface; +import org.openapitools.client.model.TriangleInterface; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * IsoscelesTriangle + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class IsoscelesTriangle { + public static final String SERIALIZED_NAME_SHAPE_TYPE = "shapeType"; + @SerializedName(SERIALIZED_NAME_SHAPE_TYPE) + private String shapeType; + + public static final String SERIALIZED_NAME_TRIANGLE_TYPE = "triangleType"; + @SerializedName(SERIALIZED_NAME_TRIANGLE_TYPE) + private String triangleType; + + public IsoscelesTriangle() { + } + + public IsoscelesTriangle shapeType(String shapeType) { + + this.shapeType = shapeType; + return this; + } + + /** + * Get shapeType + * @return shapeType + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getShapeType() { + return shapeType; + } + + + public void setShapeType(String shapeType) { + this.shapeType = shapeType; + } + + + public IsoscelesTriangle triangleType(String triangleType) { + + this.triangleType = triangleType; + return this; + } + + /** + * Get triangleType + * @return triangleType + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getTriangleType() { + return triangleType; + } + + + public void setTriangleType(String triangleType) { + this.triangleType = triangleType; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IsoscelesTriangle isoscelesTriangle = (IsoscelesTriangle) o; + return Objects.equals(this.shapeType, isoscelesTriangle.shapeType) && + Objects.equals(this.triangleType, isoscelesTriangle.triangleType); + } + + @Override + public int hashCode() { + return Objects.hash(shapeType, triangleType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IsoscelesTriangle {\n"); + sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); + sb.append(" triangleType: ").append(toIndentedString(triangleType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("shapeType"); + openapiFields.add("triangleType"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("shapeType"); + openapiRequiredFields.add("triangleType"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IsoscelesTriangle.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IsoscelesTriangle' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IsoscelesTriangle.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IsoscelesTriangle value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IsoscelesTriangle read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!IsoscelesTriangle.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `IsoscelesTriangle` properties"); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IsoscelesTriangle.openapiRequiredFields) { + if (obj.get(requiredField) == null) { + throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java new file mode 100644 index 000000000000..466644f4b7c8 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java @@ -0,0 +1,261 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.Pig; +import org.openapitools.client.model.Whale; +import org.openapitools.client.model.Zebra; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Mammal extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Mammal.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Mammal.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Mammal' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterPig = gson.getDelegateAdapter(this, TypeToken.get(Pig.class)); + final TypeAdapter adapterWhale = gson.getDelegateAdapter(this, TypeToken.get(Whale.class)); + final TypeAdapter adapterZebra = gson.getDelegateAdapter(this, TypeToken.get(Zebra.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Mammal value) throws IOException { + // check if the actual instance is of the type `Pig` + if (value.getActualInstance() instanceof Pig) { + JsonObject obj = adapterPig.toJsonTree((Pig)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + // check if the actual instance is of the type `Whale` + if (value.getActualInstance() instanceof Whale) { + JsonObject obj = adapterWhale.toJsonTree((Whale)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + // check if the actual instance is of the type `Zebra` + if (value.getActualInstance() instanceof Zebra) { + JsonObject obj = adapterZebra.toJsonTree((Zebra)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: Pig, Whale, Zebra"); + } + + @Override + public Mammal read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + + // deserialize Pig + try { + deserialized = adapterPig.fromJsonTree(jsonObject); + match++; + log.log(Level.FINER, "Input data matches schema 'Pig'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Pig'", e); + } + + // deserialize Whale + try { + deserialized = adapterWhale.fromJsonTree(jsonObject); + match++; + log.log(Level.FINER, "Input data matches schema 'Whale'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Whale'", e); + } + + // deserialize Zebra + try { + deserialized = adapterZebra.fromJsonTree(jsonObject); + match++; + log.log(Level.FINER, "Input data matches schema 'Zebra'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Zebra'", e); + } + + if (match == 1) { + Mammal ret = new Mammal(); + ret.setActualInstance(deserialized); + return ret; + } + + throw new IOException(String.format("Failed deserialization for Mammal: %d classes match result, expected 1", match)); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public Mammal() { + super("oneOf", Boolean.FALSE); + } + + public Mammal(Pig o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Mammal(Whale o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Mammal(Zebra o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Pig", new GenericType() { + }); + schemas.put("Whale", new GenericType() { + }); + schemas.put("Zebra", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return Mammal.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Pig, Whale, Zebra + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Pig) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Whale) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Zebra) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Pig, Whale, Zebra"); + } + + /** + * Get the actual instance, which can be the following: + * Pig, Whale, Zebra + * + * @return The actual instance (Pig, Whale, Zebra) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Pig`. If the actual instance is not `Pig`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Pig` + * @throws ClassCastException if the instance is not `Pig` + */ + public Pig getPig() throws ClassCastException { + return (Pig)super.getActualInstance(); + } + + /** + * Get the actual instance of `Whale`. If the actual instance is not `Whale`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Whale` + * @throws ClassCastException if the instance is not `Whale` + */ + public Whale getWhale() throws ClassCastException { + return (Whale)super.getActualInstance(); + } + + /** + * Get the actual instance of `Zebra`. If the actual instance is not `Zebra`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Zebra` + * @throws ClassCastException if the instance is not `Zebra` + */ + public Zebra getZebra() throws ClassCastException { + return (Zebra)super.getActualInstance(); + } + +} + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/MapTest.java new file mode 100644 index 000000000000..615d6de35357 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/MapTest.java @@ -0,0 +1,334 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * MapTest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class MapTest { + public static final String SERIALIZED_NAME_MAP_MAP_OF_STRING = "map_map_of_string"; + @SerializedName(SERIALIZED_NAME_MAP_MAP_OF_STRING) + private Map> mapMapOfString = null; + + /** + * Gets or Sets inner + */ + @JsonAdapter(InnerEnum.Adapter.class) + public enum InnerEnum { + UPPER("UPPER"), + + LOWER("lower"); + + private String value; + + InnerEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static InnerEnum fromValue(String value) { + for (InnerEnum b : InnerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final InnerEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public InnerEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return InnerEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_MAP_OF_ENUM_STRING = "map_of_enum_string"; + @SerializedName(SERIALIZED_NAME_MAP_OF_ENUM_STRING) + private Map mapOfEnumString = null; + + public static final String SERIALIZED_NAME_DIRECT_MAP = "direct_map"; + @SerializedName(SERIALIZED_NAME_DIRECT_MAP) + private Map directMap = null; + + public static final String SERIALIZED_NAME_INDIRECT_MAP = "indirect_map"; + @SerializedName(SERIALIZED_NAME_INDIRECT_MAP) + private Map indirectMap = null; + + public MapTest() { + } + + public MapTest mapMapOfString(Map> mapMapOfString) { + + this.mapMapOfString = mapMapOfString; + return this; + } + + public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap>(); + } + this.mapMapOfString.put(key, mapMapOfStringItem); + return this; + } + + /** + * Get mapMapOfString + * @return mapMapOfString + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Map> getMapMapOfString() { + return mapMapOfString; + } + + + public void setMapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + } + + + public MapTest mapOfEnumString(Map mapOfEnumString) { + + this.mapOfEnumString = mapOfEnumString; + return this; + } + + public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap(); + } + this.mapOfEnumString.put(key, mapOfEnumStringItem); + return this; + } + + /** + * Get mapOfEnumString + * @return mapOfEnumString + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Map getMapOfEnumString() { + return mapOfEnumString; + } + + + public void setMapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + } + + + public MapTest directMap(Map directMap) { + + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Map getDirectMap() { + return directMap; + } + + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + + public MapTest indirectMap(Map indirectMap) { + + this.indirectMap = indirectMap; + return this; + } + + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Map getIndirectMap() { + return indirectMap; + } + + + public void setIndirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MapTest mapTest = (MapTest) o; + return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); + } + + @Override + public int hashCode() { + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MapTest {\n"); + sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); + sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("map_map_of_string"); + openapiFields.add("map_of_enum_string"); + openapiFields.add("direct_map"); + openapiFields.add("indirect_map"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MapTest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MapTest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MapTest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MapTest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MapTest read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!MapTest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `MapTest` properties"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java new file mode 100644 index 000000000000..ae6e2282c9f9 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -0,0 +1,236 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import org.openapitools.client.model.Animal; +import org.threeten.bp.OffsetDateTime; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * MixedPropertiesAndAdditionalPropertiesClass + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class MixedPropertiesAndAdditionalPropertiesClass { + public static final String SERIALIZED_NAME_UUID = "uuid"; + @SerializedName(SERIALIZED_NAME_UUID) + private UUID uuid; + + public static final String SERIALIZED_NAME_DATE_TIME = "dateTime"; + @SerializedName(SERIALIZED_NAME_DATE_TIME) + private OffsetDateTime dateTime; + + public static final String SERIALIZED_NAME_MAP = "map"; + @SerializedName(SERIALIZED_NAME_MAP) + private Map map = null; + + public MixedPropertiesAndAdditionalPropertiesClass() { + } + + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public UUID getUuid() { + return uuid; + } + + + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public OffsetDateTime getDateTime() { + return dateTime; + } + + + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + + this.map = map; + return this; + } + + public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap(); + } + this.map.put(key, mapItem); + return this; + } + + /** + * Get map + * @return map + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Map getMap() { + return map; + } + + + public void setMap(Map map) { + this.map = map; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; + return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && + Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && + Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); + } + + @Override + public int hashCode() { + return Objects.hash(uuid, dateTime, map); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" map: ").append(toIndentedString(map)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("uuid"); + openapiFields.add("dateTime"); + openapiFields.add("map"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MixedPropertiesAndAdditionalPropertiesClass.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MixedPropertiesAndAdditionalPropertiesClass' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MixedPropertiesAndAdditionalPropertiesClass.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MixedPropertiesAndAdditionalPropertiesClass value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MixedPropertiesAndAdditionalPropertiesClass read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!MixedPropertiesAndAdditionalPropertiesClass.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `MixedPropertiesAndAdditionalPropertiesClass` properties"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Model200Response.java new file mode 100644 index 000000000000..b9ec6bd483df --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Model200Response.java @@ -0,0 +1,193 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * Model for testing model name starting with number + */ +@ApiModel(description = "Model for testing model name starting with number") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Model200Response { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private Integer name; + + public static final String SERIALIZED_NAME_PROPERTY_CLASS = "class"; + @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) + private String propertyClass; + + public Model200Response() { + } + + public Model200Response name(Integer name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Integer getName() { + return name; + } + + + public void setName(Integer name) { + this.name = name; + } + + + public Model200Response propertyClass(String propertyClass) { + + this.propertyClass = propertyClass; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getPropertyClass() { + return propertyClass; + } + + + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Model200Response _200response = (Model200Response) o; + return Objects.equals(this.name, _200response.name) && + Objects.equals(this.propertyClass, _200response.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(name, propertyClass); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Model200Response {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("class"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Model200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Model200Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Model200Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Model200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Model200Response read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!Model200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Model200Response` properties"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelApiResponse.java new file mode 100644 index 000000000000..c9f691d64582 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -0,0 +1,222 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * ModelApiResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelApiResponse { + public static final String SERIALIZED_NAME_CODE = "code"; + @SerializedName(SERIALIZED_NAME_CODE) + private Integer code; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public ModelApiResponse() { + } + + public ModelApiResponse code(Integer code) { + + this.code = code; + return this; + } + + /** + * Get code + * @return code + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Integer getCode() { + return code; + } + + + public void setCode(Integer code) { + this.code = code; + } + + + public ModelApiResponse type(String type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + + public ModelApiResponse message(String message) { + + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelApiResponse _apiResponse = (ModelApiResponse) o; + return Objects.equals(this.code, _apiResponse.code) && + Objects.equals(this.type, _apiResponse.type) && + Objects.equals(this.message, _apiResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, type, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("code"); + openapiFields.add("type"); + openapiFields.add("message"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ModelApiResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ModelApiResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ModelApiResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ModelApiResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ModelApiResponse read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!ModelApiResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ModelApiResponse` properties"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelReturn.java new file mode 100644 index 000000000000..64aadfb6a824 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -0,0 +1,163 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * Model for testing reserved words + */ +@ApiModel(description = "Model for testing reserved words") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelReturn { + public static final String SERIALIZED_NAME_RETURN = "return"; + @SerializedName(SERIALIZED_NAME_RETURN) + private Integer _return; + + public ModelReturn() { + } + + public ModelReturn _return(Integer _return) { + + this._return = _return; + return this; + } + + /** + * Get _return + * @return _return + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Integer getReturn() { + return _return; + } + + + public void setReturn(Integer _return) { + this._return = _return; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelReturn _return = (ModelReturn) o; + return Objects.equals(this._return, _return._return); + } + + @Override + public int hashCode() { + return Objects.hash(_return); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelReturn {\n"); + sb.append(" _return: ").append(toIndentedString(_return)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("return"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ModelReturn.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ModelReturn' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ModelReturn.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ModelReturn value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ModelReturn read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!ModelReturn.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ModelReturn` properties"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Name.java new file mode 100644 index 000000000000..528c159a8f37 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Name.java @@ -0,0 +1,253 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * Model for testing model name same as property name + */ +@ApiModel(description = "Model for testing model name same as property name") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Name { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private Integer name; + + public static final String SERIALIZED_NAME_SNAKE_CASE = "snake_case"; + @SerializedName(SERIALIZED_NAME_SNAKE_CASE) + private Integer snakeCase; + + public static final String SERIALIZED_NAME_PROPERTY = "property"; + @SerializedName(SERIALIZED_NAME_PROPERTY) + private String property; + + public static final String SERIALIZED_NAME_123NUMBER = "123Number"; + @SerializedName(SERIALIZED_NAME_123NUMBER) + private Integer _123number; + + public Name() { + } + + + public Name( + Integer snakeCase, + Integer _123number + ) { + this(); + this.snakeCase = snakeCase; + this._123number = _123number; + } + + public Name name(Integer name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public Integer getName() { + return name; + } + + + public void setName(Integer name) { + this.name = name; + } + + + /** + * Get snakeCase + * @return snakeCase + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Integer getSnakeCase() { + return snakeCase; + } + + + + + public Name property(String property) { + + this.property = property; + return this; + } + + /** + * Get property + * @return property + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getProperty() { + return property; + } + + + public void setProperty(String property) { + this.property = property; + } + + + /** + * Get _123number + * @return _123number + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Integer get123number() { + return _123number; + } + + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Name name = (Name) o; + return Objects.equals(this.name, name.name) && + Objects.equals(this.snakeCase, name.snakeCase) && + Objects.equals(this.property, name.property) && + Objects.equals(this._123number, name._123number); + } + + @Override + public int hashCode() { + return Objects.hash(name, snakeCase, property, _123number); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Name {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append(" _123number: ").append(toIndentedString(_123number)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("snake_case"); + openapiFields.add("property"); + openapiFields.add("123Number"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Name.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Name' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Name.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Name value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Name read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!Name.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Name` properties"); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Name.openapiRequiredFields) { + if (obj.get(requiredField) == null) { + throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableClass.java new file mode 100644 index 000000000000..5aa141fee0a6 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableClass.java @@ -0,0 +1,561 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * NullableClass + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class NullableClass extends HashMap { + public static final String SERIALIZED_NAME_INTEGER_PROP = "integer_prop"; + @SerializedName(SERIALIZED_NAME_INTEGER_PROP) + private Integer integerProp; + + public static final String SERIALIZED_NAME_NUMBER_PROP = "number_prop"; + @SerializedName(SERIALIZED_NAME_NUMBER_PROP) + private BigDecimal numberProp; + + public static final String SERIALIZED_NAME_BOOLEAN_PROP = "boolean_prop"; + @SerializedName(SERIALIZED_NAME_BOOLEAN_PROP) + private Boolean booleanProp; + + public static final String SERIALIZED_NAME_STRING_PROP = "string_prop"; + @SerializedName(SERIALIZED_NAME_STRING_PROP) + private String stringProp; + + public static final String SERIALIZED_NAME_DATE_PROP = "date_prop"; + @SerializedName(SERIALIZED_NAME_DATE_PROP) + private LocalDate dateProp; + + public static final String SERIALIZED_NAME_DATETIME_PROP = "datetime_prop"; + @SerializedName(SERIALIZED_NAME_DATETIME_PROP) + private OffsetDateTime datetimeProp; + + public static final String SERIALIZED_NAME_ARRAY_NULLABLE_PROP = "array_nullable_prop"; + @SerializedName(SERIALIZED_NAME_ARRAY_NULLABLE_PROP) + private List arrayNullableProp = null; + + public static final String SERIALIZED_NAME_ARRAY_AND_ITEMS_NULLABLE_PROP = "array_and_items_nullable_prop"; + @SerializedName(SERIALIZED_NAME_ARRAY_AND_ITEMS_NULLABLE_PROP) + private List arrayAndItemsNullableProp = null; + + public static final String SERIALIZED_NAME_ARRAY_ITEMS_NULLABLE = "array_items_nullable"; + @SerializedName(SERIALIZED_NAME_ARRAY_ITEMS_NULLABLE) + private List arrayItemsNullable = null; + + public static final String SERIALIZED_NAME_OBJECT_NULLABLE_PROP = "object_nullable_prop"; + @SerializedName(SERIALIZED_NAME_OBJECT_NULLABLE_PROP) + private Map objectNullableProp = null; + + public static final String SERIALIZED_NAME_OBJECT_AND_ITEMS_NULLABLE_PROP = "object_and_items_nullable_prop"; + @SerializedName(SERIALIZED_NAME_OBJECT_AND_ITEMS_NULLABLE_PROP) + private Map objectAndItemsNullableProp = null; + + public static final String SERIALIZED_NAME_OBJECT_ITEMS_NULLABLE = "object_items_nullable"; + @SerializedName(SERIALIZED_NAME_OBJECT_ITEMS_NULLABLE) + private Map objectItemsNullable = null; + + public NullableClass() { + } + + public NullableClass integerProp(Integer integerProp) { + + this.integerProp = integerProp; + return this; + } + + /** + * Get integerProp + * @return integerProp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Integer getIntegerProp() { + return integerProp; + } + + + public void setIntegerProp(Integer integerProp) { + this.integerProp = integerProp; + } + + + public NullableClass numberProp(BigDecimal numberProp) { + + this.numberProp = numberProp; + return this; + } + + /** + * Get numberProp + * @return numberProp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public BigDecimal getNumberProp() { + return numberProp; + } + + + public void setNumberProp(BigDecimal numberProp) { + this.numberProp = numberProp; + } + + + public NullableClass booleanProp(Boolean booleanProp) { + + this.booleanProp = booleanProp; + return this; + } + + /** + * Get booleanProp + * @return booleanProp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Boolean getBooleanProp() { + return booleanProp; + } + + + public void setBooleanProp(Boolean booleanProp) { + this.booleanProp = booleanProp; + } + + + public NullableClass stringProp(String stringProp) { + + this.stringProp = stringProp; + return this; + } + + /** + * Get stringProp + * @return stringProp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getStringProp() { + return stringProp; + } + + + public void setStringProp(String stringProp) { + this.stringProp = stringProp; + } + + + public NullableClass dateProp(LocalDate dateProp) { + + this.dateProp = dateProp; + return this; + } + + /** + * Get dateProp + * @return dateProp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public LocalDate getDateProp() { + return dateProp; + } + + + public void setDateProp(LocalDate dateProp) { + this.dateProp = dateProp; + } + + + public NullableClass datetimeProp(OffsetDateTime datetimeProp) { + + this.datetimeProp = datetimeProp; + return this; + } + + /** + * Get datetimeProp + * @return datetimeProp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public OffsetDateTime getDatetimeProp() { + return datetimeProp; + } + + + public void setDatetimeProp(OffsetDateTime datetimeProp) { + this.datetimeProp = datetimeProp; + } + + + public NullableClass arrayNullableProp(List arrayNullableProp) { + + this.arrayNullableProp = arrayNullableProp; + return this; + } + + public NullableClass addArrayNullablePropItem(Object arrayNullablePropItem) { + if (this.arrayNullableProp == null) { + this.arrayNullableProp = new ArrayList(); + } + this.arrayNullableProp.add(arrayNullablePropItem); + return this; + } + + /** + * Get arrayNullableProp + * @return arrayNullableProp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getArrayNullableProp() { + return arrayNullableProp; + } + + + public void setArrayNullableProp(List arrayNullableProp) { + this.arrayNullableProp = arrayNullableProp; + } + + + public NullableClass arrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + + this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + return this; + } + + public NullableClass addArrayAndItemsNullablePropItem(Object arrayAndItemsNullablePropItem) { + if (this.arrayAndItemsNullableProp == null) { + this.arrayAndItemsNullableProp = new ArrayList(); + } + this.arrayAndItemsNullableProp.add(arrayAndItemsNullablePropItem); + return this; + } + + /** + * Get arrayAndItemsNullableProp + * @return arrayAndItemsNullableProp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getArrayAndItemsNullableProp() { + return arrayAndItemsNullableProp; + } + + + public void setArrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + } + + + public NullableClass arrayItemsNullable(List arrayItemsNullable) { + + this.arrayItemsNullable = arrayItemsNullable; + return this; + } + + public NullableClass addArrayItemsNullableItem(Object arrayItemsNullableItem) { + if (this.arrayItemsNullable == null) { + this.arrayItemsNullable = new ArrayList(); + } + this.arrayItemsNullable.add(arrayItemsNullableItem); + return this; + } + + /** + * Get arrayItemsNullable + * @return arrayItemsNullable + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getArrayItemsNullable() { + return arrayItemsNullable; + } + + + public void setArrayItemsNullable(List arrayItemsNullable) { + this.arrayItemsNullable = arrayItemsNullable; + } + + + public NullableClass objectNullableProp(Map objectNullableProp) { + + this.objectNullableProp = objectNullableProp; + return this; + } + + public NullableClass putObjectNullablePropItem(String key, Object objectNullablePropItem) { + if (this.objectNullableProp == null) { + this.objectNullableProp = new HashMap(); + } + this.objectNullableProp.put(key, objectNullablePropItem); + return this; + } + + /** + * Get objectNullableProp + * @return objectNullableProp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Map getObjectNullableProp() { + return objectNullableProp; + } + + + public void setObjectNullableProp(Map objectNullableProp) { + this.objectNullableProp = objectNullableProp; + } + + + public NullableClass objectAndItemsNullableProp(Map objectAndItemsNullableProp) { + + this.objectAndItemsNullableProp = objectAndItemsNullableProp; + return this; + } + + public NullableClass putObjectAndItemsNullablePropItem(String key, Object objectAndItemsNullablePropItem) { + if (this.objectAndItemsNullableProp == null) { + this.objectAndItemsNullableProp = new HashMap(); + } + this.objectAndItemsNullableProp.put(key, objectAndItemsNullablePropItem); + return this; + } + + /** + * Get objectAndItemsNullableProp + * @return objectAndItemsNullableProp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Map getObjectAndItemsNullableProp() { + return objectAndItemsNullableProp; + } + + + public void setObjectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = objectAndItemsNullableProp; + } + + + public NullableClass objectItemsNullable(Map objectItemsNullable) { + + this.objectItemsNullable = objectItemsNullable; + return this; + } + + public NullableClass putObjectItemsNullableItem(String key, Object objectItemsNullableItem) { + if (this.objectItemsNullable == null) { + this.objectItemsNullable = new HashMap(); + } + this.objectItemsNullable.put(key, objectItemsNullableItem); + return this; + } + + /** + * Get objectItemsNullable + * @return objectItemsNullable + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Map getObjectItemsNullable() { + return objectItemsNullable; + } + + + public void setObjectItemsNullable(Map objectItemsNullable) { + this.objectItemsNullable = objectItemsNullable; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NullableClass nullableClass = (NullableClass) o; + return Objects.equals(this.integerProp, nullableClass.integerProp) && + Objects.equals(this.numberProp, nullableClass.numberProp) && + Objects.equals(this.booleanProp, nullableClass.booleanProp) && + Objects.equals(this.stringProp, nullableClass.stringProp) && + Objects.equals(this.dateProp, nullableClass.dateProp) && + Objects.equals(this.datetimeProp, nullableClass.datetimeProp) && + Objects.equals(this.arrayNullableProp, nullableClass.arrayNullableProp) && + Objects.equals(this.arrayAndItemsNullableProp, nullableClass.arrayAndItemsNullableProp) && + Objects.equals(this.arrayItemsNullable, nullableClass.arrayItemsNullable) && + Objects.equals(this.objectNullableProp, nullableClass.objectNullableProp) && + Objects.equals(this.objectAndItemsNullableProp, nullableClass.objectAndItemsNullableProp) && + Objects.equals(this.objectItemsNullable, nullableClass.objectItemsNullable) && + super.equals(o); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(integerProp, numberProp, booleanProp, stringProp, dateProp, datetimeProp, arrayNullableProp, arrayAndItemsNullableProp, arrayItemsNullable, objectNullableProp, objectAndItemsNullableProp, objectItemsNullable, super.hashCode()); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NullableClass {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" integerProp: ").append(toIndentedString(integerProp)).append("\n"); + sb.append(" numberProp: ").append(toIndentedString(numberProp)).append("\n"); + sb.append(" booleanProp: ").append(toIndentedString(booleanProp)).append("\n"); + sb.append(" stringProp: ").append(toIndentedString(stringProp)).append("\n"); + sb.append(" dateProp: ").append(toIndentedString(dateProp)).append("\n"); + sb.append(" datetimeProp: ").append(toIndentedString(datetimeProp)).append("\n"); + sb.append(" arrayNullableProp: ").append(toIndentedString(arrayNullableProp)).append("\n"); + sb.append(" arrayAndItemsNullableProp: ").append(toIndentedString(arrayAndItemsNullableProp)).append("\n"); + sb.append(" arrayItemsNullable: ").append(toIndentedString(arrayItemsNullable)).append("\n"); + sb.append(" objectNullableProp: ").append(toIndentedString(objectNullableProp)).append("\n"); + sb.append(" objectAndItemsNullableProp: ").append(toIndentedString(objectAndItemsNullableProp)).append("\n"); + sb.append(" objectItemsNullable: ").append(toIndentedString(objectItemsNullable)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("integer_prop"); + openapiFields.add("number_prop"); + openapiFields.add("boolean_prop"); + openapiFields.add("string_prop"); + openapiFields.add("date_prop"); + openapiFields.add("datetime_prop"); + openapiFields.add("array_nullable_prop"); + openapiFields.add("array_and_items_nullable_prop"); + openapiFields.add("array_items_nullable"); + openapiFields.add("object_nullable_prop"); + openapiFields.add("object_and_items_nullable_prop"); + openapiFields.add("object_items_nullable"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NullableClass.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NullableClass' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NullableClass.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NullableClass value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NullableClass read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!NullableClass.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `NullableClass` properties"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java new file mode 100644 index 000000000000..67b42a305722 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java @@ -0,0 +1,225 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.Quadrilateral; +import org.openapitools.client.model.Triangle; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class NullableShape extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(NullableShape.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NullableShape.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NullableShape' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterQuadrilateral = gson.getDelegateAdapter(this, TypeToken.get(Quadrilateral.class)); + final TypeAdapter adapterTriangle = gson.getDelegateAdapter(this, TypeToken.get(Triangle.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NullableShape value) throws IOException { + // check if the actual instance is of the type `Quadrilateral` + if (value.getActualInstance() instanceof Quadrilateral) { + JsonObject obj = adapterQuadrilateral.toJsonTree((Quadrilateral)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + // check if the actual instance is of the type `Triangle` + if (value.getActualInstance() instanceof Triangle) { + JsonObject obj = adapterTriangle.toJsonTree((Triangle)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: Quadrilateral, Triangle"); + } + + @Override + public NullableShape read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + + // deserialize Quadrilateral + try { + deserialized = adapterQuadrilateral.fromJsonTree(jsonObject); + match++; + log.log(Level.FINER, "Input data matches schema 'Quadrilateral'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Quadrilateral'", e); + } + + // deserialize Triangle + try { + deserialized = adapterTriangle.fromJsonTree(jsonObject); + match++; + log.log(Level.FINER, "Input data matches schema 'Triangle'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Triangle'", e); + } + + if (match == 1) { + NullableShape ret = new NullableShape(); + ret.setActualInstance(deserialized); + return ret; + } + + throw new IOException(String.format("Failed deserialization for NullableShape: %d classes match result, expected 1", match)); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public NullableShape() { + super("oneOf", Boolean.TRUE); + } + + public NullableShape(Quadrilateral o) { + super("oneOf", Boolean.TRUE); + setActualInstance(o); + } + + public NullableShape(Triangle o) { + super("oneOf", Boolean.TRUE); + setActualInstance(o); + } + + static { + schemas.put("Quadrilateral", new GenericType() { + }); + schemas.put("Triangle", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return NullableShape.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Quadrilateral, Triangle + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance == null) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Quadrilateral) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Triangle) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Quadrilateral, Triangle"); + } + + /** + * Get the actual instance, which can be the following: + * Quadrilateral, Triangle + * + * @return The actual instance (Quadrilateral, Triangle) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Quadrilateral` + * @throws ClassCastException if the instance is not `Quadrilateral` + */ + public Quadrilateral getQuadrilateral() throws ClassCastException { + return (Quadrilateral)super.getActualInstance(); + } + + /** + * Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Triangle` + * @throws ClassCastException if the instance is not `Triangle` + */ + public Triangle getTriangle() throws ClassCastException { + return (Triangle)super.getActualInstance(); + } + +} + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NumberOnly.java new file mode 100644 index 000000000000..7dc78d63d078 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -0,0 +1,163 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * NumberOnly + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class NumberOnly { + public static final String SERIALIZED_NAME_JUST_NUMBER = "JustNumber"; + @SerializedName(SERIALIZED_NAME_JUST_NUMBER) + private BigDecimal justNumber; + + public NumberOnly() { + } + + public NumberOnly justNumber(BigDecimal justNumber) { + + this.justNumber = justNumber; + return this; + } + + /** + * Get justNumber + * @return justNumber + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public BigDecimal getJustNumber() { + return justNumber; + } + + + public void setJustNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NumberOnly numberOnly = (NumberOnly) o; + return Objects.equals(this.justNumber, numberOnly.justNumber); + } + + @Override + public int hashCode() { + return Objects.hash(justNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberOnly {\n"); + sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("JustNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NumberOnly.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NumberOnly' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NumberOnly.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NumberOnly value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NumberOnly read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!NumberOnly.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `NumberOnly` properties"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java new file mode 100644 index 000000000000..654a4415afb5 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -0,0 +1,270 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.DeprecatedObject; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * ObjectWithDeprecatedFields + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ObjectWithDeprecatedFields { + public static final String SERIALIZED_NAME_UUID = "uuid"; + @SerializedName(SERIALIZED_NAME_UUID) + private String uuid; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private BigDecimal id; + + public static final String SERIALIZED_NAME_DEPRECATED_REF = "deprecatedRef"; + @SerializedName(SERIALIZED_NAME_DEPRECATED_REF) + private DeprecatedObject deprecatedRef; + + public static final String SERIALIZED_NAME_BARS = "bars"; + @SerializedName(SERIALIZED_NAME_BARS) + private List bars = null; + + public ObjectWithDeprecatedFields() { + } + + public ObjectWithDeprecatedFields uuid(String uuid) { + + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getUuid() { + return uuid; + } + + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + + public ObjectWithDeprecatedFields id(BigDecimal id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + * @deprecated + **/ + @Deprecated + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public BigDecimal getId() { + return id; + } + + + public void setId(BigDecimal id) { + this.id = id; + } + + + public ObjectWithDeprecatedFields deprecatedRef(DeprecatedObject deprecatedRef) { + + this.deprecatedRef = deprecatedRef; + return this; + } + + /** + * Get deprecatedRef + * @return deprecatedRef + * @deprecated + **/ + @Deprecated + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public DeprecatedObject getDeprecatedRef() { + return deprecatedRef; + } + + + public void setDeprecatedRef(DeprecatedObject deprecatedRef) { + this.deprecatedRef = deprecatedRef; + } + + + public ObjectWithDeprecatedFields bars(List bars) { + + this.bars = bars; + return this; + } + + public ObjectWithDeprecatedFields addBarsItem(String barsItem) { + if (this.bars == null) { + this.bars = new ArrayList(); + } + this.bars.add(barsItem); + return this; + } + + /** + * Get bars + * @return bars + * @deprecated + **/ + @Deprecated + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getBars() { + return bars; + } + + + public void setBars(List bars) { + this.bars = bars; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObjectWithDeprecatedFields objectWithDeprecatedFields = (ObjectWithDeprecatedFields) o; + return Objects.equals(this.uuid, objectWithDeprecatedFields.uuid) && + Objects.equals(this.id, objectWithDeprecatedFields.id) && + Objects.equals(this.deprecatedRef, objectWithDeprecatedFields.deprecatedRef) && + Objects.equals(this.bars, objectWithDeprecatedFields.bars); + } + + @Override + public int hashCode() { + return Objects.hash(uuid, id, deprecatedRef, bars); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObjectWithDeprecatedFields {\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" deprecatedRef: ").append(toIndentedString(deprecatedRef)).append("\n"); + sb.append(" bars: ").append(toIndentedString(bars)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("uuid"); + openapiFields.add("id"); + openapiFields.add("deprecatedRef"); + openapiFields.add("bars"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ObjectWithDeprecatedFields.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ObjectWithDeprecatedFields' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ObjectWithDeprecatedFields.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ObjectWithDeprecatedFields value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ObjectWithDeprecatedFields read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!ObjectWithDeprecatedFields.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ObjectWithDeprecatedFields` properties"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Order.java new file mode 100644 index 000000000000..531e45320f08 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Order.java @@ -0,0 +1,362 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * Order + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Order { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private Long id; + + public static final String SERIALIZED_NAME_PET_ID = "petId"; + @SerializedName(SERIALIZED_NAME_PET_ID) + private Long petId; + + public static final String SERIALIZED_NAME_QUANTITY = "quantity"; + @SerializedName(SERIALIZED_NAME_QUANTITY) + private Integer quantity; + + public static final String SERIALIZED_NAME_SHIP_DATE = "shipDate"; + @SerializedName(SERIALIZED_NAME_SHIP_DATE) + private OffsetDateTime shipDate; + + /** + * Order Status + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_COMPLETE = "complete"; + @SerializedName(SERIALIZED_NAME_COMPLETE) + private Boolean complete = false; + + public Order() { + } + + public Order id(Long id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Long getId() { + return id; + } + + + public void setId(Long id) { + this.id = id; + } + + + public Order petId(Long petId) { + + this.petId = petId; + return this; + } + + /** + * Get petId + * @return petId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Long getPetId() { + return petId; + } + + + public void setPetId(Long petId) { + this.petId = petId; + } + + + public Order quantity(Integer quantity) { + + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * @return quantity + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Integer getQuantity() { + return quantity; + } + + + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + + public Order shipDate(OffsetDateTime shipDate) { + + this.shipDate = shipDate; + return this; + } + + /** + * Get shipDate + * @return shipDate + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "2020-02-02T20:20:20.000222Z", value = "") + + public OffsetDateTime getShipDate() { + return shipDate; + } + + + public void setShipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; + } + + + public Order status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Order Status + * @return status + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Order Status") + + public StatusEnum getStatus() { + return status; + } + + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public Order complete(Boolean complete) { + + this.complete = complete; + return this; + } + + /** + * Get complete + * @return complete + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Boolean getComplete() { + return complete; + } + + + public void setComplete(Boolean complete) { + this.complete = complete; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Order order = (Order) o; + return Objects.equals(this.id, order.id) && + Objects.equals(this.petId, order.petId) && + Objects.equals(this.quantity, order.quantity) && + Objects.equals(this.shipDate, order.shipDate) && + Objects.equals(this.status, order.status) && + Objects.equals(this.complete, order.complete); + } + + @Override + public int hashCode() { + return Objects.hash(id, petId, quantity, shipDate, status, complete); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("petId"); + openapiFields.add("quantity"); + openapiFields.add("shipDate"); + openapiFields.add("status"); + openapiFields.add("complete"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Order.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Order' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Order.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Order value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Order read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!Order.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Order` properties"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterComposite.java new file mode 100644 index 000000000000..c0f8c964ff91 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -0,0 +1,223 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * OuterComposite + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class OuterComposite { + public static final String SERIALIZED_NAME_MY_NUMBER = "my_number"; + @SerializedName(SERIALIZED_NAME_MY_NUMBER) + private BigDecimal myNumber; + + public static final String SERIALIZED_NAME_MY_STRING = "my_string"; + @SerializedName(SERIALIZED_NAME_MY_STRING) + private String myString; + + public static final String SERIALIZED_NAME_MY_BOOLEAN = "my_boolean"; + @SerializedName(SERIALIZED_NAME_MY_BOOLEAN) + private Boolean myBoolean; + + public OuterComposite() { + } + + public OuterComposite myNumber(BigDecimal myNumber) { + + this.myNumber = myNumber; + return this; + } + + /** + * Get myNumber + * @return myNumber + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public BigDecimal getMyNumber() { + return myNumber; + } + + + public void setMyNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + } + + + public OuterComposite myString(String myString) { + + this.myString = myString; + return this; + } + + /** + * Get myString + * @return myString + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getMyString() { + return myString; + } + + + public void setMyString(String myString) { + this.myString = myString; + } + + + public OuterComposite myBoolean(Boolean myBoolean) { + + this.myBoolean = myBoolean; + return this; + } + + /** + * Get myBoolean + * @return myBoolean + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Boolean getMyBoolean() { + return myBoolean; + } + + + public void setMyBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterComposite outerComposite = (OuterComposite) o; + return Objects.equals(this.myNumber, outerComposite.myNumber) && + Objects.equals(this.myString, outerComposite.myString) && + Objects.equals(this.myBoolean, outerComposite.myBoolean); + } + + @Override + public int hashCode() { + return Objects.hash(myNumber, myString, myBoolean); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterComposite {\n"); + sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); + sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); + sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("my_number"); + openapiFields.add("my_string"); + openapiFields.add("my_boolean"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OuterComposite.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OuterComposite' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OuterComposite.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OuterComposite value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OuterComposite read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!OuterComposite.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `OuterComposite` properties"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterEnum.java new file mode 100644 index 000000000000..c4e27915c8aa --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -0,0 +1,75 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets OuterEnum + */ +@JsonAdapter(OuterEnum.Adapter.class) +public enum OuterEnum { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static OuterEnum fromValue(String value) { + for (OuterEnum b : OuterEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final OuterEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public OuterEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return OuterEnum.fromValue(value); + } + } +} + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java new file mode 100644 index 000000000000..3345a76b104b --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java @@ -0,0 +1,75 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets OuterEnumDefaultValue + */ +@JsonAdapter(OuterEnumDefaultValue.Adapter.class) +public enum OuterEnumDefaultValue { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnumDefaultValue(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static OuterEnumDefaultValue fromValue(String value) { + for (OuterEnumDefaultValue b : OuterEnumDefaultValue.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final OuterEnumDefaultValue enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public OuterEnumDefaultValue read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return OuterEnumDefaultValue.fromValue(value); + } + } +} + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterEnumInteger.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterEnumInteger.java new file mode 100644 index 000000000000..a62c0647099d --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterEnumInteger.java @@ -0,0 +1,75 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets OuterEnumInteger + */ +@JsonAdapter(OuterEnumInteger.Adapter.class) +public enum OuterEnumInteger { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + OuterEnumInteger(Integer value) { + this.value = value; + } + + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static OuterEnumInteger fromValue(Integer value) { + for (OuterEnumInteger b : OuterEnumInteger.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final OuterEnumInteger enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public OuterEnumInteger read(final JsonReader jsonReader) throws IOException { + Integer value = jsonReader.nextInt(); + return OuterEnumInteger.fromValue(value); + } + } +} + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java new file mode 100644 index 000000000000..862cb38bbfb9 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java @@ -0,0 +1,75 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets OuterEnumIntegerDefaultValue + */ +@JsonAdapter(OuterEnumIntegerDefaultValue.Adapter.class) +public enum OuterEnumIntegerDefaultValue { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + OuterEnumIntegerDefaultValue(Integer value) { + this.value = value; + } + + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static OuterEnumIntegerDefaultValue fromValue(Integer value) { + for (OuterEnumIntegerDefaultValue b : OuterEnumIntegerDefaultValue.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final OuterEnumIntegerDefaultValue enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public OuterEnumIntegerDefaultValue read(final JsonReader jsonReader) throws IOException { + Integer value = jsonReader.nextInt(); + return OuterEnumIntegerDefaultValue.fromValue(value); + } + } +} + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ParentPet.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ParentPet.java new file mode 100644 index 000000000000..f96071be437a --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ParentPet.java @@ -0,0 +1,144 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.GrandparentAnimal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * ParentPet + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ParentPet extends GrandparentAnimal { + public ParentPet() { + this.petType = this.getClass().getSimpleName(); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ParentPet {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("pet_type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("pet_type"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ParentPet.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ParentPet' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ParentPet.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ParentPet value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ParentPet read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!ParentPet.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ParentPet` properties"); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ParentPet.openapiRequiredFields) { + if (obj.get(requiredField) == null) { + throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pet.java new file mode 100644 index 000000000000..5d0065de40dd --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pet.java @@ -0,0 +1,387 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.Category; +import org.openapitools.client.model.Tag; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * Pet + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Pet { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private Long id; + + public static final String SERIALIZED_NAME_CATEGORY = "category"; + @SerializedName(SERIALIZED_NAME_CATEGORY) + private Category category; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_PHOTO_URLS = "photoUrls"; + @SerializedName(SERIALIZED_NAME_PHOTO_URLS) + private List photoUrls = new ArrayList(); + + public static final String SERIALIZED_NAME_TAGS = "tags"; + @SerializedName(SERIALIZED_NAME_TAGS) + private List tags = null; + + /** + * pet status in the store + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + AVAILABLE("available"), + + PENDING("pending"), + + SOLD("sold"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public Pet() { + } + + public Pet id(Long id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Long getId() { + return id; + } + + + public void setId(Long id) { + this.id = id; + } + + + public Pet category(Category category) { + + this.category = category; + return this; + } + + /** + * Get category + * @return category + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Category getCategory() { + return category; + } + + + public void setCategory(Category category) { + this.category = category; + } + + + public Pet name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nonnull + @ApiModelProperty(example = "doggie", required = true, value = "") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public Pet photoUrls(List photoUrls) { + + this.photoUrls = photoUrls; + return this; + } + + public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get photoUrls + * @return photoUrls + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public List getPhotoUrls() { + return photoUrls; + } + + + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + + public Pet tags(List tags) { + + this.tags = tags; + return this; + } + + public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Get tags + * @return tags + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public List getTags() { + return tags; + } + + + public void setTags(List tags) { + this.tags = tags; + } + + + public Pet status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * pet status in the store + * @return status + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "pet status in the store") + + public StatusEnum getStatus() { + return status; + } + + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pet pet = (Pet) o; + return Objects.equals(this.id, pet.id) && + Objects.equals(this.category, pet.category) && + Objects.equals(this.name, pet.name) && + Objects.equals(this.photoUrls, pet.photoUrls) && + Objects.equals(this.tags, pet.tags) && + Objects.equals(this.status, pet.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, photoUrls, tags, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("category"); + openapiFields.add("name"); + openapiFields.add("photoUrls"); + openapiFields.add("tags"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("photoUrls"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Pet.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Pet' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Pet.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Pet value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Pet read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!Pet.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Pet` properties"); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Pet.openapiRequiredFields) { + if (obj.get(requiredField) == null) { + throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java new file mode 100644 index 000000000000..ea0b58cbf909 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java @@ -0,0 +1,220 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.BasquePig; +import org.openapitools.client.model.DanishPig; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Pig extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Pig.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Pig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Pig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterBasquePig = gson.getDelegateAdapter(this, TypeToken.get(BasquePig.class)); + final TypeAdapter adapterDanishPig = gson.getDelegateAdapter(this, TypeToken.get(DanishPig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Pig value) throws IOException { + // check if the actual instance is of the type `BasquePig` + if (value.getActualInstance() instanceof BasquePig) { + JsonObject obj = adapterBasquePig.toJsonTree((BasquePig)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + // check if the actual instance is of the type `DanishPig` + if (value.getActualInstance() instanceof DanishPig) { + JsonObject obj = adapterDanishPig.toJsonTree((DanishPig)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: BasquePig, DanishPig"); + } + + @Override + public Pig read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + + // deserialize BasquePig + try { + deserialized = adapterBasquePig.fromJsonTree(jsonObject); + match++; + log.log(Level.FINER, "Input data matches schema 'BasquePig'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'BasquePig'", e); + } + + // deserialize DanishPig + try { + deserialized = adapterDanishPig.fromJsonTree(jsonObject); + match++; + log.log(Level.FINER, "Input data matches schema 'DanishPig'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'DanishPig'", e); + } + + if (match == 1) { + Pig ret = new Pig(); + ret.setActualInstance(deserialized); + return ret; + } + + throw new IOException(String.format("Failed deserialization for Pig: %d classes match result, expected 1", match)); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public Pig() { + super("oneOf", Boolean.FALSE); + } + + public Pig(BasquePig o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Pig(DanishPig o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("BasquePig", new GenericType() { + }); + schemas.put("DanishPig", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return Pig.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * BasquePig, DanishPig + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof BasquePig) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof DanishPig) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be BasquePig, DanishPig"); + } + + /** + * Get the actual instance, which can be the following: + * BasquePig, DanishPig + * + * @return The actual instance (BasquePig, DanishPig) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `BasquePig`. If the actual instance is not `BasquePig`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `BasquePig` + * @throws ClassCastException if the instance is not `BasquePig` + */ + public BasquePig getBasquePig() throws ClassCastException { + return (BasquePig)super.getActualInstance(); + } + + /** + * Get the actual instance of `DanishPig`. If the actual instance is not `DanishPig`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `DanishPig` + * @throws ClassCastException if the instance is not `DanishPig` + */ + public DanishPig getDanishPig() throws ClassCastException { + return (DanishPig)super.getActualInstance(); + } + +} + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java new file mode 100644 index 000000000000..b91dda2eece6 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java @@ -0,0 +1,220 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.ComplexQuadrilateral; +import org.openapitools.client.model.SimpleQuadrilateral; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Quadrilateral extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Quadrilateral.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Quadrilateral.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Quadrilateral' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterComplexQuadrilateral = gson.getDelegateAdapter(this, TypeToken.get(ComplexQuadrilateral.class)); + final TypeAdapter adapterSimpleQuadrilateral = gson.getDelegateAdapter(this, TypeToken.get(SimpleQuadrilateral.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Quadrilateral value) throws IOException { + // check if the actual instance is of the type `ComplexQuadrilateral` + if (value.getActualInstance() instanceof ComplexQuadrilateral) { + JsonObject obj = adapterComplexQuadrilateral.toJsonTree((ComplexQuadrilateral)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + // check if the actual instance is of the type `SimpleQuadrilateral` + if (value.getActualInstance() instanceof SimpleQuadrilateral) { + JsonObject obj = adapterSimpleQuadrilateral.toJsonTree((SimpleQuadrilateral)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: ComplexQuadrilateral, SimpleQuadrilateral"); + } + + @Override + public Quadrilateral read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + + // deserialize ComplexQuadrilateral + try { + deserialized = adapterComplexQuadrilateral.fromJsonTree(jsonObject); + match++; + log.log(Level.FINER, "Input data matches schema 'ComplexQuadrilateral'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'ComplexQuadrilateral'", e); + } + + // deserialize SimpleQuadrilateral + try { + deserialized = adapterSimpleQuadrilateral.fromJsonTree(jsonObject); + match++; + log.log(Level.FINER, "Input data matches schema 'SimpleQuadrilateral'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'SimpleQuadrilateral'", e); + } + + if (match == 1) { + Quadrilateral ret = new Quadrilateral(); + ret.setActualInstance(deserialized); + return ret; + } + + throw new IOException(String.format("Failed deserialization for Quadrilateral: %d classes match result, expected 1", match)); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public Quadrilateral() { + super("oneOf", Boolean.FALSE); + } + + public Quadrilateral(ComplexQuadrilateral o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Quadrilateral(SimpleQuadrilateral o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("ComplexQuadrilateral", new GenericType() { + }); + schemas.put("SimpleQuadrilateral", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return Quadrilateral.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * ComplexQuadrilateral, SimpleQuadrilateral + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof ComplexQuadrilateral) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof SimpleQuadrilateral) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be ComplexQuadrilateral, SimpleQuadrilateral"); + } + + /** + * Get the actual instance, which can be the following: + * ComplexQuadrilateral, SimpleQuadrilateral + * + * @return The actual instance (ComplexQuadrilateral, SimpleQuadrilateral) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `ComplexQuadrilateral`. If the actual instance is not `ComplexQuadrilateral`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ComplexQuadrilateral` + * @throws ClassCastException if the instance is not `ComplexQuadrilateral` + */ + public ComplexQuadrilateral getComplexQuadrilateral() throws ClassCastException { + return (ComplexQuadrilateral)super.getActualInstance(); + } + + /** + * Get the actual instance of `SimpleQuadrilateral`. If the actual instance is not `SimpleQuadrilateral`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `SimpleQuadrilateral` + * @throws ClassCastException if the instance is not `SimpleQuadrilateral` + */ + public SimpleQuadrilateral getSimpleQuadrilateral() throws ClassCastException { + return (SimpleQuadrilateral)super.getActualInstance(); + } + +} + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java new file mode 100644 index 000000000000..e6fc7e3d3484 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java @@ -0,0 +1,170 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * QuadrilateralInterface + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class QuadrilateralInterface { + public static final String SERIALIZED_NAME_QUADRILATERAL_TYPE = "quadrilateralType"; + @SerializedName(SERIALIZED_NAME_QUADRILATERAL_TYPE) + private String quadrilateralType; + + public QuadrilateralInterface() { + } + + public QuadrilateralInterface quadrilateralType(String quadrilateralType) { + + this.quadrilateralType = quadrilateralType; + return this; + } + + /** + * Get quadrilateralType + * @return quadrilateralType + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getQuadrilateralType() { + return quadrilateralType; + } + + + public void setQuadrilateralType(String quadrilateralType) { + this.quadrilateralType = quadrilateralType; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QuadrilateralInterface quadrilateralInterface = (QuadrilateralInterface) o; + return Objects.equals(this.quadrilateralType, quadrilateralInterface.quadrilateralType); + } + + @Override + public int hashCode() { + return Objects.hash(quadrilateralType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QuadrilateralInterface {\n"); + sb.append(" quadrilateralType: ").append(toIndentedString(quadrilateralType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("quadrilateralType"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("quadrilateralType"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!QuadrilateralInterface.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QuadrilateralInterface' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(QuadrilateralInterface.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, QuadrilateralInterface value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public QuadrilateralInterface read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!QuadrilateralInterface.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `QuadrilateralInterface` properties"); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : QuadrilateralInterface.openapiRequiredFields) { + if (obj.get(requiredField) == null) { + throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java new file mode 100644 index 000000000000..d842df280faf --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -0,0 +1,191 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * ReadOnlyFirst + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ReadOnlyFirst { + public static final String SERIALIZED_NAME_BAR = "bar"; + @SerializedName(SERIALIZED_NAME_BAR) + private String bar; + + public static final String SERIALIZED_NAME_BAZ = "baz"; + @SerializedName(SERIALIZED_NAME_BAZ) + private String baz; + + public ReadOnlyFirst() { + } + + + public ReadOnlyFirst( + String bar + ) { + this(); + this.bar = bar; + } + + /** + * Get bar + * @return bar + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getBar() { + return bar; + } + + + + + public ReadOnlyFirst baz(String baz) { + + this.baz = baz; + return this; + } + + /** + * Get baz + * @return baz + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getBaz() { + return baz; + } + + + public void setBaz(String baz) { + this.baz = baz; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; + return Objects.equals(this.bar, readOnlyFirst.bar) && + Objects.equals(this.baz, readOnlyFirst.baz); + } + + @Override + public int hashCode() { + return Objects.hash(bar, baz); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadOnlyFirst {\n"); + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("bar"); + openapiFields.add("baz"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReadOnlyFirst.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReadOnlyFirst' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReadOnlyFirst.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReadOnlyFirst value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ReadOnlyFirst read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!ReadOnlyFirst.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ReadOnlyFirst` properties"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ScaleneTriangle.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ScaleneTriangle.java new file mode 100644 index 000000000000..f7dec655276a --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ScaleneTriangle.java @@ -0,0 +1,203 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.ShapeInterface; +import org.openapitools.client.model.TriangleInterface; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * ScaleneTriangle + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ScaleneTriangle { + public static final String SERIALIZED_NAME_SHAPE_TYPE = "shapeType"; + @SerializedName(SERIALIZED_NAME_SHAPE_TYPE) + private String shapeType; + + public static final String SERIALIZED_NAME_TRIANGLE_TYPE = "triangleType"; + @SerializedName(SERIALIZED_NAME_TRIANGLE_TYPE) + private String triangleType; + + public ScaleneTriangle() { + } + + public ScaleneTriangle shapeType(String shapeType) { + + this.shapeType = shapeType; + return this; + } + + /** + * Get shapeType + * @return shapeType + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getShapeType() { + return shapeType; + } + + + public void setShapeType(String shapeType) { + this.shapeType = shapeType; + } + + + public ScaleneTriangle triangleType(String triangleType) { + + this.triangleType = triangleType; + return this; + } + + /** + * Get triangleType + * @return triangleType + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getTriangleType() { + return triangleType; + } + + + public void setTriangleType(String triangleType) { + this.triangleType = triangleType; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ScaleneTriangle scaleneTriangle = (ScaleneTriangle) o; + return Objects.equals(this.shapeType, scaleneTriangle.shapeType) && + Objects.equals(this.triangleType, scaleneTriangle.triangleType); + } + + @Override + public int hashCode() { + return Objects.hash(shapeType, triangleType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ScaleneTriangle {\n"); + sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); + sb.append(" triangleType: ").append(toIndentedString(triangleType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("shapeType"); + openapiFields.add("triangleType"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("shapeType"); + openapiRequiredFields.add("triangleType"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ScaleneTriangle.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ScaleneTriangle' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ScaleneTriangle.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ScaleneTriangle value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ScaleneTriangle read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!ScaleneTriangle.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ScaleneTriangle` properties"); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ScaleneTriangle.openapiRequiredFields) { + if (obj.get(requiredField) == null) { + throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java new file mode 100644 index 000000000000..df7274029b25 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java @@ -0,0 +1,220 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.Quadrilateral; +import org.openapitools.client.model.Triangle; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Shape extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Shape.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Shape.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Shape' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterQuadrilateral = gson.getDelegateAdapter(this, TypeToken.get(Quadrilateral.class)); + final TypeAdapter adapterTriangle = gson.getDelegateAdapter(this, TypeToken.get(Triangle.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Shape value) throws IOException { + // check if the actual instance is of the type `Quadrilateral` + if (value.getActualInstance() instanceof Quadrilateral) { + JsonObject obj = adapterQuadrilateral.toJsonTree((Quadrilateral)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + // check if the actual instance is of the type `Triangle` + if (value.getActualInstance() instanceof Triangle) { + JsonObject obj = adapterTriangle.toJsonTree((Triangle)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: Quadrilateral, Triangle"); + } + + @Override + public Shape read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + + // deserialize Quadrilateral + try { + deserialized = adapterQuadrilateral.fromJsonTree(jsonObject); + match++; + log.log(Level.FINER, "Input data matches schema 'Quadrilateral'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Quadrilateral'", e); + } + + // deserialize Triangle + try { + deserialized = adapterTriangle.fromJsonTree(jsonObject); + match++; + log.log(Level.FINER, "Input data matches schema 'Triangle'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Triangle'", e); + } + + if (match == 1) { + Shape ret = new Shape(); + ret.setActualInstance(deserialized); + return ret; + } + + throw new IOException(String.format("Failed deserialization for Shape: %d classes match result, expected 1", match)); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public Shape() { + super("oneOf", Boolean.FALSE); + } + + public Shape(Quadrilateral o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Shape(Triangle o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Quadrilateral", new GenericType() { + }); + schemas.put("Triangle", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return Shape.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Quadrilateral, Triangle + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Quadrilateral) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Triangle) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Quadrilateral, Triangle"); + } + + /** + * Get the actual instance, which can be the following: + * Quadrilateral, Triangle + * + * @return The actual instance (Quadrilateral, Triangle) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Quadrilateral` + * @throws ClassCastException if the instance is not `Quadrilateral` + */ + public Quadrilateral getQuadrilateral() throws ClassCastException { + return (Quadrilateral)super.getActualInstance(); + } + + /** + * Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Triangle` + * @throws ClassCastException if the instance is not `Triangle` + */ + public Triangle getTriangle() throws ClassCastException { + return (Triangle)super.getActualInstance(); + } + +} + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeInterface.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeInterface.java new file mode 100644 index 000000000000..628c2f7af2b2 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeInterface.java @@ -0,0 +1,170 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * ShapeInterface + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ShapeInterface { + public static final String SERIALIZED_NAME_SHAPE_TYPE = "shapeType"; + @SerializedName(SERIALIZED_NAME_SHAPE_TYPE) + private String shapeType; + + public ShapeInterface() { + } + + public ShapeInterface shapeType(String shapeType) { + + this.shapeType = shapeType; + return this; + } + + /** + * Get shapeType + * @return shapeType + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getShapeType() { + return shapeType; + } + + + public void setShapeType(String shapeType) { + this.shapeType = shapeType; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ShapeInterface shapeInterface = (ShapeInterface) o; + return Objects.equals(this.shapeType, shapeInterface.shapeType); + } + + @Override + public int hashCode() { + return Objects.hash(shapeType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ShapeInterface {\n"); + sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("shapeType"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("shapeType"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ShapeInterface.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ShapeInterface' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ShapeInterface.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ShapeInterface value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ShapeInterface read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!ShapeInterface.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ShapeInterface` properties"); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ShapeInterface.openapiRequiredFields) { + if (obj.get(requiredField) == null) { + throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java new file mode 100644 index 000000000000..7c6f090482a4 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java @@ -0,0 +1,225 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.Quadrilateral; +import org.openapitools.client.model.Triangle; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ShapeOrNull extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(ShapeOrNull.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ShapeOrNull.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ShapeOrNull' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterQuadrilateral = gson.getDelegateAdapter(this, TypeToken.get(Quadrilateral.class)); + final TypeAdapter adapterTriangle = gson.getDelegateAdapter(this, TypeToken.get(Triangle.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ShapeOrNull value) throws IOException { + // check if the actual instance is of the type `Quadrilateral` + if (value.getActualInstance() instanceof Quadrilateral) { + JsonObject obj = adapterQuadrilateral.toJsonTree((Quadrilateral)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + // check if the actual instance is of the type `Triangle` + if (value.getActualInstance() instanceof Triangle) { + JsonObject obj = adapterTriangle.toJsonTree((Triangle)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: Quadrilateral, Triangle"); + } + + @Override + public ShapeOrNull read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + + // deserialize Quadrilateral + try { + deserialized = adapterQuadrilateral.fromJsonTree(jsonObject); + match++; + log.log(Level.FINER, "Input data matches schema 'Quadrilateral'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Quadrilateral'", e); + } + + // deserialize Triangle + try { + deserialized = adapterTriangle.fromJsonTree(jsonObject); + match++; + log.log(Level.FINER, "Input data matches schema 'Triangle'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Triangle'", e); + } + + if (match == 1) { + ShapeOrNull ret = new ShapeOrNull(); + ret.setActualInstance(deserialized); + return ret; + } + + throw new IOException(String.format("Failed deserialization for ShapeOrNull: %d classes match result, expected 1", match)); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public ShapeOrNull() { + super("oneOf", Boolean.TRUE); + } + + public ShapeOrNull(Quadrilateral o) { + super("oneOf", Boolean.TRUE); + setActualInstance(o); + } + + public ShapeOrNull(Triangle o) { + super("oneOf", Boolean.TRUE); + setActualInstance(o); + } + + static { + schemas.put("Quadrilateral", new GenericType() { + }); + schemas.put("Triangle", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return ShapeOrNull.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Quadrilateral, Triangle + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance == null) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Quadrilateral) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Triangle) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Quadrilateral, Triangle"); + } + + /** + * Get the actual instance, which can be the following: + * Quadrilateral, Triangle + * + * @return The actual instance (Quadrilateral, Triangle) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Quadrilateral` + * @throws ClassCastException if the instance is not `Quadrilateral` + */ + public Quadrilateral getQuadrilateral() throws ClassCastException { + return (Quadrilateral)super.getActualInstance(); + } + + /** + * Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Triangle` + * @throws ClassCastException if the instance is not `Triangle` + */ + public Triangle getTriangle() throws ClassCastException { + return (Triangle)super.getActualInstance(); + } + +} + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java new file mode 100644 index 000000000000..064c5f0996ce --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java @@ -0,0 +1,203 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.QuadrilateralInterface; +import org.openapitools.client.model.ShapeInterface; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * SimpleQuadrilateral + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SimpleQuadrilateral { + public static final String SERIALIZED_NAME_SHAPE_TYPE = "shapeType"; + @SerializedName(SERIALIZED_NAME_SHAPE_TYPE) + private String shapeType; + + public static final String SERIALIZED_NAME_QUADRILATERAL_TYPE = "quadrilateralType"; + @SerializedName(SERIALIZED_NAME_QUADRILATERAL_TYPE) + private String quadrilateralType; + + public SimpleQuadrilateral() { + } + + public SimpleQuadrilateral shapeType(String shapeType) { + + this.shapeType = shapeType; + return this; + } + + /** + * Get shapeType + * @return shapeType + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getShapeType() { + return shapeType; + } + + + public void setShapeType(String shapeType) { + this.shapeType = shapeType; + } + + + public SimpleQuadrilateral quadrilateralType(String quadrilateralType) { + + this.quadrilateralType = quadrilateralType; + return this; + } + + /** + * Get quadrilateralType + * @return quadrilateralType + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getQuadrilateralType() { + return quadrilateralType; + } + + + public void setQuadrilateralType(String quadrilateralType) { + this.quadrilateralType = quadrilateralType; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SimpleQuadrilateral simpleQuadrilateral = (SimpleQuadrilateral) o; + return Objects.equals(this.shapeType, simpleQuadrilateral.shapeType) && + Objects.equals(this.quadrilateralType, simpleQuadrilateral.quadrilateralType); + } + + @Override + public int hashCode() { + return Objects.hash(shapeType, quadrilateralType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SimpleQuadrilateral {\n"); + sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); + sb.append(" quadrilateralType: ").append(toIndentedString(quadrilateralType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("shapeType"); + openapiFields.add("quadrilateralType"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("shapeType"); + openapiRequiredFields.add("quadrilateralType"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SimpleQuadrilateral.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SimpleQuadrilateral' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SimpleQuadrilateral.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SimpleQuadrilateral value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SimpleQuadrilateral read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!SimpleQuadrilateral.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `SimpleQuadrilateral` properties"); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SimpleQuadrilateral.openapiRequiredFields) { + if (obj.get(requiredField) == null) { + throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/SpecialModelName.java new file mode 100644 index 000000000000..dfdbc850f430 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -0,0 +1,192 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * SpecialModelName + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SpecialModelName { + public static final String SERIALIZED_NAME_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; + @SerializedName(SERIALIZED_NAME_$_SPECIAL_PROPERTY_NAME) + private Long $specialPropertyName; + + public static final String SERIALIZED_NAME_SPECIAL_MODEL_NAME = "_special_model.name_"; + @SerializedName(SERIALIZED_NAME_SPECIAL_MODEL_NAME) + private String specialModelName; + + public SpecialModelName() { + } + + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + + this.$specialPropertyName = $specialPropertyName; + return this; + } + + /** + * Get $specialPropertyName + * @return $specialPropertyName + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Long get$SpecialPropertyName() { + return $specialPropertyName; + } + + + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + } + + + public SpecialModelName specialModelName(String specialModelName) { + + this.specialModelName = specialModelName; + return this; + } + + /** + * Get specialModelName + * @return specialModelName + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getSpecialModelName() { + return specialModelName; + } + + + public void setSpecialModelName(String specialModelName) { + this.specialModelName = specialModelName; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName) && + Objects.equals(this.specialModelName, specialModelName.specialModelName); + } + + @Override + public int hashCode() { + return Objects.hash($specialPropertyName, specialModelName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialModelName {\n"); + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); + sb.append(" specialModelName: ").append(toIndentedString(specialModelName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("$special[property.name]"); + openapiFields.add("_special_model.name_"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SpecialModelName.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SpecialModelName' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SpecialModelName.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SpecialModelName value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SpecialModelName read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!SpecialModelName.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `SpecialModelName` properties"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Tag.java new file mode 100644 index 000000000000..78ea45ac8617 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Tag.java @@ -0,0 +1,192 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * Tag + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Tag { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private Long id; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public Tag() { + } + + public Tag id(Long id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Long getId() { + return id; + } + + + public void setId(Long id) { + this.id = id; + } + + + public Tag name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Tag tag = (Tag) o; + return Objects.equals(this.id, tag.id) && + Objects.equals(this.name, tag.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Tag.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Tag' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Tag.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Tag value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Tag read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!Tag.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Tag` properties"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java new file mode 100644 index 000000000000..e9e70e6be716 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java @@ -0,0 +1,261 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.EquilateralTriangle; +import org.openapitools.client.model.IsoscelesTriangle; +import org.openapitools.client.model.ScaleneTriangle; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Triangle extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Triangle.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Triangle.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Triangle' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterEquilateralTriangle = gson.getDelegateAdapter(this, TypeToken.get(EquilateralTriangle.class)); + final TypeAdapter adapterIsoscelesTriangle = gson.getDelegateAdapter(this, TypeToken.get(IsoscelesTriangle.class)); + final TypeAdapter adapterScaleneTriangle = gson.getDelegateAdapter(this, TypeToken.get(ScaleneTriangle.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Triangle value) throws IOException { + // check if the actual instance is of the type `EquilateralTriangle` + if (value.getActualInstance() instanceof EquilateralTriangle) { + JsonObject obj = adapterEquilateralTriangle.toJsonTree((EquilateralTriangle)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + // check if the actual instance is of the type `IsoscelesTriangle` + if (value.getActualInstance() instanceof IsoscelesTriangle) { + JsonObject obj = adapterIsoscelesTriangle.toJsonTree((IsoscelesTriangle)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + // check if the actual instance is of the type `ScaleneTriangle` + if (value.getActualInstance() instanceof ScaleneTriangle) { + JsonObject obj = adapterScaleneTriangle.toJsonTree((ScaleneTriangle)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle"); + } + + @Override + public Triangle read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + + // deserialize EquilateralTriangle + try { + deserialized = adapterEquilateralTriangle.fromJsonTree(jsonObject); + match++; + log.log(Level.FINER, "Input data matches schema 'EquilateralTriangle'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'EquilateralTriangle'", e); + } + + // deserialize IsoscelesTriangle + try { + deserialized = adapterIsoscelesTriangle.fromJsonTree(jsonObject); + match++; + log.log(Level.FINER, "Input data matches schema 'IsoscelesTriangle'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'IsoscelesTriangle'", e); + } + + // deserialize ScaleneTriangle + try { + deserialized = adapterScaleneTriangle.fromJsonTree(jsonObject); + match++; + log.log(Level.FINER, "Input data matches schema 'ScaleneTriangle'"); + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'ScaleneTriangle'", e); + } + + if (match == 1) { + Triangle ret = new Triangle(); + ret.setActualInstance(deserialized); + return ret; + } + + throw new IOException(String.format("Failed deserialization for Triangle: %d classes match result, expected 1", match)); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public Triangle() { + super("oneOf", Boolean.FALSE); + } + + public Triangle(EquilateralTriangle o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Triangle(IsoscelesTriangle o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Triangle(ScaleneTriangle o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("EquilateralTriangle", new GenericType() { + }); + schemas.put("IsoscelesTriangle", new GenericType() { + }); + schemas.put("ScaleneTriangle", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return Triangle.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof EquilateralTriangle) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof IsoscelesTriangle) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ScaleneTriangle) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle"); + } + + /** + * Get the actual instance, which can be the following: + * EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle + * + * @return The actual instance (EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `EquilateralTriangle`. If the actual instance is not `EquilateralTriangle`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `EquilateralTriangle` + * @throws ClassCastException if the instance is not `EquilateralTriangle` + */ + public EquilateralTriangle getEquilateralTriangle() throws ClassCastException { + return (EquilateralTriangle)super.getActualInstance(); + } + + /** + * Get the actual instance of `IsoscelesTriangle`. If the actual instance is not `IsoscelesTriangle`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `IsoscelesTriangle` + * @throws ClassCastException if the instance is not `IsoscelesTriangle` + */ + public IsoscelesTriangle getIsoscelesTriangle() throws ClassCastException { + return (IsoscelesTriangle)super.getActualInstance(); + } + + /** + * Get the actual instance of `ScaleneTriangle`. If the actual instance is not `ScaleneTriangle`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ScaleneTriangle` + * @throws ClassCastException if the instance is not `ScaleneTriangle` + */ + public ScaleneTriangle getScaleneTriangle() throws ClassCastException { + return (ScaleneTriangle)super.getActualInstance(); + } + +} + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/TriangleInterface.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/TriangleInterface.java new file mode 100644 index 000000000000..a03456d2a064 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/TriangleInterface.java @@ -0,0 +1,170 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * TriangleInterface + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TriangleInterface { + public static final String SERIALIZED_NAME_TRIANGLE_TYPE = "triangleType"; + @SerializedName(SERIALIZED_NAME_TRIANGLE_TYPE) + private String triangleType; + + public TriangleInterface() { + } + + public TriangleInterface triangleType(String triangleType) { + + this.triangleType = triangleType; + return this; + } + + /** + * Get triangleType + * @return triangleType + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getTriangleType() { + return triangleType; + } + + + public void setTriangleType(String triangleType) { + this.triangleType = triangleType; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TriangleInterface triangleInterface = (TriangleInterface) o; + return Objects.equals(this.triangleType, triangleInterface.triangleType); + } + + @Override + public int hashCode() { + return Objects.hash(triangleType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TriangleInterface {\n"); + sb.append(" triangleType: ").append(toIndentedString(triangleType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("triangleType"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("triangleType"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TriangleInterface.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TriangleInterface' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TriangleInterface.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TriangleInterface value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TriangleInterface read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!TriangleInterface.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `TriangleInterface` properties"); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TriangleInterface.openapiRequiredFields) { + if (obj.get(requiredField) == null) { + throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/User.java new file mode 100644 index 000000000000..4f60e1ecd730 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/User.java @@ -0,0 +1,504 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * User + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class User { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private Long id; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + private String username; + + public static final String SERIALIZED_NAME_FIRST_NAME = "firstName"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + private String firstName; + + public static final String SERIALIZED_NAME_LAST_NAME = "lastName"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + private String lastName; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_PASSWORD = "password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + private String password; + + public static final String SERIALIZED_NAME_PHONE = "phone"; + @SerializedName(SERIALIZED_NAME_PHONE) + private String phone; + + public static final String SERIALIZED_NAME_USER_STATUS = "userStatus"; + @SerializedName(SERIALIZED_NAME_USER_STATUS) + private Integer userStatus; + + public static final String SERIALIZED_NAME_OBJECT_WITH_NO_DECLARED_PROPS = "objectWithNoDeclaredProps"; + @SerializedName(SERIALIZED_NAME_OBJECT_WITH_NO_DECLARED_PROPS) + private Object objectWithNoDeclaredProps; + + public static final String SERIALIZED_NAME_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE = "objectWithNoDeclaredPropsNullable"; + @SerializedName(SERIALIZED_NAME_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE) + private Object objectWithNoDeclaredPropsNullable; + + public static final String SERIALIZED_NAME_ANY_TYPE_PROP = "anyTypeProp"; + @SerializedName(SERIALIZED_NAME_ANY_TYPE_PROP) + private Object anyTypeProp = null; + + public static final String SERIALIZED_NAME_ANY_TYPE_PROP_NULLABLE = "anyTypePropNullable"; + @SerializedName(SERIALIZED_NAME_ANY_TYPE_PROP_NULLABLE) + private Object anyTypePropNullable = null; + + public User() { + } + + public User id(Long id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Long getId() { + return id; + } + + + public void setId(Long id) { + this.id = id; + } + + + public User username(String username) { + + this.username = username; + return this; + } + + /** + * Get username + * @return username + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getUsername() { + return username; + } + + + public void setUsername(String username) { + this.username = username; + } + + + public User firstName(String firstName) { + + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getFirstName() { + return firstName; + } + + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + + public User lastName(String lastName) { + + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getLastName() { + return lastName; + } + + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + + public User email(String email) { + + this.email = email; + return this; + } + + /** + * Get email + * @return email + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getEmail() { + return email; + } + + + public void setEmail(String email) { + this.email = email; + } + + + public User password(String password) { + + this.password = password; + return this; + } + + /** + * Get password + * @return password + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getPassword() { + return password; + } + + + public void setPassword(String password) { + this.password = password; + } + + + public User phone(String phone) { + + this.phone = phone; + return this; + } + + /** + * Get phone + * @return phone + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getPhone() { + return phone; + } + + + public void setPhone(String phone) { + this.phone = phone; + } + + + public User userStatus(Integer userStatus) { + + this.userStatus = userStatus; + return this; + } + + /** + * User Status + * @return userStatus + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "User Status") + + public Integer getUserStatus() { + return userStatus; + } + + + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + + public User objectWithNoDeclaredProps(Object objectWithNoDeclaredProps) { + + this.objectWithNoDeclaredProps = objectWithNoDeclaredProps; + return this; + } + + /** + * test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. + * @return objectWithNoDeclaredProps + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value.") + + public Object getObjectWithNoDeclaredProps() { + return objectWithNoDeclaredProps; + } + + + public void setObjectWithNoDeclaredProps(Object objectWithNoDeclaredProps) { + this.objectWithNoDeclaredProps = objectWithNoDeclaredProps; + } + + + public User objectWithNoDeclaredPropsNullable(Object objectWithNoDeclaredPropsNullable) { + + this.objectWithNoDeclaredPropsNullable = objectWithNoDeclaredPropsNullable; + return this; + } + + /** + * test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. + * @return objectWithNoDeclaredPropsNullable + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "test code generation for nullable objects. Value must be a map of strings to values or the 'null' value.") + + public Object getObjectWithNoDeclaredPropsNullable() { + return objectWithNoDeclaredPropsNullable; + } + + + public void setObjectWithNoDeclaredPropsNullable(Object objectWithNoDeclaredPropsNullable) { + this.objectWithNoDeclaredPropsNullable = objectWithNoDeclaredPropsNullable; + } + + + public User anyTypeProp(Object anyTypeProp) { + + this.anyTypeProp = anyTypeProp; + return this; + } + + /** + * test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 + * @return anyTypeProp + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389") + + public Object getAnyTypeProp() { + return anyTypeProp; + } + + + public void setAnyTypeProp(Object anyTypeProp) { + this.anyTypeProp = anyTypeProp; + } + + + public User anyTypePropNullable(Object anyTypePropNullable) { + + this.anyTypePropNullable = anyTypePropNullable; + return this; + } + + /** + * test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. + * @return anyTypePropNullable + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values.") + + public Object getAnyTypePropNullable() { + return anyTypePropNullable; + } + + + public void setAnyTypePropNullable(Object anyTypePropNullable) { + this.anyTypePropNullable = anyTypePropNullable; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(this.id, user.id) && + Objects.equals(this.username, user.username) && + Objects.equals(this.firstName, user.firstName) && + Objects.equals(this.lastName, user.lastName) && + Objects.equals(this.email, user.email) && + Objects.equals(this.password, user.password) && + Objects.equals(this.phone, user.phone) && + Objects.equals(this.userStatus, user.userStatus) && + Objects.equals(this.objectWithNoDeclaredProps, user.objectWithNoDeclaredProps) && + Objects.equals(this.objectWithNoDeclaredPropsNullable, user.objectWithNoDeclaredPropsNullable) && + Objects.equals(this.anyTypeProp, user.anyTypeProp) && + Objects.equals(this.anyTypePropNullable, user.anyTypePropNullable); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus, objectWithNoDeclaredProps, objectWithNoDeclaredPropsNullable, anyTypeProp, anyTypePropNullable); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append(" objectWithNoDeclaredProps: ").append(toIndentedString(objectWithNoDeclaredProps)).append("\n"); + sb.append(" objectWithNoDeclaredPropsNullable: ").append(toIndentedString(objectWithNoDeclaredPropsNullable)).append("\n"); + sb.append(" anyTypeProp: ").append(toIndentedString(anyTypeProp)).append("\n"); + sb.append(" anyTypePropNullable: ").append(toIndentedString(anyTypePropNullable)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("username"); + openapiFields.add("firstName"); + openapiFields.add("lastName"); + openapiFields.add("email"); + openapiFields.add("password"); + openapiFields.add("phone"); + openapiFields.add("userStatus"); + openapiFields.add("objectWithNoDeclaredProps"); + openapiFields.add("objectWithNoDeclaredPropsNullable"); + openapiFields.add("anyTypeProp"); + openapiFields.add("anyTypePropNullable"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!User.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'User' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(User.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, User value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public User read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!User.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `User` properties"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Whale.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Whale.java new file mode 100644 index 000000000000..c84faf2790bd --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Whale.java @@ -0,0 +1,230 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * Whale + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Whale { + public static final String SERIALIZED_NAME_HAS_BALEEN = "hasBaleen"; + @SerializedName(SERIALIZED_NAME_HAS_BALEEN) + private Boolean hasBaleen; + + public static final String SERIALIZED_NAME_HAS_TEETH = "hasTeeth"; + @SerializedName(SERIALIZED_NAME_HAS_TEETH) + private Boolean hasTeeth; + + public static final String SERIALIZED_NAME_CLASS_NAME = "className"; + @SerializedName(SERIALIZED_NAME_CLASS_NAME) + private String className; + + public Whale() { + } + + public Whale hasBaleen(Boolean hasBaleen) { + + this.hasBaleen = hasBaleen; + return this; + } + + /** + * Get hasBaleen + * @return hasBaleen + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Boolean getHasBaleen() { + return hasBaleen; + } + + + public void setHasBaleen(Boolean hasBaleen) { + this.hasBaleen = hasBaleen; + } + + + public Whale hasTeeth(Boolean hasTeeth) { + + this.hasTeeth = hasTeeth; + return this; + } + + /** + * Get hasTeeth + * @return hasTeeth + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Boolean getHasTeeth() { + return hasTeeth; + } + + + public void setHasTeeth(Boolean hasTeeth) { + this.hasTeeth = hasTeeth; + } + + + public Whale className(String className) { + + this.className = className; + return this; + } + + /** + * Get className + * @return className + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getClassName() { + return className; + } + + + public void setClassName(String className) { + this.className = className; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Whale whale = (Whale) o; + return Objects.equals(this.hasBaleen, whale.hasBaleen) && + Objects.equals(this.hasTeeth, whale.hasTeeth) && + Objects.equals(this.className, whale.className); + } + + @Override + public int hashCode() { + return Objects.hash(hasBaleen, hasTeeth, className); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Whale {\n"); + sb.append(" hasBaleen: ").append(toIndentedString(hasBaleen)).append("\n"); + sb.append(" hasTeeth: ").append(toIndentedString(hasTeeth)).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("hasBaleen"); + openapiFields.add("hasTeeth"); + openapiFields.add("className"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("className"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Whale.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Whale' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Whale.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Whale value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Whale read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!Whale.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Whale` properties"); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Whale.openapiRequiredFields) { + if (obj.get(requiredField) == null) { + throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Zebra.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Zebra.java new file mode 100644 index 000000000000..7821c21caccf --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Zebra.java @@ -0,0 +1,253 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * Zebra + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Zebra extends HashMap { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + PLAINS("plains"), + + MOUNTAIN("mountain"), + + GREVYS("grevys"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_CLASS_NAME = "className"; + @SerializedName(SERIALIZED_NAME_CLASS_NAME) + private String className; + + public Zebra() { + } + + public Zebra type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + public Zebra className(String className) { + + this.className = className; + return this; + } + + /** + * Get className + * @return className + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public String getClassName() { + return className; + } + + + public void setClassName(String className) { + this.className = className; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Zebra zebra = (Zebra) o; + return Objects.equals(this.type, zebra.type) && + Objects.equals(this.className, zebra.className) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, className, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Zebra {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("className"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("className"); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Zebra.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Zebra' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Zebra.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Zebra value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Zebra read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!Zebra.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Zebra` properties"); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Zebra.openapiRequiredFields) { + if (obj.get(requiredField) == null) { + throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/ApiClientTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/ApiClientTest.java new file mode 100644 index 000000000000..9edd0ae7bedc --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/ApiClientTest.java @@ -0,0 +1,345 @@ +package org.openapitools.client; + +import static org.hamcrest.CoreMatchers.*; +import static org.junit.Assert.*; + +import java.util.*; +import okhttp3.OkHttpClient; +import org.junit.*; +import org.openapitools.client.auth.*; + +public class ApiClientTest { + ApiClient apiClient; + JSON json; + + @Before + public void setup() { + apiClient = new ApiClient(); + json = apiClient.getJSON(); + } + + @Test + public void testIsJsonMime() { + assertFalse(apiClient.isJsonMime(null)); + assertFalse(apiClient.isJsonMime("")); + assertFalse(apiClient.isJsonMime("text/plain")); + assertFalse(apiClient.isJsonMime("application/xml")); + assertFalse(apiClient.isJsonMime("application/jsonp")); + assertFalse(apiClient.isJsonMime("example/json")); + assertFalse(apiClient.isJsonMime("example/foo+bar+jsonx")); + assertFalse(apiClient.isJsonMime("example/foo+bar+xjson")); + + assertTrue(apiClient.isJsonMime("application/json")); + assertTrue(apiClient.isJsonMime("application/json; charset=UTF8")); + assertTrue(apiClient.isJsonMime("APPLICATION/JSON")); + + assertTrue(apiClient.isJsonMime("application/problem+json")); + assertTrue(apiClient.isJsonMime("APPLICATION/PROBLEM+JSON")); + assertTrue(apiClient.isJsonMime("application/json\t")); + assertTrue(apiClient.isJsonMime("example/foo+bar+json")); + assertTrue(apiClient.isJsonMime("example/foo+json;x;y")); + assertTrue(apiClient.isJsonMime("example/foo+json\t;")); + assertTrue(apiClient.isJsonMime("Example/fOO+JSON")); + + assertTrue(apiClient.isJsonMime("application/json-patch+json")); + } + + @Test + public void testSelectHeaderAccept() { + String[] accepts = {"application/json", "application/xml"}; + assertEquals("application/json", apiClient.selectHeaderAccept(accepts)); + + accepts = new String[] {"APPLICATION/XML", "APPLICATION/JSON"}; + assertEquals("APPLICATION/JSON", apiClient.selectHeaderAccept(accepts)); + + accepts = new String[] {"application/xml", "application/json; charset=UTF8"}; + assertEquals("application/json; charset=UTF8", apiClient.selectHeaderAccept(accepts)); + + accepts = new String[] {"text/plain", "application/xml"}; + assertEquals("text/plain,application/xml", apiClient.selectHeaderAccept(accepts)); + + accepts = new String[] {}; + assertNull(apiClient.selectHeaderAccept(accepts)); + } + + @Test + public void testSelectHeaderContentType() { + String[] contentTypes = {"application/json", "application/xml"}; + assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[] {"APPLICATION/JSON", "APPLICATION/XML"}; + assertEquals("APPLICATION/JSON", apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[] {"application/xml", "application/json; charset=UTF8"}; + assertEquals( + "application/json; charset=UTF8", apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[] {"text/plain", "application/xml"}; + assertEquals("text/plain", apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[] {}; + assertNull(apiClient.selectHeaderContentType(contentTypes)); + } + + @Test + public void testGetAuthentications() { + Map auths = apiClient.getAuthentications(); + + Authentication auth = auths.get("api_key"); + assertNotNull(auth); + assertTrue(auth instanceof ApiKeyAuth); + ApiKeyAuth apiKeyAuth = (ApiKeyAuth) auth; + assertEquals("header", apiKeyAuth.getLocation()); + assertEquals("api_key", apiKeyAuth.getParamName()); + + auth = auths.get("petstore_auth"); + assertTrue(auth instanceof OAuth); + assertSame(auth, apiClient.getAuthentication("petstore_auth")); + + assertNull(auths.get("unknown")); + + try { + auths.put("my_auth", new HttpBasicAuth()); + fail("the authentications returned should not be modifiable"); + } catch (UnsupportedOperationException e) { + } + } + + /* + @Test + public void testSetUsernameAndPassword() { + HttpBasicAuth auth = null; + for (Authentication _auth : apiClient.getAuthentications().values()) { + if (_auth instanceof HttpBasicAuth) { + auth = (HttpBasicAuth) _auth; + break; + } + } + auth.setUsername(null); + auth.setPassword(null); + + apiClient.setUsername("my-username"); + apiClient.setPassword("my-password"); + assertEquals("my-username", auth.getUsername()); + assertEquals("my-password", auth.getPassword()); + + // reset values + auth.setUsername(null); + auth.setPassword(null); + } + */ + + @Test + public void testSetApiKeyAndPrefix() { + ApiKeyAuth auth = null; + for (Authentication _auth : apiClient.getAuthentications().values()) { + if (_auth instanceof ApiKeyAuth) { + auth = (ApiKeyAuth) _auth; + break; + } + } + auth.setApiKey(null); + auth.setApiKeyPrefix(null); + + apiClient.setApiKey("my-api-key"); + apiClient.setApiKeyPrefix("Token"); + assertEquals("my-api-key", auth.getApiKey()); + assertEquals("Token", auth.getApiKeyPrefix()); + + // reset values + auth.setApiKey(null); + auth.setApiKeyPrefix(null); + } + + @Test + public void testGetAndSetConnectTimeout() { + // connect timeout defaults to 10 seconds + assertEquals(10000, apiClient.getConnectTimeout()); + assertEquals(10000, apiClient.getHttpClient().connectTimeoutMillis()); + + apiClient.setConnectTimeout(0); + assertEquals(0, apiClient.getConnectTimeout()); + assertEquals(0, apiClient.getHttpClient().connectTimeoutMillis()); + + apiClient.setConnectTimeout(10000); + } + + @Test + public void testGetAndSetReadTimeout() { + // read timeout defaults to 10 seconds + assertEquals(10000, apiClient.getReadTimeout()); + assertEquals(10000, apiClient.getHttpClient().readTimeoutMillis()); + + apiClient.setReadTimeout(0); + assertEquals(0, apiClient.getReadTimeout()); + assertEquals(0, apiClient.getHttpClient().readTimeoutMillis()); + + apiClient.setReadTimeout(10000); + } + + @Test + public void testGetAndSetWriteTimeout() { + // write timeout defaults to 10 seconds + assertEquals(10000, apiClient.getWriteTimeout()); + assertEquals(10000, apiClient.getHttpClient().writeTimeoutMillis()); + + apiClient.setWriteTimeout(0); + assertEquals(0, apiClient.getWriteTimeout()); + assertEquals(0, apiClient.getHttpClient().writeTimeoutMillis()); + + apiClient.setWriteTimeout(10000); + } + + @Test + public void testParameterToPairWhenNameIsInvalid() throws Exception { + List pairs_a = apiClient.parameterToPair(null, new Integer(1)); + List pairs_b = apiClient.parameterToPair("", new Integer(1)); + + assertTrue(pairs_a.isEmpty()); + assertTrue(pairs_b.isEmpty()); + } + + @Test + public void testParameterToPairWhenValueIsNull() throws Exception { + List pairs = apiClient.parameterToPair("param-a", null); + + assertTrue(pairs.isEmpty()); + } + + @Test + public void testParameterToPairWhenValueIsEmptyString() throws Exception { + // single empty string + List pairs = apiClient.parameterToPair("param-a", " "); + assertEquals(1, pairs.size()); + } + + @Test + public void testParameterToPairWhenValueIsNotCollection() throws Exception { + String name = "param-a"; + Integer value = 1; + + List pairs = apiClient.parameterToPair(name, value); + + assertEquals(1, pairs.size()); + assertEquals(value, Integer.valueOf(pairs.get(0).getValue())); + } + + @Test + public void testParameterToPairWhenValueIsCollection() throws Exception { + List values = new ArrayList(); + values.add("value-a"); + values.add(123); + values.add(new Date()); + + List pairs = apiClient.parameterToPair("param-a", values); + assertEquals(0, pairs.size()); + } + + @Test + public void testParameterToPairsWhenNameIsInvalid() throws Exception { + List objects = new ArrayList(); + objects.add(new Integer(1)); + + List pairs_a = apiClient.parameterToPairs("csv", null, objects); + List pairs_b = apiClient.parameterToPairs("csv", "", objects); + + assertTrue(pairs_a.isEmpty()); + assertTrue(pairs_b.isEmpty()); + } + + @Test + public void testParameterToPairsWhenValueIsNull() throws Exception { + List pairs = apiClient.parameterToPairs("csv", "param-a", null); + + assertTrue(pairs.isEmpty()); + } + + @Test + public void testParameterToPairsWhenValueIsEmptyStrings() throws Exception { + // list of empty strings + List strs = new ArrayList(); + strs.add(" "); + strs.add(" "); + strs.add(" "); + + List concatStrings = apiClient.parameterToPairs("csv", "param-a", strs); + + assertEquals(1, concatStrings.size()); + assertFalse(concatStrings.get(0).getValue().isEmpty()); // should contain some delimiters + } + + @Test + public void testParameterToPairsWhenValueIsCollection() throws Exception { + Map collectionFormatMap = new HashMap(); + collectionFormatMap.put("csv", ","); + collectionFormatMap.put("tsv", "\t"); + collectionFormatMap.put("ssv", " "); + collectionFormatMap.put("pipes", "|"); + collectionFormatMap.put("", ","); // no format, must default to csv + collectionFormatMap.put("unknown", ","); // all other formats, must default to csv + + String name = "param-a"; + + List values = new ArrayList(); + values.add("value-a"); + values.add(123); + values.add(new Date()); + + // check for multi separately + List multiPairs = apiClient.parameterToPairs("multi", name, values); + assertEquals(values.size(), multiPairs.size()); + for (int i = 0; i < values.size(); i++) { + assertEquals( + apiClient.escapeString(apiClient.parameterToString(values.get(i))), + multiPairs.get(i).getValue()); + } + + // all other formats + for (String collectionFormat : collectionFormatMap.keySet()) { + List pairs = apiClient.parameterToPairs(collectionFormat, name, values); + + assertEquals(1, pairs.size()); + + String delimiter = collectionFormatMap.get(collectionFormat); + if (!delimiter.equals(",")) { + // commas are not escaped because they are reserved characters in URIs + delimiter = apiClient.escapeString(delimiter); + } + String[] pairValueSplit = pairs.get(0).getValue().split(delimiter); + + // must equal input values + assertEquals(values.size(), pairValueSplit.length); + for (int i = 0; i < values.size(); i++) { + assertEquals( + apiClient.escapeString(apiClient.parameterToString(values.get(i))), + pairValueSplit[i]); + } + } + } + + @Test + public void testSanitizeFilename() { + assertEquals("sun", apiClient.sanitizeFilename("sun")); + assertEquals("sun.gif", apiClient.sanitizeFilename("sun.gif")); + assertEquals("sun.gif", apiClient.sanitizeFilename("../sun.gif")); + assertEquals("sun.gif", apiClient.sanitizeFilename("/var/tmp/sun.gif")); + assertEquals("sun.gif", apiClient.sanitizeFilename("./sun.gif")); + assertEquals("sun.gif", apiClient.sanitizeFilename("..\\sun.gif")); + assertEquals("sun.gif", apiClient.sanitizeFilename("\\var\\tmp\\sun.gif")); + assertEquals("sun.gif", apiClient.sanitizeFilename("c:\\var\\tmp\\sun.gif")); + assertEquals("sun.gif", apiClient.sanitizeFilename(".\\sun.gif")); + } + + @Test + public void testNewHttpClient() { + OkHttpClient oldClient = apiClient.getHttpClient(); + apiClient.setHttpClient(oldClient.newBuilder().build()); + assertThat(apiClient.getHttpClient(), is(not(oldClient))); + } + + /** Tests the invariant that the HttpClient for the ApiClient must never be null */ + @Test(expected = NullPointerException.class) + public void testNullHttpClient() { + apiClient.setHttpClient(null); + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/ConfigurationTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/ConfigurationTest.java new file mode 100644 index 000000000000..3d6ab82bd3e6 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/ConfigurationTest.java @@ -0,0 +1,15 @@ +package org.openapitools.client; + +import static org.junit.Assert.*; + +import org.junit.*; + +public class ConfigurationTest { + @Test + public void testDefaultApiClient() { + ApiClient apiClient = Configuration.getDefaultApiClient(); + assertNotNull(apiClient); + assertEquals("http://petstore.swagger.io:80/v2", apiClient.getBasePath()); + assertFalse(apiClient.isDebugging()); + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java new file mode 100644 index 000000000000..c6b3c2345dd8 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java @@ -0,0 +1,348 @@ +package org.openapitools.client; + +import static org.junit.Assert.*; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.reflect.TypeToken; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.charset.StandardCharsets; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.Locale; +import java.util.TimeZone; +import okio.ByteString; +import org.junit.*; +import org.openapitools.client.model.Order; +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.ZoneOffset; +import org.threeten.bp.format.DateTimeFormatter; + +import org.openapitools.client.model.*; + +public class JSONTest { + private ApiClient apiClient = null; + private JSON json = null; + private Order order = null; + + @Before + public void setup() { + apiClient = new ApiClient(); + json = apiClient.getJSON(); + order = new Order(); + } + + @Test + public void testSqlDateTypeAdapter() { + final String str = "\"2015-11-07\""; + final java.sql.Date date = java.sql.Date.valueOf("2015-11-07"); + + assertEquals(str, json.serialize(date)); + assertEquals(json.deserialize(str, java.sql.Date.class), date); + assertEquals( + json.deserialize( + "\"2015-11-07T03:49:09.356" + getCurrentTimezoneOffset() + "\"", + java.sql.Date.class) + .toString(), + date.toString()); + + // custom date format: without day + DateFormat format = new SimpleDateFormat("yyyy-MM", Locale.ROOT); + apiClient.setSqlDateFormat(format); + String dateStr = "\"2015-11\""; + assertEquals( + dateStr, + json.serialize(json.deserialize("\"2015-11-07T03:49:09Z\"", java.sql.Date.class))); + assertEquals(dateStr, json.serialize(json.deserialize("\"2015-11\"", java.sql.Date.class))); + } + + @Test + public void testDateTypeAdapter() { + Calendar cal = new GregorianCalendar(2015, 10, 7, 3, 49, 9); + cal.setTimeZone(TimeZone.getTimeZone("UTC")); + + assertEquals(json.deserialize("\"2015-11-07T05:49:09+02\"", Date.class), cal.getTime()); + + cal.set(Calendar.MILLISECOND, 300); + assertEquals(json.deserialize("\"2015-11-07T03:49:09.3Z\"", Date.class), cal.getTime()); + + cal.set(Calendar.MILLISECOND, 356); + Date date = cal.getTime(); + + final String utcDate = "\"2015-11-07T03:49:09.356Z\""; + assertEquals(json.deserialize(utcDate, Date.class), date); + assertEquals(json.deserialize("\"2015-11-07T03:49:09.356+00:00\"", Date.class), date); + assertEquals(json.deserialize("\"2015-11-07T05:49:09.356+02:00\"", Date.class), date); + assertEquals(json.deserialize("\"2015-11-07T02:49:09.356-01:00\"", Date.class), date); + assertEquals(json.deserialize("\"2015-11-07T03:49:09.356Z\"", Date.class), date); + assertEquals(json.deserialize("\"2015-11-07T03:49:09.356+00\"", Date.class), date); + assertEquals(json.deserialize("\"2015-11-07T02:49:09.356-0100\"", Date.class), date); + assertEquals(json.deserialize("\"2015-11-07T03:49:09.356456789Z\"", Date.class), date); + + assertEquals(utcDate, json.serialize(date)); + + // custom datetime format: without milli-seconds, custom time zone + DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX", Locale.ROOT); + format.setTimeZone(TimeZone.getTimeZone("GMT+10")); + apiClient.setDateFormat(format); + + String dateStr = "\"2015-11-07T13:49:09+10:00\""; + assertEquals( + dateStr, + json.serialize(json.deserialize("\"2015-11-07T03:49:09+00:00\"", Date.class))); + assertEquals( + dateStr, json.serialize(json.deserialize("\"2015-11-07T03:49:09Z\"", Date.class))); + assertEquals( + dateStr, + json.serialize(json.deserialize("\"2015-11-07T00:49:09-03:00\"", Date.class))); + + try { + // invalid time zone format + json.deserialize("\"2015-11-07T03:49:09+00\"", Date.class); + fail("json parsing should fail"); + } catch (RuntimeException e) { + // OK + } + try { + // unexpected miliseconds + json.deserialize("\"2015-11-07T03:49:09.000Z\"", Date.class); + fail("json parsing should fail"); + } catch (RuntimeException e) { + // OK + } + } + + @Test + public void testOffsetDateTimeTypeAdapter() { + final String str = "\"2016-09-09T08:02:03.123-03:00\""; + OffsetDateTime date = + OffsetDateTime.of(2016, 9, 9, 8, 2, 3, 123000000, ZoneOffset.of("-3")); + + assertEquals(str, json.serialize(date)); + // Use toString() instead of isEqual to verify that the offset is preserved + assertEquals(json.deserialize(str, OffsetDateTime.class).toString(), date.toString()); + } + + @Test + public void testLocalDateTypeAdapter() { + final String str = "\"2016-09-09\""; + final LocalDate date = LocalDate.of(2016, 9, 9); + + assertEquals(str, json.serialize(date)); + assertEquals(json.deserialize(str, LocalDate.class), date); + } + + @Test + public void testDefaultDate() throws Exception { + final DateTimeFormatter datetimeFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME; + final String dateStr = "2015-11-07T14:11:05.267Z"; + order.setShipDate(datetimeFormat.parse(dateStr, OffsetDateTime.FROM)); + + String str = json.serialize(order); + Type type = new TypeToken() {}.getType(); + Order o = json.deserialize(str, type); + assertEquals(dateStr, datetimeFormat.format(o.getShipDate())); + } + + @Test + public void testCustomDate() throws Exception { + final DateTimeFormatter datetimeFormat = + DateTimeFormatter.ISO_OFFSET_DATE_TIME.withZone(ZoneId.of("Etc/GMT+2")); + final String dateStr = "2015-11-07T14:11:05-02:00"; + order.setShipDate(datetimeFormat.parse(dateStr, OffsetDateTime.FROM)); + + String str = json.serialize(order); + Type type = new TypeToken() {}.getType(); + Order o = json.deserialize(str, type); + assertEquals(dateStr, datetimeFormat.format(o.getShipDate())); + } + + @Test + public void testByteArrayTypeAdapterSerialization() { + // Arrange + final String expectedBytesAsString = "Let's pretend this a jpg or something"; + final byte[] expectedBytes = expectedBytesAsString.getBytes(StandardCharsets.UTF_8); + + // Act + String serializedBytesWithQuotes = json.serialize(expectedBytes); + + // Assert + String serializedBytes = + serializedBytesWithQuotes.substring(1, serializedBytesWithQuotes.length() - 1); + if (json.getGson().htmlSafe()) { + serializedBytes = serializedBytes.replaceAll("\\\\u003d", "="); + } + ByteString actualAsByteString = ByteString.decodeBase64(serializedBytes); + byte[] actualBytes = actualAsByteString.toByteArray(); + assertEquals(expectedBytesAsString, new String(actualBytes, StandardCharsets.UTF_8)); + } + + @Test + public void testByteArrayTypeAdapterDeserialization() { + // Arrange + final String expectedBytesAsString = "Let's pretend this a jpg or something"; + final byte[] expectedBytes = expectedBytesAsString.getBytes(StandardCharsets.UTF_8); + final ByteString expectedByteString = ByteString.of(expectedBytes); + final String serializedBytes = expectedByteString.base64(); + final String serializedBytesWithQuotes = "\"" + serializedBytes + "\""; + Type type = new TypeToken() {}.getType(); + + // Act + byte[] actualDeserializedBytes = json.deserialize(serializedBytesWithQuotes, type); + + // Assert + assertEquals( + expectedBytesAsString, new String(actualDeserializedBytes, StandardCharsets.UTF_8)); + } + + @Test(expected = IllegalArgumentException.class) + public void testRequiredFieldException() { + // test json string missing required field(s) to ensure exception is thrown + Gson gson = json.getGson(); + //Gson gson = new GsonBuilder() + // .registerTypeAdapter(Pet.class, new Pet.CustomDeserializer()) + // .create(); + String json = "{\"id\": 5847, \"name\":\"tag test 1\"}"; // missing photoUrls (required field) + //String json = "{\"id2\": 5847, \"name\":\"tag test 1\"}"; + //String json = "{\"id\": 5847}"; + Pet p = gson.fromJson(json, Pet.class); + } + + @Test(expected = IllegalArgumentException.class) + public void testAdditionalFieldException() { + // test json string with additional field(s) to ensure exception is thrown + Gson gson = json.getGson(); + //Gson gson = new GsonBuilder() + // .registerTypeAdapter(Tag.class, new Tag.CustomDeserializer()) + // .create(); + String json = "{\"id\": 5847, \"name\":\"tag test 1\", \"new-field\": true}"; + Tag t = gson.fromJson(json, Tag.class); + } + + @Test + public void testCustomDeserializer() { + // test the custom deserializer to ensure it can deserialize json payload into objects + Gson gson = json.getGson(); + //Gson gson = new GsonBuilder() + // .registerTypeAdapter(Tag.class, new Tag.CustomDeserializer()) + // .create(); + // id and name + String json = "{\"id\": 5847, \"name\":\"tag test 1\"}"; + Tag t = gson.fromJson(json, Tag.class); + assertEquals(t.getName(), "tag test 1"); + assertEquals(t.getId(), Long.valueOf(5847L)); + + // name only + String json2 = "{\"name\":\"tag test 1\"}"; + Tag t2 = gson.fromJson(json2, Tag.class); + assertEquals(t2.getName(), "tag test 1"); + assertEquals(t2.getId(), null); + + // with all required fields + String json3 = "{\"id\": 5847, \"name\":\"pet test 1\", \"photoUrls\": [\"https://a.com\", \"https://b.com\"]}"; // missing photoUrls (required field) + Pet t3 = gson.fromJson(json3, Pet.class); + assertEquals(t3.getName(), "pet test 1"); + assertEquals(t3.getId(), Long.valueOf(5847)); + } + + /** Model tests for Pet */ + @Test + public void testPet() { + // test Pet + Pet model = new Pet(); + model.setId(1029L); + model.setName("Dog"); + + Pet model2 = new Pet(); + model2.setId(1029L); + model2.setName("Dog"); + + Assert.assertTrue(model.equals(model2)); + } + + // Obtained 22JAN2018 from stackoverflow answer by PuguaSoft + // https://stackoverflow.com/questions/11399491/java-timezone-offset + // Direct link https://stackoverflow.com/a/16680815/3166133 + public static String getCurrentTimezoneOffset() { + + TimeZone tz = TimeZone.getDefault(); + Calendar cal = GregorianCalendar.getInstance(tz, Locale.ROOT); + int offsetInMillis = tz.getOffset(cal.getTimeInMillis()); + + String offset = + String.format( + Locale.ROOT, + "%02d:%02d", + Math.abs(offsetInMillis / 3600000), + Math.abs((offsetInMillis / 60000) % 60)); + offset = (offsetInMillis >= 0 ? "+" : "-") + offset; + + return offset; + } + + /** + * Validate a oneOf schema can be deserialized into the expected class. + * The oneOf schema does not have a discriminator. + */ + @Test + public void testOneOfSchemaWithoutDiscriminator() throws Exception { + // BananaReq and AppleReq have explicitly defined properties that are different by name. + // There is no discriminator property. + { + String str = "{ \"cultivar\": \"golden delicious\", \"mealy\": false }"; + + // make sure deserialization works for pojo object + AppleReq a = json.getGson().fromJson(str, AppleReq.class); + assertEquals(a.getCultivar(), "golden delicious"); + assertEquals(a.getMealy(), false); + + FruitReq o = json.getGson().fromJson(str, FruitReq.class); + assertTrue(o.getActualInstance() instanceof AppleReq); + AppleReq inst = (AppleReq) o.getActualInstance(); + assertEquals(inst.getCultivar(), "golden delicious"); + assertEquals(inst.getMealy(), false); + assertEquals(json.getGson().toJson(inst), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); + + AppleReq inst2 = o.getAppleReq(); + assertEquals(inst2.getCultivar(), "golden delicious"); + assertEquals(inst2.getMealy(), false); + assertEquals(json.getGson().toJson(inst2), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); + } + { + // Same test, but this time with additional (undeclared) properties. + // Since FruitReq has additionalProperties: false, deserialization should fail. + String str = "{ \"cultivar\": \"golden delicious\", \"mealy\": false, \"garbage_prop\": \"abc\" }"; + Exception exception = assertThrows(com.google.gson.JsonSyntaxException.class, () -> { + FruitReq o = json.getGson().fromJson(str, FruitReq.class); + }); + assertTrue(exception.getMessage().contains("Failed deserialization for FruitReq: 0 classes match result")); + } + { + String str = "{ \"lengthCm\": 17 }"; + + // make sure deserialization works for pojo object + BananaReq b = json.getGson().fromJson(str, BananaReq.class); + assertEquals(b.getLengthCm(), new java.math.BigDecimal(17)); + + FruitReq o = json.getGson().fromJson(str, FruitReq.class); + assertTrue(o.getActualInstance() instanceof BananaReq); + BananaReq inst = (BananaReq) o.getActualInstance(); + assertEquals(inst.getLengthCm(), new java.math.BigDecimal(17)); + } + { + // Try to deserialize empty object. This should fail 'oneOf' because none will match + // AppleReq or BananaReq. + String str = "{ }"; + Exception exception = assertThrows(com.google.gson.JsonSyntaxException.class, () -> { + json.getGson().fromJson(str, FruitReq.class); + }); + assertTrue(exception.getMessage().contains("Failed deserialization for FruitReq: 0 classes match result, expected 1")); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/StringUtilTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/StringUtilTest.java new file mode 100644 index 000000000000..f6b87fbaaa12 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/StringUtilTest.java @@ -0,0 +1,33 @@ +package org.openapitools.client; + +import static org.junit.Assert.*; + +import org.junit.*; + +public class StringUtilTest { + @Test + public void testContainsIgnoreCase() { + assertTrue(StringUtil.containsIgnoreCase(new String[] {"abc"}, "abc")); + assertTrue(StringUtil.containsIgnoreCase(new String[] {"abc"}, "ABC")); + assertTrue(StringUtil.containsIgnoreCase(new String[] {"ABC"}, "abc")); + assertTrue(StringUtil.containsIgnoreCase(new String[] {null, "abc"}, "ABC")); + assertTrue(StringUtil.containsIgnoreCase(new String[] {null, "abc"}, null)); + + assertFalse(StringUtil.containsIgnoreCase(new String[] {"abc"}, "def")); + assertFalse(StringUtil.containsIgnoreCase(new String[] {}, "ABC")); + assertFalse(StringUtil.containsIgnoreCase(new String[] {}, null)); + } + + @Test + public void testJoin() { + String[] array = {"aa", "bb", "cc"}; + assertEquals("aa,bb,cc", StringUtil.join(array, ",")); + assertEquals("aa, bb, cc", StringUtil.join(array, ", ")); + assertEquals("aabbcc", StringUtil.join(array, "")); + assertEquals("aa bb cc", StringUtil.join(array, " ")); + assertEquals("aa\nbb\ncc", StringUtil.join(array, "\n")); + + assertEquals("", StringUtil.join(new String[] {}, ",")); + assertEquals("abc", StringUtil.join(new String[] {"abc"}, ",")); + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java new file mode 100644 index 000000000000..af8a9594410c --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + + +import org.junit.Ignore; +import org.junit.Test; +import org.openapitools.client.ApiException; +import org.openapitools.client.model.Client; + +/** API tests for AnotherFakeApi */ +@Ignore +public class AnotherFakeApiTest { + + private final AnotherFakeApi api = new AnotherFakeApi(); + + /** + * To test special tags + * + *

    To test special tags and operation ID starting with number + * + * @throws ApiException if the Api call fails + */ + @Test + public void call123testSpecialTagsTest() throws ApiException { + Client body = null; + Client response = api.call123testSpecialTags(body); + + // TODO: test validations + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 000000000000..5459b4b2c1d4 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.InlineResponseDefault; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for DefaultApi + */ +@Ignore +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + + /** + * + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fooGetTest() throws ApiException { + InlineResponseDefault response = api.fooGet(); + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/FakeApiTest.java new file mode 100644 index 000000000000..54eb3e8e090f --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -0,0 +1,302 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import java.math.BigDecimal; +import org.openapitools.client.model.Client; +import java.io.File; +import org.openapitools.client.model.FileSchemaTestClass; +import org.openapitools.client.model.HealthCheckResult; +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; +import org.openapitools.client.model.OuterComposite; +import org.openapitools.client.model.OuterEnum; +import org.openapitools.client.model.User; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for FakeApi + */ +@Ignore +public class FakeApiTest { + + private final FakeApi api = new FakeApi(); + + + /** + * Health check endpoint + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeHealthGetTest() throws ApiException { + HealthCheckResult response = api.fakeHealthGet(); + // TODO: test validations + } + + /** + * + * + * Test serialization of outer boolean types + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterBooleanSerializeTest() throws ApiException { + Boolean body = null; + Boolean response = api.fakeOuterBooleanSerialize(body); + // TODO: test validations + } + + /** + * + * + * Test serialization of object with outer number type + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterCompositeSerializeTest() throws ApiException { + OuterComposite outerComposite = null; + OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite); + // TODO: test validations + } + + /** + * + * + * Test serialization of outer number types + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterNumberSerializeTest() throws ApiException { + BigDecimal body = null; + BigDecimal response = api.fakeOuterNumberSerialize(body); + // TODO: test validations + } + + /** + * + * + * Test serialization of outer string types + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterStringSerializeTest() throws ApiException { + String body = null; + String response = api.fakeOuterStringSerialize(body); + // TODO: test validations + } + + /** + * Array of Enums + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getArrayOfEnumsTest() throws ApiException { + List response = api.getArrayOfEnums(); + // TODO: test validations + } + + /** + * + * + * For this test, the body for this request much reference a schema named `File`. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testBodyWithFileSchemaTest() throws ApiException { + FileSchemaTestClass fileSchemaTestClass = null; + api.testBodyWithFileSchema(fileSchemaTestClass); + // TODO: test validations + } + + /** + * + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testBodyWithQueryParamsTest() throws ApiException { + String query = null; + User user = null; + api.testBodyWithQueryParams(query, user); + // TODO: test validations + } + + /** + * To test \"client\" model + * + * To test \"client\" model + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testClientModelTest() throws ApiException { + Client client = null; + Client response = api.testClientModel(client); + // TODO: test validations + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testEndpointParametersTest() throws ApiException { + BigDecimal number = null; + Double _double = null; + String patternWithoutDelimiter = null; + byte[] _byte = null; + Integer integer = null; + Integer int32 = null; + Long int64 = null; + Float _float = null; + String string = null; + File binary = null; + LocalDate date = null; + OffsetDateTime dateTime = null; + String password = null; + String paramCallback = null; + api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + // TODO: test validations + } + + /** + * To test enum parameters + * + * To test enum parameters + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testEnumParametersTest() throws ApiException { + List enumHeaderStringArray = null; + String enumHeaderString = null; + List enumQueryStringArray = null; + String enumQueryString = null; + Integer enumQueryInteger = null; + Double enumQueryDouble = null; + List enumFormStringArray = null; + String enumFormString = null; + api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + // TODO: test validations + } + + /** + * Fake endpoint to test group parameters (optional) + * + * Fake endpoint to test group parameters (optional) + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testGroupParametersTest() throws ApiException { + Integer requiredStringGroup = null; + Boolean requiredBooleanGroup = null; + Long requiredInt64Group = null; + Integer stringGroup = null; + Boolean booleanGroup = null; + Long int64Group = null; + api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group) + .stringGroup(stringGroup) + .booleanGroup(booleanGroup) + .int64Group(int64Group) + .execute(); + // TODO: test validations + } + + /** + * test inline additionalProperties + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testInlineAdditionalPropertiesTest() throws ApiException { + Map requestBody = null; + api.testInlineAdditionalProperties(requestBody); + // TODO: test validations + } + + /** + * test json serialization of form data + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testJsonFormDataTest() throws ApiException { + String param = null; + String param2 = null; + api.testJsonFormData(param, param2); + // TODO: test validations + } + + /** + * + * + * To test the collection format in query parameters + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testQueryParameterCollectionFormatTest() throws ApiException { + List pipe = null; + List ioutil = null; + List http = null; + List url = null; + List context = null; + api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java new file mode 100644 index 000000000000..16b1c5afa719 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + + +import org.junit.Ignore; +import org.junit.Test; +import org.openapitools.client.ApiException; +import org.openapitools.client.model.Client; + +/** API tests for FakeClassnameTags123Api */ +@Ignore +public class FakeClassnameTags123ApiTest { + + private final FakeClassnameTags123Api api = new FakeClassnameTags123Api(); + + /** + * To test class name in snake case + * + *

    To test class name in snake case + * + * @throws ApiException if the Api call fails + */ + @Test + public void testClassnameTest() throws ApiException { + Client body = null; + Client response = api.testClassname(body); + + // TODO: test validations + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/PetApiTest.java new file mode 100644 index 000000000000..a4e3dcec14c2 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -0,0 +1,575 @@ +/* + * OpenAPI Petstore + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import static org.junit.Assert.*; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ThreadLocalRandom; +import java.util.concurrent.TimeUnit; +import org.junit.*; +import org.openapitools.client.*; +import org.openapitools.client.ApiException; +import org.openapitools.client.auth.*; +import org.openapitools.client.model.*; +import org.openapitools.client.model.Pet; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** API tests for PetApi */ +public class PetApiTest { + + private PetApi api = new PetApi(); + private final Logger LOG = LoggerFactory.getLogger(PetApiTest.class); + // In the circle.yml file, /etc/host is configured with an entry to resolve petstore.swagger.io + // to 127.0.0.1 + private static String basePath = "http://petstore.swagger.io:80/v2"; + + @Before + public void setup() { + // setup authentication + ApiKeyAuth apiKeyAuth = (ApiKeyAuth) api.getApiClient().getAuthentication("api_key"); + apiKeyAuth.setApiKey("special-key"); + api.getApiClient().setBasePath(basePath); + } + + @Test + public void testApiClient() { + // the default api client is used + assertEquals(Configuration.getDefaultApiClient(), api.getApiClient()); + assertNotNull(api.getApiClient()); + assertEquals(basePath, api.getApiClient().getBasePath()); + assertFalse(api.getApiClient().isDebugging()); + + ApiClient oldClient = api.getApiClient(); + + ApiClient newClient = new ApiClient(); + newClient.setVerifyingSsl(true); + newClient.setBasePath("http://example.com"); + newClient.setDebugging(true); + + // set api client via constructor + api = new PetApi(newClient); + assertNotNull(api.getApiClient()); + assertEquals("http://example.com", api.getApiClient().getBasePath()); + assertTrue(api.getApiClient().isDebugging()); + + // set api client via setter method + api.setApiClient(oldClient); + assertNotNull(api.getApiClient()); + assertEquals(basePath, api.getApiClient().getBasePath()); + assertFalse(api.getApiClient().isDebugging()); + } + + @Test + public void testCreateAndGetPet() throws Exception { + Pet pet = createPet(); + api.addPet(pet); + + Pet fetched = api.getPetById(pet.getId()); + assertPetMatches(pet, fetched); + api.deletePet(pet.getId(), null); + } + + @Test + public void testCreateAndGetPetWithHttpInfo() throws Exception { + Pet pet = createPet(); + api.addPetWithHttpInfo(pet); + + ApiResponse resp = api.getPetByIdWithHttpInfo(pet.getId()); + assertEquals(200, resp.getStatusCode()); + assertEquals("application/json", resp.getHeaders().get("Content-Type").get(0)); + Pet fetched = resp.getData(); + + assertPetMatches(pet, fetched); + api.deletePet(pet.getId(), null); + } + + @Test + public void testCreateAndGetPetAsync() throws Exception { + Pet pet = createPet(); + api.addPet(pet); + // to store returned Pet or error message/exception + final Map result = new HashMap(); + + api.getPetByIdAsync( + pet.getId(), + new ApiCallback() { + @Override + public void onFailure( + ApiException e, + int statusCode, + Map> responseHeaders) { + result.put("error", e.getMessage()); + } + + @Override + public void onSuccess( + Pet pet, int statusCode, Map> responseHeaders) { + result.put("pet", pet); + } + + @Override + public void onUploadProgress( + long bytesWritten, long contentLength, boolean done) { + // empty + } + + @Override + public void onDownloadProgress( + long bytesRead, long contentLength, boolean done) { + // empty + } + }); + + // wait for the asynchronous call to finish (at most 10 seconds) + final int maxTry = 10; + int tryCount = 1; + Pet fetched = null; + do { + if (tryCount > maxTry) fail("have not got result of getPetByIdAsync after 10 seconds"); + Thread.sleep(1000); + tryCount += 1; + if (result.get("error") != null) fail((String) result.get("error")); + if (result.get("pet") != null) { + fetched = (Pet) result.get("pet"); + break; + } + } while (result.isEmpty()); + assertPetMatches(pet, fetched); + api.deletePet(pet.getId(), null); + } + + @Test + public void testCreateAndGetPetAsyncInvalidID() throws Exception { + Pet pet = createPet(); + api.addPet(pet); + // to store returned Pet or error message/exception + final Map result = new HashMap(); + + // test getting a nonexistent pet + result.clear(); + api.getPetByIdAsync( + -10000L, + new ApiCallback() { + @Override + public void onFailure( + ApiException e, + int statusCode, + Map> responseHeaders) { + result.put("exception", e); + } + + @Override + public void onSuccess( + Pet pet, int statusCode, Map> responseHeaders) { + result.put("pet", pet); + } + + @Override + public void onUploadProgress( + long bytesWritten, long contentLength, boolean done) { + // empty + } + + @Override + public void onDownloadProgress( + long bytesRead, long contentLength, boolean done) { + // empty + } + }); + + // wait for the asynchronous call to finish (at most 10 seconds) + final int maxTry = 10; + int tryCount = 1; + Pet fetched = null; + ApiException exception = null; + + do { + if (tryCount > maxTry) fail("have not got result of getPetByIdAsync after 10 seconds"); + Thread.sleep(1000); + tryCount += 1; + if (result.get("pet") != null) fail("expected an error"); + if (result.get("exception") != null) { + exception = (ApiException) result.get("exception"); + break; + } + } while (result.isEmpty()); + assertNotNull(exception); + assertEquals(404, exception.getCode()); + assertEquals("Not Found", exception.getMessage()); + assertEquals("application/json", exception.getResponseHeaders().get("Content-Type").get(0)); + api.deletePet(pet.getId(), null); + } + + @Test + public void testCreateAndGetMultiplePetsAsync() throws Exception { + Pet pet1 = createPet(); + Pet pet2 = createPet(); + + final CountDownLatch addLatch = new CountDownLatch(2); + final TestApiCallback addCallback1 = new TestApiCallback(addLatch); + final TestApiCallback addCallback2 = new TestApiCallback(addLatch); + + // Make 2 simultaneous calls + api.addPetAsync(pet1, addCallback1); + api.addPetAsync(pet2, addCallback2); + + // wait for both asynchronous calls to finish (at most 10 seconds) + assertTrue(addLatch.await(10, TimeUnit.SECONDS)); + + assertTrue(addCallback1.isDone()); + assertTrue(addCallback2.isDone()); + + if (!addCallback1.isSuccess()) throw addCallback1.getException(); + if (!addCallback2.isSuccess()) throw addCallback2.getException(); + + assertValidProgress(addCallback1.getUploadProgress()); + assertValidProgress(addCallback2.getUploadProgress()); + + final CountDownLatch getLatch = new CountDownLatch(3); + final TestApiCallback getCallback1 = new TestApiCallback(getLatch); + final TestApiCallback getCallback2 = new TestApiCallback(getLatch); + final TestApiCallback getCallback3 = new TestApiCallback(getLatch); + + api.getPetByIdAsync(pet1.getId(), getCallback1); + api.getPetByIdAsync(pet2.getId(), getCallback2); + // Get nonexistent pet + api.getPetByIdAsync(-10000L, getCallback3); + + // wait for all asynchronous calls to finish (at most 10 seconds) + assertTrue(getLatch.await(10, TimeUnit.SECONDS)); + + assertTrue(getCallback1.isDone()); + assertTrue(getCallback2.isDone()); + assertTrue(getCallback3.isDone()); + + if (!getCallback1.isSuccess()) throw getCallback1.getException(); + if (!getCallback2.isSuccess()) throw getCallback2.getException(); + + assertPetMatches(pet1, getCallback1.getResult()); + assertPetMatches(pet2, getCallback2.getResult()); + + assertValidProgress(getCallback1.getDownloadProgress()); + assertValidProgress(getCallback2.getDownloadProgress()); + + // Last callback should fail with ApiException + assertFalse(getCallback3.isSuccess()); + final ApiException exception = getCallback3.getException(); + assertNotNull(exception); + assertEquals(404, exception.getCode()); + api.deletePet(pet1.getId(), null); + api.deletePet(pet2.getId(), null); + } + + @Test + public void testUpdatePet() throws Exception { + Pet pet = createPet(); + api.addPet(pet); + pet.setName("programmer"); + + api.updatePet(pet); + + Pet fetched = api.getPetById(pet.getId()); + assertPetMatches(pet, fetched); + api.deletePet(pet.getId(), null); + } + + @Test + public void testFindPetsByStatus() throws Exception { + assertEquals(basePath, api.getApiClient().getBasePath()); + Pet pet = createPet(); + api.addPet(pet); + pet.setName("programmer"); + pet.setStatus(Pet.StatusEnum.PENDING); + api.updatePet(pet); + + List pets = api.findPetsByStatus(Arrays.asList("pending")); + assertNotNull(pets); + + boolean found = false; + for (Pet fetched : pets) { + if (fetched.getId().equals(pet.getId())) { + found = true; + break; + } + } + + assertTrue(found); + + api.deletePet(pet.getId(), null); + } + + @Test + @Ignore + public void testFindPetsByTags() throws Exception { + Pet pet = createPet(); + pet.setName("monster"); + pet.setStatus(Pet.StatusEnum.AVAILABLE); + + List tags = new ArrayList(); + Tag tag1 = new Tag(); + tag1.setName("friendly"); + tags.add(tag1); + pet.setTags(tags); + + api.updatePet(pet); + + List pets = api.findPetsByTags((Arrays.asList("friendly"))); + assertNotNull(pets); + + boolean found = false; + for (Pet fetched : pets) { + if (fetched.getId().equals(pet.getId())) { + found = true; + break; + } + } + assertTrue(found); + + api.deletePet(pet.getId(), null); + } + + @Test + public void testUpdatePetWithForm() throws Exception { + Pet pet = createPet(); + pet.setName("frank"); + api.addPet(pet); + + Pet fetched = api.getPetById(pet.getId()); + + api.updatePetWithForm(fetched.getId(), "furt", null); + Pet updated = api.getPetById(fetched.getId()); + + assertEquals(updated.getName(), "furt"); + api.deletePet(pet.getId(), null); + } + + @Test + @Ignore + public void testDeletePet() throws Exception { + Pet pet = createPet(); + api.addPet(pet); + + Pet fetched = api.getPetById(pet.getId()); + api.deletePet(pet.getId(), null); + + try { + fetched = api.getPetById(fetched.getId()); + fail("expected an error"); + } catch (ApiException e) { + LOG.info("Code: {}. Message: {}", e.getCode(), e.getMessage()); + assertEquals(404, e.getCode()); + } + } + + @Test + public void testUploadFile() throws Exception { + Pet pet = createPet(); + api.addPet(pet); + + File file = new File("hello.txt"); + BufferedWriter writer = new BufferedWriter(new FileWriter(file)); + writer.write("Hello world!"); + writer.close(); + + api.uploadFile(pet.getId(), "a test file", new File(file.getAbsolutePath())); + api.deletePet(pet.getId(), null); + } + + @Test + public void testEqualsAndHashCode() { + Pet pet1 = new Pet(); + Pet pet2 = new Pet(); + assertTrue(pet1.equals(pet2)); + assertTrue(pet2.equals(pet1)); + assertTrue(pet1.hashCode() == pet2.hashCode()); + assertTrue(pet1.equals(pet1)); + assertTrue(pet1.hashCode() == pet1.hashCode()); + + pet2.setName("really-happy"); + pet2.setPhotoUrls( + (Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2"))); + assertFalse(pet1.equals(pet2)); + assertFalse(pet2.equals(pet1)); + assertFalse(pet1.hashCode() == (pet2.hashCode())); + assertTrue(pet2.equals(pet2)); + assertTrue(pet2.hashCode() == pet2.hashCode()); + + pet1.setName("really-happy"); + pet1.setPhotoUrls( + (Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2"))); + assertTrue(pet1.equals(pet2)); + assertTrue(pet2.equals(pet1)); + assertTrue(pet1.hashCode() == pet2.hashCode()); + assertTrue(pet1.equals(pet1)); + assertTrue(pet1.hashCode() == pet1.hashCode()); + } + + private Pet createPet() { + Pet pet = new Pet(); + pet.setId(ThreadLocalRandom.current().nextLong(Long.MAX_VALUE)); + pet.setName("gorilla"); + + Category category = new Category(); + category.setName("really-happy"); + + pet.setCategory(category); + pet.setStatus(Pet.StatusEnum.AVAILABLE); + List photos = + (Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2")); + pet.setPhotoUrls(photos); + + return pet; + } + + private String serializeJson(Object o, ApiClient apiClient) { + return apiClient.getJSON().serialize(o); + } + + private T deserializeJson(String json, Type type, ApiClient apiClient) { + return (T) apiClient.getJSON().deserialize(json, type); + } + + private void assertPetMatches(Pet expected, Pet actual) { + assertNotNull(actual); + assertEquals(expected.getId(), actual.getId()); + assertNotNull(actual.getCategory()); + assertEquals(expected.getCategory().getName(), actual.getCategory().getName()); + } + + /** + * Assert that the given upload/download progress list satisfies the following constraints: + * + *

    - List is not empty - Byte count should be nondecreasing - The last element, and only the + * last element, should have done=true + */ + private void assertValidProgress(List progressList) { + assertFalse(progressList.isEmpty()); + + Progress prev = null; + int index = 0; + for (Progress progress : progressList) { + if (prev != null) { + if (prev.done || prev.bytes > progress.bytes) { + fail("Progress list out of order at index " + index + ": " + progressList); + } + } + prev = progress; + index += 1; + } + + if (!prev.done) { + fail("Last progress item should have done=true: " + progressList); + } + } + + private static class TestApiCallback implements ApiCallback { + + private final CountDownLatch latch; + private final ConcurrentLinkedQueue uploadProgress = + new ConcurrentLinkedQueue(); + private final ConcurrentLinkedQueue downloadProgress = + new ConcurrentLinkedQueue(); + + private boolean done; + private boolean success; + private ApiException exception; + private T result; + + public TestApiCallback(CountDownLatch latch) { + this.latch = latch; + this.done = false; + } + + @Override + public void onFailure( + ApiException e, int statusCode, Map> responseHeaders) { + exception = e; + this.done = true; + this.success = false; + latch.countDown(); + } + + @Override + public void onSuccess(T result, int statusCode, Map> responseHeaders) { + this.result = result; + this.done = true; + this.success = true; + latch.countDown(); + } + + @Override + public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { + uploadProgress.add(new Progress(bytesWritten, contentLength, done)); + } + + @Override + public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { + downloadProgress.add(new Progress(bytesRead, contentLength, done)); + } + + public boolean isDone() { + return done; + } + + public boolean isSuccess() { + return success; + } + + public ApiException getException() { + return exception; + } + + public T getResult() { + return result; + } + + public List getUploadProgress() { + return new ArrayList(uploadProgress); + } + + public List getDownloadProgress() { + return new ArrayList(downloadProgress); + } + } + + private static class Progress { + public final long bytes; + public final long contentLength; + public final boolean done; + + public Progress(long bytes, long contentLength, boolean done) { + this.bytes = bytes; + this.contentLength = contentLength; + this.done = done; + } + + @Override + public String toString() { + return ""; + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/StoreApiTest.java new file mode 100644 index 000000000000..41c551458ed8 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -0,0 +1,86 @@ +/* + * OpenAPI Petstore + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + + +import java.util.Map; +import org.junit.Ignore; +import org.junit.Test; +import org.openapitools.client.ApiException; +import org.openapitools.client.model.Order; + +/** API tests for StoreApi */ +@Ignore +public class StoreApiTest { + + private final StoreApi api = new StoreApi(); + + /** + * Delete purchase order by ID + * + *

    For valid response try integer IDs with value < 1000. Anything above 1000 or + * nonintegers will generate API errors + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteOrderTest() throws ApiException { + String orderId = null; + api.deleteOrder(orderId); + + // TODO: test validations + } + + /** + * Returns pet inventories by status + * + *

    Returns a map of status codes to quantities + * + * @throws ApiException if the Api call fails + */ + @Test + public void getInventoryTest() throws ApiException { + Map response = api.getInventory(); + + // TODO: test validations + } + + /** + * Find purchase order by ID + * + *

    For valid response try integer IDs with value <= 5 or > 10. Other values will + * generated exceptions + * + * @throws ApiException if the Api call fails + */ + @Test + public void getOrderByIdTest() throws ApiException { + Long orderId = null; + Order response = api.getOrderById(orderId); + + // TODO: test validations + } + + /** + * Place an order for a pet + * + * @throws ApiException if the Api call fails + */ + @Test + public void placeOrderTest() throws ApiException { + Order body = null; + Order response = api.placeOrder(body); + + // TODO: test validations + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/UserApiTest.java new file mode 100644 index 000000000000..364b90cab318 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -0,0 +1,138 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + + +import java.util.List; +import org.junit.Ignore; +import org.junit.Test; +import org.openapitools.client.ApiException; +import org.openapitools.client.model.User; + +/** API tests for UserApi */ +@Ignore +public class UserApiTest { + + private final UserApi api = new UserApi(); + + /** + * Create user + * + *

    This can only be done by the logged in user. + * + * @throws ApiException if the Api call fails + */ + @Test + public void createUserTest() throws ApiException { + User body = null; + api.createUser(body); + + // TODO: test validations + } + + /** + * Creates list of users with given input array + * + * @throws ApiException if the Api call fails + */ + @Test + public void createUsersWithArrayInputTest() throws ApiException { + List body = null; + api.createUsersWithArrayInput(body); + + // TODO: test validations + } + + /** + * Creates list of users with given input array + * + * @throws ApiException if the Api call fails + */ + @Test + public void createUsersWithListInputTest() throws ApiException { + List body = null; + api.createUsersWithListInput(body); + + // TODO: test validations + } + + /** + * Delete user + * + *

    This can only be done by the logged in user. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteUserTest() throws ApiException { + String username = null; + api.deleteUser(username); + + // TODO: test validations + } + + /** + * Get user by user name + * + * @throws ApiException if the Api call fails + */ + @Test + public void getUserByNameTest() throws ApiException { + String username = null; + User response = api.getUserByName(username); + + // TODO: test validations + } + + /** + * Logs user into the system + * + * @throws ApiException if the Api call fails + */ + @Test + public void loginUserTest() throws ApiException { + String username = null; + String password = null; + String response = api.loginUser(username, password); + + // TODO: test validations + } + + /** + * Logs out current logged in user session + * + * @throws ApiException if the Api call fails + */ + @Test + public void logoutUserTest() throws ApiException { + api.logoutUser(); + + // TODO: test validations + } + + /** + * Updated user + * + *

    This can only be done by the logged in user. + * + * @throws ApiException if the Api call fails + */ + @Test + public void updateUserTest() throws ApiException { + String username = null; + User body = null; + api.updateUser(username, body); + + // TODO: test validations + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java new file mode 100644 index 000000000000..f7c2ecec9e1e --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java @@ -0,0 +1,119 @@ +package org.openapitools.client.auth; + +import static org.junit.Assert.*; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.*; +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +public class ApiKeyAuthTest { + @Test + public void testApplyToParamsInQuery() throws ApiException { + List queryParams = new ArrayList(); + Map headerParams = new HashMap(); + Map cookieParams = new HashMap(); + + ApiKeyAuth auth = new ApiKeyAuth("query", "api_key"); + auth.setApiKey("my-api-key"); + auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); + + assertEquals(1, queryParams.size()); + for (Pair queryParam : queryParams) { + assertEquals("my-api-key", queryParam.getValue()); + } + + // no changes to header or cookie parameters + assertEquals(0, headerParams.size()); + assertEquals(0, cookieParams.size()); + } + + @Test + public void testApplyToParamsInQueryWithNullValue() throws ApiException { + List queryParams = new ArrayList(); + Map headerParams = new HashMap(); + Map cookieParams = new HashMap(); + + ApiKeyAuth auth = new ApiKeyAuth("query", "api_key"); + auth.setApiKey(null); + auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); + + // no changes to parameters + assertEquals(0, queryParams.size()); + assertEquals(0, headerParams.size()); + assertEquals(0, cookieParams.size()); + } + + @Test + public void testApplyToParamsInHeaderWithPrefix() throws ApiException { + List queryParams = new ArrayList(); + Map headerParams = new HashMap(); + Map cookieParams = new HashMap(); + + ApiKeyAuth auth = new ApiKeyAuth("header", "X-API-TOKEN"); + auth.setApiKey("my-api-token"); + auth.setApiKeyPrefix("Token"); + auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); + + // no changes to query or cookie parameters + assertEquals(0, queryParams.size()); + assertEquals(0, cookieParams.size()); + assertEquals(1, headerParams.size()); + assertEquals("Token my-api-token", headerParams.get("X-API-TOKEN")); + } + + @Test + public void testApplyToParamsInHeaderWithNullValue() throws ApiException { + List queryParams = new ArrayList(); + Map headerParams = new HashMap(); + Map cookieParams = new HashMap(); + + ApiKeyAuth auth = new ApiKeyAuth("header", "X-API-TOKEN"); + auth.setApiKey(null); + auth.setApiKeyPrefix("Token"); + auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); + + // no changes to parameters + assertEquals(0, queryParams.size()); + assertEquals(0, cookieParams.size()); + assertEquals(0, headerParams.size()); + } + + @Test + public void testApplyToParamsInCookieWithPrefix() throws ApiException { + List queryParams = new ArrayList(); + Map headerParams = new HashMap(); + Map cookieParams = new HashMap(); + + ApiKeyAuth auth = new ApiKeyAuth("cookie", "X-API-TOKEN"); + auth.setApiKey("my-api-token"); + auth.setApiKeyPrefix("Token"); + auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); + + // no changes to query or header parameters + assertEquals(0, queryParams.size()); + assertEquals(0, headerParams.size()); + assertEquals(1, cookieParams.size()); + assertEquals("Token my-api-token", cookieParams.get("X-API-TOKEN")); + } + + @Test + public void testApplyToParamsInCookieWithNullValue() throws ApiException { + List queryParams = new ArrayList(); + Map headerParams = new HashMap(); + Map cookieParams = new HashMap(); + + ApiKeyAuth auth = new ApiKeyAuth("cookie", "X-API-TOKEN"); + auth.setApiKey(null); + auth.setApiKeyPrefix("Token"); + auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); + + // no changes to parameters + assertEquals(0, queryParams.size()); + assertEquals(0, cookieParams.size()); + assertEquals(0, headerParams.size()); + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java new file mode 100644 index 000000000000..a077d394ada2 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java @@ -0,0 +1,65 @@ +package org.openapitools.client.auth; + +import static org.junit.Assert.*; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.*; +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +public class HttpBasicAuthTest { + HttpBasicAuth auth = null; + + @Before + public void setup() { + auth = new HttpBasicAuth(); + } + + @Test + public void testApplyToParams() throws ApiException { + List queryParams = new ArrayList(); + Map headerParams = new HashMap(); + Map cookieParams = new HashMap(); + + auth.setUsername("my-username"); + auth.setPassword("my-password"); + auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); + + // no changes to query or cookie parameters + assertEquals(0, queryParams.size()); + assertEquals(0, cookieParams.size()); + assertEquals(1, headerParams.size()); + // the string below is base64-encoded result of "my-username:my-password" with the "Basic " + // prefix + String expected = "Basic bXktdXNlcm5hbWU6bXktcGFzc3dvcmQ="; + assertEquals(expected, headerParams.get("Authorization")); + + // null username should be treated as empty string + auth.setUsername(null); + auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); + // the string below is base64-encoded result of ":my-password" with the "Basic " prefix + expected = "Basic Om15LXBhc3N3b3Jk"; + assertEquals(expected, headerParams.get("Authorization")); + + // null password should be treated as empty string + auth.setUsername("my-username"); + auth.setPassword(null); + auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); + // the string below is base64-encoded result of "my-username:" with the "Basic " prefix + expected = "Basic bXktdXNlcm5hbWU6"; + assertEquals(expected, headerParams.get("Authorization")); + + // null username and password should be ignored + queryParams = new ArrayList(); + headerParams = new HashMap(); + auth.setUsername(null); + auth.setPassword(null); + auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null); + // no changes to parameters + assertEquals(0, queryParams.size()); + assertEquals(0, headerParams.size()); + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/auth/RetryingOAuthTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/auth/RetryingOAuthTest.java new file mode 100644 index 000000000000..7e0b2bec4b58 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/auth/RetryingOAuthTest.java @@ -0,0 +1,123 @@ +package org.openapitools.client.auth; + +import static org.junit.Assert.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import java.io.IOException; +import java.net.HttpURLConnection; +import java.util.Collections; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import okhttp3.*; +import okhttp3.Interceptor.Chain; +import okhttp3.Response.Builder; +import org.apache.commons.lang3.reflect.FieldUtils; +import org.apache.oltu.oauth2.client.OAuthClient; +import org.apache.oltu.oauth2.client.request.OAuthClientRequest; +import org.apache.oltu.oauth2.client.response.OAuthJSONAccessTokenResponse; +import org.apache.oltu.oauth2.common.exception.OAuthProblemException; +import org.apache.oltu.oauth2.common.exception.OAuthSystemException; +import org.junit.Before; +import org.junit.Test; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.stubbing.Answer; + +public class RetryingOAuthTest { + + private RetryingOAuth oauth; + + @Before + public void setUp() throws Exception { + oauth = + new RetryingOAuth( + "_clientId", + "_clientSecret", + OAuthFlow.accessCode, + "https://token.example.com", + Collections.emptyMap()); + oauth.setAccessToken("expired-access-token"); + FieldUtils.writeField(oauth, "oAuthClient", mockOAuthClient(), true); + } + + @Test + public void testSingleRequestUnauthorized() throws Exception { + Response response = oauth.intercept(mockChain()); + assertEquals(HttpURLConnection.HTTP_OK, response.code()); + } + + @Test + public void testTwoConcurrentRequestsUnauthorized() throws Exception { + + Callable callable = + new Callable() { + @Override + public Response call() throws Exception { + return oauth.intercept(mockChain()); + } + }; + ExecutorService executor = Executors.newFixedThreadPool(2); + try { + Future response1 = executor.submit(callable); + Future response2 = executor.submit(callable); + + assertEquals(HttpURLConnection.HTTP_OK, response1.get().code()); + assertEquals(HttpURLConnection.HTTP_OK, response2.get().code()); + } finally { + executor.shutdown(); + } + } + + private OAuthClient mockOAuthClient() throws OAuthProblemException, OAuthSystemException { + OAuthJSONAccessTokenResponse response = mock(OAuthJSONAccessTokenResponse.class); + when(response.getAccessToken()) + .thenAnswer( + new Answer() { + @Override + public String answer(InvocationOnMock invocation) throws Throwable { + // sleep ensures that the bug is triggered. + Thread.sleep(1000); + return "new-access-token"; + } + }); + + OAuthClient client = mock(OAuthClient.class); + when(client.accessToken(any(OAuthClientRequest.class))).thenReturn(response); + return client; + } + + private Chain mockChain() throws IOException { + Chain chain = mock(Chain.class); + + final Request request = new Request.Builder().url("https://api.example.com").build(); + when(chain.request()).thenReturn(request); + + when(chain.proceed(any(Request.class))) + .thenAnswer( + new Answer() { + @Override + public Response answer(InvocationOnMock inv) { + Request r = inv.getArgument(0); + int responseCode = + "Bearer new-access-token".equals(r.header("Authorization")) + ? HttpURLConnection.HTTP_OK + : HttpURLConnection.HTTP_UNAUTHORIZED; + return new Builder() + .protocol(Protocol.HTTP_1_0) + .message("sup") + .request(request) + .body( + ResponseBody.create( + new byte[0], + MediaType.get("application/test"))) + .code(responseCode) + .build(); + } + }); + + return chain; + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java new file mode 100644 index 000000000000..ba387a41bf5d --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -0,0 +1,111 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for AdditionalPropertiesClass + */ +public class AdditionalPropertiesClassTest { + private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); + + /** + * Model tests for AdditionalPropertiesClass + */ + @Test + public void testAdditionalPropertiesClass() { + // TODO: test AdditionalPropertiesClass + } + + /** + * Test the property 'mapProperty' + */ + @Test + public void mapPropertyTest() { + // TODO: test mapProperty + } + + /** + * Test the property 'mapOfMapProperty' + */ + @Test + public void mapOfMapPropertyTest() { + // TODO: test mapOfMapProperty + } + + /** + * Test the property 'anytype1' + */ + @Test + public void anytype1Test() { + // TODO: test anytype1 + } + + /** + * Test the property 'mapWithUndeclaredPropertiesAnytype1' + */ + @Test + public void mapWithUndeclaredPropertiesAnytype1Test() { + // TODO: test mapWithUndeclaredPropertiesAnytype1 + } + + /** + * Test the property 'mapWithUndeclaredPropertiesAnytype2' + */ + @Test + public void mapWithUndeclaredPropertiesAnytype2Test() { + // TODO: test mapWithUndeclaredPropertiesAnytype2 + } + + /** + * Test the property 'mapWithUndeclaredPropertiesAnytype3' + */ + @Test + public void mapWithUndeclaredPropertiesAnytype3Test() { + // TODO: test mapWithUndeclaredPropertiesAnytype3 + } + + /** + * Test the property 'emptyMap' + */ + @Test + public void emptyMapTest() { + // TODO: test emptyMap + } + + /** + * Test the property 'mapWithUndeclaredPropertiesString' + */ + @Test + public void mapWithUndeclaredPropertiesStringTest() { + // TODO: test mapWithUndeclaredPropertiesString + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/AnimalTest.java new file mode 100644 index 000000000000..b11ec766286b --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.Cat; +import org.openapitools.client.model.Dog; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Animal + */ +public class AnimalTest { + private final Animal model = new Animal(); + + /** + * Model tests for Animal + */ + @Test + public void testAnimal() { + // TODO: test Animal + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/AppleReqTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/AppleReqTest.java new file mode 100644 index 000000000000..9b071657eae6 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/AppleReqTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for AppleReq + */ +public class AppleReqTest { + private final AppleReq model = new AppleReq(); + + /** + * Model tests for AppleReq + */ + @Test + public void testAppleReq() { + // TODO: test AppleReq + } + + /** + * Test the property 'cultivar' + */ + @Test + public void cultivarTest() { + // TODO: test cultivar + } + + /** + * Test the property 'mealy' + */ + @Test + public void mealyTest() { + // TODO: test mealy + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/AppleTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/AppleTest.java new file mode 100644 index 000000000000..d70d4bca5f94 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/AppleTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Apple + */ +public class AppleTest { + private final Apple model = new Apple(); + + /** + * Model tests for Apple + */ + @Test + public void testApple() { + // TODO: test Apple + } + + /** + * Test the property 'cultivar' + */ + @Test + public void cultivarTest() { + // TODO: test cultivar + } + + /** + * Test the property 'origin' + */ + @Test + public void originTest() { + // TODO: test origin + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java new file mode 100644 index 000000000000..9afc3397f46c --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -0,0 +1,54 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ArrayOfNumberOnly + */ +public class ArrayOfNumberOnlyTest { + private final ArrayOfNumberOnly model = new ArrayOfNumberOnly(); + + /** + * Model tests for ArrayOfNumberOnly + */ + @Test + public void testArrayOfNumberOnly() { + // TODO: test ArrayOfNumberOnly + } + + /** + * Test the property 'arrayNumber' + */ + @Test + public void arrayNumberTest() { + // TODO: test arrayNumber + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ArrayTestTest.java new file mode 100644 index 000000000000..fab9a30565f3 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ReadOnlyFirst; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ArrayTest + */ +public class ArrayTestTest { + private final ArrayTest model = new ArrayTest(); + + /** + * Model tests for ArrayTest + */ + @Test + public void testArrayTest() { + // TODO: test ArrayTest + } + + /** + * Test the property 'arrayOfString' + */ + @Test + public void arrayOfStringTest() { + // TODO: test arrayOfString + } + + /** + * Test the property 'arrayArrayOfInteger' + */ + @Test + public void arrayArrayOfIntegerTest() { + // TODO: test arrayArrayOfInteger + } + + /** + * Test the property 'arrayArrayOfModel' + */ + @Test + public void arrayArrayOfModelTest() { + // TODO: test arrayArrayOfModel + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/BananaReqTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/BananaReqTest.java new file mode 100644 index 000000000000..c1457da87002 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/BananaReqTest.java @@ -0,0 +1,60 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BananaReq + */ +public class BananaReqTest { + private final BananaReq model = new BananaReq(); + + /** + * Model tests for BananaReq + */ + @Test + public void testBananaReq() { + // TODO: test BananaReq + } + + /** + * Test the property 'lengthCm' + */ + @Test + public void lengthCmTest() { + // TODO: test lengthCm + } + + /** + * Test the property 'sweet' + */ + @Test + public void sweetTest() { + // TODO: test sweet + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/BananaTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/BananaTest.java new file mode 100644 index 000000000000..ff0fbf231a78 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/BananaTest.java @@ -0,0 +1,52 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Banana + */ +public class BananaTest { + private final Banana model = new Banana(); + + /** + * Model tests for Banana + */ + @Test + public void testBanana() { + // TODO: test Banana + } + + /** + * Test the property 'lengthCm' + */ + @Test + public void lengthCmTest() { + // TODO: test lengthCm + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/BasquePigTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/BasquePigTest.java new file mode 100644 index 000000000000..5aa6806a8f76 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/BasquePigTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BasquePig + */ +public class BasquePigTest { + private final BasquePig model = new BasquePig(); + + /** + * Model tests for BasquePig + */ + @Test + public void testBasquePig() { + // TODO: test BasquePig + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/CapitalizationTest.java new file mode 100644 index 000000000000..ced4f48eb5f9 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -0,0 +1,91 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Capitalization + */ +public class CapitalizationTest { + private final Capitalization model = new Capitalization(); + + /** + * Model tests for Capitalization + */ + @Test + public void testCapitalization() { + // TODO: test Capitalization + } + + /** + * Test the property 'smallCamel' + */ + @Test + public void smallCamelTest() { + // TODO: test smallCamel + } + + /** + * Test the property 'capitalCamel' + */ + @Test + public void capitalCamelTest() { + // TODO: test capitalCamel + } + + /** + * Test the property 'smallSnake' + */ + @Test + public void smallSnakeTest() { + // TODO: test smallSnake + } + + /** + * Test the property 'capitalSnake' + */ + @Test + public void capitalSnakeTest() { + // TODO: test capitalSnake + } + + /** + * Test the property 'scAETHFlowPoints' + */ + @Test + public void scAETHFlowPointsTest() { + // TODO: test scAETHFlowPoints + } + + /** + * Test the property 'ATT_NAME' + */ + @Test + public void ATT_NAMETest() { + // TODO: test ATT_NAME + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/CatAllOfTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/CatAllOfTest.java new file mode 100644 index 000000000000..384ab21b773b --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/CatAllOfTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for CatAllOf + */ +public class CatAllOfTest { + private final CatAllOf model = new CatAllOf(); + + /** + * Model tests for CatAllOf + */ + @Test + public void testCatAllOf() { + // TODO: test CatAllOf + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/CatTest.java new file mode 100644 index 000000000000..b2b3e7e048d9 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/CatTest.java @@ -0,0 +1,69 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.Animal; +import org.openapitools.client.model.CatAllOf; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Cat + */ +public class CatTest { + private final Cat model = new Cat(); + + /** + * Model tests for Cat + */ + @Test + public void testCat() { + // TODO: test Cat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/CategoryTest.java new file mode 100644 index 000000000000..a6efa6e1fbc6 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Category + */ +public class CategoryTest { + private final Category model = new Category(); + + /** + * Model tests for Category + */ + @Test + public void testCategory() { + // TODO: test Category + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ClassModelTest.java new file mode 100644 index 000000000000..1233feec65ec --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ClassModel + */ +public class ClassModelTest { + private final ClassModel model = new ClassModel(); + + /** + * Model tests for ClassModel + */ + @Test + public void testClassModel() { + // TODO: test ClassModel + } + + /** + * Test the property 'propertyClass' + */ + @Test + public void propertyClassTest() { + // TODO: test propertyClass + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ClientTest.java new file mode 100644 index 000000000000..456fab74c4d7 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ClientTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Client + */ +public class ClientTest { + private final Client model = new Client(); + + /** + * Model tests for Client + */ + @Test + public void testClient() { + // TODO: test Client + } + + /** + * Test the property 'client' + */ + @Test + public void clientTest() { + // TODO: test client + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ComplexQuadrilateralTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ComplexQuadrilateralTest.java new file mode 100644 index 000000000000..2f8aa865194e --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ComplexQuadrilateralTest.java @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.QuadrilateralInterface; +import org.openapitools.client.model.ShapeInterface; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ComplexQuadrilateral + */ +public class ComplexQuadrilateralTest { + private final ComplexQuadrilateral model = new ComplexQuadrilateral(); + + /** + * Model tests for ComplexQuadrilateral + */ + @Test + public void testComplexQuadrilateral() { + // TODO: test ComplexQuadrilateral + } + + /** + * Test the property 'shapeType' + */ + @Test + public void shapeTypeTest() { + // TODO: test shapeType + } + + /** + * Test the property 'quadrilateralType' + */ + @Test + public void quadrilateralTypeTest() { + // TODO: test quadrilateralType + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/DanishPigTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/DanishPigTest.java new file mode 100644 index 000000000000..459a6abf0f71 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/DanishPigTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for DanishPig + */ +public class DanishPigTest { + private final DanishPig model = new DanishPig(); + + /** + * Model tests for DanishPig + */ + @Test + public void testDanishPig() { + // TODO: test DanishPig + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java new file mode 100644 index 000000000000..9b3d2aee6a83 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for DeprecatedObject + */ +public class DeprecatedObjectTest { + private final DeprecatedObject model = new DeprecatedObject(); + + /** + * Model tests for DeprecatedObject + */ + @Test + public void testDeprecatedObject() { + // TODO: test DeprecatedObject + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/DogAllOfTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/DogAllOfTest.java new file mode 100644 index 000000000000..0d695b15a639 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/DogAllOfTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for DogAllOf + */ +public class DogAllOfTest { + private final DogAllOf model = new DogAllOf(); + + /** + * Model tests for DogAllOf + */ + @Test + public void testDogAllOf() { + // TODO: test DogAllOf + } + + /** + * Test the property 'breed' + */ + @Test + public void breedTest() { + // TODO: test breed + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/DogTest.java new file mode 100644 index 000000000000..124bc99c1f12 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/DogTest.java @@ -0,0 +1,69 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.Animal; +import org.openapitools.client.model.DogAllOf; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Dog + */ +public class DogTest { + private final Dog model = new Dog(); + + /** + * Model tests for Dog + */ + @Test + public void testDog() { + // TODO: test Dog + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'breed' + */ + @Test + public void breedTest() { + // TODO: test breed + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/DrawingTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/DrawingTest.java new file mode 100644 index 000000000000..3e61e46812e4 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/DrawingTest.java @@ -0,0 +1,84 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.client.model.Fruit; +import org.openapitools.client.model.NullableShape; +import org.openapitools.client.model.Shape; +import org.openapitools.client.model.ShapeOrNull; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Drawing + */ +public class DrawingTest { + private final Drawing model = new Drawing(); + + /** + * Model tests for Drawing + */ + @Test + public void testDrawing() { + // TODO: test Drawing + } + + /** + * Test the property 'mainShape' + */ + @Test + public void mainShapeTest() { + // TODO: test mainShape + } + + /** + * Test the property 'shapeOrNull' + */ + @Test + public void shapeOrNullTest() { + // TODO: test shapeOrNull + } + + /** + * Test the property 'nullableShape' + */ + @Test + public void nullableShapeTest() { + // TODO: test nullableShape + } + + /** + * Test the property 'shapes' + */ + @Test + public void shapesTest() { + // TODO: test shapes + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/EnumArraysTest.java new file mode 100644 index 000000000000..c25b05e9f0d1 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for EnumArrays + */ +public class EnumArraysTest { + private final EnumArrays model = new EnumArrays(); + + /** + * Model tests for EnumArrays + */ + @Test + public void testEnumArrays() { + // TODO: test EnumArrays + } + + /** + * Test the property 'justSymbol' + */ + @Test + public void justSymbolTest() { + // TODO: test justSymbol + } + + /** + * Test the property 'arrayEnum' + */ + @Test + public void arrayEnumTest() { + // TODO: test arrayEnum + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/EnumClassTest.java new file mode 100644 index 000000000000..329454658e33 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -0,0 +1,34 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for EnumClass + */ +public class EnumClassTest { + /** + * Model tests for EnumClass + */ + @Test + public void testEnumClass() { + // TODO: test EnumClass + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/EnumTestTest.java new file mode 100644 index 000000000000..54c181bf9f3f --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -0,0 +1,120 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.OuterEnum; +import org.openapitools.client.model.OuterEnumDefaultValue; +import org.openapitools.client.model.OuterEnumInteger; +import org.openapitools.client.model.OuterEnumIntegerDefaultValue; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for EnumTest + */ +public class EnumTestTest { + private final EnumTest model = new EnumTest(); + + /** + * Model tests for EnumTest + */ + @Test + public void testEnumTest() { + // TODO: test EnumTest + } + + /** + * Test the property 'enumString' + */ + @Test + public void enumStringTest() { + // TODO: test enumString + } + + /** + * Test the property 'enumStringRequired' + */ + @Test + public void enumStringRequiredTest() { + // TODO: test enumStringRequired + } + + /** + * Test the property 'enumInteger' + */ + @Test + public void enumIntegerTest() { + // TODO: test enumInteger + } + + /** + * Test the property 'enumIntegerOnly' + */ + @Test + public void enumIntegerOnlyTest() { + // TODO: test enumIntegerOnly + } + + /** + * Test the property 'enumNumber' + */ + @Test + public void enumNumberTest() { + // TODO: test enumNumber + } + + /** + * Test the property 'outerEnum' + */ + @Test + public void outerEnumTest() { + // TODO: test outerEnum + } + + /** + * Test the property 'outerEnumInteger' + */ + @Test + public void outerEnumIntegerTest() { + // TODO: test outerEnumInteger + } + + /** + * Test the property 'outerEnumDefaultValue' + */ + @Test + public void outerEnumDefaultValueTest() { + // TODO: test outerEnumDefaultValue + } + + /** + * Test the property 'outerEnumIntegerDefaultValue' + */ + @Test + public void outerEnumIntegerDefaultValueTest() { + // TODO: test outerEnumIntegerDefaultValue + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/EquilateralTriangleTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/EquilateralTriangleTest.java new file mode 100644 index 000000000000..f3bae7cd78b2 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/EquilateralTriangleTest.java @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.ShapeInterface; +import org.openapitools.client.model.TriangleInterface; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for EquilateralTriangle + */ +public class EquilateralTriangleTest { + private final EquilateralTriangle model = new EquilateralTriangle(); + + /** + * Model tests for EquilateralTriangle + */ + @Test + public void testEquilateralTriangle() { + // TODO: test EquilateralTriangle + } + + /** + * Test the property 'shapeType' + */ + @Test + public void shapeTypeTest() { + // TODO: test shapeType + } + + /** + * Test the property 'triangleType' + */ + @Test + public void triangleTypeTest() { + // TODO: test triangleType + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java new file mode 100644 index 000000000000..0ca366212088 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for FileSchemaTestClass + */ +public class FileSchemaTestClassTest { + private final FileSchemaTestClass model = new FileSchemaTestClass(); + + /** + * Model tests for FileSchemaTestClass + */ + @Test + public void testFileSchemaTestClass() { + // TODO: test FileSchemaTestClass + } + + /** + * Test the property 'file' + */ + @Test + public void fileTest() { + // TODO: test file + } + + /** + * Test the property 'files' + */ + @Test + public void filesTest() { + // TODO: test files + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FooTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FooTest.java new file mode 100644 index 000000000000..417b05ea7fad --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FooTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Foo + */ +public class FooTest { + private final Foo model = new Foo(); + + /** + * Model tests for Foo + */ + @Test + public void testFoo() { + // TODO: test Foo + } + + /** + * Test the property 'bar' + */ + @Test + public void barTest() { + // TODO: test bar + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FormatTestTest.java new file mode 100644 index 000000000000..6d3c5e1c2a82 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -0,0 +1,176 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.File; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.UUID; +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for FormatTest + */ +public class FormatTestTest { + private final FormatTest model = new FormatTest(); + + /** + * Model tests for FormatTest + */ + @Test + public void testFormatTest() { + // TODO: test FormatTest + } + + /** + * Test the property 'integer' + */ + @Test + public void integerTest() { + // TODO: test integer + } + + /** + * Test the property 'int32' + */ + @Test + public void int32Test() { + // TODO: test int32 + } + + /** + * Test the property 'int64' + */ + @Test + public void int64Test() { + // TODO: test int64 + } + + /** + * Test the property 'number' + */ + @Test + public void numberTest() { + // TODO: test number + } + + /** + * Test the property '_float' + */ + @Test + public void _floatTest() { + // TODO: test _float + } + + /** + * Test the property '_double' + */ + @Test + public void _doubleTest() { + // TODO: test _double + } + + /** + * Test the property 'decimal' + */ + @Test + public void decimalTest() { + // TODO: test decimal + } + + /** + * Test the property 'string' + */ + @Test + public void stringTest() { + // TODO: test string + } + + /** + * Test the property '_byte' + */ + @Test + public void _byteTest() { + // TODO: test _byte + } + + /** + * Test the property 'binary' + */ + @Test + public void binaryTest() { + // TODO: test binary + } + + /** + * Test the property 'date' + */ + @Test + public void dateTest() { + // TODO: test date + } + + /** + * Test the property 'dateTime' + */ + @Test + public void dateTimeTest() { + // TODO: test dateTime + } + + /** + * Test the property 'uuid' + */ + @Test + public void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'password' + */ + @Test + public void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'patternWithDigits' + */ + @Test + public void patternWithDigitsTest() { + // TODO: test patternWithDigits + } + + /** + * Test the property 'patternWithDigitsAndDelimiter' + */ + @Test + public void patternWithDigitsAndDelimiterTest() { + // TODO: test patternWithDigitsAndDelimiter + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FruitReqTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FruitReqTest.java new file mode 100644 index 000000000000..d279752b095c --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FruitReqTest.java @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.AppleReq; +import org.openapitools.client.model.BananaReq; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for FruitReq + */ +public class FruitReqTest { + private final FruitReq model = new FruitReq(); + + /** + * Model tests for FruitReq + */ + @Test + public void testFruitReq() { + // TODO: test FruitReq + } + + /** + * Test the property 'cultivar' + */ + @Test + public void cultivarTest() { + // TODO: test cultivar + } + + /** + * Test the property 'mealy' + */ + @Test + public void mealyTest() { + // TODO: test mealy + } + + /** + * Test the property 'lengthCm' + */ + @Test + public void lengthCmTest() { + // TODO: test lengthCm + } + + /** + * Test the property 'sweet' + */ + @Test + public void sweetTest() { + // TODO: test sweet + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FruitTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FruitTest.java new file mode 100644 index 000000000000..b9e1f8af86c9 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FruitTest.java @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.Apple; +import org.openapitools.client.model.Banana; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Fruit + */ +public class FruitTest { + private final Fruit model = new Fruit(); + + /** + * Model tests for Fruit + */ + @Test + public void testFruit() { + // TODO: test Fruit + } + + /** + * Test the property 'cultivar' + */ + @Test + public void cultivarTest() { + // TODO: test cultivar + } + + /** + * Test the property 'origin' + */ + @Test + public void originTest() { + // TODO: test origin + } + + /** + * Test the property 'lengthCm' + */ + @Test + public void lengthCmTest() { + // TODO: test lengthCm + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/GmFruitTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/GmFruitTest.java new file mode 100644 index 000000000000..cd93334d89fa --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/GmFruitTest.java @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.Apple; +import org.openapitools.client.model.Banana; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for GmFruit + */ +public class GmFruitTest { + private final GmFruit model = new GmFruit(); + + /** + * Model tests for GmFruit + */ + @Test + public void testGmFruit() { + // TODO: test GmFruit + } + + /** + * Test the property 'cultivar' + */ + @Test + public void cultivarTest() { + // TODO: test cultivar + } + + /** + * Test the property 'origin' + */ + @Test + public void originTest() { + // TODO: test origin + } + + /** + * Test the property 'lengthCm' + */ + @Test + public void lengthCmTest() { + // TODO: test lengthCm + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/GrandparentAnimalTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/GrandparentAnimalTest.java new file mode 100644 index 000000000000..63221458573c --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/GrandparentAnimalTest.java @@ -0,0 +1,52 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.ParentPet; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for GrandparentAnimal + */ +public class GrandparentAnimalTest { + private final GrandparentAnimal model = new GrandparentAnimal(); + + /** + * Model tests for GrandparentAnimal + */ + @Test + public void testGrandparentAnimal() { + // TODO: test GrandparentAnimal + } + + /** + * Test the property 'petType' + */ + @Test + public void petTypeTest() { + // TODO: test petType + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java new file mode 100644 index 000000000000..0272d7b80004 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for HasOnlyReadOnly + */ +public class HasOnlyReadOnlyTest { + private final HasOnlyReadOnly model = new HasOnlyReadOnly(); + + /** + * Model tests for HasOnlyReadOnly + */ + @Test + public void testHasOnlyReadOnly() { + // TODO: test HasOnlyReadOnly + } + + /** + * Test the property 'bar' + */ + @Test + public void barTest() { + // TODO: test bar + } + + /** + * Test the property 'foo' + */ + @Test + public void fooTest() { + // TODO: test foo + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java new file mode 100644 index 000000000000..11572abcf303 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java @@ -0,0 +1,52 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for HealthCheckResult + */ +public class HealthCheckResultTest { + private final HealthCheckResult model = new HealthCheckResult(); + + /** + * Model tests for HealthCheckResult + */ + @Test + public void testHealthCheckResult() { + // TODO: test HealthCheckResult + } + + /** + * Test the property 'nullableMessage' + */ + @Test + public void nullableMessageTest() { + // TODO: test nullableMessage + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/InlineResponseDefaultTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/InlineResponseDefaultTest.java new file mode 100644 index 000000000000..58831cea0bdc --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/InlineResponseDefaultTest.java @@ -0,0 +1,52 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.Foo; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for InlineResponseDefault + */ +public class InlineResponseDefaultTest { + private final InlineResponseDefault model = new InlineResponseDefault(); + + /** + * Model tests for InlineResponseDefault + */ + @Test + public void testInlineResponseDefault() { + // TODO: test InlineResponseDefault + } + + /** + * Test the property 'string' + */ + @Test + public void stringTest() { + // TODO: test string + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/IsoscelesTriangleTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/IsoscelesTriangleTest.java new file mode 100644 index 000000000000..2f21d3e37c76 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/IsoscelesTriangleTest.java @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.ShapeInterface; +import org.openapitools.client.model.TriangleInterface; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for IsoscelesTriangle + */ +public class IsoscelesTriangleTest { + private final IsoscelesTriangle model = new IsoscelesTriangle(); + + /** + * Model tests for IsoscelesTriangle + */ + @Test + public void testIsoscelesTriangle() { + // TODO: test IsoscelesTriangle + } + + /** + * Test the property 'shapeType' + */ + @Test + public void shapeTypeTest() { + // TODO: test shapeType + } + + /** + * Test the property 'triangleType' + */ + @Test + public void triangleTypeTest() { + // TODO: test triangleType + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/MammalTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/MammalTest.java new file mode 100644 index 000000000000..531d9b28688e --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/MammalTest.java @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.Pig; +import org.openapitools.client.model.Whale; +import org.openapitools.client.model.Zebra; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Mammal + */ +public class MammalTest { + private final Mammal model = new Mammal(); + + /** + * Model tests for Mammal + */ + @Test + public void testMammal() { + // TODO: test Mammal + } + + /** + * Test the property 'hasBaleen' + */ + @Test + public void hasBaleenTest() { + // TODO: test hasBaleen + } + + /** + * Test the property 'hasTeeth' + */ + @Test + public void hasTeethTest() { + // TODO: test hasTeeth + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/MapTestTest.java new file mode 100644 index 000000000000..f86a1303fc88 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for MapTest + */ +public class MapTestTest { + private final MapTest model = new MapTest(); + + /** + * Model tests for MapTest + */ + @Test + public void testMapTest() { + // TODO: test MapTest + } + + /** + * Test the property 'mapMapOfString' + */ + @Test + public void mapMapOfStringTest() { + // TODO: test mapMapOfString + } + + /** + * Test the property 'mapOfEnumString' + */ + @Test + public void mapOfEnumStringTest() { + // TODO: test mapOfEnumString + } + + /** + * Test the property 'directMap' + */ + @Test + public void directMapTest() { + // TODO: test directMap + } + + /** + * Test the property 'indirectMap' + */ + @Test + public void indirectMapTest() { + // TODO: test indirectMap + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java new file mode 100644 index 000000000000..808773a5d852 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -0,0 +1,73 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import org.openapitools.client.model.Animal; +import org.threeten.bp.OffsetDateTime; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for MixedPropertiesAndAdditionalPropertiesClass + */ +public class MixedPropertiesAndAdditionalPropertiesClassTest { + private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass(); + + /** + * Model tests for MixedPropertiesAndAdditionalPropertiesClass + */ + @Test + public void testMixedPropertiesAndAdditionalPropertiesClass() { + // TODO: test MixedPropertiesAndAdditionalPropertiesClass + } + + /** + * Test the property 'uuid' + */ + @Test + public void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'dateTime' + */ + @Test + public void dateTimeTest() { + // TODO: test dateTime + } + + /** + * Test the property 'map' + */ + @Test + public void mapTest() { + // TODO: test map + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/Model200ResponseTest.java new file mode 100644 index 000000000000..d81fa5a0f669 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Model200Response + */ +public class Model200ResponseTest { + private final Model200Response model = new Model200Response(); + + /** + * Model tests for Model200Response + */ + @Test + public void testModel200Response() { + // TODO: test Model200Response + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'propertyClass' + */ + @Test + public void propertyClassTest() { + // TODO: test propertyClass + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java new file mode 100644 index 000000000000..91bd8fada260 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -0,0 +1,67 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelApiResponse + */ +public class ModelApiResponseTest { + private final ModelApiResponse model = new ModelApiResponse(); + + /** + * Model tests for ModelApiResponse + */ + @Test + public void testModelApiResponse() { + // TODO: test ModelApiResponse + } + + /** + * Test the property 'code' + */ + @Test + public void codeTest() { + // TODO: test code + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelReturnTest.java new file mode 100644 index 000000000000..f317fef485ea --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelReturn + */ +public class ModelReturnTest { + private final ModelReturn model = new ModelReturn(); + + /** + * Model tests for ModelReturn + */ + @Test + public void testModelReturn() { + // TODO: test ModelReturn + } + + /** + * Test the property '_return' + */ + @Test + public void _returnTest() { + // TODO: test _return + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/NameTest.java new file mode 100644 index 000000000000..1ed41a0f80c7 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/NameTest.java @@ -0,0 +1,75 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Name + */ +public class NameTest { + private final Name model = new Name(); + + /** + * Model tests for Name + */ + @Test + public void testName() { + // TODO: test Name + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'snakeCase' + */ + @Test + public void snakeCaseTest() { + // TODO: test snakeCase + } + + /** + * Test the property 'property' + */ + @Test + public void propertyTest() { + // TODO: test property + } + + /** + * Test the property '_123number' + */ + @Test + public void _123numberTest() { + // TODO: test _123number + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/NullableClassTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/NullableClassTest.java new file mode 100644 index 000000000000..74c390c8a664 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/NullableClassTest.java @@ -0,0 +1,147 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for NullableClass + */ +public class NullableClassTest { + private final NullableClass model = new NullableClass(); + + /** + * Model tests for NullableClass + */ + @Test + public void testNullableClass() { + // TODO: test NullableClass + } + + /** + * Test the property 'integerProp' + */ + @Test + public void integerPropTest() { + // TODO: test integerProp + } + + /** + * Test the property 'numberProp' + */ + @Test + public void numberPropTest() { + // TODO: test numberProp + } + + /** + * Test the property 'booleanProp' + */ + @Test + public void booleanPropTest() { + // TODO: test booleanProp + } + + /** + * Test the property 'stringProp' + */ + @Test + public void stringPropTest() { + // TODO: test stringProp + } + + /** + * Test the property 'dateProp' + */ + @Test + public void datePropTest() { + // TODO: test dateProp + } + + /** + * Test the property 'datetimeProp' + */ + @Test + public void datetimePropTest() { + // TODO: test datetimeProp + } + + /** + * Test the property 'arrayNullableProp' + */ + @Test + public void arrayNullablePropTest() { + // TODO: test arrayNullableProp + } + + /** + * Test the property 'arrayAndItemsNullableProp' + */ + @Test + public void arrayAndItemsNullablePropTest() { + // TODO: test arrayAndItemsNullableProp + } + + /** + * Test the property 'arrayItemsNullable' + */ + @Test + public void arrayItemsNullableTest() { + // TODO: test arrayItemsNullable + } + + /** + * Test the property 'objectNullableProp' + */ + @Test + public void objectNullablePropTest() { + // TODO: test objectNullableProp + } + + /** + * Test the property 'objectAndItemsNullableProp' + */ + @Test + public void objectAndItemsNullablePropTest() { + // TODO: test objectAndItemsNullableProp + } + + /** + * Test the property 'objectItemsNullable' + */ + @Test + public void objectItemsNullableTest() { + // TODO: test objectItemsNullable + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/NullableShapeTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/NullableShapeTest.java new file mode 100644 index 000000000000..d6c946fff37f --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/NullableShapeTest.java @@ -0,0 +1,69 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.Quadrilateral; +import org.openapitools.client.model.Triangle; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for NullableShape + */ +public class NullableShapeTest { + private final NullableShape model = new NullableShape(); + + /** + * Model tests for NullableShape + */ + @Test + public void testNullableShape() { + // TODO: test NullableShape + } + + /** + * Test the property 'shapeType' + */ + @Test + public void shapeTypeTest() { + // TODO: test shapeType + } + + /** + * Test the property 'triangleType' + */ + @Test + public void triangleTypeTest() { + // TODO: test triangleType + } + + /** + * Test the property 'quadrilateralType' + */ + @Test + public void quadrilateralTypeTest() { + // TODO: test quadrilateralType + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/NumberOnlyTest.java new file mode 100644 index 000000000000..15b74f7ef8bf --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -0,0 +1,52 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for NumberOnly + */ +public class NumberOnlyTest { + private final NumberOnly model = new NumberOnly(); + + /** + * Model tests for NumberOnly + */ + @Test + public void testNumberOnly() { + // TODO: test NumberOnly + } + + /** + * Test the property 'justNumber' + */ + @Test + public void justNumberTest() { + // TODO: test justNumber + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java new file mode 100644 index 000000000000..f8403d9abc40 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java @@ -0,0 +1,79 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.DeprecatedObject; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ObjectWithDeprecatedFields + */ +public class ObjectWithDeprecatedFieldsTest { + private final ObjectWithDeprecatedFields model = new ObjectWithDeprecatedFields(); + + /** + * Model tests for ObjectWithDeprecatedFields + */ + @Test + public void testObjectWithDeprecatedFields() { + // TODO: test ObjectWithDeprecatedFields + } + + /** + * Test the property 'uuid' + */ + @Test + public void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'deprecatedRef' + */ + @Test + public void deprecatedRefTest() { + // TODO: test deprecatedRef + } + + /** + * Test the property 'bars' + */ + @Test + public void barsTest() { + // TODO: test bars + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OrderTest.java new file mode 100644 index 000000000000..b5cc55e4f581 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OrderTest.java @@ -0,0 +1,92 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Order + */ +public class OrderTest { + private final Order model = new Order(); + + /** + * Model tests for Order + */ + @Test + public void testOrder() { + // TODO: test Order + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'petId' + */ + @Test + public void petIdTest() { + // TODO: test petId + } + + /** + * Test the property 'quantity' + */ + @Test + public void quantityTest() { + // TODO: test quantity + } + + /** + * Test the property 'shipDate' + */ + @Test + public void shipDateTest() { + // TODO: test shipDate + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'complete' + */ + @Test + public void completeTest() { + // TODO: test complete + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OuterCompositeTest.java new file mode 100644 index 000000000000..67ee59963636 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -0,0 +1,68 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for OuterComposite + */ +public class OuterCompositeTest { + private final OuterComposite model = new OuterComposite(); + + /** + * Model tests for OuterComposite + */ + @Test + public void testOuterComposite() { + // TODO: test OuterComposite + } + + /** + * Test the property 'myNumber' + */ + @Test + public void myNumberTest() { + // TODO: test myNumber + } + + /** + * Test the property 'myString' + */ + @Test + public void myStringTest() { + // TODO: test myString + } + + /** + * Test the property 'myBoolean' + */ + @Test + public void myBooleanTest() { + // TODO: test myBoolean + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java new file mode 100644 index 000000000000..e6d40222de0c --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java @@ -0,0 +1,34 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for OuterEnumDefaultValue + */ +public class OuterEnumDefaultValueTest { + /** + * Model tests for OuterEnumDefaultValue + */ + @Test + public void testOuterEnumDefaultValue() { + // TODO: test OuterEnumDefaultValue + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java new file mode 100644 index 000000000000..c030716b5612 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java @@ -0,0 +1,34 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for OuterEnumIntegerDefaultValue + */ +public class OuterEnumIntegerDefaultValueTest { + /** + * Model tests for OuterEnumIntegerDefaultValue + */ + @Test + public void testOuterEnumIntegerDefaultValue() { + // TODO: test OuterEnumIntegerDefaultValue + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java new file mode 100644 index 000000000000..67b2f5ede6da --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java @@ -0,0 +1,34 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for OuterEnumInteger + */ +public class OuterEnumIntegerTest { + /** + * Model tests for OuterEnumInteger + */ + @Test + public void testOuterEnumInteger() { + // TODO: test OuterEnumInteger + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OuterEnumTest.java new file mode 100644 index 000000000000..220d40e83cbb --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -0,0 +1,34 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for OuterEnum + */ +public class OuterEnumTest { + /** + * Model tests for OuterEnum + */ + @Test + public void testOuterEnum() { + // TODO: test OuterEnum + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ParentPetTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ParentPetTest.java new file mode 100644 index 000000000000..729352ddf64d --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ParentPetTest.java @@ -0,0 +1,52 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.GrandparentAnimal; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ParentPet + */ +public class ParentPetTest { + private final ParentPet model = new ParentPet(); + + /** + * Model tests for ParentPet + */ + @Test + public void testParentPet() { + // TODO: test ParentPet + } + + /** + * Test the property 'petType' + */ + @Test + public void petTypeTest() { + // TODO: test petType + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/PigTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/PigTest.java new file mode 100644 index 000000000000..003af60bcc47 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/PigTest.java @@ -0,0 +1,53 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.BasquePig; +import org.openapitools.client.model.DanishPig; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Pig + */ +public class PigTest { + private final Pig model = new Pig(); + + /** + * Model tests for Pig + */ + @Test + public void testPig() { + // TODO: test Pig + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/QuadrilateralInterfaceTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/QuadrilateralInterfaceTest.java new file mode 100644 index 000000000000..a27f30704afa --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/QuadrilateralInterfaceTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for QuadrilateralInterface + */ +public class QuadrilateralInterfaceTest { + private final QuadrilateralInterface model = new QuadrilateralInterface(); + + /** + * Model tests for QuadrilateralInterface + */ + @Test + public void testQuadrilateralInterface() { + // TODO: test QuadrilateralInterface + } + + /** + * Test the property 'quadrilateralType' + */ + @Test + public void quadrilateralTypeTest() { + // TODO: test quadrilateralType + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/QuadrilateralTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/QuadrilateralTest.java new file mode 100644 index 000000000000..96985f4b6f56 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/QuadrilateralTest.java @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.ComplexQuadrilateral; +import org.openapitools.client.model.SimpleQuadrilateral; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Quadrilateral + */ +public class QuadrilateralTest { + private final Quadrilateral model = new Quadrilateral(); + + /** + * Model tests for Quadrilateral + */ + @Test + public void testQuadrilateral() { + // TODO: test Quadrilateral + } + + /** + * Test the property 'shapeType' + */ + @Test + public void shapeTypeTest() { + // TODO: test shapeType + } + + /** + * Test the property 'quadrilateralType' + */ + @Test + public void quadrilateralTypeTest() { + // TODO: test quadrilateralType + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java new file mode 100644 index 000000000000..2dc9cb2ae2cd --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ReadOnlyFirst + */ +public class ReadOnlyFirstTest { + private final ReadOnlyFirst model = new ReadOnlyFirst(); + + /** + * Model tests for ReadOnlyFirst + */ + @Test + public void testReadOnlyFirst() { + // TODO: test ReadOnlyFirst + } + + /** + * Test the property 'bar' + */ + @Test + public void barTest() { + // TODO: test bar + } + + /** + * Test the property 'baz' + */ + @Test + public void bazTest() { + // TODO: test baz + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ScaleneTriangleTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ScaleneTriangleTest.java new file mode 100644 index 000000000000..62bfbaa7d72f --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ScaleneTriangleTest.java @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.ShapeInterface; +import org.openapitools.client.model.TriangleInterface; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ScaleneTriangle + */ +public class ScaleneTriangleTest { + private final ScaleneTriangle model = new ScaleneTriangle(); + + /** + * Model tests for ScaleneTriangle + */ + @Test + public void testScaleneTriangle() { + // TODO: test ScaleneTriangle + } + + /** + * Test the property 'shapeType' + */ + @Test + public void shapeTypeTest() { + // TODO: test shapeType + } + + /** + * Test the property 'triangleType' + */ + @Test + public void triangleTypeTest() { + // TODO: test triangleType + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ShapeInterfaceTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ShapeInterfaceTest.java new file mode 100644 index 000000000000..21b9d7478852 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ShapeInterfaceTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ShapeInterface + */ +public class ShapeInterfaceTest { + private final ShapeInterface model = new ShapeInterface(); + + /** + * Model tests for ShapeInterface + */ + @Test + public void testShapeInterface() { + // TODO: test ShapeInterface + } + + /** + * Test the property 'shapeType' + */ + @Test + public void shapeTypeTest() { + // TODO: test shapeType + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ShapeOrNullTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ShapeOrNullTest.java new file mode 100644 index 000000000000..9ea2ec9fa044 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ShapeOrNullTest.java @@ -0,0 +1,69 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.Quadrilateral; +import org.openapitools.client.model.Triangle; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ShapeOrNull + */ +public class ShapeOrNullTest { + private final ShapeOrNull model = new ShapeOrNull(); + + /** + * Model tests for ShapeOrNull + */ + @Test + public void testShapeOrNull() { + // TODO: test ShapeOrNull + } + + /** + * Test the property 'shapeType' + */ + @Test + public void shapeTypeTest() { + // TODO: test shapeType + } + + /** + * Test the property 'triangleType' + */ + @Test + public void triangleTypeTest() { + // TODO: test triangleType + } + + /** + * Test the property 'quadrilateralType' + */ + @Test + public void quadrilateralTypeTest() { + // TODO: test quadrilateralType + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ShapeTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ShapeTest.java new file mode 100644 index 000000000000..1ed82e64e36d --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ShapeTest.java @@ -0,0 +1,69 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.Quadrilateral; +import org.openapitools.client.model.Triangle; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Shape + */ +public class ShapeTest { + private final Shape model = new Shape(); + + /** + * Model tests for Shape + */ + @Test + public void testShape() { + // TODO: test Shape + } + + /** + * Test the property 'shapeType' + */ + @Test + public void shapeTypeTest() { + // TODO: test shapeType + } + + /** + * Test the property 'triangleType' + */ + @Test + public void triangleTypeTest() { + // TODO: test triangleType + } + + /** + * Test the property 'quadrilateralType' + */ + @Test + public void quadrilateralTypeTest() { + // TODO: test quadrilateralType + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/SimpleQuadrilateralTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/SimpleQuadrilateralTest.java new file mode 100644 index 000000000000..7396def4a463 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/SimpleQuadrilateralTest.java @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.QuadrilateralInterface; +import org.openapitools.client.model.ShapeInterface; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for SimpleQuadrilateral + */ +public class SimpleQuadrilateralTest { + private final SimpleQuadrilateral model = new SimpleQuadrilateral(); + + /** + * Model tests for SimpleQuadrilateral + */ + @Test + public void testSimpleQuadrilateral() { + // TODO: test SimpleQuadrilateral + } + + /** + * Test the property 'shapeType' + */ + @Test + public void shapeTypeTest() { + // TODO: test shapeType + } + + /** + * Test the property 'quadrilateralType' + */ + @Test + public void quadrilateralTypeTest() { + // TODO: test quadrilateralType + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java new file mode 100644 index 000000000000..0c723c8cd0cc --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for SpecialModelName + */ +public class SpecialModelNameTest { + private final SpecialModelName model = new SpecialModelName(); + + /** + * Model tests for SpecialModelName + */ + @Test + public void testSpecialModelName() { + // TODO: test SpecialModelName + } + + /** + * Test the property '$specialPropertyName' + */ + @Test + public void $specialPropertyNameTest() { + // TODO: test $specialPropertyName + } + + /** + * Test the property 'specialModelName' + */ + @Test + public void specialModelNameTest() { + // TODO: test specialModelName + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/TagTest.java new file mode 100644 index 000000000000..83f536d2fa39 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/TagTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Tag + */ +public class TagTest { + private final Tag model = new Tag(); + + /** + * Model tests for Tag + */ + @Test + public void testTag() { + // TODO: test Tag + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/TriangleInterfaceTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/TriangleInterfaceTest.java new file mode 100644 index 000000000000..e17fdd94cf2b --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/TriangleInterfaceTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for TriangleInterface + */ +public class TriangleInterfaceTest { + private final TriangleInterface model = new TriangleInterface(); + + /** + * Model tests for TriangleInterface + */ + @Test + public void testTriangleInterface() { + // TODO: test TriangleInterface + } + + /** + * Test the property 'triangleType' + */ + @Test + public void triangleTypeTest() { + // TODO: test triangleType + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/TriangleTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/TriangleTest.java new file mode 100644 index 000000000000..071646b6645b --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/TriangleTest.java @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.EquilateralTriangle; +import org.openapitools.client.model.IsoscelesTriangle; +import org.openapitools.client.model.ScaleneTriangle; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Triangle + */ +public class TriangleTest { + private final Triangle model = new Triangle(); + + /** + * Model tests for Triangle + */ + @Test + public void testTriangle() { + // TODO: test Triangle + } + + /** + * Test the property 'shapeType' + */ + @Test + public void shapeTypeTest() { + // TODO: test shapeType + } + + /** + * Test the property 'triangleType' + */ + @Test + public void triangleTypeTest() { + // TODO: test triangleType + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/UserTest.java new file mode 100644 index 000000000000..3b673daf5442 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/UserTest.java @@ -0,0 +1,140 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for User + */ +public class UserTest { + private final User model = new User(); + + /** + * Model tests for User + */ + @Test + public void testUser() { + // TODO: test User + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'username' + */ + @Test + public void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'firstName' + */ + @Test + public void firstNameTest() { + // TODO: test firstName + } + + /** + * Test the property 'lastName' + */ + @Test + public void lastNameTest() { + // TODO: test lastName + } + + /** + * Test the property 'email' + */ + @Test + public void emailTest() { + // TODO: test email + } + + /** + * Test the property 'password' + */ + @Test + public void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'phone' + */ + @Test + public void phoneTest() { + // TODO: test phone + } + + /** + * Test the property 'userStatus' + */ + @Test + public void userStatusTest() { + // TODO: test userStatus + } + + /** + * Test the property 'objectWithNoDeclaredProps' + */ + @Test + public void objectWithNoDeclaredPropsTest() { + // TODO: test objectWithNoDeclaredProps + } + + /** + * Test the property 'objectWithNoDeclaredPropsNullable' + */ + @Test + public void objectWithNoDeclaredPropsNullableTest() { + // TODO: test objectWithNoDeclaredPropsNullable + } + + /** + * Test the property 'anyTypeProp' + */ + @Test + public void anyTypePropTest() { + // TODO: test anyTypeProp + } + + /** + * Test the property 'anyTypePropNullable' + */ + @Test + public void anyTypePropNullableTest() { + // TODO: test anyTypePropNullable + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/WhaleTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/WhaleTest.java new file mode 100644 index 000000000000..6b38ea184bbd --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/WhaleTest.java @@ -0,0 +1,67 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Whale + */ +public class WhaleTest { + private final Whale model = new Whale(); + + /** + * Model tests for Whale + */ + @Test + public void testWhale() { + // TODO: test Whale + } + + /** + * Test the property 'hasBaleen' + */ + @Test + public void hasBaleenTest() { + // TODO: test hasBaleen + } + + /** + * Test the property 'hasTeeth' + */ + @Test + public void hasTeethTest() { + // TODO: test hasTeeth + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ZebraTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ZebraTest.java new file mode 100644 index 000000000000..b622d7822bf5 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ZebraTest.java @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Zebra + */ +public class ZebraTest { + private final Zebra model = new Zebra(); + + /** + * Model tests for Zebra + */ + @Test + public void testZebra() { + // TODO: test Zebra + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 000000000000..ddda27d5fed9 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} From a24d314006c5d19c600d089a3d1c4648f7e39f69 Mon Sep 17 00:00:00 2001 From: Fumito Nakazawa Date: Wed, 1 Dec 2021 01:34:15 +0900 Subject: [PATCH 049/117] [swift5] Use enum as parameter instead of raw type (#10967) * Fix enum type * Remove operation_id * Fix samples --- .../src/main/resources/swift5/api.mustache | 14 +++++++------- .../src/main/resources/swift5/api_doc.mustache | 8 ++++---- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 4 ++-- .../Classes/OpenAPIs/APIs/PetAPI.swift | 4 ++-- .../swift5/alamofireLibrary/docs/FakeAPI.md | 2 +- .../swift5/alamofireLibrary/docs/PetAPI.md | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 4 ++-- .../Classes/OpenAPIs/APIs/PetAPI.swift | 4 ++-- .../swift5/asyncAwaitLibrary/docs/FakeAPI.md | 2 +- .../swift5/asyncAwaitLibrary/docs/PetAPI.md | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 4 ++-- .../Classes/OpenAPIs/APIs/PetAPI.swift | 4 ++-- .../petstore/swift5/combineLibrary/docs/FakeAPI.md | 2 +- .../petstore/swift5/combineLibrary/docs/PetAPI.md | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 4 ++-- .../Classes/OpenAPIs/APIs/PetAPI.swift | 4 ++-- .../client/petstore/swift5/default/docs/FakeAPI.md | 2 +- .../client/petstore/swift5/default/docs/PetAPI.md | 2 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 4 ++-- .../petstore/swift5/deprecated/docs/PetAPI.md | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 4 ++-- .../Classes/OpenAPIs/APIs/PetAPI.swift | 4 ++-- .../petstore/swift5/nonPublicApi/docs/FakeAPI.md | 2 +- .../petstore/swift5/nonPublicApi/docs/PetAPI.md | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 4 ++-- .../Classes/OpenAPIs/APIs/PetAPI.swift | 4 ++-- .../petstore/swift5/objcCompatible/docs/FakeAPI.md | 2 +- .../petstore/swift5/objcCompatible/docs/PetAPI.md | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 4 ++-- .../Classes/OpenAPIs/APIs/PetAPI.swift | 4 ++-- .../swift5/promisekitLibrary/docs/FakeAPI.md | 2 +- .../swift5/promisekitLibrary/docs/PetAPI.md | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 4 ++-- .../Classes/OpenAPIs/APIs/PetAPI.swift | 4 ++-- .../swift5/readonlyProperties/docs/FakeAPI.md | 2 +- .../swift5/readonlyProperties/docs/PetAPI.md | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 4 ++-- .../Classes/OpenAPIs/APIs/PetAPI.swift | 4 ++-- .../petstore/swift5/resultLibrary/docs/FakeAPI.md | 2 +- .../petstore/swift5/resultLibrary/docs/PetAPI.md | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 4 ++-- .../Classes/OpenAPIs/APIs/PetAPI.swift | 4 ++-- .../petstore/swift5/rxswiftLibrary/docs/FakeAPI.md | 2 +- .../petstore/swift5/rxswiftLibrary/docs/PetAPI.md | 2 +- .../Sources/PetstoreClient/APIs/FakeAPI.swift | 4 ++-- .../Sources/PetstoreClient/APIs/PetAPI.swift | 4 ++-- .../swift5/urlsessionLibrary/docs/FakeAPI.md | 2 +- .../swift5/urlsessionLibrary/docs/PetAPI.md | 2 +- .../petstore/swift5/vaporLibrary/docs/FakeAPI.md | 2 +- .../petstore/swift5/vaporLibrary/docs/PetAPI.md | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 4 ++-- .../Classes/OpenAPIs/APIs/PetAPI.swift | 4 ++-- .../swift5/x-swift-hashable/docs/FakeAPI.md | 2 +- .../swift5/x-swift-hashable/docs/PetAPI.md | 2 +- 54 files changed, 88 insertions(+), 88 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/swift5/api.mustache b/modules/openapi-generator/src/main/resources/swift5/api.mustache index 6e95e653a32f..42b44955aadd 100644 --- a/modules/openapi-generator/src/main/resources/swift5/api.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/api.mustache @@ -57,7 +57,7 @@ extension {{projectName}}API { @available(*, deprecated, message: "This operation is deprecated.") {{/isDeprecated}} @discardableResult - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, completion: @escaping ((_ data: {{{returnType}}}{{^returnType}}Void{{/returnType}}?, _ error: Error?) -> Void)) -> URLSessionTask? { + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, completion: @escaping ((_ data: {{{returnType}}}{{^returnType}}Void{{/returnType}}?, _ error: Error?) -> Void)) -> URLSessionTask? { return {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute(apiResponseQueue) { result in switch result { {{#returnType}} @@ -91,7 +91,7 @@ extension {{projectName}}API { {{#isDeprecated}} @available(*, deprecated, message: "This operation is deprecated.") {{/isDeprecated}} - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}} {{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue) -> Promise<{{{returnType}}}{{^returnType}}Void{{/returnType}}> { + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}} {{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue) -> Promise<{{{returnType}}}{{^returnType}}Void{{/returnType}}> { let deferred = Promise<{{{returnType}}}{{^returnType}}Void{{/returnType}}>.pending() {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute(apiResponseQueue) { result in switch result { @@ -122,7 +122,7 @@ extension {{projectName}}API { {{#isDeprecated}} @available(*, deprecated, message: "This operation is deprecated.") {{/isDeprecated}} - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue) -> Observable<{{{returnType}}}{{^returnType}}Void{{/returnType}}> { + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue) -> Observable<{{{returnType}}}{{^returnType}}Void{{/returnType}}> { return Observable.create { observer -> Disposable in let task = {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute(apiResponseQueue) { result in switch result { @@ -160,7 +160,7 @@ extension {{projectName}}API { @available(*, deprecated, message: "This operation is deprecated.") {{/isDeprecated}} @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue) -> AnyPublisher<{{{returnType}}}{{^returnType}}Void{{/returnType}}, Error> { + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue) -> AnyPublisher<{{{returnType}}}{{^returnType}}Void{{/returnType}}, Error> { var task: URLSessionTask? return Future<{{{returnType}}}{{^returnType}}Void{{/returnType}}, Error> { promise in task = {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute(apiResponseQueue) { result in @@ -198,7 +198,7 @@ extension {{projectName}}API { @available(*, deprecated, message: "This operation is deprecated.") {{/isDeprecated}} @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue) async throws{{#returnType}} -> {{{returnType}}}{{/returnType}} { + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue) async throws{{#returnType}} -> {{{returnType}}}{{/returnType}} { var task: URLSessionTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -241,7 +241,7 @@ extension {{projectName}}API { @available(*, deprecated, message: "This operation is deprecated.") {{/isDeprecated}} @discardableResult - open class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<{{{returnType}}}{{^returnType}}Void{{/returnType}}, ErrorResponse>) -> Void)) -> URLSessionTask? { + open class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<{{{returnType}}}{{^returnType}}Void{{/returnType}}, ErrorResponse>) -> Void)) -> URLSessionTask? { return {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute(apiResponseQueue) { result in switch result { {{#returnType}} @@ -411,7 +411,7 @@ extension {{projectName}}API { {{#isDeprecated}} @available(*, deprecated, message: "This operation is deprecated.") {{/isDeprecated}} - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> RequestBuilder<{{{returnType}}}{{^returnType}}Void{{/returnType}}> { + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> RequestBuilder<{{{returnType}}}{{^returnType}}Void{{/returnType}}> { {{^pathParams}}let{{/pathParams}}{{#pathParams}}{{#-first}}var{{/-first}}{{/pathParams}} localVariablePath = "{{{path}}}"{{#pathParams}} let {{paramName}}PreEscape = "\({{#isEnum}}{{paramName}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}.rawValue{{/isContainer}}{{/isEnum}}{{^isEnum}}APIHelper.mapValueToPathItem({{paramName}}){{/isEnum}})" let {{paramName}}PostEscape = {{paramName}}PreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" diff --git a/modules/openapi-generator/src/main/resources/swift5/api_doc.mustache b/modules/openapi-generator/src/main/resources/swift5/api_doc.mustache index 7d7c58f1dc48..7faccc1a1d8f 100644 --- a/modules/openapi-generator/src/main/resources/swift5/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/api_doc.mustache @@ -15,18 +15,18 @@ Method | HTTP request | Description {{^usePromiseKit}} {{^useRxSwift}} {{^useVapor}} - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}completion: @escaping (_ data: {{{returnType}}}{{^returnType}}Void{{/returnType}}?, _ error: Error?) -> Void) + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}completion: @escaping (_ data: {{{returnType}}}{{^returnType}}Void{{/returnType}}?, _ error: Error?) -> Void) {{/useVapor}} {{/useRxSwift}} {{/usePromiseKit}} {{#usePromiseKit}} - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}} {{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Promise<{{{returnType}}}{{^returnType}}Void{{/returnType}}> + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}} {{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Promise<{{{returnType}}}{{^returnType}}Void{{/returnType}}> {{/usePromiseKit}} {{#useRxSwift}} - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Observable<{{{returnType}}}{{^returnType}}Void{{/returnType}}> + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Observable<{{{returnType}}}{{^returnType}}Void{{/returnType}}> {{/useRxSwift}} {{#useVapor}} - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}headers: HTTPHeaders = {{projectName}}API.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture<{{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}> + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}headers: HTTPHeaders = {{projectName}}API.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture<{{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}> {{/useVapor}} ``` 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 87d1539d825e..a5165719f100 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 @@ -485,7 +485,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - 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)) -> URLSessionTask? { + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { return testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: @@ -510,7 +510,7 @@ open class FakeAPI { - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - 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: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let localVariablePath = "/fake" let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath let localVariableFormParams: [String: Any?] = [ 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 5c22a59a5c53..bd5c091925bf 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 @@ -126,7 +126,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -147,7 +147,7 @@ open class PetAPI { - parameter status: (query) Status values that need to be considered for filter - returns: RequestBuilder<[Pet]> */ - open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { + open class func findPetsByStatusWithRequestBuilder(status: [Status_findPetsByStatus]) -> RequestBuilder<[Pet]> { let localVariablePath = "/pet/findByStatus" let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath let localVariableParameters: [String: Any]? = nil diff --git a/samples/client/petstore/swift5/alamofireLibrary/docs/FakeAPI.md b/samples/client/petstore/swift5/alamofireLibrary/docs/FakeAPI.md index f07991250846..69b1faa2b991 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/docs/FakeAPI.md +++ b/samples/client/petstore/swift5/alamofireLibrary/docs/FakeAPI.md @@ -440,7 +440,7 @@ Void (empty response body) # **testEnumParameters** ```swift - 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) + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) ``` To test enum parameters diff --git a/samples/client/petstore/swift5/alamofireLibrary/docs/PetAPI.md b/samples/client/petstore/swift5/alamofireLibrary/docs/PetAPI.md index 5babbd06a3c0..7dc73a98900d 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/docs/PetAPI.md +++ b/samples/client/petstore/swift5/alamofireLibrary/docs/PetAPI.md @@ -115,7 +115,7 @@ Void (empty response body) # **findPetsByStatus** ```swift - open class func findPetsByStatus(status: [String], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) + open class func findPetsByStatus(status: [Status_findPetsByStatus], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) ``` Finds Pets by status diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index e773584bb02b..8e449d22dc7c 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -589,7 +589,7 @@ open class FakeAPI { - returns: Void */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var task: URLSessionTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -627,7 +627,7 @@ open class FakeAPI { - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - 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: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let localVariablePath = "/fake" let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath let localVariableFormParams: [String: Any?] = [ diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 2f713417bfb0..f169ed382da2 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -152,7 +152,7 @@ open class PetAPI { - returns: [Pet] */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) - open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> [Pet] { + open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> [Pet] { var task: URLSessionTask? return try await withTaskCancellationHandler { try Task.checkCancellation() @@ -186,7 +186,7 @@ open class PetAPI { - parameter status: (query) Status values that need to be considered for filter - returns: RequestBuilder<[Pet]> */ - open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { + open class func findPetsByStatusWithRequestBuilder(status: [Status_findPetsByStatus]) -> RequestBuilder<[Pet]> { let localVariablePath = "/pet/findByStatus" let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath let localVariableParameters: [String: Any]? = nil diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/docs/FakeAPI.md b/samples/client/petstore/swift5/asyncAwaitLibrary/docs/FakeAPI.md index f07991250846..69b1faa2b991 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/docs/FakeAPI.md +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/docs/FakeAPI.md @@ -440,7 +440,7 @@ Void (empty response body) # **testEnumParameters** ```swift - 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) + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) ``` To test enum parameters diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/docs/PetAPI.md b/samples/client/petstore/swift5/asyncAwaitLibrary/docs/PetAPI.md index 5babbd06a3c0..7dc73a98900d 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/docs/PetAPI.md +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/docs/PetAPI.md @@ -115,7 +115,7 @@ Void (empty response body) # **findPetsByStatus** ```swift - open class func findPetsByStatus(status: [String], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) + open class func findPetsByStatus(status: [Status_findPetsByStatus], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) ``` Finds Pets by status 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 b64f5581ea63..27b455e59fff 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 @@ -561,7 +561,7 @@ open class FakeAPI { */ #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { var task: URLSessionTask? return Future { promise in task = testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in @@ -594,7 +594,7 @@ open class FakeAPI { - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - 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: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let localVariablePath = "/fake" let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath let localVariableFormParams: [String: Any?] = [ 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 1335065e0133..71225a5b53d9 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 @@ -148,7 +148,7 @@ open class PetAPI { */ #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher<[Pet], Error> { + open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher<[Pet], Error> { var task: URLSessionTask? return Future<[Pet], Error> { promise in task = findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in @@ -177,7 +177,7 @@ open class PetAPI { - parameter status: (query) Status values that need to be considered for filter - returns: RequestBuilder<[Pet]> */ - open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { + open class func findPetsByStatusWithRequestBuilder(status: [Status_findPetsByStatus]) -> RequestBuilder<[Pet]> { let localVariablePath = "/pet/findByStatus" let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath let localVariableParameters: [String: Any]? = nil diff --git a/samples/client/petstore/swift5/combineLibrary/docs/FakeAPI.md b/samples/client/petstore/swift5/combineLibrary/docs/FakeAPI.md index f07991250846..69b1faa2b991 100644 --- a/samples/client/petstore/swift5/combineLibrary/docs/FakeAPI.md +++ b/samples/client/petstore/swift5/combineLibrary/docs/FakeAPI.md @@ -440,7 +440,7 @@ Void (empty response body) # **testEnumParameters** ```swift - 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) + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) ``` To test enum parameters diff --git a/samples/client/petstore/swift5/combineLibrary/docs/PetAPI.md b/samples/client/petstore/swift5/combineLibrary/docs/PetAPI.md index 5babbd06a3c0..7dc73a98900d 100644 --- a/samples/client/petstore/swift5/combineLibrary/docs/PetAPI.md +++ b/samples/client/petstore/swift5/combineLibrary/docs/PetAPI.md @@ -115,7 +115,7 @@ Void (empty response body) # **findPetsByStatus** ```swift - open class func findPetsByStatus(status: [String], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) + open class func findPetsByStatus(status: [Status_findPetsByStatus], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) ``` Finds Pets by status 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 faaa1611c8f7..bf154f2e1db3 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 @@ -529,7 +529,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - 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)) -> URLSessionTask? { + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { return testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: @@ -554,7 +554,7 @@ open class FakeAPI { - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - 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: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let localVariablePath = "/fake" let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath let localVariableFormParams: [String: Any?] = [ 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 87aedd5c1a32..655b2358c526 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 @@ -126,7 +126,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -147,7 +147,7 @@ open class PetAPI { - parameter status: (query) Status values that need to be considered for filter - returns: RequestBuilder<[Pet]> */ - open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { + open class func findPetsByStatusWithRequestBuilder(status: [Status_findPetsByStatus]) -> RequestBuilder<[Pet]> { let localVariablePath = "/pet/findByStatus" let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath let localVariableParameters: [String: Any]? = nil diff --git a/samples/client/petstore/swift5/default/docs/FakeAPI.md b/samples/client/petstore/swift5/default/docs/FakeAPI.md index e2df98a9d44d..5004221689ee 100644 --- a/samples/client/petstore/swift5/default/docs/FakeAPI.md +++ b/samples/client/petstore/swift5/default/docs/FakeAPI.md @@ -492,7 +492,7 @@ Void (empty response body) # **testEnumParameters** ```swift - 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) + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) ``` To test enum parameters diff --git a/samples/client/petstore/swift5/default/docs/PetAPI.md b/samples/client/petstore/swift5/default/docs/PetAPI.md index 6195924f3c23..ee837e6f8af2 100644 --- a/samples/client/petstore/swift5/default/docs/PetAPI.md +++ b/samples/client/petstore/swift5/default/docs/PetAPI.md @@ -115,7 +115,7 @@ Void (empty response body) # **findPetsByStatus** ```swift - open class func findPetsByStatus(status: [String], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) + open class func findPetsByStatus(status: [Status_findPetsByStatus], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) ``` Finds Pets by status diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index f838ced0df6d..59a82575aa13 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -126,7 +126,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -147,7 +147,7 @@ open class PetAPI { - parameter status: (query) Status values that need to be considered for filter - returns: RequestBuilder<[Pet]> */ - open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { + open class func findPetsByStatusWithRequestBuilder(status: [Status_findPetsByStatus]) -> RequestBuilder<[Pet]> { let localVariablePath = "/pet/findByStatus" let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath let localVariableParameters: [String: Any]? = nil diff --git a/samples/client/petstore/swift5/deprecated/docs/PetAPI.md b/samples/client/petstore/swift5/deprecated/docs/PetAPI.md index c602c9fb5725..cd138421072e 100644 --- a/samples/client/petstore/swift5/deprecated/docs/PetAPI.md +++ b/samples/client/petstore/swift5/deprecated/docs/PetAPI.md @@ -114,7 +114,7 @@ Void (empty response body) # **findPetsByStatus** ```swift - open class func findPetsByStatus(status: [String], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) + open class func findPetsByStatus(status: [Status_findPetsByStatus], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) ``` Finds Pets by status 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 a5bf5a193ef6..31c875915aca 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 @@ -485,7 +485,7 @@ internal class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - 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)) -> URLSessionTask? { + internal class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { return testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: @@ -510,7 +510,7 @@ internal class FakeAPI { - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - returns: RequestBuilder */ - 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 { + internal class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let localVariablePath = "/fake" let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath let localVariableFormParams: [String: Any?] = [ 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 0441d91c0944..74aa56a14e69 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 @@ -126,7 +126,7 @@ internal class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -147,7 +147,7 @@ internal class PetAPI { - parameter status: (query) Status values that need to be considered for filter - returns: RequestBuilder<[Pet]> */ - internal class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { + internal class func findPetsByStatusWithRequestBuilder(status: [Status_findPetsByStatus]) -> RequestBuilder<[Pet]> { let localVariablePath = "/pet/findByStatus" let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath let localVariableParameters: [String: Any]? = nil diff --git a/samples/client/petstore/swift5/nonPublicApi/docs/FakeAPI.md b/samples/client/petstore/swift5/nonPublicApi/docs/FakeAPI.md index d18c94250105..1cc75c5aab2c 100644 --- a/samples/client/petstore/swift5/nonPublicApi/docs/FakeAPI.md +++ b/samples/client/petstore/swift5/nonPublicApi/docs/FakeAPI.md @@ -440,7 +440,7 @@ Void (empty response body) # **testEnumParameters** ```swift - 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) + internal class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) ``` To test enum parameters diff --git a/samples/client/petstore/swift5/nonPublicApi/docs/PetAPI.md b/samples/client/petstore/swift5/nonPublicApi/docs/PetAPI.md index eb2db2040cdd..a9e13c339cfd 100644 --- a/samples/client/petstore/swift5/nonPublicApi/docs/PetAPI.md +++ b/samples/client/petstore/swift5/nonPublicApi/docs/PetAPI.md @@ -115,7 +115,7 @@ Void (empty response body) # **findPetsByStatus** ```swift - internal class func findPetsByStatus(status: [String], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) + internal class func findPetsByStatus(status: [Status_findPetsByStatus], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) ``` Finds Pets by status 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 58208b46ee78..5396fe8dd325 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 @@ -485,7 +485,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - 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)) -> URLSessionTask? { + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { return testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: @@ -510,7 +510,7 @@ import AnyCodable - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - 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: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let localVariablePath = "/fake" let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath let localVariableFormParams: [String: Any?] = [ 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 6ee487217519..58fbeae4d633 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 @@ -126,7 +126,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -147,7 +147,7 @@ import AnyCodable - parameter status: (query) Status values that need to be considered for filter - returns: RequestBuilder<[Pet]> */ - open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { + open class func findPetsByStatusWithRequestBuilder(status: [Status_findPetsByStatus]) -> RequestBuilder<[Pet]> { let localVariablePath = "/pet/findByStatus" let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath let localVariableParameters: [String: Any]? = nil diff --git a/samples/client/petstore/swift5/objcCompatible/docs/FakeAPI.md b/samples/client/petstore/swift5/objcCompatible/docs/FakeAPI.md index c0a0824fb70f..a75c5864f1c6 100644 --- a/samples/client/petstore/swift5/objcCompatible/docs/FakeAPI.md +++ b/samples/client/petstore/swift5/objcCompatible/docs/FakeAPI.md @@ -440,7 +440,7 @@ Void (empty response body) # **testEnumParameters** ```swift - 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) + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) ``` To test enum parameters diff --git a/samples/client/petstore/swift5/objcCompatible/docs/PetAPI.md b/samples/client/petstore/swift5/objcCompatible/docs/PetAPI.md index b3187a511281..5e6bccd7eaa2 100644 --- a/samples/client/petstore/swift5/objcCompatible/docs/PetAPI.md +++ b/samples/client/petstore/swift5/objcCompatible/docs/PetAPI.md @@ -115,7 +115,7 @@ Void (empty response body) # **findPetsByStatus** ```swift - open class func findPetsByStatus(status: [String], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) + open class func findPetsByStatus(status: [Status_findPetsByStatus], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) ``` Finds Pets by status 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 ef784bfffdcf..17beed78a8e2 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 @@ -493,7 +493,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: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = 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 in switch result { @@ -520,7 +520,7 @@ open class FakeAPI { - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - 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: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let localVariablePath = "/fake" let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath let localVariableFormParams: [String: Any?] = [ 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 a6de43f38702..11c84c864332 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 @@ -128,7 +128,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise<[Pet]> */ - open class func findPetsByStatus( status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise<[Pet]> { + open class func findPetsByStatus( status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise<[Pet]> { let deferred = Promise<[Pet]>.pending() findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { @@ -151,7 +151,7 @@ open class PetAPI { - parameter status: (query) Status values that need to be considered for filter - returns: RequestBuilder<[Pet]> */ - open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { + open class func findPetsByStatusWithRequestBuilder(status: [Status_findPetsByStatus]) -> RequestBuilder<[Pet]> { let localVariablePath = "/pet/findByStatus" let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath let localVariableParameters: [String: Any]? = nil diff --git a/samples/client/petstore/swift5/promisekitLibrary/docs/FakeAPI.md b/samples/client/petstore/swift5/promisekitLibrary/docs/FakeAPI.md index 0d4d1a6ce269..5164a64867d8 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/docs/FakeAPI.md +++ b/samples/client/petstore/swift5/promisekitLibrary/docs/FakeAPI.md @@ -416,7 +416,7 @@ Void (empty response body) # **testEnumParameters** ```swift - 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: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> Promise ``` To test enum parameters diff --git a/samples/client/petstore/swift5/promisekitLibrary/docs/PetAPI.md b/samples/client/petstore/swift5/promisekitLibrary/docs/PetAPI.md index 8a516ca30148..41d27fed4e70 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/docs/PetAPI.md +++ b/samples/client/petstore/swift5/promisekitLibrary/docs/PetAPI.md @@ -109,7 +109,7 @@ Void (empty response body) # **findPetsByStatus** ```swift - open class func findPetsByStatus( status: [String]) -> Promise<[Pet]> + open class func findPetsByStatus( status: [Status_findPetsByStatus]) -> Promise<[Pet]> ``` Finds Pets by status diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 87d1539d825e..a5165719f100 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -485,7 +485,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - 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)) -> URLSessionTask? { + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { return testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: @@ -510,7 +510,7 @@ open class FakeAPI { - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - 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: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let localVariablePath = "/fake" let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath let localVariableFormParams: [String: Any?] = [ diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 5c22a59a5c53..bd5c091925bf 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -126,7 +126,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -147,7 +147,7 @@ open class PetAPI { - parameter status: (query) Status values that need to be considered for filter - returns: RequestBuilder<[Pet]> */ - open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { + open class func findPetsByStatusWithRequestBuilder(status: [Status_findPetsByStatus]) -> RequestBuilder<[Pet]> { let localVariablePath = "/pet/findByStatus" let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath let localVariableParameters: [String: Any]? = nil diff --git a/samples/client/petstore/swift5/readonlyProperties/docs/FakeAPI.md b/samples/client/petstore/swift5/readonlyProperties/docs/FakeAPI.md index f07991250846..69b1faa2b991 100644 --- a/samples/client/petstore/swift5/readonlyProperties/docs/FakeAPI.md +++ b/samples/client/petstore/swift5/readonlyProperties/docs/FakeAPI.md @@ -440,7 +440,7 @@ Void (empty response body) # **testEnumParameters** ```swift - 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) + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) ``` To test enum parameters diff --git a/samples/client/petstore/swift5/readonlyProperties/docs/PetAPI.md b/samples/client/petstore/swift5/readonlyProperties/docs/PetAPI.md index 5babbd06a3c0..7dc73a98900d 100644 --- a/samples/client/petstore/swift5/readonlyProperties/docs/PetAPI.md +++ b/samples/client/petstore/swift5/readonlyProperties/docs/PetAPI.md @@ -115,7 +115,7 @@ Void (empty response body) # **findPetsByStatus** ```swift - open class func findPetsByStatus(status: [String], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) + open class func findPetsByStatus(status: [Status_findPetsByStatus], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) ``` Finds Pets by status 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 1bb864f1684f..db0c4cb351cb 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 @@ -485,7 +485,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ @discardableResult - 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 ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { return testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: @@ -510,7 +510,7 @@ open class FakeAPI { - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - 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: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let localVariablePath = "/fake" let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath let localVariableFormParams: [String: Any?] = [ 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 ff5d3c3db107..33bc3ed33a9a 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 @@ -126,7 +126,7 @@ open class PetAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<[Pet], ErrorResponse>) -> Void)) -> URLSessionTask? { + open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<[Pet], ErrorResponse>) -> Void)) -> URLSessionTask? { return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -147,7 +147,7 @@ open class PetAPI { - parameter status: (query) Status values that need to be considered for filter - returns: RequestBuilder<[Pet]> */ - open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { + open class func findPetsByStatusWithRequestBuilder(status: [Status_findPetsByStatus]) -> RequestBuilder<[Pet]> { let localVariablePath = "/pet/findByStatus" let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath let localVariableParameters: [String: Any]? = nil diff --git a/samples/client/petstore/swift5/resultLibrary/docs/FakeAPI.md b/samples/client/petstore/swift5/resultLibrary/docs/FakeAPI.md index f07991250846..69b1faa2b991 100644 --- a/samples/client/petstore/swift5/resultLibrary/docs/FakeAPI.md +++ b/samples/client/petstore/swift5/resultLibrary/docs/FakeAPI.md @@ -440,7 +440,7 @@ Void (empty response body) # **testEnumParameters** ```swift - 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) + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) ``` To test enum parameters diff --git a/samples/client/petstore/swift5/resultLibrary/docs/PetAPI.md b/samples/client/petstore/swift5/resultLibrary/docs/PetAPI.md index 5babbd06a3c0..7dc73a98900d 100644 --- a/samples/client/petstore/swift5/resultLibrary/docs/PetAPI.md +++ b/samples/client/petstore/swift5/resultLibrary/docs/PetAPI.md @@ -115,7 +115,7 @@ Void (empty response body) # **findPetsByStatus** ```swift - open class func findPetsByStatus(status: [String], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) + open class func findPetsByStatus(status: [Status_findPetsByStatus], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) ``` Finds Pets by status 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 7836542dbe09..4d998a532176 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 @@ -533,7 +533,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - 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, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in let task = testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { @@ -565,7 +565,7 @@ open class FakeAPI { - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - 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: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let localVariablePath = "/fake" let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath let localVariableFormParams: [String: Any?] = [ 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 1f346ba10199..73e4a43c655e 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 @@ -138,7 +138,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Observable<[Pet]> */ - open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable<[Pet]> { + open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable<[Pet]> { return Observable.create { observer -> Disposable in let task = findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { @@ -166,7 +166,7 @@ open class PetAPI { - parameter status: (query) Status values that need to be considered for filter - returns: RequestBuilder<[Pet]> */ - open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { + open class func findPetsByStatusWithRequestBuilder(status: [Status_findPetsByStatus]) -> RequestBuilder<[Pet]> { let localVariablePath = "/pet/findByStatus" let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath let localVariableParameters: [String: Any]? = nil diff --git a/samples/client/petstore/swift5/rxswiftLibrary/docs/FakeAPI.md b/samples/client/petstore/swift5/rxswiftLibrary/docs/FakeAPI.md index aecb7880a3c0..350928e8e7f7 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/docs/FakeAPI.md +++ b/samples/client/petstore/swift5/rxswiftLibrary/docs/FakeAPI.md @@ -366,7 +366,7 @@ Void (empty response body) # **testEnumParameters** ```swift - 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: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> Observable ``` To test enum parameters diff --git a/samples/client/petstore/swift5/rxswiftLibrary/docs/PetAPI.md b/samples/client/petstore/swift5/rxswiftLibrary/docs/PetAPI.md index a87db33f46dc..9f9a42ca4f56 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/docs/PetAPI.md +++ b/samples/client/petstore/swift5/rxswiftLibrary/docs/PetAPI.md @@ -95,7 +95,7 @@ Void (empty response body) # **findPetsByStatus** ```swift - open class func findPetsByStatus(status: [String]) -> Observable<[Pet]> + open class func findPetsByStatus(status: [Status_findPetsByStatus]) -> Observable<[Pet]> ``` Finds Pets by status diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift index 016a94b531a1..80d050c6d3e3 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift @@ -488,7 +488,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - 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)) -> URLSessionTask? { + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { return testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: @@ -513,7 +513,7 @@ open class FakeAPI { - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - 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: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let localVariablePath = "/fake" let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath let localVariableFormParams: [String: Any?] = [ diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/PetAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/PetAPI.swift index 2bbb5aba0795..ffcf8725e94f 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/PetAPI.swift @@ -129,7 +129,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -150,7 +150,7 @@ open class PetAPI { - parameter status: (query) Status values that need to be considered for filter - returns: RequestBuilder<[Pet]> */ - open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { + open class func findPetsByStatusWithRequestBuilder(status: [Status_findPetsByStatus]) -> RequestBuilder<[Pet]> { let localVariablePath = "/pet/findByStatus" let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath let localVariableParameters: [String: Any]? = nil diff --git a/samples/client/petstore/swift5/urlsessionLibrary/docs/FakeAPI.md b/samples/client/petstore/swift5/urlsessionLibrary/docs/FakeAPI.md index f07991250846..69b1faa2b991 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/docs/FakeAPI.md +++ b/samples/client/petstore/swift5/urlsessionLibrary/docs/FakeAPI.md @@ -440,7 +440,7 @@ Void (empty response body) # **testEnumParameters** ```swift - 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) + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) ``` To test enum parameters diff --git a/samples/client/petstore/swift5/urlsessionLibrary/docs/PetAPI.md b/samples/client/petstore/swift5/urlsessionLibrary/docs/PetAPI.md index 5babbd06a3c0..7dc73a98900d 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/docs/PetAPI.md +++ b/samples/client/petstore/swift5/urlsessionLibrary/docs/PetAPI.md @@ -115,7 +115,7 @@ Void (empty response body) # **findPetsByStatus** ```swift - open class func findPetsByStatus(status: [String], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) + open class func findPetsByStatus(status: [Status_findPetsByStatus], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) ``` Finds Pets by status diff --git a/samples/client/petstore/swift5/vaporLibrary/docs/FakeAPI.md b/samples/client/petstore/swift5/vaporLibrary/docs/FakeAPI.md index cc68117f304a..2cb0e52af6d4 100644 --- a/samples/client/petstore/swift5/vaporLibrary/docs/FakeAPI.md +++ b/samples/client/petstore/swift5/vaporLibrary/docs/FakeAPI.md @@ -575,7 +575,7 @@ public enum TestEndpointParameters { # **testEnumParameters** ```swift - 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, headers: HTTPHeaders = PetstoreClientAPI.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, headers: HTTPHeaders = PetstoreClientAPI.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture ``` To test enum parameters diff --git a/samples/client/petstore/swift5/vaporLibrary/docs/PetAPI.md b/samples/client/petstore/swift5/vaporLibrary/docs/PetAPI.md index f93e01e6d5db..3fc719012eb5 100644 --- a/samples/client/petstore/swift5/vaporLibrary/docs/PetAPI.md +++ b/samples/client/petstore/swift5/vaporLibrary/docs/PetAPI.md @@ -137,7 +137,7 @@ public enum DeletePet { # **findPetsByStatus** ```swift - open class func findPetsByStatus(status: [String], headers: HTTPHeaders = PetstoreClientAPI.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture + open class func findPetsByStatus(status: [Status_findPetsByStatus], headers: HTTPHeaders = PetstoreClientAPI.customHeaders, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture ``` Finds Pets by status diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 87d1539d825e..a5165719f100 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -485,7 +485,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - 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)) -> URLSessionTask? { + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { return testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: @@ -510,7 +510,7 @@ open class FakeAPI { - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - 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: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let localVariablePath = "/fake" let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath let localVariableFormParams: [String: Any?] = [ diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 5c22a59a5c53..bd5c091925bf 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -126,7 +126,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -147,7 +147,7 @@ open class PetAPI { - parameter status: (query) Status values that need to be considered for filter - returns: RequestBuilder<[Pet]> */ - open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { + open class func findPetsByStatusWithRequestBuilder(status: [Status_findPetsByStatus]) -> RequestBuilder<[Pet]> { let localVariablePath = "/pet/findByStatus" let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath let localVariableParameters: [String: Any]? = nil diff --git a/samples/client/petstore/swift5/x-swift-hashable/docs/FakeAPI.md b/samples/client/petstore/swift5/x-swift-hashable/docs/FakeAPI.md index f07991250846..69b1faa2b991 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/docs/FakeAPI.md +++ b/samples/client/petstore/swift5/x-swift-hashable/docs/FakeAPI.md @@ -440,7 +440,7 @@ Void (empty response body) # **testEnumParameters** ```swift - 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) + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) ``` To test enum parameters diff --git a/samples/client/petstore/swift5/x-swift-hashable/docs/PetAPI.md b/samples/client/petstore/swift5/x-swift-hashable/docs/PetAPI.md index 5babbd06a3c0..7dc73a98900d 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/docs/PetAPI.md +++ b/samples/client/petstore/swift5/x-swift-hashable/docs/PetAPI.md @@ -115,7 +115,7 @@ Void (empty response body) # **findPetsByStatus** ```swift - open class func findPetsByStatus(status: [String], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) + open class func findPetsByStatus(status: [Status_findPetsByStatus], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) ``` Finds Pets by status From acabbe0e884ee903becf6252e801d8bf517f023e Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 1 Dec 2021 13:54:02 +0800 Subject: [PATCH 050/117] Update launcher script to use 4.x as examples --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 8aca24c1a675..7241d3bf309d 100644 --- a/README.md +++ b/README.md @@ -223,21 +223,21 @@ Examples: # Execute latest released openapi-generator-cli openapi-generator-cli version -# Execute version 3.1.0 for the current invocation, regardless of the latest released version -OPENAPI_GENERATOR_VERSION=3.1.0 openapi-generator-cli version +# Execute version 4.1.0 for the current invocation, regardless of the latest released version +OPENAPI_GENERATOR_VERSION=4.1.0 openapi-generator-cli version -# Execute version 3.1.0-SNAPSHOT for the current invocation -OPENAPI_GENERATOR_VERSION=3.1.0-SNAPSHOT openapi-generator-cli version +# Execute version 4.1.0-SNAPSHOT for the current invocation +OPENAPI_GENERATOR_VERSION=4.1.0-SNAPSHOT openapi-generator-cli version -# Execute version 3.0.2 for every invocation in the current shell session -export OPENAPI_GENERATOR_VERSION=3.0.2 -openapi-generator-cli version # is 3.0.2 -openapi-generator-cli version # is also 3.0.2 +# Execute version 4.0.2 for every invocation in the current shell session +export OPENAPI_GENERATOR_VERSION=4.0.2 +openapi-generator-cli version # is 4.0.2 +openapi-generator-cli version # is also 4.0.2 # To "install" a specific version, set the variable in .bashrc/.bash_profile -echo "export OPENAPI_GENERATOR_VERSION=3.0.2" >> ~/.bashrc +echo "export OPENAPI_GENERATOR_VERSION=4.0.2" >> ~/.bashrc source ~/.bashrc -openapi-generator-cli version # is always 3.0.2, unless any of the above overrides are done ad hoc +openapi-generator-cli version # is always 4.0.2, unless any of the above overrides are done ad hoc ``` ### [1.4 - Build Projects](#table-of-contents) From 40609ad67702e0c12337b402a2ea2fa6902ccce0 Mon Sep 17 00:00:00 2001 From: agilob Date: Wed, 1 Dec 2021 06:19:28 +0000 Subject: [PATCH 051/117] Add vscode openapi workspace configuration (#10996) * Add vscode openapi workspace * Config changes for more intellij-like behaviour * Remove recommended plugin editorconfig --- openapi-generator.code-workspace | 78 ++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 openapi-generator.code-workspace diff --git a/openapi-generator.code-workspace b/openapi-generator.code-workspace new file mode 100644 index 000000000000..94b0864b5d8d --- /dev/null +++ b/openapi-generator.code-workspace @@ -0,0 +1,78 @@ +{ + "folders": [ + { + "name": "openapi-generator", + "path": "." + }, + { + "name": "openapi-generator-cli", + "path": "modules/openapi-generator-cli" + }, + { + "name": "openapi-generator-core", + "path": "modules/openapi-generator-core" + }, + { + "name": "openapi-generator-gradle-plugin", + "path": "modules/openapi-generator-gradle-plugin" + }, + { + "name": "openapi-generator-maven-plugin", + "path": "modules/openapi-generator-maven-plugin" + }, + { + "name": "openapi-generator-online", + "path": "modules/openapi-generator-online" + }, + ], + "settings": { + "editor.formatOnType": true, + "editor.linkedEditing": true, + "editor.tabCompletion": "on", + "editor.tabSize": 4, + "editor.renderWhitespace": "boundary", + "editor.suggest.shareSuggestSelections": true, + "editor.suggestSelection": "first", + "editor.semanticHighlighting.enabled": true, + "explorer.confirmDelete": true, + + "files.autoSave": "onFocusChange", + "files.exclude": { + "**/.classpath": true, + "**/.factorypath": true, + "**/.project": true, + "**/.settings": true + }, + "files.trimFinalNewlines": false, + "files.trimTrailingWhitespace": true, + + "task.saveBeforeRun": "always", + + "java.autobuild.enabled": false, + "java.completion.enabled": true, + "java.completion.guessMethodArguments": true, + "java.completion.maxResults": 5, + "java.format.onType.enabled": true, + + "java.referencesCodeLens.enabled": true, + "java.saveActions.organizeImports": true, + "java.showBuildStatusOnStart.enabled": true, + + "java.dependency.autoRefresh": true, + "java.dependency.refreshDelay": 3000, + "java.format.enabled": true, + + "maven.pomfile.autoUpdateEffectivePOM": true, + }, + "extensions": { + "recommendations": [ + "vscjava.vscode-java-pack", + "attilabuti.mustache-syntax-vscode", + "formulahendry.code-runner", + "visualstudioexptteam.vscodeintellicode", + "42crunch.vscode-openapi", + "mermade.openapi-lint" + + ] + } +} \ No newline at end of file From a745f053bd250af43611a517674341e687bdcd58 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 1 Dec 2021 14:20:39 +0800 Subject: [PATCH 052/117] skip custom adapter for parent object (#10998) --- .../okhttp-gson-nextgen/JSON.mustache | 16 +----- .../okhttp-gson-nextgen/pojo.mustache | 2 + .../java/org/openapitools/client/JSON.java | 2 - .../org/openapitools/client/model/Animal.java | 56 ------------------- .../client/model/GrandparentAnimal.java | 55 ------------------ 5 files changed, 4 insertions(+), 127 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/JSON.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/JSON.mustache index 91a7905d0bc1..56477b8dc179 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/JSON.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/JSON.mustache @@ -132,21 +132,9 @@ public class JSON { {{#models}} {{#model}} {{^isEnum}} - {{#oneOf}} - {{#-first}} + {{^hasChildren}} .registerTypeAdapterFactory(new {{modelPackage}}.{{{classname}}}.CustomTypeAdapterFactory()) - {{/-first}} - {{/oneOf}} - {{^oneOf}} - {{#anyOf}} - {{#-first}} - .registerTypeAdapterFactory(new {{modelPackage}}.{{{classname}}}.CustomTypeAdapterFactory()) - {{/-first}} - {{/anyOf}} - {{^anyOf}} - .registerTypeAdapterFactory(new {{modelPackage}}.{{{classname}}}.CustomTypeAdapterFactory()) - {{/anyOf}} - {{/oneOf}} + {{/hasChildren}} {{/isEnum}} {{/model}} {{/models}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pojo.mustache index df9dbc320d4e..f7ad1e3a05a8 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pojo.mustache @@ -379,6 +379,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens } }; {{/parcelableModel}} +{{^hasChildren}} public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -442,4 +443,5 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens }.nullSafe(); } } +{{/hasChildren}} } \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java index 53717e8ac51b..40146a3e6f5f 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java @@ -221,7 +221,6 @@ public JSON() { .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) .registerTypeAdapter(byte[].class, byteArrayAdapter) .registerTypeAdapterFactory(new org.openapitools.client.model.AdditionalPropertiesClass.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.Animal.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.Apple.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.AppleReq.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.ArrayOfArrayOfNumberOnly.CustomTypeAdapterFactory()) @@ -251,7 +250,6 @@ public JSON() { .registerTypeAdapterFactory(new org.openapitools.client.model.Fruit.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.FruitReq.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.GmFruit.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.GrandparentAnimal.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.HasOnlyReadOnly.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.HealthCheckResult.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.InlineResponseDefault.CustomTypeAdapterFactory()) diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Animal.java index cf1f00de64ff..4d60101ca177 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Animal.java @@ -144,60 +144,4 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("className"); - openapiFields.add("color"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("className"); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Animal.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Animal' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Animal.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Animal value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Animal read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!Animal.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Animal` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Animal.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); - } - - }.nullSafe(); - } - } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GrandparentAnimal.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GrandparentAnimal.java index df924fe5f33d..085ccbfbfc1c 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GrandparentAnimal.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GrandparentAnimal.java @@ -114,59 +114,4 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("pet_type"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("pet_type"); - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!GrandparentAnimal.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'GrandparentAnimal' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(GrandparentAnimal.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, GrandparentAnimal value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public GrandparentAnimal read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!GrandparentAnimal.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `GrandparentAnimal` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : GrandparentAnimal.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); - } - - }.nullSafe(); - } - } } From 56e7f811bc634eea50576e3445180eb8d2e6f598 Mon Sep 17 00:00:00 2001 From: Deniz Dogan Date: Wed, 1 Dec 2021 07:49:00 +0100 Subject: [PATCH 053/117] Add Hashable to oneOf enums (#10971) Fixes #10970 --- .../src/main/resources/swift5/modelOneOf.mustache | 2 +- .../oneOf/PetstoreClient/Classes/OpenAPIs/Models/Fruit.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/swift5/modelOneOf.mustache b/modules/openapi-generator/src/main/resources/swift5/modelOneOf.mustache index fae34faa975e..1c16a3955bc4 100644 --- a/modules/openapi-generator/src/main/resources/swift5/modelOneOf.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/modelOneOf.mustache @@ -1,4 +1,4 @@ -public enum {{classname}}: {{#useVapor}}Content{{/useVapor}}{{^useVapor}}Codable{{/useVapor}} { +public enum {{classname}}: {{#useVapor}}Content{{/useVapor}}{{^useVapor}}Codable{{#vendorExtensions.x-swift-hashable}}, Hashable{{/vendorExtensions.x-swift-hashable}}{{/useVapor}} { {{#oneOf}} case type{{.}}({{.}}) {{/oneOf}} diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models/Fruit.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models/Fruit.swift index d58ad1f8b319..c249774d2a2b 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models/Fruit.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models/Fruit.swift @@ -10,7 +10,7 @@ import Foundation import AnyCodable #endif -public enum Fruit: Codable { +public enum Fruit: Codable, Hashable { case typeApple(Apple) case typeBanana(Banana) From ef31941b1314d1d60f6aed5d29a72a278052748f Mon Sep 17 00:00:00 2001 From: jiangyuan <469391363@qq.com> Date: Fri, 3 Dec 2021 00:50:52 +0800 Subject: [PATCH 054/117] fix file path (#11005) Co-authored-by: jiangyuan04 --- .../codegen/languages/PythonLegacyClientCodegen.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java index 138b1c543566..05b5b92df39c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonLegacyClientCodegen.java @@ -215,6 +215,9 @@ public void processOpts() { } } + String modelPath = packagePath() + File.separatorChar + modelPackage.replace('.', File.separatorChar); + String apiPath = packagePath() + File.separatorChar + apiPackage.replace('.', File.separatorChar); + String readmePath = "README.md"; String readmeTemplate = "README.mustache"; if (generateSourceCodeOnly) { @@ -237,8 +240,8 @@ public void processOpts() { } supportingFiles.add(new SupportingFile("configuration.mustache", packagePath(), "configuration.py")); supportingFiles.add(new SupportingFile("__init__package.mustache", packagePath(), "__init__.py")); - supportingFiles.add(new SupportingFile("__init__model.mustache", packagePath() + File.separatorChar + modelPackage, "__init__.py")); - supportingFiles.add(new SupportingFile("__init__api.mustache", packagePath() + File.separatorChar + apiPackage, "__init__.py")); + supportingFiles.add(new SupportingFile("__init__model.mustache", modelPath, "__init__.py")); + supportingFiles.add(new SupportingFile("__init__api.mustache", apiPath, "__init__.py")); // If the package name consists of dots(openapi.client), then we need to create the directory structure like openapi/client with __init__ files. String[] packageNameSplits = packageName.split("\\."); From b915ad99a8068330ea90bbffbc7ba9a7dcd2855e Mon Sep 17 00:00:00 2001 From: cghislai Date: Fri, 3 Dec 2021 09:10:40 +0100 Subject: [PATCH 055/117] typescript-angular: Add supports for v13 (#10877) --- ...angular-v13-provided-in-root-with-npm.yaml | 11 + ...pescript-angular-v13-provided-in-root.yaml | 7 + docs/generators/typescript-angular.md | 2 +- .../TypeScriptAngularClientCodegen.java | 19 +- .../builds/default/.gitignore | 4 + .../builds/default/.openapi-generator-ignore | 23 + .../builds/default/.openapi-generator/FILES | 19 + .../builds/default/.openapi-generator/VERSION | 1 + .../builds/default/README.md | 203 ++++++ .../builds/default/api.module.ts | 33 + .../builds/default/api/api.ts | 7 + .../builds/default/api/pet.service.ts | 666 ++++++++++++++++++ .../builds/default/api/store.service.ts | 311 ++++++++ .../builds/default/api/user.service.ts | 549 +++++++++++++++ .../builds/default/configuration.ts | 141 ++++ .../builds/default/encoder.ts | 20 + .../builds/default/git_push.sh | 57 ++ .../builds/default/index.ts | 5 + .../builds/default/model/apiResponse.ts | 22 + .../builds/default/model/category.ts | 21 + .../builds/default/model/models.ts | 6 + .../builds/default/model/order.ts | 37 + .../builds/default/model/pet.ts | 39 + .../builds/default/model/tag.ts | 21 + .../builds/default/model/user.ts | 30 + .../builds/default/variables.ts | 9 + .../builds/with-npm/.gitignore | 4 + .../builds/with-npm/.openapi-generator-ignore | 23 + .../builds/with-npm/.openapi-generator/FILES | 22 + .../with-npm/.openapi-generator/VERSION | 1 + .../builds/with-npm/README.md | 203 ++++++ .../builds/with-npm/api.module.ts | 33 + .../builds/with-npm/api/api.ts | 7 + .../builds/with-npm/api/pet.service.ts | 666 ++++++++++++++++++ .../builds/with-npm/api/store.service.ts | 311 ++++++++ .../builds/with-npm/api/user.service.ts | 549 +++++++++++++++ .../builds/with-npm/configuration.ts | 141 ++++ .../builds/with-npm/encoder.ts | 20 + .../builds/with-npm/git_push.sh | 57 ++ .../builds/with-npm/index.ts | 5 + .../builds/with-npm/model/apiResponse.ts | 22 + .../builds/with-npm/model/category.ts | 21 + .../builds/with-npm/model/models.ts | 6 + .../builds/with-npm/model/order.ts | 37 + .../builds/with-npm/model/pet.ts | 39 + .../builds/with-npm/model/tag.ts | 21 + .../builds/with-npm/model/user.ts | 30 + .../builds/with-npm/ng-package.json | 6 + .../builds/with-npm/package.json | 34 + .../builds/with-npm/tsconfig.json | 28 + .../builds/with-npm/variables.ts | 9 + 51 files changed, 4551 insertions(+), 7 deletions(-) create mode 100644 bin/configs/typescript-angular-v13-provided-in-root-with-npm.yaml create mode 100644 bin/configs/typescript-angular-v13-provided-in-root.yaml create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/.gitignore create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/.openapi-generator-ignore create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/.openapi-generator/VERSION create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/README.md create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api.module.ts create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/api.ts create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/pet.service.ts create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/store.service.ts create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/user.service.ts create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/configuration.ts create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/encoder.ts create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/git_push.sh create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/index.ts create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/model/apiResponse.ts create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/model/category.ts create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/model/models.ts create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/model/order.ts create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/model/pet.ts create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/model/tag.ts create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/model/user.ts create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/variables.ts create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/.gitignore create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/.openapi-generator-ignore create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/.openapi-generator/VERSION create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/README.md create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api.module.ts create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/api.ts create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/pet.service.ts create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/store.service.ts create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/user.service.ts create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/configuration.ts create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/encoder.ts create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/git_push.sh create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/index.ts create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/model/apiResponse.ts create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/model/category.ts create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/model/models.ts create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/model/order.ts create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/model/pet.ts create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/model/tag.ts create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/model/user.ts create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/ng-package.json create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/package.json create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/tsconfig.json create mode 100644 samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/variables.ts diff --git a/bin/configs/typescript-angular-v13-provided-in-root-with-npm.yaml b/bin/configs/typescript-angular-v13-provided-in-root-with-npm.yaml new file mode 100644 index 000000000000..22284f92f6cc --- /dev/null +++ b/bin/configs/typescript-angular-v13-provided-in-root-with-npm.yaml @@ -0,0 +1,11 @@ +generatorName: typescript-angular +outputDir: samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/typescript-angular +additionalProperties: + ngVersion: 13.0.1 + npmVersion: 1.0.0 + npmName: '@openapitools/typescript-angular-petstore' + npmRepository: https://skimdb.npmjs.com/registry + snapshot: false + supportsES6: true diff --git a/bin/configs/typescript-angular-v13-provided-in-root.yaml b/bin/configs/typescript-angular-v13-provided-in-root.yaml new file mode 100644 index 000000000000..bf16e022deda --- /dev/null +++ b/bin/configs/typescript-angular-v13-provided-in-root.yaml @@ -0,0 +1,7 @@ +generatorName: typescript-angular +outputDir: samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/typescript-angular +additionalProperties: + ngVersion: 13.0.1 + supportsES6: true diff --git a/docs/generators/typescript-angular.md b/docs/generators/typescript-angular.md index ab8b3da35fc8..2083b09cadf4 100644 --- a/docs/generators/typescript-angular.md +++ b/docs/generators/typescript-angular.md @@ -19,7 +19,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |modelFileSuffix|The suffix of the file of the generated model (model<suffix>.ts).| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original| |modelSuffix|The suffix of the generated model.| |null| -|ngVersion|The version of Angular. (At least 6.0.0)| |12.2.12| +|ngVersion|The version of Angular. (At least 6.0.0)| |13.0.1| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| |npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| |npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java index 758f2650f5a1..858e33d0c535 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java @@ -67,7 +67,7 @@ public static enum PROVIDED_IN_LEVEL {none, root, any, platform} public static final String STRING_ENUMS_DESC = "Generate string enums instead of objects for enum values."; public static final String QUERY_PARAM_OBJECT_FORMAT = "queryParamObjectFormat"; - protected String ngVersion = "12.2.12"; + protected String ngVersion = "13.0.1"; protected String npmRepository = null; private boolean useSingleRequestParameter = false; protected String serviceSuffix = "Service"; @@ -146,7 +146,7 @@ public String getName() { @Override public String getHelp() { - return "Generates a TypeScript Angular (6.x - 12.x) client library."; + return "Generates a TypeScript Angular (6.x - 13.x) client library."; } @Override @@ -243,7 +243,7 @@ public void processOpts() { } else { additionalProperties.put(DELETE_ACCEPTS_BODY, false); } - + additionalProperties.put(NG_VERSION, ngVersion); if (additionalProperties.containsKey(API_MODULE_PREFIX)) { @@ -300,7 +300,9 @@ private void addNpmPackageGeneration(SemVer ngVersion) { } // Set the typescript version compatible to the Angular version - if (ngVersion.atLeast("12.0.0")) { + if (ngVersion.atLeast("13.0.0")) { + additionalProperties.put("tsVersion", ">=4.4.2 <4.5.0"); + } else if (ngVersion.atLeast("12.0.0")) { additionalProperties.put("tsVersion", ">=4.3.0 <4.4.0"); } else if (ngVersion.atLeast("11.0.0")) { additionalProperties.put("tsVersion", ">=4.0.0 <4.1.0"); @@ -318,7 +320,9 @@ private void addNpmPackageGeneration(SemVer ngVersion) { } // Set the rxJS version compatible to the Angular version - if (ngVersion.atLeast("10.0.0")) { + if (ngVersion.atLeast("13.0.0")) { + additionalProperties.put("rxjsVersion", "7.4.0"); + } else if (ngVersion.atLeast("10.0.0")) { additionalProperties.put("rxjsVersion", "6.6.0"); } else if (ngVersion.atLeast("9.0.0")) { additionalProperties.put("rxjsVersion", "6.5.3"); @@ -334,7 +338,10 @@ private void addNpmPackageGeneration(SemVer ngVersion) { supportingFiles.add(new SupportingFile("ng-package.mustache", getIndexDirectory(), "ng-package.json")); // Specific ng-packagr configuration - if (ngVersion.atLeast("12.0.0")) { + if (ngVersion.atLeast("13.0.0")) { + additionalProperties.put("ngPackagrVersion", "13.0.3"); + additionalProperties.put("tsickleVersion", "0.43.0"); + } else if (ngVersion.atLeast("12.0.0")) { additionalProperties.put("ngPackagrVersion", "12.2.1"); additionalProperties.put("tsickleVersion", "0.43.0"); } else if (ngVersion.atLeast("11.0.0")) { diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/.gitignore b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/.gitignore new file mode 100644 index 000000000000..149b57654723 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/.openapi-generator-ignore b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/.openapi-generator/FILES new file mode 100644 index 000000000000..7f8ebffb302f --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/.openapi-generator/FILES @@ -0,0 +1,19 @@ +.gitignore +README.md +api.module.ts +api/api.ts +api/pet.service.ts +api/store.service.ts +api/user.service.ts +configuration.ts +encoder.ts +git_push.sh +index.ts +model/apiResponse.ts +model/category.ts +model/models.ts +model/order.ts +model/pet.ts +model/tag.ts +model/user.ts +variables.ts diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/.openapi-generator/VERSION new file mode 100644 index 000000000000..4077803655c0 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/README.md b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/README.md new file mode 100644 index 000000000000..f2e5a1c1ee2d --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/README.md @@ -0,0 +1,203 @@ +## @ + +### Building + +To install the required dependencies and to build the typescript sources run: +``` +npm install +npm run build +``` + +### publishing + +First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!) + +### consuming + +Navigate to the folder of your consuming project and run one of next commands. + +_published:_ + +``` +npm install @ --save +``` + +_without publishing (not recommended):_ + +``` +npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save +``` + +_It's important to take the tgz file, otherwise you'll get trouble with links on windows_ + +_using `npm link`:_ + +In PATH_TO_GENERATED_PACKAGE/dist: +``` +npm link +``` + +In your project: +``` +npm link +``` + +__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages. +Please refer to this issue https://github.com/angular/angular-cli/issues/8284 for a solution / workaround. +Published packages are not effected by this issue. + + +#### General usage + +In your Angular project: + + +``` +// without configuring providers +import { ApiModule } from ''; +import { HttpClientModule } from '@angular/common/http'; + +@NgModule({ + imports: [ + ApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule + ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +// configuring providers +import { ApiModule, Configuration, ConfigurationParameters } from ''; + +export function apiConfigFactory (): Configuration { + const params: ConfigurationParameters = { + // set configuration parameters here. + } + return new Configuration(params); +} + +@NgModule({ + imports: [ ApiModule.forRoot(apiConfigFactory) ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +// configuring providers with an authentication service that manages your access tokens +import { ApiModule, Configuration } from ''; + +@NgModule({ + imports: [ ApiModule ], + declarations: [ AppComponent ], + providers: [ + { + provide: Configuration, + useFactory: (authService: AuthService) => new Configuration( + { + basePath: environment.apiUrl, + accessToken: authService.getAccessToken.bind(authService) + } + ), + deps: [AuthService], + multi: false + } + ], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +import { DefaultApi } from ''; + +export class AppComponent { + constructor(private apiGateway: DefaultApi) { } +} +``` + +Note: The ApiModule is restricted to being instantiated once app wide. +This is to ensure that all services are treated as singletons. + +#### Using multiple OpenAPI files / APIs / ApiModules +In order to use multiple `ApiModules` generated from different OpenAPI files, +you can create an alias name when importing the modules +in order to avoid naming conflicts: +``` +import { ApiModule } from 'my-api-path'; +import { ApiModule as OtherApiModule } from 'my-other-api-path'; +import { HttpClientModule } from '@angular/common/http'; + +@NgModule({ + imports: [ + ApiModule, + OtherApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule + ] +}) +export class AppModule { + +} +``` + + +### Set service base path +If different than the generated base path, during app bootstrap, you can provide the base path to your service. + +``` +import { BASE_PATH } from ''; + +bootstrap(AppComponent, [ + { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, +]); +``` +or + +``` +import { BASE_PATH } from ''; + +@NgModule({ + imports: [], + declarations: [ AppComponent ], + providers: [ provide: BASE_PATH, useValue: 'https://your-web-service.com' ], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + + +#### Using @angular/cli +First extend your `src/environments/*.ts` files by adding the corresponding base path: + +``` +export const environment = { + production: false, + API_BASE_PATH: 'http://127.0.0.1:8080' +}; +``` + +In the src/app/app.module.ts: +``` +import { BASE_PATH } from ''; +import { environment } from '../environments/environment'; + +@NgModule({ + declarations: [ + AppComponent + ], + imports: [ ], + providers: [{ provide: BASE_PATH, useValue: environment.API_BASE_PATH }], + bootstrap: [ AppComponent ] +}) +export class AppModule { } +``` diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api.module.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api.module.ts new file mode 100644 index 000000000000..2afb8f64e926 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api.module.ts @@ -0,0 +1,33 @@ +import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core'; +import { Configuration } from './configuration'; +import { HttpClient } from '@angular/common/http'; + +import { PetService } from './api/pet.service'; +import { StoreService } from './api/store.service'; +import { UserService } from './api/user.service'; + +@NgModule({ + imports: [], + declarations: [], + exports: [], + providers: [] +}) +export class ApiModule { + public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders { + return { + ngModule: ApiModule, + providers: [ { provide: Configuration, useFactory: configurationFactory } ] + }; + } + + constructor( @Optional() @SkipSelf() parentModule: ApiModule, + @Optional() http: HttpClient) { + if (parentModule) { + throw new Error('ApiModule is already loaded. Import in your base AppModule only.'); + } + if (!http) { + throw new Error('You need to import the HttpClientModule in your AppModule! \n' + + 'See also https://github.com/angular/angular/issues/20575'); + } + } +} diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/api.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/api.ts new file mode 100644 index 000000000000..8e44b64083d5 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/api.ts @@ -0,0 +1,7 @@ +export * from './pet.service'; +import { PetService } from './pet.service'; +export * from './store.service'; +import { StoreService } from './store.service'; +export * from './user.service'; +import { UserService } from './user.service'; +export const APIS = [PetService, StoreService, UserService]; diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/pet.service.ts new file mode 100644 index 000000000000..4e6194e7b10f --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/pet.service.ts @@ -0,0 +1,666 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { ApiResponse } from '../model/apiResponse'; +// @ts-ignore +import { Pet } from '../model/pet'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class PetService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + /** + * @param consumes string[] mime-types + * @return true: consumes contains 'multipart/form-data', false: otherwise + */ + private canConsumeForm(consumes: string[]): boolean { + const form = 'multipart/form-data'; + for (const consume of consumes) { + if (form === consume) { + return true; + } + } + return false; + } + + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Add a new pet to the store + * @param body Pet object that needs to be added to the store + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling addPet.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json', + 'application/xml' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/pet`, + body, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Deletes a pet + * @param petId Pet id to delete + * @param apiKey + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling deletePet.'); + } + + let localVarHeaders = this.defaultHeaders; + if (apiKey !== undefined && apiKey !== null) { + localVarHeaders = localVarHeaders.set('api_key', String(apiKey)); + } + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, + null, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { + if (status === null || status === undefined) { + throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (status) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + status.join(COLLECTION_FORMATS['csv']), 'status'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + * @deprecated + */ + public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>>; + public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>>; + public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { + if (tags === null || tags === undefined) { + throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (tags) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + tags.join(COLLECTION_FORMATS['csv']), 'tags'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable; + public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling getPetById.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Update an existing pet + * @param body Pet object that needs to be added to the store + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling updatePet.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json', + 'application/xml' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.put(`${this.configuration.basePath}/pet`, + body, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Updates a pet in the store with form data + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet + * @param status Updated status of the pet + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/x-www-form-urlencoded' + ]; + + const canConsumeForm = this.canConsumeForm(consumes); + + let localVarFormParams: { append(param: string, value: any): any; }; + let localVarUseForm = false; + let localVarConvertFormParamsToString = false; + if (localVarUseForm) { + localVarFormParams = new FormData(); + } else { + localVarFormParams = new HttpParams({encoder: this.encoder}); + } + + if (name !== undefined) { + localVarFormParams = localVarFormParams.append('name', name) as any || localVarFormParams; + } + if (status !== undefined) { + localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; + } + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, + localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * uploads an image + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server + * @param file file to upload + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'multipart/form-data' + ]; + + const canConsumeForm = this.canConsumeForm(consumes); + + let localVarFormParams: { append(param: string, value: any): any; }; + let localVarUseForm = false; + let localVarConvertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + localVarUseForm = canConsumeForm; + if (localVarUseForm) { + localVarFormParams = new FormData(); + } else { + localVarFormParams = new HttpParams({encoder: this.encoder}); + } + + if (additionalMetadata !== undefined) { + localVarFormParams = localVarFormParams.append('additionalMetadata', additionalMetadata) as any || localVarFormParams; + } + if (file !== undefined) { + localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; + } + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, + localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/store.service.ts new file mode 100644 index 000000000000..9d00e8b652cb --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/store.service.ts @@ -0,0 +1,311 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { Order } from '../model/order'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class StoreService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (orderId === null || orderId === undefined) { + throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, + null, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable<{ [key: string]: number; }>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; + public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable { + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable; + public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { + if (orderId === null || orderId === undefined) { + throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Place an order for a pet + * @param body order placed for purchasing the pet + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable; + public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling placeOrder.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/store/order`, + body, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/user.service.ts new file mode 100644 index 000000000000..7fc46dada8a2 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/user.service.ts @@ -0,0 +1,549 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { User } from '../model/user'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class UserService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUser.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/user`, + body, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Creates list of users with given input array + * @param body List of user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, + body, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Creates list of users with given input array + * @param body List of user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, + body, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling deleteUser.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, + null, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Get user by user name + * @param username The name that needs to be fetched. Use user1 for testing. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable; + public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling getUserByName.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Logs user into the system + * @param username The user name for login + * @param password The password for login in clear text + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable; + public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling loginUser.'); + } + if (password === null || password === undefined) { + throw new Error('Required parameter password was null or undefined when calling loginUser.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (username !== undefined && username !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + username, 'username'); + } + if (password !== undefined && password !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + password, 'password'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/user/login`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Logs out current logged in user session + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/user/logout`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * 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 observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling updateUser.'); + } + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling updateUser.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, + body, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/configuration.ts new file mode 100644 index 000000000000..6fc0f80d973f --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/configuration.ts @@ -0,0 +1,141 @@ +import { HttpParameterCodec } from '@angular/common/http'; + +export interface ConfigurationParameters { + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials?: {[ key: string ]: string | (() => string | undefined)}; +} + +export class Configuration { + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials: {[ key: string ]: string | (() => string | undefined)}; + + constructor(configurationParameters: ConfigurationParameters = {}) { + this.apiKeys = configurationParameters.apiKeys; + this.username = configurationParameters.username; + this.password = configurationParameters.password; + this.accessToken = configurationParameters.accessToken; + this.basePath = configurationParameters.basePath; + this.withCredentials = configurationParameters.withCredentials; + this.encoder = configurationParameters.encoder; + if (configurationParameters.credentials) { + this.credentials = configurationParameters.credentials; + } + else { + this.credentials = {}; + } + + // init default api_key credential + if (!this.credentials['api_key']) { + this.credentials['api_key'] = () => { + if (this.apiKeys === null || this.apiKeys === undefined) { + return undefined; + } else { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + } + }; + } + + // init default petstore_auth credential + if (!this.credentials['petstore_auth']) { + this.credentials['petstore_auth'] = () => { + return typeof this.accessToken === 'function' + ? this.accessToken() + : this.accessToken; + }; + } + } + + /** + * Select the correct content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param contentTypes - the array of content types that are available for selection + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderContentType (contentTypes: string[]): string | undefined { + if (contentTypes.length === 0) { + return undefined; + } + + const type = contentTypes.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return contentTypes[0]; + } + return type; + } + + /** + * Select the correct accept content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param accepts - the array of content types that are available for selection. + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderAccept(accepts: string[]): string | undefined { + if (accepts.length === 0) { + return undefined; + } + + const type = accepts.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return accepts[0]; + } + return type; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } + + public lookupCredential(key: string): string | undefined { + const value = this.credentials[key]; + return typeof value === 'function' + ? value() + : value; + } +} diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/encoder.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/encoder.ts new file mode 100644 index 000000000000..138c4d5cf2c1 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/encoder.ts @@ -0,0 +1,20 @@ +import { HttpParameterCodec } from '@angular/common/http'; + +/** + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ +export class CustomHttpParameterCodec implements HttpParameterCodec { + encodeKey(k: string): string { + return encodeURIComponent(k); + } + encodeValue(v: string): string { + return encodeURIComponent(v); + } + decodeKey(k: string): string { + return decodeURIComponent(k); + } + decodeValue(v: string): string { + return decodeURIComponent(v); + } +} diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/git_push.sh b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/git_push.sh new file mode 100644 index 000000000000..f53a75d4fabe --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/index.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/index.ts new file mode 100644 index 000000000000..c312b70fa3ef --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/index.ts @@ -0,0 +1,5 @@ +export * from './api/api'; +export * from './model/models'; +export * from './variables'; +export * from './configuration'; +export * from './api.module'; \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/model/apiResponse.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/model/apiResponse.ts new file mode 100644 index 000000000000..682ba478921e --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/model/apiResponse.ts @@ -0,0 +1,22 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * Describes the result of uploading an image resource + */ +export interface ApiResponse { + code?: number; + type?: string; + message?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/model/category.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/model/category.ts new file mode 100644 index 000000000000..b988b6827a05 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/model/category.ts @@ -0,0 +1,21 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * A category for a pet + */ +export interface Category { + id?: number; + name?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/model/models.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/model/models.ts new file mode 100644 index 000000000000..8607c5dabd0c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/model/models.ts @@ -0,0 +1,6 @@ +export * from './apiResponse'; +export * from './category'; +export * from './order'; +export * from './pet'; +export * from './tag'; +export * from './user'; diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/model/order.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/model/order.ts new file mode 100644 index 000000000000..a29bebe49065 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/model/order.ts @@ -0,0 +1,37 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * An order for a pets from the pet store + */ +export interface Order { + id?: number; + petId?: number; + quantity?: number; + shipDate?: string; + /** + * Order Status + */ + status?: Order.StatusEnum; + complete?: boolean; +} +export namespace Order { + export type StatusEnum = 'placed' | 'approved' | 'delivered'; + export const StatusEnum = { + Placed: 'placed' as StatusEnum, + Approved: 'approved' as StatusEnum, + Delivered: 'delivered' as StatusEnum + }; +} + + diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/model/pet.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/model/pet.ts new file mode 100644 index 000000000000..e0404395f91c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/model/pet.ts @@ -0,0 +1,39 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Category } from './category'; +import { Tag } from './tag'; + + +/** + * A pet for sale in the pet store + */ +export interface Pet { + id?: number; + category?: Category; + name: string; + photoUrls: Array; + tags?: Array; + /** + * pet status in the store + */ + status?: Pet.StatusEnum; +} +export namespace Pet { + export type StatusEnum = 'available' | 'pending' | 'sold'; + export const StatusEnum = { + Available: 'available' as StatusEnum, + Pending: 'pending' as StatusEnum, + Sold: 'sold' as StatusEnum + }; +} + + diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/model/tag.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/model/tag.ts new file mode 100644 index 000000000000..b6ff210e8df4 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/model/tag.ts @@ -0,0 +1,21 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * A tag for a pet + */ +export interface Tag { + id?: number; + name?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/model/user.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/model/user.ts new file mode 100644 index 000000000000..fce51005300c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/model/user.ts @@ -0,0 +1,30 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * A User who is purchasing from the pet store + */ +export interface User { + id?: number; + username?: string; + firstName?: string; + lastName?: string; + email?: string; + password?: string; + phone?: string; + /** + * User Status + */ + userStatus?: number; +} + diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/variables.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/variables.ts new file mode 100644 index 000000000000..6fe58549f395 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/variables.ts @@ -0,0 +1,9 @@ +import { InjectionToken } from '@angular/core'; + +export const BASE_PATH = new InjectionToken('basePath'); +export const COLLECTION_FORMATS = { + 'csv': ',', + 'tsv': ' ', + 'ssv': ' ', + 'pipes': '|' +} diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/.gitignore b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/.gitignore new file mode 100644 index 000000000000..149b57654723 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/.openapi-generator-ignore b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/.openapi-generator/FILES new file mode 100644 index 000000000000..5db7bd763695 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/.openapi-generator/FILES @@ -0,0 +1,22 @@ +.gitignore +README.md +api.module.ts +api/api.ts +api/pet.service.ts +api/store.service.ts +api/user.service.ts +configuration.ts +encoder.ts +git_push.sh +index.ts +model/apiResponse.ts +model/category.ts +model/models.ts +model/order.ts +model/pet.ts +model/tag.ts +model/user.ts +ng-package.json +package.json +tsconfig.json +variables.ts diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/.openapi-generator/VERSION new file mode 100644 index 000000000000..4077803655c0 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/README.md b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/README.md new file mode 100644 index 000000000000..000c51d694b6 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/README.md @@ -0,0 +1,203 @@ +## @openapitools/typescript-angular-petstore@1.0.0 + +### Building + +To install the required dependencies and to build the typescript sources run: +``` +npm install +npm run build +``` + +### publishing + +First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!) + +### consuming + +Navigate to the folder of your consuming project and run one of next commands. + +_published:_ + +``` +npm install @openapitools/typescript-angular-petstore@1.0.0 --save +``` + +_without publishing (not recommended):_ + +``` +npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save +``` + +_It's important to take the tgz file, otherwise you'll get trouble with links on windows_ + +_using `npm link`:_ + +In PATH_TO_GENERATED_PACKAGE/dist: +``` +npm link +``` + +In your project: +``` +npm link @openapitools/typescript-angular-petstore +``` + +__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages. +Please refer to this issue https://github.com/angular/angular-cli/issues/8284 for a solution / workaround. +Published packages are not effected by this issue. + + +#### General usage + +In your Angular project: + + +``` +// without configuring providers +import { ApiModule } from '@openapitools/typescript-angular-petstore'; +import { HttpClientModule } from '@angular/common/http'; + +@NgModule({ + imports: [ + ApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule + ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +// configuring providers +import { ApiModule, Configuration, ConfigurationParameters } from '@openapitools/typescript-angular-petstore'; + +export function apiConfigFactory (): Configuration { + const params: ConfigurationParameters = { + // set configuration parameters here. + } + return new Configuration(params); +} + +@NgModule({ + imports: [ ApiModule.forRoot(apiConfigFactory) ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +// configuring providers with an authentication service that manages your access tokens +import { ApiModule, Configuration } from '@openapitools/typescript-angular-petstore'; + +@NgModule({ + imports: [ ApiModule ], + declarations: [ AppComponent ], + providers: [ + { + provide: Configuration, + useFactory: (authService: AuthService) => new Configuration( + { + basePath: environment.apiUrl, + accessToken: authService.getAccessToken.bind(authService) + } + ), + deps: [AuthService], + multi: false + } + ], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +import { DefaultApi } from '@openapitools/typescript-angular-petstore'; + +export class AppComponent { + constructor(private apiGateway: DefaultApi) { } +} +``` + +Note: The ApiModule is restricted to being instantiated once app wide. +This is to ensure that all services are treated as singletons. + +#### Using multiple OpenAPI files / APIs / ApiModules +In order to use multiple `ApiModules` generated from different OpenAPI files, +you can create an alias name when importing the modules +in order to avoid naming conflicts: +``` +import { ApiModule } from 'my-api-path'; +import { ApiModule as OtherApiModule } from 'my-other-api-path'; +import { HttpClientModule } from '@angular/common/http'; + +@NgModule({ + imports: [ + ApiModule, + OtherApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule + ] +}) +export class AppModule { + +} +``` + + +### Set service base path +If different than the generated base path, during app bootstrap, you can provide the base path to your service. + +``` +import { BASE_PATH } from '@openapitools/typescript-angular-petstore'; + +bootstrap(AppComponent, [ + { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, +]); +``` +or + +``` +import { BASE_PATH } from '@openapitools/typescript-angular-petstore'; + +@NgModule({ + imports: [], + declarations: [ AppComponent ], + providers: [ provide: BASE_PATH, useValue: 'https://your-web-service.com' ], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + + +#### Using @angular/cli +First extend your `src/environments/*.ts` files by adding the corresponding base path: + +``` +export const environment = { + production: false, + API_BASE_PATH: 'http://127.0.0.1:8080' +}; +``` + +In the src/app/app.module.ts: +``` +import { BASE_PATH } from '@openapitools/typescript-angular-petstore'; +import { environment } from '../environments/environment'; + +@NgModule({ + declarations: [ + AppComponent + ], + imports: [ ], + providers: [{ provide: BASE_PATH, useValue: environment.API_BASE_PATH }], + bootstrap: [ AppComponent ] +}) +export class AppModule { } +``` diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api.module.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api.module.ts new file mode 100644 index 000000000000..2afb8f64e926 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api.module.ts @@ -0,0 +1,33 @@ +import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core'; +import { Configuration } from './configuration'; +import { HttpClient } from '@angular/common/http'; + +import { PetService } from './api/pet.service'; +import { StoreService } from './api/store.service'; +import { UserService } from './api/user.service'; + +@NgModule({ + imports: [], + declarations: [], + exports: [], + providers: [] +}) +export class ApiModule { + public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders { + return { + ngModule: ApiModule, + providers: [ { provide: Configuration, useFactory: configurationFactory } ] + }; + } + + constructor( @Optional() @SkipSelf() parentModule: ApiModule, + @Optional() http: HttpClient) { + if (parentModule) { + throw new Error('ApiModule is already loaded. Import in your base AppModule only.'); + } + if (!http) { + throw new Error('You need to import the HttpClientModule in your AppModule! \n' + + 'See also https://github.com/angular/angular/issues/20575'); + } + } +} diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/api.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/api.ts new file mode 100644 index 000000000000..8e44b64083d5 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/api.ts @@ -0,0 +1,7 @@ +export * from './pet.service'; +import { PetService } from './pet.service'; +export * from './store.service'; +import { StoreService } from './store.service'; +export * from './user.service'; +import { UserService } from './user.service'; +export const APIS = [PetService, StoreService, UserService]; diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/pet.service.ts new file mode 100644 index 000000000000..4e6194e7b10f --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/pet.service.ts @@ -0,0 +1,666 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { ApiResponse } from '../model/apiResponse'; +// @ts-ignore +import { Pet } from '../model/pet'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class PetService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + /** + * @param consumes string[] mime-types + * @return true: consumes contains 'multipart/form-data', false: otherwise + */ + private canConsumeForm(consumes: string[]): boolean { + const form = 'multipart/form-data'; + for (const consume of consumes) { + if (form === consume) { + return true; + } + } + return false; + } + + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Add a new pet to the store + * @param body Pet object that needs to be added to the store + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling addPet.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json', + 'application/xml' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/pet`, + body, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Deletes a pet + * @param petId Pet id to delete + * @param apiKey + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling deletePet.'); + } + + let localVarHeaders = this.defaultHeaders; + if (apiKey !== undefined && apiKey !== null) { + localVarHeaders = localVarHeaders.set('api_key', String(apiKey)); + } + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, + null, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { + if (status === null || status === undefined) { + throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (status) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + status.join(COLLECTION_FORMATS['csv']), 'status'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + * @deprecated + */ + public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>>; + public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>>; + public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { + if (tags === null || tags === undefined) { + throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (tags) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + tags.join(COLLECTION_FORMATS['csv']), 'tags'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable; + public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling getPetById.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Update an existing pet + * @param body Pet object that needs to be added to the store + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling updatePet.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json', + 'application/xml' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.put(`${this.configuration.basePath}/pet`, + body, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Updates a pet in the store with form data + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet + * @param status Updated status of the pet + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/x-www-form-urlencoded' + ]; + + const canConsumeForm = this.canConsumeForm(consumes); + + let localVarFormParams: { append(param: string, value: any): any; }; + let localVarUseForm = false; + let localVarConvertFormParamsToString = false; + if (localVarUseForm) { + localVarFormParams = new FormData(); + } else { + localVarFormParams = new HttpParams({encoder: this.encoder}); + } + + if (name !== undefined) { + localVarFormParams = localVarFormParams.append('name', name) as any || localVarFormParams; + } + if (status !== undefined) { + localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; + } + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, + localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * uploads an image + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server + * @param file file to upload + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (petstore_auth) required + localVarCredential = this.configuration.lookupCredential('petstore_auth'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'multipart/form-data' + ]; + + const canConsumeForm = this.canConsumeForm(consumes); + + let localVarFormParams: { append(param: string, value: any): any; }; + let localVarUseForm = false; + let localVarConvertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + localVarUseForm = canConsumeForm; + if (localVarUseForm) { + localVarFormParams = new FormData(); + } else { + localVarFormParams = new HttpParams({encoder: this.encoder}); + } + + if (additionalMetadata !== undefined) { + localVarFormParams = localVarFormParams.append('additionalMetadata', additionalMetadata) as any || localVarFormParams; + } + if (file !== undefined) { + localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; + } + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, + localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/store.service.ts new file mode 100644 index 000000000000..9d00e8b652cb --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/store.service.ts @@ -0,0 +1,311 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { Order } from '../model/order'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class StoreService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (orderId === null || orderId === undefined) { + throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, + null, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable<{ [key: string]: number; }>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; + public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable { + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (api_key) required + localVarCredential = this.configuration.lookupCredential('api_key'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('api_key', localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable; + public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { + if (orderId === null || orderId === undefined) { + throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Place an order for a pet + * @param body order placed for purchasing the pet + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable; + public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling placeOrder.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/store/order`, + body, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/user.service.ts new file mode 100644 index 000000000000..7fc46dada8a2 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/user.service.ts @@ -0,0 +1,549 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { User } from '../model/user'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class UserService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUser.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/user`, + body, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Creates list of users with given input array + * @param body List of user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, + body, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Creates list of users with given input array + * @param body List of user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, + body, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling deleteUser.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, + null, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Get user by user name + * @param username The name that needs to be fetched. Use user1 for testing. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable; + public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling getUserByName.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Logs user into the system + * @param username The user name for login + * @param password The password for login in clear text + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable; + public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable>; + public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json', context?: HttpContext}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling loginUser.'); + } + if (password === null || password === undefined) { + throw new Error('Required parameter password was null or undefined when calling loginUser.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (username !== undefined && username !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + username, 'username'); + } + if (password !== undefined && password !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + password, 'password'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/user/login`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Logs out current logged in user session + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/user/logout`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * 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 observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling updateUser.'); + } + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling updateUser.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, + body, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/configuration.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/configuration.ts new file mode 100644 index 000000000000..6fc0f80d973f --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/configuration.ts @@ -0,0 +1,141 @@ +import { HttpParameterCodec } from '@angular/common/http'; + +export interface ConfigurationParameters { + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials?: {[ key: string ]: string | (() => string | undefined)}; +} + +export class Configuration { + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials: {[ key: string ]: string | (() => string | undefined)}; + + constructor(configurationParameters: ConfigurationParameters = {}) { + this.apiKeys = configurationParameters.apiKeys; + this.username = configurationParameters.username; + this.password = configurationParameters.password; + this.accessToken = configurationParameters.accessToken; + this.basePath = configurationParameters.basePath; + this.withCredentials = configurationParameters.withCredentials; + this.encoder = configurationParameters.encoder; + if (configurationParameters.credentials) { + this.credentials = configurationParameters.credentials; + } + else { + this.credentials = {}; + } + + // init default api_key credential + if (!this.credentials['api_key']) { + this.credentials['api_key'] = () => { + if (this.apiKeys === null || this.apiKeys === undefined) { + return undefined; + } else { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + } + }; + } + + // init default petstore_auth credential + if (!this.credentials['petstore_auth']) { + this.credentials['petstore_auth'] = () => { + return typeof this.accessToken === 'function' + ? this.accessToken() + : this.accessToken; + }; + } + } + + /** + * Select the correct content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param contentTypes - the array of content types that are available for selection + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderContentType (contentTypes: string[]): string | undefined { + if (contentTypes.length === 0) { + return undefined; + } + + const type = contentTypes.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return contentTypes[0]; + } + return type; + } + + /** + * Select the correct accept content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param accepts - the array of content types that are available for selection. + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderAccept(accepts: string[]): string | undefined { + if (accepts.length === 0) { + return undefined; + } + + const type = accepts.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return accepts[0]; + } + return type; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } + + public lookupCredential(key: string): string | undefined { + const value = this.credentials[key]; + return typeof value === 'function' + ? value() + : value; + } +} diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/encoder.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/encoder.ts new file mode 100644 index 000000000000..138c4d5cf2c1 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/encoder.ts @@ -0,0 +1,20 @@ +import { HttpParameterCodec } from '@angular/common/http'; + +/** + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ +export class CustomHttpParameterCodec implements HttpParameterCodec { + encodeKey(k: string): string { + return encodeURIComponent(k); + } + encodeValue(v: string): string { + return encodeURIComponent(v); + } + decodeKey(k: string): string { + return decodeURIComponent(k); + } + decodeValue(v: string): string { + return decodeURIComponent(v); + } +} diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/git_push.sh b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/git_push.sh new file mode 100644 index 000000000000..f53a75d4fabe --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/index.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/index.ts new file mode 100644 index 000000000000..c312b70fa3ef --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/index.ts @@ -0,0 +1,5 @@ +export * from './api/api'; +export * from './model/models'; +export * from './variables'; +export * from './configuration'; +export * from './api.module'; \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/model/apiResponse.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/model/apiResponse.ts new file mode 100644 index 000000000000..682ba478921e --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/model/apiResponse.ts @@ -0,0 +1,22 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * Describes the result of uploading an image resource + */ +export interface ApiResponse { + code?: number; + type?: string; + message?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/model/category.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/model/category.ts new file mode 100644 index 000000000000..b988b6827a05 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/model/category.ts @@ -0,0 +1,21 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * A category for a pet + */ +export interface Category { + id?: number; + name?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/model/models.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/model/models.ts new file mode 100644 index 000000000000..8607c5dabd0c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/model/models.ts @@ -0,0 +1,6 @@ +export * from './apiResponse'; +export * from './category'; +export * from './order'; +export * from './pet'; +export * from './tag'; +export * from './user'; diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/model/order.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/model/order.ts new file mode 100644 index 000000000000..a29bebe49065 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/model/order.ts @@ -0,0 +1,37 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * An order for a pets from the pet store + */ +export interface Order { + id?: number; + petId?: number; + quantity?: number; + shipDate?: string; + /** + * Order Status + */ + status?: Order.StatusEnum; + complete?: boolean; +} +export namespace Order { + export type StatusEnum = 'placed' | 'approved' | 'delivered'; + export const StatusEnum = { + Placed: 'placed' as StatusEnum, + Approved: 'approved' as StatusEnum, + Delivered: 'delivered' as StatusEnum + }; +} + + diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/model/pet.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/model/pet.ts new file mode 100644 index 000000000000..e0404395f91c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/model/pet.ts @@ -0,0 +1,39 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Category } from './category'; +import { Tag } from './tag'; + + +/** + * A pet for sale in the pet store + */ +export interface Pet { + id?: number; + category?: Category; + name: string; + photoUrls: Array; + tags?: Array; + /** + * pet status in the store + */ + status?: Pet.StatusEnum; +} +export namespace Pet { + export type StatusEnum = 'available' | 'pending' | 'sold'; + export const StatusEnum = { + Available: 'available' as StatusEnum, + Pending: 'pending' as StatusEnum, + Sold: 'sold' as StatusEnum + }; +} + + diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/model/tag.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/model/tag.ts new file mode 100644 index 000000000000..b6ff210e8df4 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/model/tag.ts @@ -0,0 +1,21 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * A tag for a pet + */ +export interface Tag { + id?: number; + name?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/model/user.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/model/user.ts new file mode 100644 index 000000000000..fce51005300c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/model/user.ts @@ -0,0 +1,30 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * A User who is purchasing from the pet store + */ +export interface User { + id?: number; + username?: string; + firstName?: string; + lastName?: string; + email?: string; + password?: string; + phone?: string; + /** + * User Status + */ + userStatus?: number; +} + diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/ng-package.json b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/ng-package.json new file mode 100644 index 000000000000..3b17900dc9c3 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/ng-package.json @@ -0,0 +1,6 @@ +{ + "$schema": "./node_modules/ng-packagr/ng-package.schema.json", + "lib": { + "entryFile": "index.ts" + } +} diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/package.json b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/package.json new file mode 100644 index 000000000000..a00df3cd562c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/package.json @@ -0,0 +1,34 @@ +{ + "name": "@openapitools/typescript-angular-petstore", + "version": "1.0.0", + "description": "OpenAPI client for @openapitools/typescript-angular-petstore", + "author": "OpenAPI-Generator Contributors", + "keywords": [ + "openapi-client", + "openapi-generator" + ], + "license": "Unlicense", + "scripts": { + "build": "ng-packagr -p ng-package.json" + }, + "peerDependencies": { + "@angular/core": "^13.0.1", + "rxjs": "^7.4.0" + }, + "devDependencies": { + "@angular/common": "^13.0.1", + "@angular/compiler": "^13.0.1", + "@angular/compiler-cli": "^13.0.1", + "@angular/core": "^13.0.1", + "@angular/platform-browser": "^13.0.1", + "ng-packagr": "^13.0.3", + "reflect-metadata": "^0.1.3", + "rxjs": "^7.4.0", + "tsickle": "^0.43.0", + "typescript": ">=4.4.2 <4.5.0", + "zone.js": "^0.11.4" + }, + "publishConfig": { + "registry": "https://skimdb.npmjs.com/registry" + } +} diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/tsconfig.json b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/tsconfig.json new file mode 100644 index 000000000000..fd2abf8a2ad4 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "noImplicitAny": false, + "suppressImplicitAnyIndexErrors": true, + "target": "es6", + "module": "es6", + "moduleResolution": "node", + "removeComments": true, + "sourceMap": true, + "outDir": "./dist", + "noLib": false, + "declaration": true, + "lib": [ "es6", "dom" ], + "typeRoots": [ + "node_modules/@types" + ] + }, + "exclude": [ + "node_modules", + "dist" + ], + "filesGlob": [ + "./model/*.ts", + "./api/*.ts" + ] +} diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/variables.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/variables.ts new file mode 100644 index 000000000000..6fe58549f395 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/variables.ts @@ -0,0 +1,9 @@ +import { InjectionToken } from '@angular/core'; + +export const BASE_PATH = new InjectionToken('basePath'); +export const COLLECTION_FORMATS = { + 'csv': ',', + 'tsv': ' ', + 'ssv': ' ', + 'pipes': '|' +} From 836e40f1d22fca7466be20fa55b64da3e1c42db8 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Fri, 3 Dec 2021 10:21:36 -0800 Subject: [PATCH 056/117] Fixes CodegenMediaType schema baseName (#11030) --- .../java/org/openapitools/codegen/DefaultCodegen.java | 8 ++++++-- .../java/org/openapitools/codegen/DefaultCodegenTest.java | 4 ++++ 2 files changed, 10 insertions(+), 2 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 046d8609d3ce..042ffc089c38 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 @@ -6558,6 +6558,10 @@ protected void updateRequestBodyForString(CodegenParameter codegenParameter, Sch codegenParameter.pattern = toRegularExpression(schema.getPattern()); } + protected String toMediaTypeSchemaName(String contentType) { + return toModelName(contentType + "Schema"); + } + protected LinkedHashMap getContent(Content content, Set imports) { if (content == null) { return null; @@ -6605,9 +6609,9 @@ protected LinkedHashMap getContent(Content content, Se ceMap.put(propName, ce); } } - CodegenProperty schemaProp = fromProperty("schema", mt.getSchema()); - CodegenMediaType codegenMt = new CodegenMediaType(schemaProp, ceMap); String contentType = contentEntry.getKey(); + CodegenProperty schemaProp = fromProperty(toMediaTypeSchemaName(contentType), mt.getSchema()); + CodegenMediaType codegenMt = new CodegenMediaType(schemaProp, ceMap); cmtContent.put(contentType, codegenMt); } return cmtContent; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java index 28748850f1bd..87486da4c36e 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java @@ -3922,11 +3922,13 @@ public void testRequestBodyContent() { CodegenMediaType mt = content.get("application/json"); assertNull(mt.getEncoding()); CodegenProperty cp = mt.getSchema(); + assertEquals(cp.baseName, "ApplicationJsonSchema"); assertNotNull(cp); mt = content.get("text/plain"); assertNull(mt.getEncoding()); cp = mt.getSchema(); + assertEquals(cp.baseName, "TextPlainSchema"); assertNotNull(cp); // Note: the inline model resolver has a bug for this use case; it extracts an inline request body into a component // but the schema it references is not string type @@ -3940,11 +3942,13 @@ public void testRequestBodyContent() { mt = content.get("application/json"); assertNull(mt.getEncoding()); cp = mt.getSchema(); + assertEquals(cp.baseName, "ApplicationJsonSchema"); assertEquals(cp.complexType, "coordinates"); mt = content.get("text/plain"); assertNull(mt.getEncoding()); cp = mt.getSchema(); + assertEquals(cp.baseName, "TextPlainSchema"); assertTrue(cp.isString); } } From 37190357879efc838faf881f66a0dd3b6311b67d Mon Sep 17 00:00:00 2001 From: Tal Kirshboim Date: Sat, 4 Dec 2021 05:56:40 +0100 Subject: [PATCH 057/117] Fix HTTP client configuration object freezing issue on iOS (#11012) --- .../infrastructure/ApiClient.kt.mustache | 13 +++++++++---- .../openapitools/client/infrastructure/ApiClient.kt | 13 +++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/infrastructure/ApiClient.kt.mustache index 84836e45e7e1..470c4bc29265 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/infrastructure/ApiClient.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/infrastructure/ApiClient.kt.mustache @@ -34,15 +34,20 @@ import {{packageName}}.auth.* KotlinxSerializer(json).ignoreOutgoingContent() } - private val defaultHttpClientConfig: (HttpClientConfig<*>) -> Unit by lazy { - val jsonConfig: JsonFeature.Config.() -> Unit = { this.serializer = this@ApiClient.serializer } - { it.install(JsonFeature, jsonConfig) } + private val clientConfig: (HttpClientConfig<*>) -> Unit by lazy { + { + // Hold a reference to the serializer to avoid freezing the entire ApiClient instance + // when the JsonFeature is configured. + val serializerReference = serializer + it.install(JsonFeature) { serializer = serializerReference } + httpClientConfig?.invoke(it) + } } private val client: HttpClient by lazy { - val clientConfig: (HttpClientConfig<*>) -> Unit = httpClientConfig ?: defaultHttpClientConfig httpClientEngine?.let { HttpClient(it, clientConfig) } ?: HttpClient(clientConfig) } + {{#hasAuthMethods}} private val authentications: kotlin.collections.Map by lazy { mapOf({{#authMethods}}{{#isBasic}}{{#isBasicBasic}} diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 4fbb14f3f451..a6ec2640afcf 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -34,15 +34,20 @@ open class ApiClient( KotlinxSerializer(json).ignoreOutgoingContent() } - private val defaultHttpClientConfig: (HttpClientConfig<*>) -> Unit by lazy { - val jsonConfig: JsonFeature.Config.() -> Unit = { this.serializer = this@ApiClient.serializer } - { it.install(JsonFeature, jsonConfig) } + private val clientConfig: (HttpClientConfig<*>) -> Unit by lazy { + { + // Hold a reference to the serializer to avoid freezing the entire ApiClient instance + // when the JsonFeature is configured. + val serializerReference = serializer + it.install(JsonFeature) { serializer = serializerReference } + httpClientConfig?.invoke(it) + } } private val client: HttpClient by lazy { - val clientConfig: (HttpClientConfig<*>) -> Unit = httpClientConfig ?: defaultHttpClientConfig httpClientEngine?.let { HttpClient(it, clientConfig) } ?: HttpClient(clientConfig) } + private val authentications: kotlin.collections.Map by lazy { mapOf( "api_key" to ApiKeyAuth("header", "api_key"), From 6bc739091473d974187fa14ea669de7aee9f057d Mon Sep 17 00:00:00 2001 From: Abrhm7786 <82376602+Abrhm7786@users.noreply.github.com> Date: Sat, 4 Dec 2021 05:05:30 +0000 Subject: [PATCH 058/117] Azure functions (#11020) * New branch * Added test class for functions server * Logger should not be static * Added csharp-netcore-functions to docs/generators * Added csharp-netcore-functions to generators.md * Removes sln and csproj --- docs/generators.md | 1 + docs/generators/csharp-netcore-functions.md | 300 +++++ .../CSharpNetCoreReducedClientCodegen.java | 1151 +++++++++++++++++ .../CsharpNetcoreFunctionsServerCodegen.java | 82 ++ .../org.openapitools.codegen.CodegenConfig | 1 + .../AbstractOpenAPISchema.mustache | 68 + .../ApiClient.mustache | 867 +++++++++++++ .../ApiException.mustache | 60 + .../ApiResponse.mustache | 158 +++ .../AssemblyInfo.mustache | 40 + .../ClientUtils.mustache | 239 ++++ .../Configuration.mustache | 574 ++++++++ .../ExceptionFactory.mustache | 14 + .../GlobalConfiguration.mustache | 59 + .../HttpMethod.mustache | 25 + .../HttpSigningConfiguration.mustache | 757 +++++++++++ .../IApiAccessor.mustache | 29 + .../IAsynchronousClient.mustache | 92 ++ .../IReadableConfiguration.mustache | 114 ++ .../ISynchronousClient.mustache | 85 ++ .../JsonSubTypesTests.mustache | 125 ++ .../Multimap.mustache | 287 ++++ .../OpenAPIDateConverter.mustache | 21 + .../csharp-netcore-functions/README.mustache | 270 ++++ .../ReadOnlyDictionary.mustache | 137 ++ .../RequestOptions.mustache | 66 + .../RetryConfiguration.mustache | 39 + .../Solution.mustache | 27 + .../TestProject.mustache | 36 + .../WebRequestPathBuilder.mustache | 44 + .../csharp-netcore-functions/api.mustache | 626 +++++++++ .../csharp-netcore-functions/api_doc.mustache | 134 ++ .../api_test.mustache | 73 ++ .../appveyor.mustache | 9 + .../functions.mustache | 28 + .../git_push.sh.mustache | 58 + .../gitignore.mustache | 362 ++++++ .../libraries/httpclient/ApiClient.mustache | 739 +++++++++++ .../httpclient/FileParameter.mustache | 54 + .../httpclient/RequestOptions.mustache | 66 + .../libraries/httpclient/api.mustache | 724 +++++++++++ .../libraries/httpclient/model.mustache | 48 + .../csharp-netcore-functions/model.mustache | 47 + .../modelAnyOf.mustache | 227 ++++ .../modelEnum.mustache | 30 + .../modelGeneric.mustache | 456 +++++++ .../modelInnerEnum.mustache | 26 + .../modelOneOf.mustache | 264 ++++ .../model_doc.mustache | 22 + .../model_test.mustache | 81 ++ .../netcore_project.mustache | 44 + .../netcore_testproject.mustache | 20 + .../csharp-netcore-functions/nuspec.mustache | 52 + .../partial_header.mustache | 17 + .../pathParam.mustache | 1 + .../csharp-netcore-functions/project.mustache | 12 + .../visibility.mustache | 1 + ...harpNetcoreFunctionsServerCodegenTest.java | 40 + 58 files changed, 10029 insertions(+) create mode 100644 docs/generators/csharp-netcore-functions.md create mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreReducedClientCodegen.java create mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CsharpNetcoreFunctionsServerCodegen.java create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/AbstractOpenAPISchema.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/ApiClient.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/ApiException.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/ApiResponse.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/AssemblyInfo.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/ClientUtils.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/Configuration.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/ExceptionFactory.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/GlobalConfiguration.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/HttpMethod.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/HttpSigningConfiguration.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/IApiAccessor.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/IAsynchronousClient.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/IReadableConfiguration.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/ISynchronousClient.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/JsonSubTypesTests.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/Multimap.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/OpenAPIDateConverter.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/README.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/ReadOnlyDictionary.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/RequestOptions.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/RetryConfiguration.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/Solution.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/TestProject.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/WebRequestPathBuilder.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/api.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/api_doc.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/api_test.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/appveyor.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/functions.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/git_push.sh.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/gitignore.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/libraries/httpclient/ApiClient.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/libraries/httpclient/FileParameter.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/libraries/httpclient/RequestOptions.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/libraries/httpclient/api.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/libraries/httpclient/model.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/model.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/modelAnyOf.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/modelEnum.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/modelGeneric.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/modelInnerEnum.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/modelOneOf.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/model_doc.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/model_test.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/netcore_project.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/netcore_testproject.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/nuspec.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/partial_header.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/pathParam.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/project.mustache create mode 100644 modules/openapi-generator/src/main/resources/csharp-netcore-functions/visibility.mustache create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp-netcore-functions/CsharpNetcoreFunctionsServerCodegenTest.java diff --git a/docs/generators.md b/docs/generators.md index ed80e860e490..088acf1b859c 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -85,6 +85,7 @@ The following generators are available: * [cpp-pistache-server](generators/cpp-pistache-server.md) * [cpp-qt-qhttpengine-server](generators/cpp-qt-qhttpengine-server.md) * [cpp-restbed-server](generators/cpp-restbed-server.md) +* [csharp-netcore-functions](generators/csharp-netcore-functions.md) * [csharp-nancyfx](generators/csharp-nancyfx.md) * [erlang-server](generators/erlang-server.md) * [fsharp-functions (beta)](generators/fsharp-functions.md) diff --git a/docs/generators/csharp-netcore-functions.md b/docs/generators/csharp-netcore-functions.md new file mode 100644 index 000000000000..50ec49b34a1b --- /dev/null +++ b/docs/generators/csharp-netcore-functions.md @@ -0,0 +1,300 @@ +--- +title: Config Options for csharp-netcore-functions +sidebar_label: csharp-netcore-functions +--- + +These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. + +| Option | Description | Values | Default | +| ------ | ----------- | ------ | ------- | +|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|caseInsensitiveResponseHeaders|Make API response's headers case-insensitive| |false| +|conditionalSerialization|Serialize only those properties which are initialized by user, accepted values are true or false, default value is false.| |false| +|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|

    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| +|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| +|interfacePrefix|Prefix interfaces with a community standard or widely accepted prefix.| |I| +|library|HTTP library template (sub-template) to use|
    **httpclient**
    HttpClient (https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient) (Experimental. May subject to breaking changes without further notice.)
    **restsharp**
    RestSharp (https://github.com/restsharp/RestSharp)
    |restsharp| +|licenseId|The identifier of the license| |null| +|modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |PascalCase| +|netCoreProjectFile|Use the new format (.NET Core) for .NET project files (.csproj).| |false| +|nonPublicApi|Generates code with reduced access modifiers; allows embedding elsewhere without exposing non-public API calls to consumers.| |false| +|nullableReferenceTypes|Use nullable annotations in the project. Only supported on C# 8 / ASP.NET Core 3.0 or newer.| |false| +|optionalAssemblyInfo|Generate AssemblyInfo.cs.| |true| +|optionalEmitDefaultValues|Set DataMember's EmitDefaultValue.| |false| +|optionalMethodArgument|C# Optional method argument, e.g. void square(int x=10) (.net 4.0+ only).| |true| +|optionalProjectFile|Generate {PackageName}.csproj.| |true| +|packageGuid|The GUID that will be associated with the C# project| |null| +|packageName|C# package name (convention: Title.Case).| |Org.OpenAPITools| +|packageTags|Tags to identify the package| |null| +|packageVersion|C# package version.| |1.0.0| +|releaseNote|Release note, default to 'Minor update'.| |Minor update| +|returnICollection|Return ICollection<T> instead of the concrete type.| |false| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| +|sourceFolder|source folder for generated code| |src| +|targetFramework|The target .NET framework version. To target multiple frameworks, use `;` as the separator, e.g. `netstandard2.1;netcoreapp3.0`|
    **netstandard1.3**
    .NET Standard 1.3 compatible
    **netstandard1.4**
    .NET Standard 1.4 compatible
    **netstandard1.5**
    .NET Standard 1.5 compatible
    **netstandard1.6**
    .NET Standard 1.6 compatible
    **netstandard2.0**
    .NET Standard 2.0 compatible
    **netstandard2.1**
    .NET Standard 2.1 compatible
    **netcoreapp2.0**
    .NET Core 2.0 compatible
    **netcoreapp2.1**
    .NET Core 2.1 compatible
    **netcoreapp3.0**
    .NET Core 3.0 compatible
    **netcoreapp3.1**
    .NET Core 3.1 compatible
    **net47**
    .NET Framework 4.7 compatible
    **net5.0**
    .NET 5.0 compatible
    |netstandard2.0| +|useCollection|Deserialize array types to Collection<T> instead of List<T>.| |false| +|useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false| +|useOneOfDiscriminatorLookup|Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and only one match in oneOf's schemas) will be skipped.| |false| +|validatable|Generates self-validatable models.| |true| + +## IMPORT MAPPING + +| Type/Alias | Imports | +| ---------- | ------- | + + +## INSTANTIATION TYPES + +| Type/Alias | Instantiated By | +| ---------- | --------------- | +|array|List| +|list|List| +|map|Dictionary| + + +## LANGUAGE PRIMITIVES + +
      +
    • Boolean
    • +
    • Collection
    • +
    • DateTime
    • +
    • DateTime?
    • +
    • DateTimeOffset
    • +
    • DateTimeOffset?
    • +
    • Decimal
    • +
    • Dictionary
    • +
    • Double
    • +
    • Float
    • +
    • Guid
    • +
    • Guid?
    • +
    • ICollection
    • +
    • Int32
    • +
    • Int64
    • +
    • List
    • +
    • Object
    • +
    • String
    • +
    • System.IO.Stream
    • +
    • bool
    • +
    • bool?
    • +
    • byte[]
    • +
    • decimal
    • +
    • decimal?
    • +
    • double
    • +
    • double?
    • +
    • float
    • +
    • float?
    • +
    • int
    • +
    • int?
    • +
    • long
    • +
    • long?
    • +
    • string
    • +
    + +## RESERVED WORDS + +
      +
    • Client
    • +
    • Configuration
    • +
    • Version
    • +
    • abstract
    • +
    • as
    • +
    • base
    • +
    • bool
    • +
    • break
    • +
    • byte
    • +
    • case
    • +
    • catch
    • +
    • char
    • +
    • checked
    • +
    • class
    • +
    • client
    • +
    • const
    • +
    • continue
    • +
    • decimal
    • +
    • default
    • +
    • delegate
    • +
    • do
    • +
    • double
    • +
    • else
    • +
    • enum
    • +
    • event
    • +
    • explicit
    • +
    • extern
    • +
    • false
    • +
    • finally
    • +
    • fixed
    • +
    • float
    • +
    • for
    • +
    • foreach
    • +
    • goto
    • +
    • if
    • +
    • implicit
    • +
    • in
    • +
    • int
    • +
    • interface
    • +
    • internal
    • +
    • is
    • +
    • localVarFileParams
    • +
    • localVarFormParams
    • +
    • localVarHeaderParams
    • +
    • localVarHttpContentType
    • +
    • localVarHttpContentTypes
    • +
    • localVarHttpHeaderAccept
    • +
    • localVarHttpHeaderAccepts
    • +
    • localVarPath
    • +
    • localVarPathParams
    • +
    • localVarPostBody
    • +
    • localVarQueryParams
    • +
    • localVarResponse
    • +
    • localVarStatusCode
    • +
    • lock
    • +
    • long
    • +
    • namespace
    • +
    • new
    • +
    • null
    • +
    • object
    • +
    • operator
    • +
    • out
    • +
    • override
    • +
    • parameter
    • +
    • params
    • +
    • private
    • +
    • protected
    • +
    • public
    • +
    • readonly
    • +
    • ref
    • +
    • return
    • +
    • sbyte
    • +
    • sealed
    • +
    • short
    • +
    • sizeof
    • +
    • stackalloc
    • +
    • static
    • +
    • string
    • +
    • struct
    • +
    • switch
    • +
    • this
    • +
    • throw
    • +
    • true
    • +
    • try
    • +
    • typeof
    • +
    • uint
    • +
    • ulong
    • +
    • unchecked
    • +
    • unsafe
    • +
    • ushort
    • +
    • using
    • +
    • virtual
    • +
    • void
    • +
    • volatile
    • +
    • while
    • +
    + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✓|ToolingExtension +|MockServer|✗|ToolingExtension + +### Data Type Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Custom|✗|OAS2,OAS3 +|Int32|✓|OAS2,OAS3 +|Int64|✓|OAS2,OAS3 +|Float|✓|OAS2,OAS3 +|Double|✓|OAS2,OAS3 +|Decimal|✓|ToolingExtension +|String|✓|OAS2,OAS3 +|Byte|✓|OAS2,OAS3 +|Binary|✓|OAS2,OAS3 +|Boolean|✓|OAS2,OAS3 +|Date|✓|OAS2,OAS3 +|DateTime|✓|OAS2,OAS3 +|Password|✓|OAS2,OAS3 +|File|✓|OAS2 +|Array|✓|OAS2,OAS3 +|Maps|✓|ToolingExtension +|CollectionFormat|✓|OAS2 +|CollectionFormatMulti|✓|OAS2 +|Enum|✓|OAS2,OAS3 +|ArrayOfEnum|✓|ToolingExtension +|ArrayOfModel|✓|ToolingExtension +|ArrayOfCollectionOfPrimitives|✓|ToolingExtension +|ArrayOfCollectionOfModel|✓|ToolingExtension +|ArrayOfCollectionOfEnum|✓|ToolingExtension +|MapOfEnum|✓|ToolingExtension +|MapOfModel|✓|ToolingExtension +|MapOfCollectionOfPrimitives|✓|ToolingExtension +|MapOfCollectionOfModel|✓|ToolingExtension +|MapOfCollectionOfEnum|✓|ToolingExtension + +### Documentation Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Readme|✓|ToolingExtension +|Model|✓|ToolingExtension +|Api|✓|ToolingExtension + +### Global Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Host|✓|OAS2,OAS3 +|BasePath|✓|OAS2,OAS3 +|Info|✓|OAS2,OAS3 +|Schemes|✗|OAS2,OAS3 +|PartialSchemes|✓|OAS2,OAS3 +|Consumes|✓|OAS2 +|Produces|✓|OAS2 +|ExternalDocumentation|✓|OAS2,OAS3 +|Examples|✓|OAS2,OAS3 +|XMLStructureDefinitions|✗|OAS2,OAS3 +|MultiServer|✗|OAS3 +|ParameterizedServer|✗|OAS3 +|ParameterStyling|✗|OAS3 +|Callbacks|✗|OAS3 +|LinkObjects|✗|OAS3 + +### Parameter Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Path|✓|OAS2,OAS3 +|Query|✓|OAS2,OAS3 +|Header|✓|OAS2,OAS3 +|Body|✓|OAS2 +|FormUnencoded|✓|OAS2 +|FormMultipart|✓|OAS2 +|Cookie|✓|OAS3 + +### Schema Support Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Simple|✓|OAS2,OAS3 +|Composite|✓|OAS2,OAS3 +|Polymorphism|✓|OAS2,OAS3 +|Union|✗|OAS3 + +### Security Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasicAuth|✓|OAS2,OAS3 +|ApiKey|✓|OAS2,OAS3 +|OpenIDConnect|✗|OAS3 +|BearerToken|✗|OAS3 +|OAuth2_Implicit|✓|OAS2,OAS3 +|OAuth2_Password|✗|OAS2,OAS3 +|OAuth2_ClientCredentials|✗|OAS2,OAS3 +|OAuth2_AuthorizationCode|✗|OAS2,OAS3 + +### Wire Format Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|JSON|✓|OAS2,OAS3 +|XML|✓|OAS2,OAS3 +|PROTOBUF|✗|ToolingExtension +|Custom|✗|OAS2,OAS3 diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreReducedClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreReducedClientCodegen.java new file mode 100644 index 000000000000..8f189b444ba6 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreReducedClientCodegen.java @@ -0,0 +1,1151 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.languages; + +import com.google.common.collect.ImmutableMap; +import com.samskivert.mustache.Mustache; +import io.swagger.v3.oas.models.media.ArraySchema; +import io.swagger.v3.oas.models.media.ComposedSchema; +import io.swagger.v3.oas.models.media.Schema; +import org.openapitools.codegen.*; +import org.openapitools.codegen.meta.features.*; +import org.openapitools.codegen.utils.ModelUtils; +import org.openapitools.codegen.utils.ProcessUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.util.*; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Consumer; +import java.util.stream.Collectors; + +import static org.apache.commons.lang3.StringUtils.isEmpty; +import static org.openapitools.codegen.utils.StringUtils.camelize; +import static org.openapitools.codegen.utils.StringUtils.underscore; + +@SuppressWarnings("Duplicates") +public class CSharpNetCoreReducedClientCodegen extends AbstractCSharpCodegen { + // Defines the sdk option for targeted frameworks, which differs from targetFramework and targetFrameworkNuget + protected static final String MCS_NET_VERSION_KEY = "x-mcs-sdk"; + protected static final String SUPPORTS_UWP = "supportsUWP"; + protected static final String SUPPORTS_RETRY = "supportsRetry"; + + protected static final String NET_STANDARD = "netStandard"; + + // HTTP libraries + protected static final String RESTSHARP = "restsharp"; + protected static final String HTTPCLIENT = "httpclient"; + + // Project Variable, determined from target framework. Not intended to be user-settable. + protected static final String TARGET_FRAMEWORK_IDENTIFIER = "targetFrameworkIdentifier"; + // Project Variable, determined from target framework. Not intended to be user-settable. + protected static final String TARGET_FRAMEWORK_VERSION = "targetFrameworkVersion"; + + @SuppressWarnings("hiding") + private final Logger LOGGER = LoggerFactory.getLogger(CSharpClientCodegen.class); + private static final List frameworkStrategies = Arrays.asList( + FrameworkStrategy.NETSTANDARD_1_3, + FrameworkStrategy.NETSTANDARD_1_4, + FrameworkStrategy.NETSTANDARD_1_5, + FrameworkStrategy.NETSTANDARD_1_6, + FrameworkStrategy.NETSTANDARD_2_0, + FrameworkStrategy.NETSTANDARD_2_1, + FrameworkStrategy.NETCOREAPP_2_0, + FrameworkStrategy.NETCOREAPP_2_1, + FrameworkStrategy.NETCOREAPP_3_0, + FrameworkStrategy.NETCOREAPP_3_1, + FrameworkStrategy.NETFRAMEWORK_4_7, + FrameworkStrategy.NET_5_0 + ); + private static FrameworkStrategy defaultFramework = FrameworkStrategy.NETSTANDARD_2_0; + protected final Map frameworks; + protected String packageGuid = "{" + java.util.UUID.randomUUID().toString().toUpperCase(Locale.ROOT) + "}"; + protected String clientPackage = "Org.OpenAPITools.Client"; + protected String apiDocPath = "docs/"; + protected String modelDocPath = "docs/"; + + // Defines TargetFrameworkVersion in csproj files + protected String targetFramework = defaultFramework.name; + protected String testTargetFramework = defaultFramework.testTargetFramework; + + // Defines nuget identifiers for target framework + protected String targetFrameworkNuget = targetFramework; + + protected boolean supportsRetry = Boolean.TRUE; + protected boolean supportsAsync = Boolean.TRUE; + protected boolean netStandard = Boolean.FALSE; + + protected boolean validatable = Boolean.TRUE; + protected Map regexModifiers; + // By default, generated code is considered public + protected boolean nonPublicApi = Boolean.FALSE; + + protected boolean caseInsensitiveResponseHeaders = Boolean.FALSE; + protected String releaseNote = "Minor update"; + protected String licenseId; + protected String packageTags; + protected boolean useOneOfDiscriminatorLookup = false; // use oneOf discriminator's mapping for model lookup + + protected boolean needsCustomHttpMethod = false; + protected boolean needsUriBuilder = false; + + public CSharpNetCoreReducedClientCodegen() { + super(); + + modifyFeatureSet(features -> features + .includeDocumentationFeatures(DocumentationFeature.Readme) + .securityFeatures(EnumSet.of( + SecurityFeature.OAuth2_Implicit, + SecurityFeature.BasicAuth, + SecurityFeature.ApiKey + )) + .excludeGlobalFeatures( + GlobalFeature.XMLStructureDefinitions, + GlobalFeature.Callbacks, + GlobalFeature.LinkObjects, + GlobalFeature.ParameterStyling + ) + .includeSchemaSupportFeatures( + SchemaSupportFeature.Polymorphism + ) + .includeParameterFeatures( + ParameterFeature.Cookie + ) + .includeClientModificationFeatures( + ClientModificationFeature.BasePath, + ClientModificationFeature.UserAgent + ) + ); + + // mapped non-nullable type without ? + typeMapping = new HashMap(); + typeMapping.put("string", "string"); + typeMapping.put("binary", "byte[]"); + typeMapping.put("ByteArray", "byte[]"); + typeMapping.put("boolean", "bool"); + typeMapping.put("integer", "int"); + typeMapping.put("float", "float"); + typeMapping.put("long", "long"); + typeMapping.put("double", "double"); + typeMapping.put("number", "decimal"); + typeMapping.put("decimal", "decimal"); + typeMapping.put("DateTime", "DateTime"); + typeMapping.put("date", "DateTime"); + typeMapping.put("file", "System.IO.Stream"); + typeMapping.put("array", "List"); + typeMapping.put("list", "List"); + typeMapping.put("map", "Dictionary"); + typeMapping.put("object", "Object"); + typeMapping.put("UUID", "Guid"); + typeMapping.put("URI", "string"); + typeMapping.put("AnyType", "Object"); + + setSupportNullable(Boolean.TRUE); + hideGenerationTimestamp = Boolean.TRUE; + supportsInheritance = true; + modelTemplateFiles.put("model.mustache", ".cs"); + apiTemplateFiles.put("api.mustache", ".cs"); + modelDocTemplateFiles.put("model_doc.mustache", ".md"); + apiDocTemplateFiles.put("api_doc.mustache", ".md"); + embeddedTemplateDir = templateDir = "csharp-netcore"; + + cliOptions.clear(); + + // CLI options + addOption(CodegenConstants.PACKAGE_NAME, + "C# package name (convention: Title.Case).", + this.packageName); + + addOption(CodegenConstants.PACKAGE_VERSION, + "C# package version.", + this.packageVersion); + + addOption(CodegenConstants.SOURCE_FOLDER, + CodegenConstants.SOURCE_FOLDER_DESC, + sourceFolder); + + addOption(CodegenConstants.OPTIONAL_PROJECT_GUID, + CodegenConstants.OPTIONAL_PROJECT_GUID_DESC, + null); + + addOption(CodegenConstants.INTERFACE_PREFIX, + CodegenConstants.INTERFACE_PREFIX_DESC, + interfacePrefix); + + addOption(CodegenConstants.LICENSE_ID, + CodegenConstants.LICENSE_ID_DESC, + this.licenseId); + + addOption(CodegenConstants.RELEASE_NOTE, + CodegenConstants.RELEASE_NOTE_DESC, + this.releaseNote); + + addOption(CodegenConstants.PACKAGE_TAGS, + CodegenConstants.PACKAGE_TAGS_DESC, + this.packageTags); + + CliOption framework = new CliOption( + CodegenConstants.DOTNET_FRAMEWORK, + CodegenConstants.DOTNET_FRAMEWORK_DESC + ); + + CliOption disallowAdditionalPropertiesIfNotPresentOpt = CliOption.newBoolean( + CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, + CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.TRUE.toString()); + Map disallowAdditionalPropertiesIfNotPresentOpts = new HashMap<>(); + disallowAdditionalPropertiesIfNotPresentOpts.put("false", + "The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications."); + disallowAdditionalPropertiesIfNotPresentOpts.put("true", + "Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default."); + disallowAdditionalPropertiesIfNotPresentOpt.setEnum(disallowAdditionalPropertiesIfNotPresentOpts); + cliOptions.add(disallowAdditionalPropertiesIfNotPresentOpt); + this.setDisallowAdditionalPropertiesIfNotPresent(true); + + ImmutableMap.Builder frameworkBuilder = new ImmutableMap.Builder<>(); + for (FrameworkStrategy frameworkStrategy : frameworkStrategies) { + frameworkBuilder.put(frameworkStrategy.name, frameworkStrategy.description); + } + + frameworks = frameworkBuilder.build(); + + framework.defaultValue(this.targetFramework); + framework.setEnum(frameworks); + cliOptions.add(framework); + + CliOption modelPropertyNaming = new CliOption(CodegenConstants.MODEL_PROPERTY_NAMING, CodegenConstants.MODEL_PROPERTY_NAMING_DESC); + cliOptions.add(modelPropertyNaming.defaultValue("PascalCase")); + + // CLI Switches + addSwitch(CodegenConstants.NULLABLE_REFERENCE_TYPES, + CodegenConstants.NULLABLE_REFERENCE_TYPES_DESC, + this.nullReferenceTypesFlag); + + addSwitch(CodegenConstants.HIDE_GENERATION_TIMESTAMP, + CodegenConstants.HIDE_GENERATION_TIMESTAMP_DESC, + this.hideGenerationTimestamp); + + addSwitch(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, + CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG_DESC, + this.sortParamsByRequiredFlag); + + addSwitch(CodegenConstants.USE_DATETIME_OFFSET, + CodegenConstants.USE_DATETIME_OFFSET_DESC, + this.useDateTimeOffsetFlag); + + addSwitch(CodegenConstants.USE_COLLECTION, + CodegenConstants.USE_COLLECTION_DESC, + this.useCollection); + + addSwitch(CodegenConstants.RETURN_ICOLLECTION, + CodegenConstants.RETURN_ICOLLECTION_DESC, + this.returnICollection); + + addSwitch(CodegenConstants.OPTIONAL_METHOD_ARGUMENT, + "C# Optional method argument, e.g. void square(int x=10) (.net 4.0+ only).", + this.optionalMethodArgumentFlag); + + addSwitch(CodegenConstants.OPTIONAL_ASSEMBLY_INFO, + CodegenConstants.OPTIONAL_ASSEMBLY_INFO_DESC, + this.optionalAssemblyInfoFlag); + + addSwitch(CodegenConstants.OPTIONAL_EMIT_DEFAULT_VALUES, + CodegenConstants.OPTIONAL_EMIT_DEFAULT_VALUES_DESC, + this.optionalEmitDefaultValuesFlag); + + addSwitch(CodegenConstants.OPTIONAL_CONDITIONAL_SERIALIZATION, + CodegenConstants.OPTIONAL_CONDITIONAL_SERIALIZATION_DESC, + this.conditionalSerialization); + + addSwitch(CodegenConstants.OPTIONAL_PROJECT_FILE, + CodegenConstants.OPTIONAL_PROJECT_FILE_DESC, + this.optionalProjectFileFlag); + + // NOTE: This will reduce visibility of all public members in templates. Users can use InternalsVisibleTo + // https://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.internalsvisibletoattribute(v=vs.110).aspx + // to expose to shared code if the generated code is not embedded into another project. Otherwise, users of codegen + // should rely on default public visibility. + addSwitch(CodegenConstants.NON_PUBLIC_API, + CodegenConstants.NON_PUBLIC_API_DESC, + this.nonPublicApi); + + addSwitch(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, + CodegenConstants.ALLOW_UNICODE_IDENTIFIERS_DESC, + this.allowUnicodeIdentifiers); + + addSwitch(CodegenConstants.NETCORE_PROJECT_FILE, + CodegenConstants.NETCORE_PROJECT_FILE_DESC, + this.netCoreProjectFileFlag); + + addSwitch(CodegenConstants.VALIDATABLE, + CodegenConstants.VALIDATABLE_DESC, + this.validatable); + + addSwitch(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, + CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP_DESC, + this.caseInsensitiveResponseHeaders); + + addSwitch(CodegenConstants.CASE_INSENSITIVE_RESPONSE_HEADERS, + CodegenConstants.CASE_INSENSITIVE_RESPONSE_HEADERS_DESC, + this.caseInsensitiveResponseHeaders); + + regexModifiers = new HashMap<>(); + regexModifiers.put('i', "IgnoreCase"); + regexModifiers.put('m', "Multiline"); + regexModifiers.put('s', "Singleline"); + regexModifiers.put('x', "IgnorePatternWhitespace"); + + supportedLibraries.put(HTTPCLIENT, "HttpClient (https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient) " + + "(Experimental. May subject to breaking changes without further notice.)"); + supportedLibraries.put(RESTSHARP, "RestSharp (https://github.com/restsharp/RestSharp)"); + + CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "HTTP library template (sub-template) to use"); + libraryOption.setEnum(supportedLibraries); + // set RESTSHARP as the default + libraryOption.setDefault(RESTSHARP); + cliOptions.add(libraryOption); + setLibrary(RESTSHARP); + } + + @Override + public String apiDocFileFolder() { + return (outputFolder + "/" + apiDocPath).replace('/', File.separatorChar); + } + + @Override + public String apiTestFileFolder() { + return outputFolder + File.separator + testFolder + File.separator + testPackageName() + File.separator + apiPackage(); + } + + @Override + public CodegenModel fromModel(String name, Schema model) { + Map allDefinitions = ModelUtils.getSchemas(this.openAPI); + CodegenModel codegenModel = super.fromModel(name, model); + if (allDefinitions != null && codegenModel != null && codegenModel.parent != null) { + final Schema parentModel = allDefinitions.get(toModelName(codegenModel.parent)); + if (parentModel != null) { + final CodegenModel parentCodegenModel = super.fromModel(codegenModel.parent, parentModel); + if (codegenModel.hasEnums) { + codegenModel = this.reconcileInlineEnums(codegenModel, parentCodegenModel); + } + + Map propertyHash = new HashMap<>(codegenModel.vars.size()); + for (final CodegenProperty property : codegenModel.vars) { + propertyHash.put(property.name, property); + } + + for (final CodegenProperty property : codegenModel.readWriteVars) { + if (property.defaultValue == null && parentCodegenModel.discriminator != null && property.name.equals(parentCodegenModel.discriminator.getPropertyName())) { + property.defaultValue = "\"" + name + "\""; + } + } + + CodegenProperty last = null; + for (final CodegenProperty property : parentCodegenModel.vars) { + // helper list of parentVars simplifies templating + if (!propertyHash.containsKey(property.name)) { + final CodegenProperty parentVar = property.clone(); + parentVar.isInherited = true; + last = parentVar; + LOGGER.debug("adding parent variable {}", property.name); + codegenModel.parentVars.add(parentVar); + } + } + } + } + + // Cleanup possible duplicates. Currently, readWriteVars can contain the same property twice. May or may not be isolated to C#. + if (codegenModel != null && codegenModel.readWriteVars != null && codegenModel.readWriteVars.size() > 1) { + int length = codegenModel.readWriteVars.size() - 1; + for (int i = length; i > (length / 2); i--) { + final CodegenProperty codegenProperty = codegenModel.readWriteVars.get(i); + // If the property at current index is found earlier in the list, remove this last instance. + if (codegenModel.readWriteVars.indexOf(codegenProperty) < i) { + codegenModel.readWriteVars.remove(i); + } + } + } + + return codegenModel; + } + + @Override + public String getHelp() { + return "Generates a C# client library (.NET Standard, .NET Core)."; + } + + public String getModelPropertyNaming() { + return this.modelPropertyNaming; + } + + public void setModelPropertyNaming(String naming) { + if ("original".equals(naming) || "camelCase".equals(naming) || + "PascalCase".equals(naming) || "snake_case".equals(naming)) { + this.modelPropertyNaming = naming; + } else { + throw new IllegalArgumentException("Invalid model property naming '" + + naming + "'. Must be 'original', 'camelCase', " + + "'PascalCase' or 'snake_case'"); + } + } + + @Override + public String getName() { + return "csharp-netcore"; + } + + public String getNameUsingModelPropertyNaming(String name) { + switch (CodegenConstants.MODEL_PROPERTY_NAMING_TYPE.valueOf(getModelPropertyNaming())) { + case original: + return name; + case camelCase: + return camelize(name, true); + case PascalCase: + return camelize(name); + case snake_case: + return underscore(name); + default: + throw new IllegalArgumentException("Invalid model property naming '" + + name + "'. Must be 'original', 'camelCase', " + + "'PascalCase' or 'snake_case'"); + } + } + + @Override + public String getNullableType(Schema p, String type) { + if (languageSpecificPrimitives.contains(type)) { + if (isSupportNullable() && ModelUtils.isNullable(p) && nullableType.contains(type)) { + return type + "?"; + } else { + return type; + } + } else { + return null; + } + } + + @Override + public CodegenType getTag() { + return CodegenType.CLIENT; + } + + public boolean isNonPublicApi() { + return nonPublicApi; + } + + public void setNonPublicApi(final boolean nonPublicApi) { + this.nonPublicApi = nonPublicApi; + } + + @Override + public String modelDocFileFolder() { + return (outputFolder + "/" + modelDocPath).replace('/', File.separatorChar); + } + + @Override + public String modelTestFileFolder() { + return outputFolder + File.separator + testFolder + File.separator + testPackageName() + File.separator + modelPackage(); + } + + @Override + public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { + postProcessPattern(property.pattern, property.vendorExtensions); + postProcessEmitDefaultValue(property.vendorExtensions); + + super.postProcessModelProperty(model, property); + } + + @Override + public void postProcessParameter(CodegenParameter parameter) { + postProcessPattern(parameter.pattern, parameter.vendorExtensions); + postProcessEmitDefaultValue(parameter.vendorExtensions); + super.postProcessParameter(parameter); + } + + /* + * The pattern spec follows the Perl convention and style of modifiers. .NET + * does not support this syntax directly so we need to convert the pattern to a .NET compatible + * format and apply modifiers in a compatible way. + * See https://msdn.microsoft.com/en-us/library/yd1hzczs(v=vs.110).aspx for .NET options. + */ + public void postProcessPattern(String pattern, Map vendorExtensions) { + if (pattern != null) { + int i = pattern.lastIndexOf('/'); + + //Must follow Perl /pattern/modifiers convention + if (pattern.charAt(0) != '/' || i < 2) { + throw new IllegalArgumentException("Pattern must follow the Perl " + + "/pattern/modifiers convention. " + pattern + " is not valid."); + } + + String regex = pattern.substring(1, i).replace("'", "\'").replace("\"", "\"\""); + List modifiers = new ArrayList(); + + // perl requires an explicit modifier to be culture specific and .NET is the reverse. + modifiers.add("CultureInvariant"); + + for (char c : pattern.substring(i).toCharArray()) { + if (regexModifiers.containsKey(c)) { + String modifier = regexModifiers.get(c); + modifiers.add(modifier); + } else if (c == 'l') { + modifiers.remove("CultureInvariant"); + } + } + + vendorExtensions.put("x-regex", regex); + vendorExtensions.put("x-modifiers", modifiers); + } + } + + public void postProcessEmitDefaultValue(Map vendorExtensions) { + vendorExtensions.put("x-emit-default-value", optionalEmitDefaultValuesFlag); + } + + @Override + public Mustache.Compiler processCompiler(Mustache.Compiler compiler) { + // To avoid unexpected behaviors when options are passed programmatically such as { "supportsAsync": "" } + return super.processCompiler(compiler).emptyStringIsFalse(true); + } + + @Override + public void processOpts() { + this.setLegacyDiscriminatorBehavior(false); + + super.processOpts(); + + /* + * NOTE: When supporting boolean additionalProperties, you should read the value and write it back as a boolean. + * This avoids oddities where additionalProperties contains "false" rather than false, which will cause the + * templating engine to behave unexpectedly. + * + * Use the pattern: + * if (additionalProperties.containsKey(prop)) convertPropertyToBooleanAndWriteBack(prop); + */ + + if (additionalProperties.containsKey(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT)) { + this.setDisallowAdditionalPropertiesIfNotPresent(Boolean.parseBoolean(additionalProperties + .get(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT).toString())); + } + + if (additionalProperties.containsKey(CodegenConstants.OPTIONAL_EMIT_DEFAULT_VALUES)) { + setOptionalEmitDefaultValuesFlag(convertPropertyToBooleanAndWriteBack(CodegenConstants.OPTIONAL_EMIT_DEFAULT_VALUES)); + } else { + additionalProperties.put(CodegenConstants.OPTIONAL_EMIT_DEFAULT_VALUES, optionalEmitDefaultValuesFlag); + } + + if (additionalProperties.containsKey(CodegenConstants.OPTIONAL_CONDITIONAL_SERIALIZATION)) { + setConditionalSerialization(convertPropertyToBooleanAndWriteBack(CodegenConstants.OPTIONAL_CONDITIONAL_SERIALIZATION)); + } else { + additionalProperties.put(CodegenConstants.OPTIONAL_CONDITIONAL_SERIALIZATION, conditionalSerialization); + } + + if (additionalProperties.containsKey(CodegenConstants.MODEL_PROPERTY_NAMING)) { + setModelPropertyNaming((String) additionalProperties.get(CodegenConstants.MODEL_PROPERTY_NAMING)); + } + + if (isEmpty(apiPackage)) { + setApiPackage("Api"); + } + if (isEmpty(modelPackage)) { + setModelPackage("Model"); + } + + clientPackage = "Client"; + + if (RESTSHARP.equals(getLibrary())) { + additionalProperties.put("useRestSharp", true); + needsCustomHttpMethod = true; + } else if (HTTPCLIENT.equals(getLibrary())) { + setLibrary(HTTPCLIENT); + additionalProperties.put("useHttpClient", true); + needsUriBuilder = true; + } else { + throw new RuntimeException("Invalid HTTP library " + getLibrary() + ". Only restsharp, httpclient are supported."); + } + + String inputFramework = (String) additionalProperties.getOrDefault(CodegenConstants.DOTNET_FRAMEWORK, defaultFramework.name); + String[] frameworks; + List strategies = new ArrayList<>(); + + if (inputFramework.contains(";")) { + // multiple target framework + frameworks = inputFramework.split(";"); + additionalProperties.put("multiTarget", true); + } else { + // just a single value + frameworks = new String [] {inputFramework}; + } + + for (String framework : frameworks) { + boolean strategyMatched = false; + for (FrameworkStrategy frameworkStrategy : frameworkStrategies) { + if (framework.equals(frameworkStrategy.name)) { + strategies.add(frameworkStrategy); + strategyMatched = true; + } + + if (frameworkStrategy != FrameworkStrategy.NETSTANDARD_2_0 && "restsharp".equals(getLibrary())) { + LOGGER.warn("If using built-in templates, RestSharp only supports netstandard 2.0 or later."); + } + } + + if (!strategyMatched) { + // throws exception if the input targetFramework is invalid + throw new IllegalArgumentException("The input (" + inputFramework + ") contains Invalid .NET framework version: " + + framework + ". List of supported versions: " + + frameworkStrategies.stream() + .map(p -> p.name) + .collect(Collectors.joining(", "))); + } + } + + configureAdditionalPropertiesForFrameworks(additionalProperties, strategies); + setTargetFrameworkNuget(strategies); + setTargetFramework(strategies); + setTestTargetFramework(strategies); + + setSupportsAsync(Boolean.TRUE); + setNetStandard(strategies.stream().anyMatch(p -> Boolean.TRUE.equals(p.isNetStandard))); + + if (!netStandard) { + setNetCoreProjectFileFlag(true); + } + + if (additionalProperties.containsKey(CodegenConstants.GENERATE_PROPERTY_CHANGED)) { + LOGGER.warn("{} is not supported in the .NET Standard generator.", CodegenConstants.GENERATE_PROPERTY_CHANGED); + additionalProperties.remove(CodegenConstants.GENERATE_PROPERTY_CHANGED); + } + + final AtomicReference excludeTests = new AtomicReference<>(); + syncBooleanProperty(additionalProperties, CodegenConstants.EXCLUDE_TESTS, excludeTests::set, false); + + syncStringProperty(additionalProperties, "clientPackage", (s) -> { }, clientPackage); + + syncStringProperty(additionalProperties, CodegenConstants.API_PACKAGE, this::setApiPackage, apiPackage); + syncStringProperty(additionalProperties, CodegenConstants.MODEL_PACKAGE, this::setModelPackage, modelPackage); + syncStringProperty(additionalProperties, CodegenConstants.OPTIONAL_PROJECT_GUID, this::setPackageGuid, packageGuid); + syncStringProperty(additionalProperties, "targetFrameworkNuget", this::setTargetFrameworkNuget, this.targetFrameworkNuget); + syncStringProperty(additionalProperties, "testTargetFramework", this::setTestTargetFramework, this.testTargetFramework); + + syncBooleanProperty(additionalProperties, "netStandard", this::setNetStandard, this.netStandard); + + syncBooleanProperty(additionalProperties, CodegenConstants.VALIDATABLE, this::setValidatable, this.validatable); + syncBooleanProperty(additionalProperties, CodegenConstants.SUPPORTS_ASYNC, this::setSupportsAsync, this.supportsAsync); + syncBooleanProperty(additionalProperties, SUPPORTS_RETRY, this::setSupportsRetry, this.supportsRetry); + syncBooleanProperty(additionalProperties, CodegenConstants.OPTIONAL_METHOD_ARGUMENT, this::setOptionalMethodArgumentFlag, optionalMethodArgumentFlag); + syncBooleanProperty(additionalProperties, CodegenConstants.NON_PUBLIC_API, this::setNonPublicApi, isNonPublicApi()); + syncBooleanProperty(additionalProperties, CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, this::setUseOneOfDiscriminatorLookup, this.useOneOfDiscriminatorLookup); + + final String testPackageName = testPackageName(); + String packageFolder = sourceFolder + File.separator + packageName; + String clientPackageDir = packageFolder + File.separator + clientPackage; + String modelPackageDir = packageFolder + File.separator + modelPackage; + String testPackageFolder = testFolder + File.separator + testPackageName; + + additionalProperties.put("testPackageName", testPackageName); + + //Compute the relative path to the bin directory where the external assemblies live + //This is necessary to properly generate the project file + int packageDepth = packageFolder.length() - packageFolder.replace(java.io.File.separator, "").length(); + String binRelativePath = "..\\"; + for (int i = 0; i < packageDepth; i = i + 1) { + binRelativePath += "..\\"; + } + binRelativePath += "vendor"; + additionalProperties.put("binRelativePath", binRelativePath); + + if(HTTPCLIENT.equals(getLibrary())) { + supportingFiles.add(new SupportingFile("FileParameter.mustache", clientPackageDir, "FileParameter.cs")); + typeMapping.put("file", "FileParameter"); + } + + supportingFiles.add(new SupportingFile("IApiAccessor.mustache", clientPackageDir, "IApiAccessor.cs")); + supportingFiles.add(new SupportingFile("Configuration.mustache", clientPackageDir, "Configuration.cs")); + supportingFiles.add(new SupportingFile("ApiClient.mustache", clientPackageDir, "ApiClient.cs")); + supportingFiles.add(new SupportingFile("ApiException.mustache", clientPackageDir, "ApiException.cs")); + supportingFiles.add(new SupportingFile("ApiResponse.mustache", clientPackageDir, "ApiResponse.cs")); + supportingFiles.add(new SupportingFile("ExceptionFactory.mustache", clientPackageDir, "ExceptionFactory.cs")); + supportingFiles.add(new SupportingFile("OpenAPIDateConverter.mustache", clientPackageDir, "OpenAPIDateConverter.cs")); + supportingFiles.add(new SupportingFile("ClientUtils.mustache", clientPackageDir, "ClientUtils.cs")); + if(needsCustomHttpMethod) { + supportingFiles.add(new SupportingFile("HttpMethod.mustache", clientPackageDir, "HttpMethod.cs")); + } + if(needsUriBuilder) { + supportingFiles.add(new SupportingFile("WebRequestPathBuilder.mustache", clientPackageDir, "WebRequestPathBuilder.cs")); + } + if (ProcessUtils.hasHttpSignatureMethods(openAPI)) { + supportingFiles.add(new SupportingFile("HttpSigningConfiguration.mustache", clientPackageDir, "HttpSigningConfiguration.cs")); + } + if (supportsAsync) { + supportingFiles.add(new SupportingFile("IAsynchronousClient.mustache", clientPackageDir, "IAsynchronousClient.cs")); + } + supportingFiles.add(new SupportingFile("ISynchronousClient.mustache", clientPackageDir, "ISynchronousClient.cs")); + supportingFiles.add(new SupportingFile("RequestOptions.mustache", clientPackageDir, "RequestOptions.cs")); + supportingFiles.add(new SupportingFile("Multimap.mustache", clientPackageDir, "Multimap.cs")); + + if (supportsRetry) { + supportingFiles.add(new SupportingFile("RetryConfiguration.mustache", clientPackageDir, "RetryConfiguration.cs")); + } + + supportingFiles.add(new SupportingFile("IReadableConfiguration.mustache", + clientPackageDir, "IReadableConfiguration.cs")); + supportingFiles.add(new SupportingFile("GlobalConfiguration.mustache", + clientPackageDir, "GlobalConfiguration.cs")); + + // Only write out test related files if excludeTests is unset or explicitly set to false (see start of this method) + if (Boolean.FALSE.equals(excludeTests.get())) { + modelTestTemplateFiles.put("model_test.mustache", ".cs"); + apiTestTemplateFiles.put("api_test.mustache", ".cs"); + } + + supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); + supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); + supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); + + supportingFiles.add(new SupportingFile("appveyor.mustache", "", "appveyor.yml")); + supportingFiles.add(new SupportingFile("AbstractOpenAPISchema.mustache", modelPackageDir, "AbstractOpenAPISchema.cs")); + + additionalProperties.put("apiDocPath", apiDocPath); + additionalProperties.put("modelDocPath", modelDocPath); + } + + public void setNetStandard(Boolean netStandard) { + this.netStandard = netStandard; + } + + public void setOptionalAssemblyInfoFlag(boolean flag) { + this.optionalAssemblyInfoFlag = flag; + } + + public void setOptionalEmitDefaultValuesFlag(boolean flag) { + this.optionalEmitDefaultValuesFlag = flag; + } + + public void setConditionalSerialization(boolean flag){ + this.conditionalSerialization = flag; + } + + public void setOptionalProjectFileFlag(boolean flag) { + this.optionalProjectFileFlag = flag; + } + + public void setPackageGuid(String packageGuid) { + this.packageGuid = packageGuid; + } + + @Override + public void setPackageName(String packageName) { + this.packageName = packageName; + } + + @Override + public void setPackageVersion(String packageVersion) { + this.packageVersion = packageVersion; + } + + public void setSupportsAsync(Boolean supportsAsync) { + this.supportsAsync = supportsAsync; + } + + public void setSupportsRetry(Boolean supportsRetry) { + this.supportsRetry = supportsRetry; + } + + public void setTargetFramework(String dotnetFramework) { + if (!frameworks.containsKey(dotnetFramework)) { + throw new IllegalArgumentException("Invalid .NET framework version: " + + dotnetFramework + ". List of supported versions: " + + frameworkStrategies.stream() + .map(p -> p.name) + .collect(Collectors.joining(", "))); + } else { + this.targetFramework = dotnetFramework; + } + LOGGER.info("Generating code for .NET Framework {}", this.targetFramework); + } + + public void setTargetFramework(List strategies) { + for (FrameworkStrategy strategy : strategies) { + if (!frameworks.containsKey(strategy.name)) { + throw new IllegalArgumentException("Invalid .NET framework version: " + + strategy.name + ". List of supported versions: " + + frameworkStrategies.stream() + .map(p -> p.name) + .collect(Collectors.joining(", "))); + } + } + this.targetFramework = strategies.stream().map(p -> p.name) + .collect(Collectors.joining(";")); + LOGGER.info("Generating code for .NET Framework {}", this.targetFramework); + } + + public void setTestTargetFramework(String testTargetFramework) { + this.testTargetFramework = testTargetFramework; + } + + public void setTestTargetFramework(List strategies) { + this.testTargetFramework = strategies.stream().map(p -> p.testTargetFramework) + .collect(Collectors.joining(";")); + } + + public void setTargetFrameworkNuget(String targetFrameworkNuget) { + this.targetFrameworkNuget = targetFrameworkNuget; + } + + public void setTargetFrameworkNuget(List strategies) { + this.targetFrameworkNuget = strategies.stream().map(p -> p.getNugetFrameworkIdentifier()) + .collect(Collectors.joining(";")); + } + + public void setValidatable(boolean validatable) { + this.validatable = validatable; + } + + public void setCaseInsensitiveResponseHeaders(final Boolean caseInsensitiveResponseHeaders) { + this.caseInsensitiveResponseHeaders = caseInsensitiveResponseHeaders; + } + + public void setLicenseId(String licenseId) { + this.licenseId = licenseId; + } + + @Override + public void setReleaseNote(String releaseNote) { + this.releaseNote = releaseNote; + } + + public void setPackageTags(String packageTags) { + this.packageTags = packageTags; + } + + public void setUseOneOfDiscriminatorLookup(boolean useOneOfDiscriminatorLookup) { + this.useOneOfDiscriminatorLookup = useOneOfDiscriminatorLookup; + } + + public boolean getUseOneOfDiscriminatorLookup() { + return this.useOneOfDiscriminatorLookup; + } + + @Override + public String toEnumVarName(String value, String datatype) { + if (value.length() == 0) { + return "Empty"; + } + + // for symbol, e.g. $, # + if (getSymbolName(value) != null) { + return camelize(getSymbolName(value)); + } + + // number + if (datatype.startsWith("int") || datatype.startsWith("long") || + datatype.startsWith("double") || datatype.startsWith("float")) { + String varName = "NUMBER_" + value; + varName = varName.replaceAll("-", "MINUS_"); + varName = varName.replaceAll("\\+", "PLUS_"); + varName = varName.replaceAll("\\.", "_DOT_"); + return varName; + } + + // string + String var = value.replaceAll(" ", "_"); + var = camelize(var); + var = var.replaceAll("\\W+", ""); + + if (var.matches("\\d.*")) { + return "_" + var; + } else { + return var; + } + } + + @Override + public String toModelDocFilename(String name) { + return toModelFilename(name); + } + + @Override + public String toVarName(String name) { + // sanitize name + name = sanitizeName(name); + + // if it's all upper case, do nothing + if (name.matches("^[A-Z_]*$")) { + return name; + } + + name = getNameUsingModelPropertyNaming(name); + + // for reserved word or word starting with number, append _ + if (isReservedWord(name) || name.matches("^\\d.*")) { + name = escapeReservedWord(name); + } + + // for function names in the model, escape with the "Property" prefix + if (propertySpecialKeywords.contains(name)) { + return camelize("property_" + name); + } + + return name; + } + + private CodegenModel reconcileInlineEnums(CodegenModel codegenModel, CodegenModel parentCodegenModel) { + // This generator uses inline classes to define enums, which breaks when + // dealing with models that have subTypes. To clean this up, we will analyze + // the parent and child models, look for enums that match, and remove + // them from the child models and leave them in the parent. + // Because the child models extend the parents, the enums will be available via the parent. + + // Only bother with reconciliation if the parent model has enums. + if (parentCodegenModel.hasEnums) { + + // Get the properties for the parent and child models + final List parentModelCodegenProperties = parentCodegenModel.vars; + List codegenProperties = codegenModel.vars; + + // Iterate over all of the parent model properties + boolean removedChildEnum = false; + for (CodegenProperty parentModelCodegenProperty : parentModelCodegenProperties) { + // Look for enums + if (parentModelCodegenProperty.isEnum) { + // Now that we have found an enum in the parent class, + // and search the child class for the same enum. + Iterator iterator = codegenProperties.iterator(); + while (iterator.hasNext()) { + CodegenProperty codegenProperty = iterator.next(); + if (codegenProperty.isEnum && codegenProperty.equals(parentModelCodegenProperty)) { + // We found an enum in the child class that is + // a duplicate of the one in the parent, so remove it. + iterator.remove(); + removedChildEnum = true; + } + } + } + } + + if (removedChildEnum) { + codegenModel.vars = codegenProperties; + } + } + + return codegenModel; + } + + private void syncBooleanProperty(final Map additionalProperties, final String key, final Consumer setter, final Boolean defaultValue) { + if (additionalProperties.containsKey(key)) { + setter.accept(convertPropertyToBooleanAndWriteBack(key)); + } else { + additionalProperties.put(key, defaultValue); + setter.accept(defaultValue); + } + } + + private void syncStringProperty(final Map additionalProperties, final String key, final Consumer setter, final String defaultValue) { + if (additionalProperties.containsKey(key)) { + setter.accept((String) additionalProperties.get(key)); + } else { + additionalProperties.put(key, defaultValue); + setter.accept(defaultValue); + } + } + + // https://docs.microsoft.com/en-us/dotnet/standard/net-standard + @SuppressWarnings("Duplicates") + private static abstract class FrameworkStrategy { + + private final Logger LOGGER = LoggerFactory.getLogger(CSharpClientCodegen.class); + + static FrameworkStrategy NETSTANDARD_1_3 = new FrameworkStrategy("netstandard1.3", ".NET Standard 1.3 compatible", "netcoreapp2.0") { + }; + static FrameworkStrategy NETSTANDARD_1_4 = new FrameworkStrategy("netstandard1.4", ".NET Standard 1.4 compatible", "netcoreapp2.0") { + }; + static FrameworkStrategy NETSTANDARD_1_5 = new FrameworkStrategy("netstandard1.5", ".NET Standard 1.5 compatible", "netcoreapp2.0") { + }; + static FrameworkStrategy NETSTANDARD_1_6 = new FrameworkStrategy("netstandard1.6", ".NET Standard 1.6 compatible", "netcoreapp2.0") { + }; + static FrameworkStrategy NETSTANDARD_2_0 = new FrameworkStrategy("netstandard2.0", ".NET Standard 2.0 compatible", "netcoreapp2.0") { + }; + static FrameworkStrategy NETSTANDARD_2_1 = new FrameworkStrategy("netstandard2.1", ".NET Standard 2.1 compatible", "netcoreapp3.0") { + }; + static FrameworkStrategy NETCOREAPP_2_0 = new FrameworkStrategy("netcoreapp2.0", ".NET Core 2.0 compatible", "netcoreapp2.0", Boolean.FALSE) { + }; + static FrameworkStrategy NETCOREAPP_2_1 = new FrameworkStrategy("netcoreapp2.1", ".NET Core 2.1 compatible", "netcoreapp2.1", Boolean.FALSE) { + }; + static FrameworkStrategy NETCOREAPP_3_0 = new FrameworkStrategy("netcoreapp3.0", ".NET Core 3.0 compatible", "netcoreapp3.0", Boolean.FALSE) { + }; + static FrameworkStrategy NETCOREAPP_3_1 = new FrameworkStrategy("netcoreapp3.1", ".NET Core 3.1 compatible", "netcoreapp3.1", Boolean.FALSE) { + }; + static FrameworkStrategy NETFRAMEWORK_4_7 = new FrameworkStrategy("net47", ".NET Framework 4.7 compatible", "net47", Boolean.FALSE) { + }; + static FrameworkStrategy NET_5_0 = new FrameworkStrategy("net5.0", ".NET 5.0 compatible", "net5.0", Boolean.FALSE) { + }; + protected String name; + protected String description; + protected String testTargetFramework; + private Boolean isNetStandard = Boolean.TRUE; + + FrameworkStrategy(String name, String description, String testTargetFramework) { + this.name = name; + this.description = description; + this.testTargetFramework = testTargetFramework; + } + + FrameworkStrategy(String name, String description, String testTargetFramework, Boolean isNetStandard) { + this.name = name; + this.description = description; + this.testTargetFramework = testTargetFramework; + this.isNetStandard = isNetStandard; + } + + protected void configureAdditionalProperties(final Map properties) { + properties.putIfAbsent(CodegenConstants.DOTNET_FRAMEWORK, this.name); + + // not intended to be user-settable + properties.put(TARGET_FRAMEWORK_IDENTIFIER, this.getTargetFrameworkIdentifier()); + properties.put(TARGET_FRAMEWORK_VERSION, this.getTargetFrameworkVersion()); + properties.putIfAbsent(MCS_NET_VERSION_KEY, "4.6-api"); + + properties.put(NET_STANDARD, this.isNetStandard); + if (properties.containsKey(SUPPORTS_UWP)) { + LOGGER.warn(".NET {} generator does not support the UWP option. Use the csharp generator instead.", + this.name); + properties.remove(SUPPORTS_UWP); + } + } + + protected String getNugetFrameworkIdentifier() { + return this.name.toLowerCase(Locale.ROOT); + } + + protected String getTargetFrameworkIdentifier() { + if (this.isNetStandard) return ".NETStandard"; + else return ".NETCoreApp"; + } + + protected String getTargetFrameworkVersion() { + if (this.isNetStandard) return "v" + this.name.replace("netstandard", ""); + else return "v" + this.name.replace("netcoreapp", ""); + } + } + + protected void configureAdditionalPropertiesForFrameworks(final Map properties, List strategies) { + properties.putIfAbsent(CodegenConstants.DOTNET_FRAMEWORK, strategies.stream() + .map(p -> p.name) + .collect(Collectors.joining(";"))); + + // not intended to be user-settable + properties.put(TARGET_FRAMEWORK_IDENTIFIER, strategies.stream() + .map(p -> p.getTargetFrameworkIdentifier()) + .collect(Collectors.joining(";"))); + properties.put(TARGET_FRAMEWORK_VERSION, strategies.stream() + .map(p -> p.getTargetFrameworkVersion()) + .collect(Collectors.joining(";"))); + properties.putIfAbsent(MCS_NET_VERSION_KEY, "4.6-api"); + + properties.put(NET_STANDARD, strategies.stream().anyMatch(p -> Boolean.TRUE.equals(p.isNetStandard))); + } + + /** + * Return the instantiation type of the property, especially for map and array + * + * @param schema property schema + * @return string presentation of the instantiation type of the property + */ + @Override + public String toInstantiationType(Schema schema) { + if (ModelUtils.isMapSchema(schema)) { + Schema additionalProperties = getAdditionalProperties(schema); + String inner = getSchemaType(additionalProperties); + if (ModelUtils.isMapSchema(additionalProperties)) { + inner = toInstantiationType(additionalProperties); + } + return instantiationTypes.get("map") + ""; + } else if (ModelUtils.isArraySchema(schema)) { + ArraySchema arraySchema = (ArraySchema) schema; + String inner = getSchemaType(arraySchema.getItems()); + return instantiationTypes.get("array") + "<" + inner + ">"; + } else { + return null; + } + } + + @SuppressWarnings("unchecked") + @Override + public Map postProcessModels(Map objs) { + objs = super.postProcessModels(objs); + List models = (List) objs.get("models"); + + // add implements for serializable/parcelable to all models + for (Object _mo : models) { + Map mo = (Map) _mo; + CodegenModel cm = (CodegenModel) mo.get("model"); + + if (cm.oneOf != null && !cm.oneOf.isEmpty() && cm.oneOf.contains("ModelNull")) { + // if oneOf contains "null" type + cm.isNullable = true; + cm.oneOf.remove("ModelNull"); + } + + if (cm.anyOf != null && !cm.anyOf.isEmpty() && cm.anyOf.contains("ModelNull")) { + // if anyOf contains "null" type + cm.isNullable = true; + cm.anyOf.remove("ModelNull"); + } + } + + return objs; + } + + @Override + public void postProcess() { + System.out.println("################################################################################"); + System.out.println("# Thanks for using OpenAPI Generator. #"); + System.out.println("# Please consider donation to help us maintain this project \uD83D\uDE4F #"); + System.out.println("# https://opencollective.com/openapi_generator/donate #"); + System.out.println("# #"); + System.out.println("# This generator's contributed by Jim Schubert (https://github.com/jimschubert)#"); + System.out.println("# Please support his work directly via https://patreon.com/jimschubert \uD83D\uDE4F #"); + System.out.println("################################################################################"); + } + + @Override + protected void updateModelForObject(CodegenModel m, Schema schema) { + /** + * we have a custom version of this function so we only set isMap to true if + * ModelUtils.isMapSchema + * In other generators, isMap is true for all type object schemas + */ + if (schema.getProperties() != null || schema.getRequired() != null && !(schema instanceof ComposedSchema)) { + // passing null to allProperties and allRequired as there's no parent + addVars(m, unaliasPropertySchema(schema.getProperties()), schema.getRequired(), null, null); + } + if (ModelUtils.isMapSchema(schema)) { + // an object or anyType composed schema that has additionalProperties set + addAdditionPropertiesToCodeGenModel(m, schema); + } else { + m.setIsMap(false); + if (ModelUtils.isFreeFormObject(openAPI, schema)) { + // non-composed object type with no properties + additionalProperties + // additionalProperties must be null, ObjectSchema, or empty Schema + addAdditionPropertiesToCodeGenModel(m, schema); + } + } + // process 'additionalProperties' + setAddProps(schema, m); + } +} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CsharpNetcoreFunctionsServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CsharpNetcoreFunctionsServerCodegen.java new file mode 100644 index 000000000000..fb99c5a149af --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CsharpNetcoreFunctionsServerCodegen.java @@ -0,0 +1,82 @@ +package org.openapitools.codegen.languages; + +import org.openapitools.codegen.*; +import io.swagger.models.properties.ArrayProperty; +import io.swagger.models.properties.MapProperty; +import io.swagger.models.properties.Property; +import io.swagger.models.parameters.Parameter; + +import java.io.File; +import java.util.*; + +import org.apache.commons.lang3.StringUtils; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class CsharpNetcoreFunctionsServerCodegen extends CSharpNetCoreReducedClientCodegen { + public static final String PROJECT_NAME = "projectName"; + + final Logger LOGGER = LoggerFactory.getLogger(CsharpNetcoreFunctionsServerCodegen.class); + + public CodegenType getTag() { + return CodegenType.SERVER; + } + + public String getName() { + return "csharp-netcore-functions"; + } + + public String getHelp() { + return "Generates a csharp server."; + } + + public CsharpNetcoreFunctionsServerCodegen() { + super(); + outputFolder = "generated-code" + File.separator + "csharp"; + modelTemplateFiles.put("model.mustache", ".cs"); + apiTemplateFiles.put("functions.mustache", ".cs"); + embeddedTemplateDir = templateDir = "csharp-netcore-functions"; + apiPackage = "Apis"; + modelPackage = "Models"; + String clientPackageDir = "generatedSrc/Client"; + supportingFiles.add(new SupportingFile("README.mustache", "generatedSrc", "README.md")); + supportingFiles.add(new SupportingFile("project.mustache", "generatedSrc", "project.json")); + + supportingFiles.add(new SupportingFile("IApiAccessor.mustache", + clientPackageDir, "IApiAccessor.cs")); + supportingFiles.add(new SupportingFile("Configuration.mustache", + clientPackageDir, "Configuration.cs")); + supportingFiles.add(new SupportingFile("ApiClient.mustache", + clientPackageDir, "ApiClient.cs")); + supportingFiles.add(new SupportingFile("ApiException.mustache", + clientPackageDir, "ApiException.cs")); + supportingFiles.add(new SupportingFile("ApiResponse.mustache", + clientPackageDir, "ApiResponse.cs")); + supportingFiles.add(new SupportingFile("ExceptionFactory.mustache", + clientPackageDir, "ExceptionFactory.cs")); + supportingFiles.add(new SupportingFile("OpenAPIDateConverter.mustache", + clientPackageDir, "OpenAPIDateConverter.cs")); + } + + @Override + public String apiFileFolder() { + return outputFolder + File.separator + "generatedSrc" + File.separator + "Functions"; + } + + @Override + public String modelFileFolder() { + return outputFolder + File.separator + "generatedSrc" + File.separator + "Models"; + } + + @Override + public String apiDocFileFolder() { + return (outputFolder + "/Docs").replace('/', File.separatorChar); + } + + @Override + public String apiTestFileFolder() { + return outputFolder + File.separator + "Tests" + File.separator + "Tests" + File.separator + apiPackage(); + } + +} diff --git a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig index 78855ce50adb..727ec5d990f3 100644 --- a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig +++ b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig @@ -23,6 +23,7 @@ org.openapitools.codegen.languages.CSharpClientCodegen org.openapitools.codegen.languages.CSharpNetCoreClientCodegen org.openapitools.codegen.languages.CSharpDotNet2ClientCodegen org.openapitools.codegen.languages.CSharpNancyFXServerCodegen +org.openapitools.codegen.languages.CsharpNetcoreFunctionsServerCodegen org.openapitools.codegen.languages.DartClientCodegen org.openapitools.codegen.languages.DartDioClientCodegen org.openapitools.codegen.languages.DartDioNextClientCodegen diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/AbstractOpenAPISchema.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/AbstractOpenAPISchema.mustache new file mode 100644 index 000000000000..05e78204959a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/AbstractOpenAPISchema.mustache @@ -0,0 +1,68 @@ +{{>partial_header}} + +using System; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; + +namespace {{packageName}}.{{modelPackage}} +{ + /// + /// Abstract base class for oneOf, anyOf schemas in the OpenAPI specification + /// + {{>visibility}} abstract partial class AbstractOpenAPISchema + { + /// + /// Custom JSON serializer + /// + static public readonly JsonSerializerSettings SerializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + MissingMemberHandling = MissingMemberHandling.Error, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Custom JSON serializer for objects with additional properties + /// + static public readonly JsonSerializerSettings AdditionalPropertiesSerializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + MissingMemberHandling = MissingMemberHandling.Ignore, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Gets or Sets the actual instance + /// + public abstract Object ActualInstance { get; set; } + + /// + /// Gets or Sets IsNullable to indicate whether the instance is nullable + /// + public bool IsNullable { get; protected set; } + + /// + /// Gets or Sets the schema type, which can be either `oneOf` or `anyOf` + /// + public string SchemaType { get; protected set; } + + /// + /// Converts the instance into JSON string. + /// + public abstract string ToJson(); + } +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/ApiClient.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/ApiClient.mustache new file mode 100644 index 000000000000..65cbf8d76bc3 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/ApiClient.mustache @@ -0,0 +1,867 @@ +{{>partial_header}} + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Formatters; +using System.Text; +using System.Threading; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +{{^netStandard}} +using System.Web; +{{/netStandard}} +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs; +using RestSharp; +using RestSharp.Deserializers; +using RestSharpMethod = RestSharp.Method; +{{#useWebRequest}} +using System.Net.Http; +{{/useWebRequest}} +{{#supportsRetry}} +using Polly; +{{/supportsRetry}} + +namespace {{packageName}}.Client +{ + /// + /// Allows RestSharp to Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON. + /// + internal class CustomJsonCodec : RestSharp.Serializers.ISerializer, RestSharp.Deserializers.IDeserializer + { + private readonly IReadableConfiguration _configuration; + private static readonly string _contentType = "application/json"; + private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + public CustomJsonCodec(IReadableConfiguration configuration) + { + _configuration = configuration; + } + + public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) + { + _serializerSettings = serializerSettings; + _configuration = configuration; + } + + /// + /// Serialize the object into a JSON string. + /// + /// Object to be serialized. + /// A JSON string. + public string Serialize(object obj) + { + if (obj != null && obj is {{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema) + { + // the object to be serialized is an oneOf/anyOf schema + return (({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema)obj).ToJson(); + } + else + { + return JsonConvert.SerializeObject(obj, _serializerSettings); + } + } + + public T Deserialize(IRestResponse response) + { + var result = (T)Deserialize(response, typeof(T)); + return result; + } + + /// + /// Deserialize the JSON string into a proper object. + /// + /// The HTTP response. + /// Object type. + /// Object representation of the JSON string. + internal object Deserialize(IRestResponse response, Type type) + { + if (type == typeof(byte[])) // return byte array + { + return response.RawBytes; + } + + // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) + if (type == typeof(Stream)) + { + var bytes = response.RawBytes; + if (response.Headers != null) + { + var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) + ? Path.GetTempPath() + : _configuration.TempFolderPath; + var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); + foreach (var header in response.Headers) + { + var match = regex.Match(header.ToString()); + if (match.Success) + { + string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); + File.WriteAllBytes(fileName, bytes); + return new FileStream(fileName, FileMode.Open); + } + } + } + var stream = new MemoryStream(bytes); + return stream; + } + + if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object + { + return DateTime.Parse(response.Content, null, System.Globalization.DateTimeStyles.RoundtripKind); + } + + if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type + { + return Convert.ChangeType(response.Content, type); + } + + // at this point, it must be a model (json) + try + { + return JsonConvert.DeserializeObject(response.Content, type, _serializerSettings); + } + catch (Exception e) + { + throw new ApiException(500, e.Message); + } + } + + public string RootElement { get; set; } + public string Namespace { get; set; } + public string DateFormat { get; set; } + + public string ContentType + { + get { return _contentType; } + set { throw new InvalidOperationException("Not allowed to set content type."); } + } + } + {{! NOTE: Any changes related to RestSharp should be done in this class. All other client classes are for extensibility by consumers.}} + /// + /// Provides a default implementation of an Api client (both synchronous and asynchronous implementatios), + /// encapsulating general REST accessor use cases. + /// + {{>visibility}} partial class ApiClient : ISynchronousClient{{#supportsAsync}}, IAsynchronousClient{{/supportsAsync}} + { + private readonly string _baseUrl; + + /// + /// Specifies the settings on a object. + /// These settings can be adjusted to accomodate custom serialization rules. + /// + public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Allows for extending request processing for generated code. + /// + /// The RestSharp request object + partial void InterceptRequest(IRestRequest request); + + /// + /// Allows for extending response processing for generated code. + /// + /// The RestSharp request object + /// The RestSharp response object + partial void InterceptResponse(IRestRequest request, IRestResponse response); + + /// + /// Initializes a new instance of the , defaulting to the global configurations' base url. + /// + public ApiClient() + { + _baseUrl = {{packageName}}.Client.GlobalConfiguration.Instance.BasePath; + } + + /// + /// Initializes a new instance of the + /// + /// The target service's base path in URL format. + /// + public ApiClient(string basePath) + { + if (string.IsNullOrEmpty(basePath)) + throw new ArgumentException("basePath cannot be empty"); + + _baseUrl = basePath; + } + + /// + /// Constructs the RestSharp version of an http method + /// + /// Swagger Client Custom HttpMethod + /// RestSharp's HttpMethod instance. + /// + private RestSharpMethod Method(HttpMethod method) + { + RestSharpMethod other; + switch (method) + { + case HttpMethod.Get: + other = RestSharpMethod.GET; + break; + case HttpMethod.Post: + other = RestSharpMethod.POST; + break; + case HttpMethod.Put: + other = RestSharpMethod.PUT; + break; + case HttpMethod.Delete: + other = RestSharpMethod.DELETE; + break; + case HttpMethod.Head: + other = RestSharpMethod.HEAD; + break; + case HttpMethod.Options: + other = RestSharpMethod.OPTIONS; + break; + case HttpMethod.Patch: + other = RestSharpMethod.PATCH; + break; + default: + throw new ArgumentOutOfRangeException("method", method, null); + } + + return other; + } + + /// + /// Provides all logic for constructing a new RestSharp . + /// At this point, all information for querying the service is known. Here, it is simply + /// mapped into the RestSharp request. + /// + /// The http verb. + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// [private] A new RestRequest instance. + /// + private RestRequest NewRequest( + HttpMethod method, + string path, + RequestOptions options, + IReadableConfiguration configuration) + { + if (path == null) throw new ArgumentNullException("path"); + if (options == null) throw new ArgumentNullException("options"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + RestRequest request = new RestRequest(Method(method)) + { + Resource = path, + JsonSerializer = new CustomJsonCodec(SerializerSettings, configuration) + }; + + if (options.PathParameters != null) + { + foreach (var pathParam in options.PathParameters) + { + request.AddParameter(pathParam.Key, pathParam.Value, ParameterType.UrlSegment); + } + } + + if (options.QueryParameters != null) + { + foreach (var queryParam in options.QueryParameters) + { + foreach (var value in queryParam.Value) + { + request.AddQueryParameter(queryParam.Key, value); + } + } + } + + if (configuration.DefaultHeaders != null) + { + foreach (var headerParam in configuration.DefaultHeaders) + { + request.AddHeader(headerParam.Key, headerParam.Value); + } + } + + if (options.HeaderParameters != null) + { + foreach (var headerParam in options.HeaderParameters) + { + foreach (var value in headerParam.Value) + { + request.AddHeader(headerParam.Key, value); + } + } + } + + if (options.FormParameters != null) + { + foreach (var formParam in options.FormParameters) + { + request.AddParameter(formParam.Key, formParam.Value); + } + } + + if (options.Data != null) + { + if (options.Data is Stream stream) + { + var contentType = "application/octet-stream"; + if (options.HeaderParameters != null) + { + var contentTypes = options.HeaderParameters["Content-Type"]; + contentType = contentTypes[0]; + } + + var bytes = ClientUtils.ReadAsBytes(stream); + request.AddParameter(contentType, bytes, ParameterType.RequestBody); + } + else + { + if (options.HeaderParameters != null) + { + var contentTypes = options.HeaderParameters["Content-Type"]; + if (contentTypes == null || contentTypes.Any(header => header.Contains("application/json"))) + { + request.RequestFormat = DataFormat.Json; + } + else + { + // TODO: Generated client user should add additional handlers. RestSharp only supports XML and JSON, with XML as default. + } + } + else + { + // Here, we'll assume JSON APIs are more common. XML can be forced by adding produces/consumes to openapi spec explicitly. + request.RequestFormat = DataFormat.Json; + } + + request.AddJsonBody(options.Data); + } + } + + if (options.FileParameters != null) + { + foreach (var fileParam in options.FileParameters) + { + var bytes = ClientUtils.ReadAsBytes(fileParam.Value); + var fileStream = fileParam.Value as FileStream; + if (fileStream != null) + request.Files.Add(FileParameter.Create(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name))); + else + request.Files.Add(FileParameter.Create(fileParam.Key, bytes, "no_file_name_provided")); + } + } + + if (options.Cookies != null && options.Cookies.Count > 0) + { + foreach (var cookie in options.Cookies) + { + request.AddCookie(cookie.Name, cookie.Value); + } + } + + return request; + } + + private ApiResponse ToApiResponse(IRestResponse response) + { + T result = response.Data; + string rawContent = response.Content; + + var transformed = new ApiResponse(response.StatusCode, new Multimap({{#caseInsensitiveResponseHeaders}}StringComparer.OrdinalIgnoreCase{{/caseInsensitiveResponseHeaders}}), result, rawContent) + { + ErrorText = response.ErrorMessage, + Cookies = new List() + }; + + if (response.Headers != null) + { + foreach (var responseHeader in response.Headers) + { + transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value)); + } + } + + if (response.Cookies != null) + { + foreach (var responseCookies in response.Cookies) + { + transformed.Cookies.Add( + new Cookie( + responseCookies.Name, + responseCookies.Value, + responseCookies.Path, + responseCookies.Domain) + ); + } + } + + return transformed; + } + + private ApiResponse Exec(RestRequest req, IReadableConfiguration configuration) + { + RestClient client = new RestClient(_baseUrl); + + client.ClearHandlers(); + var existingDeserializer = req.JsonSerializer as IDeserializer; + if (existingDeserializer != null) + { + client.AddHandler("application/json", () => existingDeserializer); + client.AddHandler("text/json", () => existingDeserializer); + client.AddHandler("text/x-json", () => existingDeserializer); + client.AddHandler("text/javascript", () => existingDeserializer); + client.AddHandler("*+json", () => existingDeserializer); + } + else + { + var customDeserializer = new CustomJsonCodec(SerializerSettings, configuration); + client.AddHandler("application/json", () => customDeserializer); + client.AddHandler("text/json", () => customDeserializer); + client.AddHandler("text/x-json", () => customDeserializer); + client.AddHandler("text/javascript", () => customDeserializer); + client.AddHandler("*+json", () => customDeserializer); + } + + var xmlDeserializer = new XmlDeserializer(); + client.AddHandler("application/xml", () => xmlDeserializer); + client.AddHandler("text/xml", () => xmlDeserializer); + client.AddHandler("*+xml", () => xmlDeserializer); + client.AddHandler("*", () => xmlDeserializer); + + client.Timeout = configuration.Timeout; + + if (configuration.Proxy != null) + { + client.Proxy = configuration.Proxy; + } + + if (configuration.UserAgent != null) + { + client.UserAgent = configuration.UserAgent; + } + + if (configuration.ClientCertificates != null) + { + client.ClientCertificates = configuration.ClientCertificates; + } + + InterceptRequest(req); + + IRestResponse response; + if (RetryConfiguration.RetryPolicy != null) + { + var policy = RetryConfiguration.RetryPolicy; + var policyResult = policy.ExecuteAndCapture(() => client.Execute(req)); + response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse + { + Request = req, + ErrorException = policyResult.FinalException + }; + } + else + { + response = client.Execute(req); + } + + // if the response type is oneOf/anyOf, call FromJSON to deserialize the data + if (typeof({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + { + response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + } + else if (typeof(T).Name == "Stream") // for binary response + { + response.Data = (T)(object)new MemoryStream(response.RawBytes); + } + + InterceptResponse(req, response); + + var result = ToApiResponse(response); + if (response.ErrorMessage != null) + { + result.ErrorText = response.ErrorMessage; + } + + if (response.Cookies != null && response.Cookies.Count > 0) + { + if (result.Cookies == null) result.Cookies = new List(); + foreach (var restResponseCookie in response.Cookies) + { + var cookie = new Cookie( + restResponseCookie.Name, + restResponseCookie.Value, + restResponseCookie.Path, + restResponseCookie.Domain + ) + { + Comment = restResponseCookie.Comment, + CommentUri = restResponseCookie.CommentUri, + Discard = restResponseCookie.Discard, + Expired = restResponseCookie.Expired, + Expires = restResponseCookie.Expires, + HttpOnly = restResponseCookie.HttpOnly, + Port = restResponseCookie.Port, + Secure = restResponseCookie.Secure, + Version = restResponseCookie.Version + }; + + result.Cookies.Add(cookie); + } + } + return result; + } + + {{#supportsAsync}} + private async Task> ExecAsync(RestRequest req, IReadableConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + RestClient client = new RestClient(_baseUrl); + + client.ClearHandlers(); + var existingDeserializer = req.JsonSerializer as IDeserializer; + if (existingDeserializer != null) + { + client.AddHandler("application/json", () => existingDeserializer); + client.AddHandler("text/json", () => existingDeserializer); + client.AddHandler("text/x-json", () => existingDeserializer); + client.AddHandler("text/javascript", () => existingDeserializer); + client.AddHandler("*+json", () => existingDeserializer); + } + else + { + var customDeserializer = new CustomJsonCodec(SerializerSettings, configuration); + client.AddHandler("application/json", () => customDeserializer); + client.AddHandler("text/json", () => customDeserializer); + client.AddHandler("text/x-json", () => customDeserializer); + client.AddHandler("text/javascript", () => customDeserializer); + client.AddHandler("*+json", () => customDeserializer); + } + + var xmlDeserializer = new XmlDeserializer(); + client.AddHandler("application/xml", () => xmlDeserializer); + client.AddHandler("text/xml", () => xmlDeserializer); + client.AddHandler("*+xml", () => xmlDeserializer); + client.AddHandler("*", () => xmlDeserializer); + + client.Timeout = configuration.Timeout; + + if (configuration.Proxy != null) + { + client.Proxy = configuration.Proxy; + } + + if (configuration.UserAgent != null) + { + client.UserAgent = configuration.UserAgent; + } + + if (configuration.ClientCertificates != null) + { + client.ClientCertificates = configuration.ClientCertificates; + } + + InterceptRequest(req); + + IRestResponse response; + {{#supportsRetry}} + if (RetryConfiguration.AsyncRetryPolicy != null) + { + var policy = RetryConfiguration.AsyncRetryPolicy; + var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(req, ct), cancellationToken).ConfigureAwait(false); + response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse + { + Request = req, + ErrorException = policyResult.FinalException + }; + } + else + { + {{/supportsRetry}} + response = await client.ExecuteAsync(req, cancellationToken).ConfigureAwait(false); + {{#supportsRetry}} + } + {{/supportsRetry}} + + // if the response type is oneOf/anyOf, call FromJSON to deserialize the data + if (typeof({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + { + response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + } + else if (typeof(T).Name == "Stream") // for binary response + { + response.Data = (T)(object)new MemoryStream(response.RawBytes); + } + + InterceptResponse(req, response); + + var result = ToApiResponse(response); + if (response.ErrorMessage != null) + { + result.ErrorText = response.ErrorMessage; + } + + if (response.Cookies != null && response.Cookies.Count > 0) + { + if (result.Cookies == null) result.Cookies = new List(); + foreach (var restResponseCookie in response.Cookies) + { + var cookie = new Cookie( + restResponseCookie.Name, + restResponseCookie.Value, + restResponseCookie.Path, + restResponseCookie.Domain + ) + { + Comment = restResponseCookie.Comment, + CommentUri = restResponseCookie.CommentUri, + Discard = restResponseCookie.Discard, + Expired = restResponseCookie.Expired, + Expires = restResponseCookie.Expires, + HttpOnly = restResponseCookie.HttpOnly, + Port = restResponseCookie.Port, + Secure = restResponseCookie.Secure, + Version = restResponseCookie.Version + }; + + result.Cookies.Add(cookie); + } + } + return result; + } + + #region IAsynchronousClient + /// + /// Make a HTTP GET request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP POST request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP PUT request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP DELETE request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP HEAD request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP OPTION request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP PATCH request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), config, cancellationToken); + } + #endregion IAsynchronousClient + {{/supportsAsync}} + + #region ISynchronousClient + /// + /// Make a HTTP GET request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Get, path, options, config), config); + } + + /// + /// Make a HTTP POST request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Post, path, options, config), config); + } + + /// + /// Make a HTTP PUT request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Put, path, options, config), config); + } + + /// + /// Make a HTTP DELETE request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Delete, path, options, config), config); + } + + /// + /// Make a HTTP HEAD request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Head, path, options, config), config); + } + + /// + /// Make a HTTP OPTION request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Options, path, options, config), config); + } + + /// + /// Make a HTTP PATCH request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Patch, path, options, config), config); + } + #endregion ISynchronousClient + } +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/ApiException.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/ApiException.mustache new file mode 100644 index 000000000000..f7dadc5573c9 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/ApiException.mustache @@ -0,0 +1,60 @@ +{{>partial_header}} + +using System; + +namespace {{packageName}}.Client +{ + /// + /// API Exception + /// + {{>visibility}} class ApiException : Exception + { + /// + /// Gets or sets the error code (HTTP status code) + /// + /// The error code (HTTP status code). + public int ErrorCode { get; set; } + + /// + /// Gets or sets the error content (body json object) + /// + /// The error content (Http response body). + public object ErrorContent { get; private set; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + public Multimap Headers { get; private set; } + + /// + /// Initializes a new instance of the class. + /// + public ApiException() { } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Error message. + public ApiException(int errorCode, string message) : base(message) + { + this.ErrorCode = errorCode; + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Error message. + /// Error content. + /// HTTP Headers. + public ApiException(int errorCode, string message, object errorContent = null, Multimap headers = null) : base(message) + { + this.ErrorCode = errorCode; + this.ErrorContent = errorContent; + this.Headers = headers; + } + } + +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/ApiResponse.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/ApiResponse.mustache new file mode 100644 index 000000000000..161c2acd16c3 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/ApiResponse.mustache @@ -0,0 +1,158 @@ +{{>partial_header}} + +using System; +using System.Collections.Generic; +using System.Net; + +namespace {{packageName}}.Client +{ + /// + /// Provides a non-generic contract for the ApiResponse wrapper. + /// + public interface IApiResponse + { + /// + /// The data type of + /// + Type ResponseType { get; } + + /// + /// The content of this response + /// + Object Content { get; } + + /// + /// Gets or sets the status code (HTTP status code) + /// + /// The status code. + HttpStatusCode StatusCode { get; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + Multimap Headers { get; } + + /// + /// Gets or sets any error text defined by the calling client. + /// + string ErrorText { get; set; } + + /// + /// Gets or sets any cookies passed along on the response. + /// + List Cookies { get; set; } + + /// + /// The raw content of this response + /// + string RawContent { get; } + } + + /// + /// API Response + /// + public class ApiResponse : IApiResponse + { + #region Properties + + /// + /// Gets or sets the status code (HTTP status code) + /// + /// The status code. + public HttpStatusCode StatusCode { get; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + public Multimap Headers { get; } + + /// + /// Gets or sets the data (parsed HTTP body) + /// + /// The data. + public T Data { get; } + + /// + /// Gets or sets any error text defined by the calling client. + /// + public string ErrorText { get; set; } + + /// + /// Gets or sets any cookies passed along on the response. + /// + public List Cookies { get; set; } + + /// + /// The content of this response + /// + public Type ResponseType + { + get { return typeof(T); } + } + + /// + /// The data type of + /// + public object Content + { + get { return Data; } + } + + /// + /// The raw content + /// + public string RawContent { get; } + + #endregion Properties + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// HTTP headers. + /// Data (parsed HTTP body) + /// Raw content. + public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data, string rawContent) + { + StatusCode = statusCode; + Headers = headers; + Data = data; + RawContent = rawContent; + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// HTTP headers. + /// Data (parsed HTTP body) + public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data) : this(statusCode, headers, data, null) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Data (parsed HTTP body) + /// Raw content. + public ApiResponse(HttpStatusCode statusCode, T data, string rawContent) : this(statusCode, null, data, rawContent) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Data (parsed HTTP body) + public ApiResponse(HttpStatusCode statusCode, T data) : this(statusCode, data, null) + { + } + + #endregion Constructors + } +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/AssemblyInfo.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/AssemblyInfo.mustache new file mode 100644 index 000000000000..d5d937dc19fa --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/AssemblyInfo.mustache @@ -0,0 +1,40 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("{{packageTitle}}")] +[assembly: AssemblyDescription("{{packageDescription}}")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("{{packageCompany}}")] +[assembly: AssemblyProduct("{{packageProductName}}")] +[assembly: AssemblyCopyright("{{packageCopyright}}")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("{{packageVersion}}")] +[assembly: AssemblyFileVersion("{{packageVersion}}")] +{{^supportsAsync}} +// Settings which don't support asynchronous operations rely on non-public constructors +// This is due to how RestSharp requires the type constraint `where T : new()` in places it probably shouldn't. +[assembly: InternalsVisibleTo("RestSharp")] +[assembly: InternalsVisibleTo("NewtonSoft.Json")] +[assembly: InternalsVisibleTo("JsonSubTypes")] +{{/supportsAsync}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/ClientUtils.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/ClientUtils.mustache new file mode 100644 index 000000000000..3c04dcdbd0c1 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/ClientUtils.mustache @@ -0,0 +1,239 @@ +{{>partial_header}} + +using System; +using System.Collections; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +{{#useCompareNetObjects}} +using KellermanSoftware.CompareNetObjects; +{{/useCompareNetObjects}} + +namespace {{packageName}}.Client +{ + /// + /// Utility functions providing some benefit to API client consumers. + /// + public static class ClientUtils + { + {{#useCompareNetObjects}} + /// + /// An instance of CompareLogic. + /// + public static CompareLogic compareLogic; + + /// + /// Static contstructor to initialise compareLogic. + /// + static ClientUtils() + { + compareLogic = new CompareLogic(); + } + + {{/useCompareNetObjects}} + /// + /// Sanitize filename by removing the path + /// + /// Filename + /// Filename + public static string SanitizeFilename(string filename) + { + Match match = Regex.Match(filename, @".*[/\\](.*)$"); + return match.Success ? match.Groups[1].Value : filename; + } + + /// + /// Convert params to key/value pairs. + /// Use collectionFormat to properly format lists and collections. + /// + /// The swagger-supported collection format, one of: csv, tsv, ssv, pipes, multi + /// Key name. + /// Value object. + /// A multimap of keys with 1..n associated values. + public static Multimap ParameterToMultiMap(string collectionFormat, string name, object value) + { + var parameters = new Multimap(); + + if (value is ICollection collection && collectionFormat == "multi") + { + foreach (var item in collection) + { + parameters.Add(name, ParameterToString(item)); + } + } + else if (value is IDictionary dictionary) + { + if(collectionFormat == "deepObject") { + foreach (DictionaryEntry entry in dictionary) + { + parameters.Add(name + "[" + entry.Key + "]", ParameterToString(entry.Value)); + } + } + else { + foreach (DictionaryEntry entry in dictionary) + { + parameters.Add(entry.Key.ToString(), ParameterToString(entry.Value)); + } + } + } + else + { + parameters.Add(name, ParameterToString(value)); + } + + return parameters; + } + + /// + /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + /// If parameter is a list, join the list with ",". + /// Otherwise just return the string. + /// + /// The parameter (header, path, query, form). + /// An optional configuration instance, providing formatting options used in processing. + /// Formatted string. + public static string ParameterToString(object obj, IReadableConfiguration configuration = null) + { + if (obj is DateTime dateTime) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTime.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); + if (obj is DateTimeOffset dateTimeOffset) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); + if (obj is bool boolean) + return boolean ? "true" : "false"; + if (obj is ICollection collection) + return string.Join(",", collection.Cast()); + + return Convert.ToString(obj, CultureInfo.InvariantCulture); + } + + /// + /// URL encode a string + /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 + /// + /// string to be URL encoded + /// Byte array + public static string UrlEncode(string input) + { + const int maxLength = 32766; + + if (input == null) + { + throw new ArgumentNullException("input"); + } + + if (input.Length <= maxLength) + { + return Uri.EscapeDataString(input); + } + + StringBuilder sb = new StringBuilder(input.Length * 2); + int index = 0; + + while (index < input.Length) + { + int length = Math.Min(input.Length - index, maxLength); + string subString = input.Substring(index, length); + + sb.Append(Uri.EscapeDataString(subString)); + index += subString.Length; + } + + return sb.ToString(); + } + + /// + /// Encode string in base64 format. + /// + /// string to be encoded. + /// Encoded string. + public static string Base64Encode(string text) + { + return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// + /// Convert stream to byte array + /// + /// Input stream to be converted + /// Byte array + public static byte[] ReadAsBytes(Stream inputStream) + { + using (var ms = new MemoryStream()) + { + inputStream.CopyTo(ms); + return ms.ToArray(); + } + } + + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON type exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public static string SelectHeaderContentType(string[] contentTypes) + { + if (contentTypes.Length == 0) + return null; + + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType)) + return contentType; + } + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + + /// + /// Select the Accept header's value from the given accepts array: + /// if JSON exists in the given array, use it; + /// otherwise use all of them (joining into a string) + /// + /// The accepts array to select from. + /// The Accept header to use. + public static string SelectHeaderAccept(string[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return string.Join(",", accepts); + } + + /// + /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. + /// + public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + /// + /// Check if the given MIME is a JSON MIME. + /// JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public static bool IsJsonMime(string mime) + { + if (string.IsNullOrWhiteSpace(mime)) return false; + + return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json"); + } + } +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/Configuration.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/Configuration.mustache new file mode 100644 index 000000000000..ead564144412 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/Configuration.mustache @@ -0,0 +1,574 @@ +{{>partial_header}} + +using System; +{{^net35}} +using System.Collections.Concurrent; +{{/net35}} +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Security.Cryptography.X509Certificates; +using System.Text; + +namespace {{packageName}}.Client +{ + /// + /// Represents a set of configuration settings + /// + {{>visibility}} class Configuration : IReadableConfiguration + { + #region Constants + + /// + /// Version of the package. + /// + /// Version of the package. + public const string Version = "{{packageVersion}}"; + + /// + /// Identifier for ISO 8601 DateTime Format + /// + /// See https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 for more information. + // ReSharper disable once InconsistentNaming + public const string ISO8601_DATETIME_FORMAT = "o"; + + #endregion Constants + + #region Static Members + + /// + /// Default creation of exceptions for a given method name and response object + /// + public static readonly ExceptionFactory DefaultExceptionFactory = (methodName, response) => + { + var status = (int)response.StatusCode; + if (status >= 400) + { + return new ApiException(status, + string.Format("Error calling {0}: {1}", methodName, response.RawContent), + response.RawContent, response.Headers); + } + {{^netStandard}} + if (status == 0) + { + return new ApiException(status, + string.Format("Error calling {0}: {1}", methodName, response.ErrorText), response.ErrorText); + } + {{/netStandard}} + return null; + }; + + #endregion Static Members + + #region Private Members + + /// + /// Defines the base path of the target API server. + /// Example: http://localhost:3000/v1/ + /// + private string _basePath; + + /// + /// Gets or sets the API key based on the authentication name. + /// This is the key and value comprising the "secret" for acessing an API. + /// + /// The API key. + private IDictionary _apiKey; + + /// + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// + /// The prefix of the API key. + private IDictionary _apiKeyPrefix; + + private string _dateTimeFormat = ISO8601_DATETIME_FORMAT; + private string _tempFolderPath = Path.GetTempPath(); + {{#servers.0}} + + /// + /// Gets or sets the servers defined in the OpenAPI spec. + /// + /// The servers + private IList> _servers; + {{/servers.0}} + {{#hasHttpSignatureMethods}} + + /// + /// HttpSigning configuration + /// + private HttpSigningConfiguration _HttpSigningConfiguration = null; + {{/hasHttpSignatureMethods}} + #endregion Private Members + + #region Constructors + + /// + /// Initializes a new instance of the class + /// + [System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + public Configuration() + { + Proxy = null; + UserAgent = "{{#httpUserAgent}}{{.}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{packageVersion}}/csharp{{/httpUserAgent}}"; + BasePath = "{{{basePath}}}"; + DefaultHeaders = new {{^net35}}Concurrent{{/net35}}Dictionary(); + ApiKey = new {{^net35}}Concurrent{{/net35}}Dictionary(); + ApiKeyPrefix = new {{^net35}}Concurrent{{/net35}}Dictionary(); + {{#servers}} + {{#-first}} + Servers = new List>() + { + {{/-first}} + { + new Dictionary { + {"url", "{{{url}}}"}, + {"description", "{{{description}}}{{^description}}No description provided{{/description}}"}, + {{#variables}} + {{#-first}} + { + "variables", new Dictionary { + {{/-first}} + { + "{{{name}}}", new Dictionary { + {"description", "{{{description}}}{{^description}}No description provided{{/description}}"}, + {"default_value", "{{{defaultValue}}}"}, + {{#enumValues}} + {{#-first}} + { + "enum_values", new List() { + {{/-first}} + "{{{.}}}"{{^-last}},{{/-last}} + {{#-last}} + } + } + {{/-last}} + {{/enumValues}} + } + }{{^-last}},{{/-last}} + {{#-last}} + } + } + {{/-last}} + {{/variables}} + } + }{{^-last}},{{/-last}} + {{#-last}} + }; + {{/-last}} + {{/servers}} + + // Setting Timeout has side effects (forces ApiClient creation). + Timeout = 100000; + } + + /// + /// Initializes a new instance of the class + /// + [System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + public Configuration( + IDictionary defaultHeaders, + IDictionary apiKey, + IDictionary apiKeyPrefix, + string basePath = "{{{basePath}}}") : this() + { + if (string.{{^net35}}IsNullOrWhiteSpace{{/net35}}{{#net35}}IsNullOrEmpty{{/net35}}(basePath)) + throw new ArgumentException("The provided basePath is invalid.", "basePath"); + if (defaultHeaders == null) + throw new ArgumentNullException("defaultHeaders"); + if (apiKey == null) + throw new ArgumentNullException("apiKey"); + if (apiKeyPrefix == null) + throw new ArgumentNullException("apiKeyPrefix"); + + BasePath = basePath; + + foreach (var keyValuePair in defaultHeaders) + { + DefaultHeaders.Add(keyValuePair); + } + + foreach (var keyValuePair in apiKey) + { + ApiKey.Add(keyValuePair); + } + + foreach (var keyValuePair in apiKeyPrefix) + { + ApiKeyPrefix.Add(keyValuePair); + } + } + + #endregion Constructors + + #region Properties + + /// + /// Gets or sets the base path for API access. + /// + public virtual string BasePath { + get { return _basePath; } + set { _basePath = value; } + } + + /// + /// Gets or sets the default header. + /// + [Obsolete("Use DefaultHeaders instead.")] + public virtual IDictionary DefaultHeader + { + get + { + return DefaultHeaders; + } + set + { + DefaultHeaders = value; + } + } + + /// + /// Gets or sets the default headers. + /// + public virtual IDictionary DefaultHeaders { get; set; } + + /// + /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. + /// + public virtual int Timeout { get; set; } + + /// + /// Gets or sets the proxy + /// + /// Proxy. + public virtual WebProxy Proxy { get; set; } + + /// + /// Gets or sets the HTTP user agent. + /// + /// Http user agent. + public virtual string UserAgent { get; set; } + + /// + /// Gets or sets the username (HTTP basic authentication). + /// + /// The username. + public virtual string Username { get; set; } + + /// + /// Gets or sets the password (HTTP basic authentication). + /// + /// The password. + public virtual string Password { get; set; } + + /// + /// Gets the API key with prefix. + /// + /// API key identifier (authentication scheme). + /// API key with prefix. + public string GetApiKeyWithPrefix(string apiKeyIdentifier) + { + string apiKeyValue; + ApiKey.TryGetValue(apiKeyIdentifier, out apiKeyValue); + string apiKeyPrefix; + if (ApiKeyPrefix.TryGetValue(apiKeyIdentifier, out apiKeyPrefix)) + { + return apiKeyPrefix + " " + apiKeyValue; + } + + return apiKeyValue; + } + + /// + /// Gets or sets certificate collection to be sent with requests. + /// + /// X509 Certificate collection. + public X509CertificateCollection ClientCertificates { get; set; } + + /// + /// Gets or sets the access token for OAuth2 authentication. + /// + /// This helper property simplifies code generation. + /// + /// The access token. + public virtual string AccessToken { get; set; } + + /// + /// Gets or sets the temporary folder path to store the files downloaded from the server. + /// + /// Folder path. + public virtual string TempFolderPath + { + get { return _tempFolderPath; } + + set + { + if (string.IsNullOrEmpty(value)) + { + _tempFolderPath = Path.GetTempPath(); + return; + } + + // create the directory if it does not exist + if (!Directory.Exists(value)) + { + Directory.CreateDirectory(value); + } + + // check if the path contains directory separator at the end + if (value[value.Length - 1] == Path.DirectorySeparatorChar) + { + _tempFolderPath = value; + } + else + { + _tempFolderPath = value + Path.DirectorySeparatorChar; + } + } + } + + /// + /// Gets or sets the date time format used when serializing in the ApiClient + /// By default, it's set to ISO 8601 - "o", for others see: + /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx + /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx + /// No validation is done to ensure that the string you're providing is valid + /// + /// The DateTimeFormat string + public virtual string DateTimeFormat + { + get { return _dateTimeFormat; } + set + { + if (string.IsNullOrEmpty(value)) + { + // Never allow a blank or null string, go back to the default + _dateTimeFormat = ISO8601_DATETIME_FORMAT; + return; + } + + // Caution, no validation when you choose date time format other than ISO 8601 + // Take a look at the above links + _dateTimeFormat = value; + } + } + + /// + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// + /// Whatever you set here will be prepended to the value defined in AddApiKey. + /// + /// An example invocation here might be: + /// + /// ApiKeyPrefix["Authorization"] = "Bearer"; + /// + /// … where ApiKey["Authorization"] would then be used to set the value of your bearer token. + /// + /// + /// OAuth2 workflows should set tokens via AccessToken. + /// + /// + /// The prefix of the API key. + public virtual IDictionary ApiKeyPrefix + { + get { return _apiKeyPrefix; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKeyPrefix collection may not be null."); + } + _apiKeyPrefix = value; + } + } + + /// + /// Gets or sets the API key based on the authentication name. + /// + /// The API key. + public virtual IDictionary ApiKey + { + get { return _apiKey; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKey collection may not be null."); + } + _apiKey = value; + } + } + {{#servers.0}} + + /// + /// Gets or sets the servers. + /// + /// The servers. + public virtual IList> Servers + { + get { return _servers; } + set + { + if (value == null) + { + throw new InvalidOperationException("Servers may not be null."); + } + _servers = value; + } + } + + /// + /// Returns URL based on server settings without providing values + /// for the variables + /// + /// Array index of the server settings. + /// The server URL. + public string GetServerUrl(int index) + { + return GetServerUrl(index, null); + } + + /// + /// Returns URL based on server settings. + /// + /// Array index of the server settings. + /// Dictionary of the variables and the corresponding values. + /// The server URL. + public string GetServerUrl(int index, Dictionary inputVariables) + { + if (index < 0 || index >= Servers.Count) + { + throw new InvalidOperationException($"Invalid index {index} when selecting the server. Must be less than {Servers.Count}."); + } + + if (inputVariables == null) + { + inputVariables = new Dictionary(); + } + + IReadOnlyDictionary server = Servers[index]; + string url = (string)server["url"]; + + // go through variable and assign a value + foreach (KeyValuePair variable in (IReadOnlyDictionary)server["variables"]) + { + + IReadOnlyDictionary serverVariables = (IReadOnlyDictionary)(variable.Value); + + if (inputVariables.ContainsKey(variable.Key)) + { + if (((List)serverVariables["enum_values"]).Contains(inputVariables[variable.Key])) + { + url = url.Replace("{" + variable.Key + "}", inputVariables[variable.Key]); + } + else + { + throw new InvalidOperationException($"The variable `{variable.Key}` in the server URL has invalid value #{inputVariables[variable.Key]}. Must be {(List)serverVariables["enum_values"]}"); + } + } + else + { + // use defualt value + url = url.Replace("{" + variable.Key + "}", (string)serverVariables["default_value"]); + } + } + + return url; + } + {{/servers.0}} + {{#hasHttpSignatureMethods}} + + /// + /// Gets and Sets the HttpSigningConfiuration + /// + public HttpSigningConfiguration HttpSigningConfiguration + { + get { return _HttpSigningConfiguration; } + set { _HttpSigningConfiguration = value; } + } + {{/hasHttpSignatureMethods}} + + #endregion Properties + + #region Methods + + /// + /// Returns a string with essential information for debugging. + /// + public static string ToDebugReport() + { + string report = "C# SDK ({{{packageName}}}) Debug Report:\n"; + report += " OS: " + System.Environment.OSVersion + "\n"; + report += " .NET Framework Version: " + System.Environment.Version + "\n"; + report += " Version of the API: {{{version}}}\n"; + report += " SDK Package Version: {{{packageVersion}}}\n"; + + return report; + } + + /// + /// Add Api Key Header. + /// + /// Api Key name. + /// Api Key value. + /// + public void AddApiKey(string key, string value) + { + ApiKey[key] = value; + } + + /// + /// Sets the API key prefix. + /// + /// Api Key name. + /// Api Key value. + public void AddApiKeyPrefix(string key, string value) + { + ApiKeyPrefix[key] = value; + } + + #endregion Methods + + #region Static Members + /// + /// Merge configurations. + /// + /// First configuration. + /// Second configuration. + /// Merged configuration. + public static IReadableConfiguration MergeConfigurations(IReadableConfiguration first, IReadableConfiguration second) + { + if (second == null) return first ?? GlobalConfiguration.Instance; + + Dictionary apiKey = first.ApiKey.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + Dictionary apiKeyPrefix = first.ApiKeyPrefix.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + Dictionary defaultHeaders = first.DefaultHeaders.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + + foreach (var kvp in second.ApiKey) apiKey[kvp.Key] = kvp.Value; + foreach (var kvp in second.ApiKeyPrefix) apiKeyPrefix[kvp.Key] = kvp.Value; + foreach (var kvp in second.DefaultHeaders) defaultHeaders[kvp.Key] = kvp.Value; + + var config = new Configuration + { + ApiKey = apiKey, + ApiKeyPrefix = apiKeyPrefix, + DefaultHeaders = defaultHeaders, + BasePath = second.BasePath ?? first.BasePath, + Timeout = second.Timeout, + Proxy = second.Proxy ?? first.Proxy, + UserAgent = second.UserAgent ?? first.UserAgent, + Username = second.Username ?? first.Username, + Password = second.Password ?? first.Password, + AccessToken = second.AccessToken ?? first.AccessToken, + {{#hasHttpSignatureMethods}} + HttpSigningConfiguration = second.HttpSigningConfiguration ?? first.HttpSigningConfiguration, + {{/hasHttpSignatureMethods}} + TempFolderPath = second.TempFolderPath ?? first.TempFolderPath, + DateTimeFormat = second.DateTimeFormat ?? first.DateTimeFormat + }; + return config; + } + #endregion Static Members + } +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/ExceptionFactory.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/ExceptionFactory.mustache new file mode 100644 index 000000000000..4a141f6f1aec --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/ExceptionFactory.mustache @@ -0,0 +1,14 @@ +{{>partial_header}} + +using System; + +namespace {{packageName}}.Client +{ + /// + /// A delegate to ExceptionFactory method + /// + /// Method name + /// Response + /// Exceptions + {{>visibility}} delegate Exception ExceptionFactory(string methodName, IApiResponse response); +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/GlobalConfiguration.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/GlobalConfiguration.mustache new file mode 100644 index 000000000000..bdfa4b99cc13 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/GlobalConfiguration.mustache @@ -0,0 +1,59 @@ +{{>partial_header}} + +using System.Collections.Generic; + +namespace {{packageName}}.Client +{ + /// + /// provides a compile-time extension point for globally configuring + /// API Clients. + /// + /// + /// A customized implementation via partial class may reside in another file and may + /// be excluded from automatic generation via a .openapi-generator-ignore file. + /// + public partial class GlobalConfiguration : Configuration + { + #region Private Members + + private static readonly object GlobalConfigSync = new { }; + private static IReadableConfiguration _globalConfiguration; + + #endregion Private Members + + #region Constructors + + /// + private GlobalConfiguration() + { + } + + /// + public GlobalConfiguration(IDictionary defaultHeader, IDictionary apiKey, IDictionary apiKeyPrefix, string basePath = "http://localhost:3000/api") : base(defaultHeader, apiKey, apiKeyPrefix, basePath) + { + } + + static GlobalConfiguration() + { + Instance = new GlobalConfiguration(); + } + + #endregion Constructors + + /// + /// Gets or sets the default Configuration. + /// + /// Configuration. + public static IReadableConfiguration Instance + { + get { return _globalConfiguration; } + set + { + lock (GlobalConfigSync) + { + _globalConfiguration = value; + } + } + } + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/HttpMethod.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/HttpMethod.mustache new file mode 100644 index 000000000000..904a042a9acf --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/HttpMethod.mustache @@ -0,0 +1,25 @@ +{{>partial_header}} + +namespace {{packageName}}.Client +{ + /// + /// Http methods supported by swagger + /// + public enum HttpMethod + { + /// HTTP GET request. + Get, + /// HTTP POST request. + Post, + /// HTTP PUT request. + Put, + /// HTTP DELETE request. + Delete, + /// HTTP HEAD request. + Head, + /// HTTP OPTIONS request. + Options, + /// HTTP PATCH request. + Patch + } +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/HttpSigningConfiguration.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/HttpSigningConfiguration.mustache new file mode 100644 index 000000000000..cc8c275e40bf --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/HttpSigningConfiguration.mustache @@ -0,0 +1,757 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Runtime.InteropServices; +using System.Security; +using System.Security.Cryptography; +using System.Text; +using System.Web; + +namespace {{packageName}}.Client +{ + /// + /// Class for HttpSigning auth related parameter and methods + /// + public class HttpSigningConfiguration + { + #region + /// + /// Initailize the HashAlgorithm and SigningAlgorithm to default value + /// + public HttpSigningConfiguration() + { + HashAlgorithm = HashAlgorithmName.SHA256; + SigningAlgorithm = "PKCS1-v15"; + } + #endregion + + #region Properties + /// + ///Gets the Api keyId + /// + public string KeyId { get; set; } + + /// + /// Gets the Key file path + /// + public string KeyFilePath { get; set; } + + /// + /// Gets the key pass phrase for password protected key + /// + public SecureString KeyPassPhrase { get; set; } + + /// + /// Gets the HTTP signing header + /// + public List HttpSigningHeader { get; set; } + + /// + /// Gets the hash algorithm sha256 or sha512 + /// + public HashAlgorithmName HashAlgorithm { get; set; } + + /// + /// Gets the signing algorithm + /// + public string SigningAlgorithm { get; set; } + + /// + /// Gets the Signature validaty period in seconds + /// + public int SignatureValidityPeriod { get; set; } + + #endregion + + #region enum + private enum PrivateKeyType + { + None = 0, + RSA = 1, + ECDSA = 2, + } + #endregion + + #region Methods + /// + /// Gets the Headers for HttpSigning + /// + /// Base path + /// HTTP method + /// Path + /// Request options + /// + internal Dictionary GetHttpSignedHeader(string basePath,string method, string path, RequestOptions requestOptions) + { + const string HEADER_REQUEST_TARGET = "(request-target)"; + //The time when the HTTP signature expires. The API server should reject HTTP requests + //that have expired. + const string HEADER_EXPIRES = "(expires)"; + //The 'Date' header. + const string HEADER_DATE = "Date"; + //The 'Host' header. + const string HEADER_HOST = "Host"; + //The time when the HTTP signature was generated. + const string HEADER_CREATED = "(created)"; + //When the 'Digest' header is included in the HTTP signature, the client automatically + //computes the digest of the HTTP request body, per RFC 3230. + const string HEADER_DIGEST = "Digest"; + //The 'Authorization' header is automatically generated by the client. It includes + //the list of signed headers and a base64-encoded signature. + const string HEADER_AUTHORIZATION = "Authorization"; + + //Hash table to store singed headers + var HttpSignedRequestHeader = new Dictionary(); + var HttpSignatureHeader = new Dictionary(); + + if (HttpSigningHeader.Count == 0) + { + HttpSigningHeader.Add("(created)"); + } + + if (requestOptions.PathParameters != null) + { + foreach (var pathParam in requestOptions.PathParameters) + { + var tempPath = path.Replace(pathParam.Key, "0"); + path = string.Format(tempPath, pathParam.Value); + } + } + + var httpValues = HttpUtility.ParseQueryString(string.Empty); + foreach (var parameter in requestOptions.QueryParameters) + { +#if (NETCOREAPP) + if (parameter.Value.Count > 1) + { // array + foreach (var value in parameter.Value) + { + httpValues.Add(HttpUtility.UrlEncode(parameter.Key) + "[]", value); + } + } + else + { + httpValues.Add(HttpUtility.UrlEncode(parameter.Key), parameter.Value[0]); + } +#else + if (parameter.Value.Count > 1) + { // array + foreach (var value in parameter.Value) + { + httpValues.Add(parameter.Key + "[]", value); + } + } + else + { + httpValues.Add(parameter.Key, parameter.Value[0]); + } +#endif + } + var uriBuilder = new UriBuilder(string.Concat(basePath, path)); + uriBuilder.Query = httpValues.ToString().Replace("+", "%20"); + + var dateTime = DateTime.Now; + string Digest = string.Empty; + + //get the body + string requestBody = string.Empty; + if (requestOptions.Data != null) + { + var serializerSettings = new JsonSerializerSettings(); + requestBody = JsonConvert.SerializeObject(requestOptions.Data, serializerSettings); + } + + if (HashAlgorithm == HashAlgorithmName.SHA256) + { + var bodyDigest = GetStringHash(HashAlgorithm.ToString(), requestBody); + Digest = string.Format("SHA-256={0}", Convert.ToBase64String(bodyDigest)); + } + else if (HashAlgorithm == HashAlgorithmName.SHA512) + { + var bodyDigest = GetStringHash(HashAlgorithm.ToString(), requestBody); + Digest = string.Format("SHA-512={0}", Convert.ToBase64String(bodyDigest)); + } + else + { + throw new Exception(string.Format("{0} not supported", HashAlgorithm)); + } + + + foreach (var header in HttpSigningHeader) + { + if (header.Equals(HEADER_REQUEST_TARGET)) + { + var targetUrl = string.Format("{0} {1}{2}", method.ToLower(), uriBuilder.Path, uriBuilder.Query); + HttpSignatureHeader.Add(header.ToLower(), targetUrl); + } + else if (header.Equals(HEADER_EXPIRES)) + { + var expireDateTime = dateTime.AddSeconds(SignatureValidityPeriod); + HttpSignatureHeader.Add(header.ToLower(), GetUnixTime(expireDateTime).ToString()); + } + else if (header.Equals(HEADER_DATE)) + { + var utcDateTime = dateTime.ToString("r").ToString(); + HttpSignatureHeader.Add(header.ToLower(), utcDateTime); + HttpSignedRequestHeader.Add(HEADER_DATE, utcDateTime); + } + else if (header.Equals(HEADER_HOST)) + { + HttpSignatureHeader.Add(header.ToLower(), uriBuilder.Host); + HttpSignedRequestHeader.Add(HEADER_HOST, uriBuilder.Host); + } + else if (header.Equals(HEADER_CREATED)) + { + HttpSignatureHeader.Add(header.ToLower(), GetUnixTime(dateTime).ToString()); + } + else if (header.Equals(HEADER_DIGEST)) + { + HttpSignedRequestHeader.Add(HEADER_DIGEST, Digest); + HttpSignatureHeader.Add(header.ToLower(), Digest); + } + else + { + bool isHeaderFound = false; + foreach (var item in requestOptions.HeaderParameters) + { + if (string.Equals(item.Key, header, StringComparison.OrdinalIgnoreCase)) + { + HttpSignatureHeader.Add(header.ToLower(), item.Value.ToString()); + isHeaderFound = true; + break; + } + } + if (!isHeaderFound) + { + throw new Exception(string.Format("Cannot sign HTTP request.Request does not contain the {0} header.",header)); + } + } + + } + var headersKeysString = string.Join(" ", HttpSignatureHeader.Keys); + var headerValuesList = new List(); + + foreach (var keyVal in HttpSignatureHeader) + { + headerValuesList.Add(string.Format("{0}: {1}", keyVal.Key, keyVal.Value)); + + } + //Concatinate headers value separated by new line + var headerValuesString = string.Join("\n", headerValuesList); + var signatureStringHash = GetStringHash(HashAlgorithm.ToString(), headerValuesString); + string headerSignatureStr = null; + var keyType = GetKeyType(KeyFilePath); + + if (keyType == PrivateKeyType.RSA) + { + headerSignatureStr = GetRSASignature(signatureStringHash); + } + else if (keyType == PrivateKeyType.ECDSA) + { + headerSignatureStr = GetECDSASignature(signatureStringHash); + } + var cryptographicScheme = "hs2019"; + var authorizationHeaderValue = string.Format("Signature keyId=\"{0}\",algorithm=\"{1}\"", + KeyId, cryptographicScheme); + + if (HttpSignatureHeader.ContainsKey(HEADER_CREATED)) + { + authorizationHeaderValue += string.Format(",created={0}", HttpSignatureHeader[HEADER_CREATED]); + } + + if (HttpSignatureHeader.ContainsKey(HEADER_EXPIRES)) + { + authorizationHeaderValue += string.Format(",expires={0}", HttpSignatureHeader[HEADER_EXPIRES]); + } + + authorizationHeaderValue += string.Format(",headers=\"{0}\",signature=\"{1}\"", + headersKeysString, headerSignatureStr); + + HttpSignedRequestHeader.Add(HEADER_AUTHORIZATION, authorizationHeaderValue); + + return HttpSignedRequestHeader; + } + + private byte[] GetStringHash(string hashName, string stringToBeHashed) + { + var hashAlgorithm = System.Security.Cryptography.HashAlgorithm.Create(hashName); + var bytes = Encoding.UTF8.GetBytes(stringToBeHashed); + var stringHash = hashAlgorithm.ComputeHash(bytes); + return stringHash; + } + + private int GetUnixTime(DateTime date2) + { + DateTime date1 = new DateTime(1970, 01, 01); + TimeSpan timeSpan = date2 - date1; + return (int)timeSpan.TotalSeconds; + } + + private string GetRSASignature(byte[] stringToSign) + { + RSA rsa = GetRSAProviderFromPemFile(KeyFilePath, KeyPassPhrase); + if (SigningAlgorithm == "RSASSA-PSS") + { + var signedbytes = rsa.SignHash(stringToSign, HashAlgorithm, RSASignaturePadding.Pss); + return Convert.ToBase64String(signedbytes); + } + else if (SigningAlgorithm == "PKCS1-v15") + { + var signedbytes = rsa.SignHash(stringToSign, HashAlgorithm, RSASignaturePadding.Pkcs1); + return Convert.ToBase64String(signedbytes); + } + return string.Empty; + } + + /// + /// Gets the ECDSA signature + /// + /// + /// + private string GetECDSASignature(byte[] dataToSign) + { + if (!File.Exists(KeyFilePath)) + { + throw new Exception("key file path does not exist."); + } + + var ecKeyHeader = "-----BEGIN EC PRIVATE KEY-----"; + var ecKeyFooter = "-----END EC PRIVATE KEY-----"; + var keyStr = File.ReadAllText(KeyFilePath); + var ecKeyBase64String = keyStr.Replace(ecKeyHeader, "").Replace(ecKeyFooter, "").Trim(); + var keyBytes = System.Convert.FromBase64String(ecKeyBase64String); + var ecdsa = ECDsa.Create(); + +#if (NETCOREAPP3_0 || NETCOREAPP3_1 || NET5_0) + var byteCount = 0; + if (KeyPassPhrase != null) + { + IntPtr unmanagedString = IntPtr.Zero; + try + { + // convert secure string to byte array + unmanagedString = Marshal.SecureStringToGlobalAllocUnicode(KeyPassPhrase); + ecdsa.ImportEncryptedPkcs8PrivateKey(Encoding.UTF8.GetBytes(Marshal.PtrToStringUni(unmanagedString)), keyBytes, out byteCount); + } + finally + { + if (unmanagedString != IntPtr.Zero) + { + Marshal.ZeroFreeBSTR(unmanagedString); + } + } + } + else + { + ecdsa.ImportPkcs8PrivateKey(keyBytes, out byteCount); + } + var signedBytes = ecdsa.SignHash(dataToSign); + var derBytes = ConvertToECDSAANS1Format(signedBytes); + var signedString = System.Convert.ToBase64String(derBytes); + + return signedString; +#else + throw new Exception("ECDSA signing is supported only on NETCOREAPP3_0 and above"); +#endif + + } + + private byte[] ConvertToECDSAANS1Format(byte[] signedBytes) + { + var derBytes = new List(); + byte derLength = 68; //default lenght for ECDSA code signinged bit 0x44 + byte rbytesLength = 32; //R length 0x20 + byte sbytesLength = 32; //S length 0x20 + var rBytes = new List(); + var sBytes = new List(); + for (int i = 0; i < 32; i++) + { + rBytes.Add(signedBytes[i]); + } + for (int i = 32; i < 64; i++) + { + sBytes.Add(signedBytes[i]); + } + + if (rBytes[0] > 0x7F) + { + derLength++; + rbytesLength++; + var tempBytes = new List(); + tempBytes.AddRange(rBytes); + rBytes.Clear(); + rBytes.Add(0x00); + rBytes.AddRange(tempBytes); + } + + if (sBytes[0] > 0x7F) + { + derLength++; + sbytesLength++; + var tempBytes = new List(); + tempBytes.AddRange(sBytes); + sBytes.Clear(); + sBytes.Add(0x00); + sBytes.AddRange(tempBytes); + + } + + derBytes.Add(48); //start of the sequence 0x30 + derBytes.Add(derLength); //total length r lenth, type and r bytes + + derBytes.Add(2); //tag for integer + derBytes.Add(rbytesLength); //length of r + derBytes.AddRange(rBytes); + + derBytes.Add(2); //tag for integer + derBytes.Add(sbytesLength); //length of s + derBytes.AddRange(sBytes); + return derBytes.ToArray(); + } + + private RSACryptoServiceProvider GetRSAProviderFromPemFile(string pemfile, SecureString keyPassPharse = null) + { + const string pempubheader = "-----BEGIN PUBLIC KEY-----"; + const string pempubfooter = "-----END PUBLIC KEY-----"; + bool isPrivateKeyFile = true; + byte[] pemkey = null; + + if (!File.Exists(pemfile)) + { + throw new Exception("private key file does not exist."); + } + string pemstr = File.ReadAllText(pemfile).Trim(); + + if (pemstr.StartsWith(pempubheader) && pemstr.EndsWith(pempubfooter)) + { + isPrivateKeyFile = false; + } + + if (isPrivateKeyFile) + { + pemkey = ConvertPrivateKeyToBytes(pemstr, keyPassPharse); + if (pemkey == null) + { + return null; + } + return DecodeRSAPrivateKey(pemkey); + } + return null; + } + + private byte[] ConvertPrivateKeyToBytes(string instr, SecureString keyPassPharse = null) + { + const string pemprivheader = "-----BEGIN RSA PRIVATE KEY-----"; + const string pemprivfooter = "-----END RSA PRIVATE KEY-----"; + string pemstr = instr.Trim(); + byte[] binkey; + + if (!pemstr.StartsWith(pemprivheader) || !pemstr.EndsWith(pemprivfooter)) + { + return null; + } + + StringBuilder sb = new StringBuilder(pemstr); + sb.Replace(pemprivheader, ""); + sb.Replace(pemprivfooter, ""); + string pvkstr = sb.ToString().Trim(); + + try + { // if there are no PEM encryption info lines, this is an UNencrypted PEM private key + binkey = Convert.FromBase64String(pvkstr); + return binkey; + } + catch (System.FormatException) + { + StringReader str = new StringReader(pvkstr); + + //-------- read PEM encryption info. lines and extract salt ----- + if (!str.ReadLine().StartsWith("Proc-Type: 4,ENCRYPTED")) + { + return null; + } + string saltline = str.ReadLine(); + if (!saltline.StartsWith("DEK-Info: DES-EDE3-CBC,")) + { + return null; + } + string saltstr = saltline.Substring(saltline.IndexOf(",") + 1).Trim(); + byte[] salt = new byte[saltstr.Length / 2]; + for (int i = 0; i < salt.Length; i++) + salt[i] = Convert.ToByte(saltstr.Substring(i * 2, 2), 16); + if (!(str.ReadLine() == "")) + { + return null; + } + + //------ remaining b64 data is encrypted RSA key ---- + string encryptedstr = str.ReadToEnd(); + + try + { //should have b64 encrypted RSA key now + binkey = Convert.FromBase64String(encryptedstr); + } + catch (System.FormatException) + { //data is not in base64 fromat + return null; + } + + byte[] deskey = GetEncryptedKey(salt, keyPassPharse, 1, 2); // count=1 (for OpenSSL implementation); 2 iterations to get at least 24 bytes + if (deskey == null) + { + return null; + } + + //------ Decrypt the encrypted 3des-encrypted RSA private key ------ + byte[] rsakey = DecryptKey(binkey, deskey, salt); //OpenSSL uses salt value in PEM header also as 3DES IV + return rsakey; + } + } + + private RSACryptoServiceProvider DecodeRSAPrivateKey(byte[] privkey) + { + byte[] MODULUS, E, D, P, Q, DP, DQ, IQ; + + // --------- Set up stream to decode the asn.1 encoded RSA private key ------ + MemoryStream mem = new MemoryStream(privkey); + BinaryReader binr = new BinaryReader(mem); //wrap Memory Stream with BinaryReader for easy reading + byte bt = 0; + ushort twobytes = 0; + int elems = 0; + try + { + twobytes = binr.ReadUInt16(); + if (twobytes == 0x8130) //data read as little endian order (actual data order for Sequence is 30 81) + { + binr.ReadByte(); //advance 1 byte + } + else if (twobytes == 0x8230) + { + binr.ReadInt16(); //advance 2 bytes + } + else + { + return null; + } + + twobytes = binr.ReadUInt16(); + if (twobytes != 0x0102) //version number + { + return null; + } + bt = binr.ReadByte(); + if (bt != 0x00) + { + return null; + } + + //------ all private key components are Integer sequences ---- + elems = GetIntegerSize(binr); + MODULUS = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + E = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + D = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + P = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + Q = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + DP = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + DQ = binr.ReadBytes(elems); + + elems = GetIntegerSize(binr); + IQ = binr.ReadBytes(elems); + + // ------- create RSACryptoServiceProvider instance and initialize with public key ----- + RSACryptoServiceProvider RSA = new RSACryptoServiceProvider(); + RSAParameters RSAparams = new RSAParameters(); + RSAparams.Modulus = MODULUS; + RSAparams.Exponent = E; + RSAparams.D = D; + RSAparams.P = P; + RSAparams.Q = Q; + RSAparams.DP = DP; + RSAparams.DQ = DQ; + RSAparams.InverseQ = IQ; + RSA.ImportParameters(RSAparams); + return RSA; + } + catch (Exception) + { + return null; + } + finally + { + binr.Close(); + } + } + + private int GetIntegerSize(BinaryReader binr) + { + byte bt = 0; + byte lowbyte = 0x00; + byte highbyte = 0x00; + int count = 0; + bt = binr.ReadByte(); + if (bt != 0x02) //expect integer + { + return 0; + } + bt = binr.ReadByte(); + + if (bt == 0x81) + { + count = binr.ReadByte(); // data size in next byte + } + else if (bt == 0x82) + { + highbyte = binr.ReadByte(); // data size in next 2 bytes + lowbyte = binr.ReadByte(); + byte[] modint = { lowbyte, highbyte, 0x00, 0x00 }; + count = BitConverter.ToInt32(modint, 0); + } + else + { + count = bt; // we already have the data size + } + while (binr.ReadByte() == 0x00) + { + //remove high order zeros in data + count -= 1; + } + binr.BaseStream.Seek(-1, SeekOrigin.Current); + //last ReadByte wasn't a removed zero, so back up a byte + return count; + } + + private byte[] GetEncryptedKey(byte[] salt, SecureString secpswd, int count, int miter) + { + IntPtr unmanagedPswd = IntPtr.Zero; + int HASHLENGTH = 16; //MD5 bytes + byte[] keymaterial = new byte[HASHLENGTH * miter]; //to store contatenated Mi hashed results + + byte[] psbytes = new byte[secpswd.Length]; + unmanagedPswd = Marshal.SecureStringToGlobalAllocAnsi(secpswd); + Marshal.Copy(unmanagedPswd, psbytes, 0, psbytes.Length); + Marshal.ZeroFreeGlobalAllocAnsi(unmanagedPswd); + + // --- contatenate salt and pswd bytes into fixed data array --- + byte[] data00 = new byte[psbytes.Length + salt.Length]; + Array.Copy(psbytes, data00, psbytes.Length); //copy the pswd bytes + Array.Copy(salt, 0, data00, psbytes.Length, salt.Length); //concatenate the salt bytes + + // ---- do multi-hashing and contatenate results D1, D2 ... into keymaterial bytes ---- + MD5 md5 = new MD5CryptoServiceProvider(); + byte[] result = null; + byte[] hashtarget = new byte[HASHLENGTH + data00.Length]; //fixed length initial hashtarget + + for (int j = 0; j < miter; j++) + { + // ---- Now hash consecutively for count times ------ + if (j == 0) + { + result = data00; //initialize + } + else + { + Array.Copy(result, hashtarget, result.Length); + Array.Copy(data00, 0, hashtarget, result.Length, data00.Length); + result = hashtarget; + } + + for (int i = 0; i < count; i++) + result = md5.ComputeHash(result); + Array.Copy(result, 0, keymaterial, j * HASHLENGTH, result.Length); //contatenate to keymaterial + } + byte[] deskey = new byte[24]; + Array.Copy(keymaterial, deskey, deskey.Length); + + Array.Clear(psbytes, 0, psbytes.Length); + Array.Clear(data00, 0, data00.Length); + Array.Clear(result, 0, result.Length); + Array.Clear(hashtarget, 0, hashtarget.Length); + Array.Clear(keymaterial, 0, keymaterial.Length); + return deskey; + } + + private byte[] DecryptKey(byte[] cipherData, byte[] desKey, byte[] IV) + { + MemoryStream memst = new MemoryStream(); + TripleDES alg = TripleDES.Create(); + alg.Key = desKey; + alg.IV = IV; + try + { + CryptoStream cs = new CryptoStream(memst, alg.CreateDecryptor(), CryptoStreamMode.Write); + cs.Write(cipherData, 0, cipherData.Length); + cs.Close(); + } + catch (Exception) + { + return null; + } + byte[] decryptedData = memst.ToArray(); + return decryptedData; + } + + /// + /// Detect the key type from the pem file. + /// + /// key file path in pem format + /// + private PrivateKeyType GetKeyType(string keyFilePath) + { + if (!File.Exists(keyFilePath)) + { + throw new Exception("Key file path does not exist."); + } + + var ecPrivateKeyHeader = "BEGIN EC PRIVATE KEY"; + var ecPrivateKeyFooter = "END EC PRIVATE KEY"; + var rsaPrivateKeyHeader = "BEGIN RSA PRIVATE KEY"; + var rsaPrivateFooter = "END RSA PRIVATE KEY"; + //var pkcs8Header = "BEGIN PRIVATE KEY"; + //var pkcs8Footer = "END PRIVATE KEY"; + var keyType = PrivateKeyType.None; + var key = File.ReadAllLines(keyFilePath); + + if (key[0].ToString().Contains(rsaPrivateKeyHeader) && + key[key.Length - 1].ToString().Contains(rsaPrivateFooter)) + { + keyType = PrivateKeyType.RSA; + } + else if (key[0].ToString().Contains(ecPrivateKeyHeader) && + key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) + { + keyType = PrivateKeyType.ECDSA; + } + else if (key[0].ToString().Contains(ecPrivateKeyHeader) && + key[key.Length - 1].ToString().Contains(ecPrivateKeyFooter)) + { + + /* this type of key can hold many type different types of private key, but here due lack of pem header + Considering this as EC key + */ + //TODO :- update the key based on oid + keyType = PrivateKeyType.ECDSA; + } + else + { + throw new Exception("Either the key is invalid or key is not supported"); + + } + return keyType; + } + #endregion + } +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/IApiAccessor.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/IApiAccessor.mustache new file mode 100644 index 000000000000..a269f56e9046 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/IApiAccessor.mustache @@ -0,0 +1,29 @@ +{{>partial_header}} + +using System; + +namespace {{packageName}}.Client +{ + /// + /// Represents configuration aspects required to interact with the API endpoints. + /// + {{>visibility}} interface IApiAccessor + { + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + IReadableConfiguration Configuration { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + string GetBasePath(); + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + ExceptionFactory ExceptionFactory { get; set; } + } +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/IAsynchronousClient.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/IAsynchronousClient.mustache new file mode 100644 index 000000000000..f0c88fae473d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/IAsynchronousClient.mustache @@ -0,0 +1,92 @@ +{{>partial_header}} + +using System; +using System.Threading.Tasks; + +namespace {{packageName}}.Client +{ + /// + /// Contract for Asynchronous RESTful API interactions. + /// + /// This interface allows consumers to provide a custom API accessor client. + /// + public interface IAsynchronousClient + { + /// + /// Executes a non-blocking call to some using the GET http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the POST http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the PUT http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the DELETE http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the HEAD http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the OPTIONS http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the PATCH http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/IReadableConfiguration.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/IReadableConfiguration.mustache new file mode 100644 index 000000000000..7c6487d92f84 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/IReadableConfiguration.mustache @@ -0,0 +1,114 @@ +{{>partial_header}} + +using System; +using System.Collections.Generic; +using System.Net; +using System.Security.Cryptography.X509Certificates; + +namespace {{packageName}}.Client +{ + /// + /// Represents a readable-only configuration contract. + /// + public interface IReadableConfiguration + { + /// + /// Gets the access token. + /// + /// Access token. + string AccessToken { get; } + + /// + /// Gets the API key. + /// + /// API key. + IDictionary ApiKey { get; } + + /// + /// Gets the API key prefix. + /// + /// API key prefix. + IDictionary ApiKeyPrefix { get; } + + /// + /// Gets the base path. + /// + /// Base path. + string BasePath { get; } + + /// + /// Gets the date time format. + /// + /// Date time foramt. + string DateTimeFormat { get; } + + /// + /// Gets the default header. + /// + /// Default header. + [Obsolete("Use DefaultHeaders instead.")] + IDictionary DefaultHeader { get; } + + /// + /// Gets the default headers. + /// + /// Default headers. + IDictionary DefaultHeaders { get; } + + /// + /// Gets the temp folder path. + /// + /// Temp folder path. + string TempFolderPath { get; } + + /// + /// Gets the HTTP connection timeout (in milliseconds) + /// + /// HTTP connection timeout. + int Timeout { get; } + + /// + /// Gets the proxy. + /// + /// Proxy. + WebProxy Proxy { get; } + + /// + /// Gets the user agent. + /// + /// User agent. + string UserAgent { get; } + + /// + /// Gets the username. + /// + /// Username. + string Username { get; } + + /// + /// Gets the password. + /// + /// Password. + string Password { get; } + + /// + /// Gets the API key with prefix. + /// + /// API key identifier (authentication scheme). + /// API key with prefix. + string GetApiKeyWithPrefix(string apiKeyIdentifier); + + /// + /// Gets certificate collection to be sent with requests. + /// + /// X509 Certificate collection. + X509CertificateCollection ClientCertificates { get; } + {{#hasHttpSignatureMethods}} + + /// + /// Gets the HttpSigning configuration + /// + HttpSigningConfiguration HttpSigningConfiguration { get; } + {{/hasHttpSignatureMethods}} + } +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/ISynchronousClient.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/ISynchronousClient.mustache new file mode 100644 index 000000000000..c09bfbfed660 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/ISynchronousClient.mustache @@ -0,0 +1,85 @@ +{{>partial_header}} + +using System; +using System.IO; + +namespace {{packageName}}.Client +{ + /// + /// Contract for Synchronous RESTful API interactions. + /// + /// This interface allows consumers to provide a custom API accessor client. + /// + public interface ISynchronousClient + { + /// + /// Executes a blocking call to some using the GET http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the POST http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the PUT http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the DELETE http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the HEAD http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the OPTIONS http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the PATCH http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null); + } +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/JsonSubTypesTests.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/JsonSubTypesTests.mustache new file mode 100644 index 000000000000..9b1f66624d74 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/JsonSubTypesTests.mustache @@ -0,0 +1,125 @@ +{{>partial_header}} + +using System.Collections.Generic; +using System.Linq; +using JsonSubTypes; +using Newtonsoft.Json; +using NUnit.Framework; + +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.{{modelPackage}}; +using {{packageName}}.Client; + +namespace {{packageName}}.Test.Client +{ + public class JsonSubTypesTests + { + [Test] + public void TestSimpleJsonSubTypesExample() + { + var annimal = + JsonConvert.DeserializeObject("{\"Kind\":\"Dog\",\"Breed\":\"Jack Russell Terrier\"}"); + Assert.AreEqual("Jack Russell Terrier", (annimal as Dog)?.Breed); + } + + [Test] + public void DeserializeObjectWithCustomMapping() + { + var annimal = + JsonConvert.DeserializeObject("{\"Sound\":\"Bark\",\"Breed\":\"Jack Russell Terrier\"}"); + Assert.AreEqual("Jack Russell Terrier", (annimal as Dog2)?.Breed); + } + + [Test] + public void DeserializeObjectMappingByPropertyPresence() + { + string json = + "[{\"Department\":\"Department1\",\"JobTitle\":\"JobTitle1\",\"FirstName\":\"FirstName1\",\"LastName\":\"LastName1\"}," + + "{\"Department\":\"Department1\",\"JobTitle\":\"JobTitle1\",\"FirstName\":\"FirstName1\",\"LastName\":\"LastName1\"}," + + "{\"Skill\":\"Painter\",\"FirstName\":\"FirstName1\",\"LastName\":\"LastName1\"}]"; + + + var persons = JsonConvert.DeserializeObject>(json); + Assert.AreEqual("Painter", (persons.Last() as Artist)?.Skill); + } + } + + [JsonConverter(typeof(JsonSubtypes), "Kind")] + public interface IAnimal + { + string Kind { get; } + } + + public class Dog : IAnimal + { + public Dog() + { + Kind = "Dog"; + } + + public string Kind { get; } + public string Breed { get; set; } + } + + class Cat : IAnimal + { + public Cat() + { + Kind = "Cat"; + } + + public string Kind { get; } + bool Declawed { get; set; } + } + + [JsonConverter(typeof(JsonSubtypes), "Sound")] + [JsonSubtypes.KnownSubType(typeof(Dog2), "Bark")] + [JsonSubtypes.KnownSubType(typeof(Cat2), "Meow")] + public class Animal2 + { + public virtual string Sound { get; } + public string Color { get; set; } + } + + public class Dog2 : Animal2 + { + public Dog2() + { + Sound = "Bark"; + } + + public override string Sound { get; } + public string Breed { get; set; } + } + + public class Cat2 : Animal2 + { + public Cat2() + { + Sound = "Meow"; + } + + public override string Sound { get; } + public bool Declawed { get; set; } + } + + [JsonConverter(typeof(JsonSubtypes))] + [JsonSubtypes.KnownSubTypeWithProperty(typeof(Employee), "JobTitle")] + [JsonSubtypes.KnownSubTypeWithProperty(typeof(Artist), "Skill")] + public class Person + { + public string FirstName { get; set; } + public string LastName { get; set; } + } + + public class Employee : Person + { + public string Department { get; set; } + public string JobTitle { get; set; } + } + + public class Artist : Person + { + public string Skill { get; set; } + } +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/Multimap.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/Multimap.mustache new file mode 100644 index 000000000000..8624af009244 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/Multimap.mustache @@ -0,0 +1,287 @@ +{{>partial_header}} + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace {{packageName}}.Client +{ + /// + /// A dictionary in which one key has many associated values. + /// + /// The type of the key + /// The type of the value associated with the key. + public class Multimap : IDictionary> + { + #region Private Fields + + private readonly Dictionary> _dictionary; + + #endregion Private Fields + + #region Constructors + + /// + /// Empty Constructor. + /// + public Multimap() + { + _dictionary = new Dictionary>(); + } + + /// + /// Constructor with comparer. + /// + /// + public Multimap(IEqualityComparer comparer) + { + _dictionary = new Dictionary>(comparer); + } + + #endregion Constructors + + #region Enumerators + + /// + /// To get the enumerator. + /// + /// Enumerator + public IEnumerator>> GetEnumerator() + { + return _dictionary.GetEnumerator(); + } + + /// + /// To get the enumerator. + /// + /// Enumerator + IEnumerator IEnumerable.GetEnumerator() + { + return _dictionary.GetEnumerator(); + } + + #endregion Enumerators + + #region Public Members + /// + /// Add values to Multimap + /// + /// Key value pair + public void Add(KeyValuePair> item) + { + if (!TryAdd(item.Key, item.Value)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + + /// + /// Add Multimap to Multimap + /// + /// Multimap + public void Add(Multimap multimap) + { + foreach (var item in multimap) + { + if (!TryAdd(item.Key, item.Value)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + } + + /// + /// Clear Multimap + /// + public void Clear() + { + _dictionary.Clear(); + } + + /// + /// Determines whether Multimap contains the specified item. + /// + /// Key value pair + /// Method needs to be implemented + /// true if the Multimap contains the item; otherwise, false. + public bool Contains(KeyValuePair> item) + { + throw new NotImplementedException(); + } + + /// + /// Copy items of the Multimap to an array, + /// starting at a particular array index. + /// + /// The array that is the destination of the items copied + /// from Multimap. The array must have zero-based indexing. + /// The zero-based index in array at which copying begins. + /// Method needs to be implemented + public void CopyTo(KeyValuePair>[] array, int arrayIndex) + { + throw new NotImplementedException(); + } + + /// + /// Removes the specified item from the Multimap. + /// + /// Key value pair + /// true if the item is successfully removed; otherwise, false. + /// Method needs to be implemented + public bool Remove(KeyValuePair> item) + { + throw new NotImplementedException(); + } + + /// + /// Gets the number of items contained in the Multimap. + /// + public int Count => _dictionary.Count; + + /// + /// Gets a value indicating whether the Multimap is read-only. + /// + public bool IsReadOnly => false; + + /// + /// Adds an item with the provided key and value to the Multimap. + /// + /// The object to use as the key of the item to add. + /// The object to use as the value of the item to add. + /// Thrown when couldn't add the value to Multimap. + public void Add(TKey key, IList value) + { + if (value != null && value.Count > 0) + { + if (_dictionary.TryGetValue(key, out var list)) + { + foreach (var k in value) list.Add(k); + } + else + { + list = new List(value); + if (!TryAdd(key, list)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + } + } + + /// + /// Determines whether the Multimap contains an item with the specified key. + /// + /// The key to locate in the Multimap. + /// true if the Multimap contains an item with + /// the key; otherwise, false. + public bool ContainsKey(TKey key) + { + return _dictionary.ContainsKey(key); + } + + /// + /// Removes item with the specified key from the Multimap. + /// + /// The key to locate in the Multimap. + /// true if the item is successfully removed; otherwise, false. + public bool Remove(TKey key) + { + return TryRemove(key, out var _); + } + + /// + /// Gets the value associated with the specified key. + /// + /// The key whose value to get. + /// When this method returns, the value associated with the specified key, if the + /// key is found; otherwise, the default value for the type of the value parameter. + /// This parameter is passed uninitialized. + /// true if the object that implements Multimap contains + /// an item with the specified key; otherwise, false. + public bool TryGetValue(TKey key, out IList value) + { + return _dictionary.TryGetValue(key, out value); + } + + /// + /// Gets or sets the item with the specified key. + /// + /// The key of the item to get or set. + /// The value of the specified key. + public IList this[TKey key] + { + get => _dictionary[key]; + set => _dictionary[key] = value; + } + + /// + /// Gets a System.Collections.Generic.ICollection containing the keys of the Multimap. + /// + public ICollection Keys => _dictionary.Keys; + + /// + /// Gets a System.Collections.Generic.ICollection containing the values of the Multimap. + /// + public ICollection> Values => _dictionary.Values; + + /// + /// Copy the items of the Multimap to an System.Array, + /// starting at a particular System.Array index. + /// + /// The one-dimensional System.Array that is the destination of the items copied + /// from Multimap. The System.Array must have zero-based indexing. + /// The zero-based index in array at which copying begins. + public void CopyTo(Array array, int index) + { + ((ICollection)_dictionary).CopyTo(array, index); + } + + /// + /// Adds an item with the provided key and value to the Multimap. + /// + /// The object to use as the key of the item to add. + /// The object to use as the value of the item to add. + /// Thrown when couldn't add value to Multimap. + public void Add(TKey key, TValue value) + { + if (value != null) + { + if (_dictionary.TryGetValue(key, out var list)) + { + list.Add(value); + } + else + { + list = new List { value }; + if (!TryAdd(key, list)) + throw new InvalidOperationException("Could not add value to Multimap."); + } + } + } + + #endregion Public Members + + #region Private Members + + /** + * Helper method to encapsulate generator differences between dictionary types. + */ + private bool TryRemove(TKey key, out IList value) + { + _dictionary.TryGetValue(key, out value); + return _dictionary.Remove(key); + } + + /** + * Helper method to encapsulate generator differences between dictionary types. + */ + private bool TryAdd(TKey key, IList value) + { + try + { + _dictionary.Add(key, value); + } + catch (ArgumentException) + { + return false; + } + + return true; + } + #endregion Private Members + } +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/OpenAPIDateConverter.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/OpenAPIDateConverter.mustache new file mode 100644 index 000000000000..d7905102576d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/OpenAPIDateConverter.mustache @@ -0,0 +1,21 @@ +{{>partial_header}} +using Newtonsoft.Json.Converters; + +namespace {{packageName}}.Client +{ + /// + /// Formatter for 'date' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class OpenAPIDateConverter : IsoDateTimeConverter + { + /// + /// Initializes a new instance of the class. + /// + public OpenAPIDateConverter() + { + // full-date = date-fullyear "-" date-month "-" date-mday + DateTimeFormat = "yyyy-MM-dd"; + } + } +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/README.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/README.mustache new file mode 100644 index 000000000000..b15d2a25bf19 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/README.mustache @@ -0,0 +1,270 @@ +# {{packageName}} - the C# library for the {{appName}} + +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} + +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: {{appVersion}} +- SDK version: {{packageVersion}} +{{^hideGenerationTimestamp}} +- Build date: {{generatedDate}} +{{/hideGenerationTimestamp}} +- Build package: {{generatorClass}} +{{#infoUrl}} + For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/infoUrl}} + + +## Frameworks supported +{{#netStandard}} +- .NET Core >=1.0 +- .NET Framework >=4.6 +- Mono/Xamarin >=vNext +{{/netStandard}} + + +## Dependencies + +{{#useRestSharp}} +- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.11.7 or later +{{/useRestSharp}} +- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 12.0.3 or later +- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.8.0 or later +{{#useCompareNetObjects}} +- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later +{{/useCompareNetObjects}} +{{#validatable}} +- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 5.0.0 or later +{{/validatable}} + +The DLLs included in the package may not be the latest version. We recommend using [NuGet](https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: +``` +{{#useRestSharp}} +Install-Package RestSharp +{{/useRestSharp}} +Install-Package Newtonsoft.Json +Install-Package JsonSubTypes +{{#validatable}} +Install-Package System.ComponentModel.Annotations +{{/validatable}} +{{#useCompareNetObjects}} +Install-Package CompareNETObjects +{{/useCompareNetObjects}} +``` +{{#useRestSharp}} + +NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See [RestSharp#742](https://github.com/restsharp/RestSharp/issues/742). +NOTE: RestSharp for .Net Core creates a new socket for each api call, which can lead to a socket exhaustion problem. See [RestSharp#1406](https://github.com/restsharp/RestSharp/issues/1406). + +{{/useRestSharp}} + +## Installation +{{#netStandard}} +Generate the DLL using your preferred tool (e.g. `dotnet build`) +{{/netStandard}} +{{^netStandard}} +Run the following command to generate the DLL +- [Mac/Linux] `/bin/sh build.sh` +- [Windows] `build.bat` +{{/netStandard}} + +Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces: +```csharp +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.Client; +using {{packageName}}.{{modelPackage}}; +``` +{{^netStandard}} + +## Packaging + +A `.nuspec` is included with the project. You can follow the Nuget quickstart to [create](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#create-the-package) and [publish](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#publish-the-package) packages. + +This `.nuspec` uses placeholders from the `.csproj`, so build the `.csproj` directly: + +``` +nuget pack -Build -OutputDirectory out {{packageName}}.csproj +``` + +Then, publish to a [local feed](https://docs.microsoft.com/en-us/nuget/hosting-packages/local-feeds) or [other host](https://docs.microsoft.com/en-us/nuget/hosting-packages/overview) and consume the new package via Nuget as usual. + +{{/netStandard}} + +## Usage + +To use the API client with a HTTP proxy, setup a `System.Net.WebProxy` +```csharp +Configuration c = new Configuration(); +System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/"); +webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials; +c.Proxy = webProxy; +``` +{{#useHttpClient}} + +### Connections +Each ApiClass (properly the ApiClient inside it) will create an istance of HttpClient. It will use that for the entire lifecycle and dispose it when called the Dispose method. + +To better manager the connections it's a common practice to reuse the HttpClient and HttpClientHander (see [here](https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests#issues-with-the-original-httpclient-class-available-in-net) for details). To use your own HttpClient instance just pass it to the ApiClass constructor. + +```csharp +HttpClientHandler yourHandler = new HttpClientHandler(); +HttpClient yourHttpClient = new HttpClient(yourHandler); +var api = new YourApiClass(yourHttpClient, yourHandler); +``` + +If you want to use an HttpClient and don't have access to the handler, for example in a DI context in Asp.net Core when using IHttpClientFactory. + +```csharp +HttpClient yourHttpClient = new HttpClient(); +var api = new YourApiClass(yourHttpClient); +``` +You'll loose some configuration settings, the features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. You need to either manually handle those in your setup of the HttpClient or they won't be available. + +Here an example of DI setup in a sample web project: + +```csharp +services.AddHttpClient(httpClient => + new PetApi(httpClient)); +``` + +{{/useHttpClient}} + + +## Getting Started + +```csharp +using System.Collections.Generic; +using System.Diagnostics; +{{#useHttpClient}} +using System.Net.Http; +{{/useHttpClient}} +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.Client; +using {{packageName}}.{{modelPackage}}; + +namespace Example +{ + public class {{operationId}}Example + { + public static void Main() + { +{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} + Configuration config = new Configuration(); + config.BasePath = "{{{basePath}}}"; + {{#hasAuthMethods}} + {{#authMethods}} + {{#isBasicBasic}} + // Configure HTTP basic authorization: {{{name}}} + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + {{/isBasicBasic}} + {{#isBasicBearer}} + // Configure Bearer token for authorization: {{{name}}} + config.AccessToken = "YOUR_BEARER_TOKEN"; + {{/isBasicBearer}} + {{#isApiKey}} + // Configure API key authorization: {{{name}}} + config.ApiKey.Add("{{{keyParamName}}}", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.ApiKeyPrefix.Add("{{{keyParamName}}}", "Bearer"); + {{/isApiKey}} + {{#isOAuth}} + // Configure OAuth2 access token for authorization: {{{name}}} + config.AccessToken = "YOUR_ACCESS_TOKEN"; + {{/isOAuth}} + {{/authMethods}} + + {{/hasAuthMethods}} + {{#useHttpClient}} + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new {{classname}}(httpClient, config, httpClientHandler); + {{/useHttpClient}} + {{^useHttpClient}} + var apiInstance = new {{classname}}(config); + {{/useHttpClient}} + {{#allParams}} + {{#isPrimitiveType}} + var {{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + var {{paramName}} = new {{{dataType}}}(); // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/isPrimitiveType}} + {{/allParams}} + + try + { + {{#summary}} + // {{{.}}} + {{/summary}} + {{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + Debug.WriteLine(result);{{/returnType}} + } + catch (ApiException e) + { + Debug.Print("Exception when calling {{classname}}.{{operationId}}: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } +{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} + } + } +} +``` + + +## Documentation for API Endpoints + +All URIs are relative to *{{{basePath}}}* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{{summary}}}{{/summary}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} + + +## Documentation for Models + +{{#modelPackage}} +{{#models}}{{#model}} - [{{{modelPackage}}}.{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) +{{/model}}{{/models}} +{{/modelPackage}} +{{^modelPackage}} +No model defined in this package +{{/modelPackage}} + + +## Documentation for Authorization + +{{^authMethods}} +All endpoints do not require authorization. +{{/authMethods}} +{{#authMethods}} +{{#last}} +Authentication schemes defined for the API: +{{/last}} +{{/authMethods}} +{{#authMethods}} + +### {{name}} + +{{#isApiKey}}- **Type**: API key +- **API key parameter name**: {{keyParamName}} +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} +{{/isApiKey}} +{{#isBasicBasic}}- **Type**: HTTP basic authentication +{{/isBasicBasic}} +{{#isBasicBearer}}- **Type**: Bearer Authentication +{{/isBasicBearer}} +{{#isOAuth}}- **Type**: OAuth +- **Flow**: {{flow}} +- **Authorization URL**: {{authorizationUrl}} +- **Scopes**: {{^scopes}}N/A{{/scopes}} +{{#scopes}} - {{scope}}: {{description}} +{{/scopes}} +{{/isOAuth}} + +{{/authMethods}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/ReadOnlyDictionary.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/ReadOnlyDictionary.mustache new file mode 100644 index 000000000000..1299b2436be9 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/ReadOnlyDictionary.mustache @@ -0,0 +1,137 @@ +{{>partial_header}} +using System; +using System.Collections; +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace {{packageName}}.Client +{ + public class ReadOnlyDictionary : IDictionary + { + private IDictionary _dictionaryImplementation; + public IEnumerator> GetEnumerator() + { + return _dictionaryImplementation.GetEnumerator(); + } + + public ReadOnlyDictionary() + { + _dictionaryImplementation = new Dictionary(); + } + + public ReadOnlyDictionary(IDictionary dictionaryImplementation) + { + if (dictionaryImplementation == null) throw new ArgumentNullException("dictionaryImplementation"); + _dictionaryImplementation = dictionaryImplementation; + } + + IEnumerator IEnumerable.GetEnumerator() + { + return ((IEnumerable) _dictionaryImplementation).GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + throw new ReadonlyOperationException("This instance is readonly."); + } + + public void Clear() + { + throw new ReadonlyOperationException("This instance is readonly."); + } + + public bool Contains(KeyValuePair item) + { + return _dictionaryImplementation.Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int arrayIndex) + { + _dictionaryImplementation.CopyTo(array, arrayIndex); + } + + public bool Remove(KeyValuePair item) + { + throw new ReadonlyOperationException("This instance is readonly."); + } + + public int Count + { + get { return _dictionaryImplementation.Count; } + } + + public bool IsReadOnly + { + get { return true; } + } + + public void Add(T key, K value) + { + throw new ReadonlyOperationException("This instance is readonly."); + } + + public bool ContainsKey(T key) + { + return _dictionaryImplementation.ContainsKey(key); + } + + public bool Remove(T key) + { + throw new ReadonlyOperationException("This instance is readonly."); + } + + public bool TryGetValue(T key, out K value) + { + return _dictionaryImplementation.TryGetValue(key, out value); + } + + public K this[T key] + { + get { return _dictionaryImplementation[key]; } + set + { + throw new ReadonlyOperationException("This instance is readonly."); + + } + } + + public ICollection Keys + { + get { return _dictionaryImplementation.Keys; } + } + + public ICollection Values + { + get { return _dictionaryImplementation.Values; } + } + } + + [Serializable] + public class ReadonlyOperationException : Exception + { + // + // For guidelines regarding the creation of new exception types, see + // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconerrorraisinghandlingguidelines.asp + // and + // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp07192001.asp + // + + public ReadonlyOperationException() + { + } + + public ReadonlyOperationException(string message) : base(message) + { + } + + public ReadonlyOperationException(string message, Exception inner) : base(message, inner) + { + } + + protected ReadonlyOperationException( + SerializationInfo info, + StreamingContext context) : base(info, context) + { + } + } +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/RequestOptions.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/RequestOptions.mustache new file mode 100644 index 000000000000..dc924c733c1a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/RequestOptions.mustache @@ -0,0 +1,66 @@ +{{>partial_header}} + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; + +namespace {{packageName}}.Client +{ + /// + /// A container for generalized request inputs. This type allows consumers to extend the request functionality + /// by abstracting away from the default (built-in) request framework (e.g. RestSharp). + /// + public class RequestOptions + { + /// + /// Parameters to be bound to path parts of the Request's URL + /// + public Dictionary PathParameters { get; set; } + + /// + /// Query parameters to be applied to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap QueryParameters { get; set; } + + /// + /// Header parameters to be applied to to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap HeaderParameters { get; set; } + + /// + /// Form parameters to be sent along with the request. + /// + public Dictionary FormParameters { get; set; } + + /// + /// File parameters to be sent along with the request. + /// + public Dictionary FileParameters { get; set; } + + /// + /// Cookies to be sent along with the request. + /// + public List Cookies { get; set; } + + /// + /// Any data associated with a request body. + /// + public Object Data { get; set; } + + /// + /// Constructs a new instance of + /// + public RequestOptions() + { + PathParameters = new Dictionary(); + QueryParameters = new Multimap(); + HeaderParameters = new Multimap(); + FormParameters = new Dictionary(); + FileParameters = new Dictionary(); + Cookies = new List(); + } + } +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/RetryConfiguration.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/RetryConfiguration.mustache new file mode 100644 index 000000000000..29aa60926811 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/RetryConfiguration.mustache @@ -0,0 +1,39 @@ +using Polly; +{{#useRestSharp}} +using RestSharp; +{{/useRestSharp}} +{{#useHttpClient}} +using System.Net.Http; +{{/useHttpClient}} + +namespace {{packageName}}.Client +{ + /// + /// Configuration class to set the polly retry policies to be applied to the requests. + /// + public class RetryConfiguration + { +{{#useRestSharp}} + /// + /// Retry policy + /// + public static Policy RetryPolicy { get; set; } + + /// + /// Async retry policy + /// + public static AsyncPolicy AsyncRetryPolicy { get; set; } +{{/useRestSharp}} +{{#useHttpClient}} + /// + /// Retry policy + /// + public static Policy RetryPolicy { get; set; } + + /// + /// Async retry policy + /// + public static AsyncPolicy AsyncRetryPolicy { get; set; } +{{/useHttpClient}} + } +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/Solution.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/Solution.mustache new file mode 100644 index 000000000000..112cc3dc405c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/Solution.mustache @@ -0,0 +1,27 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio {{^netStandard}}2012{{/netStandard}}{{#netStandard}}14{{/netStandard}} +VisualStudioVersion = {{^netStandard}}12.0.0.0{{/netStandard}}{{#netStandard}}14.0.25420.1{{/netStandard}} +MinimumVisualStudioVersion = {{^netStandard}}10.0.0.1{{/netStandard}}{{#netStandard}}10.0.40219.1{{/netStandard}} +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{packageName}}", "src\{{packageName}}\{{packageName}}.csproj", "{{packageGuid}}" +EndProject +{{^excludeTests}}Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{testPackageName}}", "src\{{testPackageName}}\{{testPackageName}}.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" +EndProject +{{/excludeTests}}Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {{packageGuid}}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {{packageGuid}}.Debug|Any CPU.Build.0 = Debug|Any CPU + {{packageGuid}}.Release|Any CPU.ActiveCfg = Release|Any CPU + {{packageGuid}}.Release|Any CPU.Build.0 = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/TestProject.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/TestProject.mustache new file mode 100644 index 000000000000..b1a50ae778e3 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/TestProject.mustache @@ -0,0 +1,36 @@ + + + + + false + Properties + {{testPackageName}} + {{testPackageName}} + {{testTargetFramework}} + false + 512 + + + + + + + + + {{packageGuid}} + {{packageName}} + + + + diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/WebRequestPathBuilder.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/WebRequestPathBuilder.mustache new file mode 100644 index 000000000000..8175f0e57576 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/WebRequestPathBuilder.mustache @@ -0,0 +1,44 @@ +{{>partial_header}} +using System.Collections.Generic; + +namespace {{packageName}}.Client +{ + /// + /// A URI builder + /// + class WebRequestPathBuilder + { + private string _baseUrl; + private string _path; + private string _query = "?"; + public WebRequestPathBuilder(string baseUrl, string path) + { + _baseUrl = baseUrl; + _path = path; + } + + public void AddPathParameters(Dictionary parameters) + { + foreach (var parameter in parameters) + { + _path = _path.Replace("{" + parameter.Key + "}", parameter.Value); + } + } + + public void AddQueryParameters(Multimap parameters) + { + foreach (var parameter in parameters) + { + foreach (var value in parameter.Value) + { + _query = _query + parameter.Key + "=" + value + "&"; + } + } + } + + public string GetFullUri() + { + return _baseUrl + _path + _query.Substring(0, _query.Length - 1); + } + } +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/api.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/api.mustache new file mode 100644 index 000000000000..8d84eecefb41 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/api.mustache @@ -0,0 +1,626 @@ +{{>partial_header}} + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net; +using System.Net.Mime; +using {{packageName}}.Client; +{{#hasImport}}using {{packageName}}.{{modelPackage}}; +{{/hasImport}} + +namespace {{packageName}}.{{apiPackage}} +{ + {{#operations}} + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} interface {{interfacePrefix}}{{classname}}Sync : IApiAccessor + { + #region Synchronous Operations + {{#operation}} + /// + /// {{summary}} + /// + {{#notes}} + /// + /// {{notes}} + /// + {{/notes}} + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}}/// {{#returnType}}{{returnType}}{{/returnType}} + {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); + + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}}/// ApiResponse of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Object(void){{/returnType}} + ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); + {{/operation}} + #endregion Synchronous Operations + } + + {{#supportsAsync}} + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} interface {{interfacePrefix}}{{classname}}Async : IApiAccessor + { + #region Asynchronous Operations + {{#operation}} + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// Task of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}void{{/returnType}} + {{#returnType}}System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// Task of ApiResponse{{#returnType}} ({{returnType}}){{/returnType}} + System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + {{/operation}} + #endregion Asynchronous Operations + } + {{/supportsAsync}} + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} interface {{interfacePrefix}}{{classname}} : {{interfacePrefix}}{{classname}}Sync{{#supportsAsync}}, {{interfacePrefix}}{{classname}}Async{{/supportsAsync}} + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} partial class {{classname}} : {{interfacePrefix}}{{classname}} + { + private {{packageName}}.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public {{classname}}() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// + public {{classname}}(string basePath) + { + this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( + {{packageName}}.Client.GlobalConfiguration.Instance, + new {{packageName}}.Client.Configuration { BasePath = basePath } + ); + this.Client = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); + {{#supportsAsync}} + this.AsynchronousClient = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); + {{/supportsAsync}} + this.ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public {{classname}}({{packageName}}.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( + {{packageName}}.Client.GlobalConfiguration.Instance, + configuration + ); + this.Client = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); + {{#supportsAsync}} + this.AsynchronousClient = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); + {{/supportsAsync}} + ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using a Configuration object and client instance. + /// + /// The client interface for synchronous API access.{{#supportsAsync}} + /// The client interface for asynchronous API access.{{/supportsAsync}} + /// The configuration object. + public {{classname}}({{packageName}}.Client.ISynchronousClient client, {{#supportsAsync}}{{packageName}}.Client.IAsynchronousClient asyncClient, {{/supportsAsync}}{{packageName}}.Client.IReadableConfiguration configuration) + { + if (client == null) throw new ArgumentNullException("client"); + {{#supportsAsync}} + if (asyncClient == null) throw new ArgumentNullException("asyncClient"); + {{/supportsAsync}} + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Client = client; + {{#supportsAsync}} + this.AsynchronousClient = asyncClient; + {{/supportsAsync}} + this.Configuration = configuration; + this.ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + {{#supportsAsync}} + /// + /// The client for accessing this underlying API asynchronously. + /// + public {{packageName}}.Client.IAsynchronousClient AsynchronousClient { get; set; } + {{/supportsAsync}} + + /// + /// The client for accessing this underlying API synchronously. + /// + public {{packageName}}.Client.ISynchronousClient Client { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public {{packageName}}.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public {{packageName}}.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + {{#operation}} + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}}/// {{#returnType}}{{returnType}}{{/returnType}} + public {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + { + {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + return localVarResponse.Data;{{/returnType}}{{^returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/returnType}} + } + + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}}/// ApiResponse of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Object(void){{/returnType}} + public {{packageName}}.Client.ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + { + {{#allParams}} + {{#required}} + {{^vendorExtensions.x-csharp-value-type}} + // verify the required parameter '{{paramName}}' is set + if ({{paramName}} == null) + throw new {{packageName}}.Client.ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); + + {{/vendorExtensions.x-csharp-value-type}} + {{/required}} + {{/allParams}} + {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + {{#consumes}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/consumes}} + }; + + // to determine the Accept header + string[] _accepts = new string[] { + {{#produces}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/produces}} + }; + + var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + {{#pathParams}} + {{#required}} + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + } + {{/required}} + {{/pathParams}} + {{#queryParams}} + {{#required}} + {{#isDeepObject}} + {{#items.vars}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); + {{/items.vars}} + {{^items}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); + {{/items}} + {{/isDeepObject}} + {{^isDeepObject}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/isDeepObject}} + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + {{#isDeepObject}} + {{#items.vars}} + if ({{paramName}}.{{name}} != null) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); + } + {{/items.vars}} + {{^items}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); + {{/items}} + {{/isDeepObject}} + {{^isDeepObject}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/isDeepObject}} + } + {{/required}} + {{/queryParams}} + {{#headerParams}} + {{#required}} + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + } + {{/required}} + {{/headerParams}} + {{#formParams}} + {{#required}} + {{#isFile}} + localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + {{/isFile}} + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + {{#isFile}} + localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + {{/isFile}} + } + {{/required}} + {{/formParams}} + {{#bodyParam}} + localVarRequestOptions.Data = {{paramName}}; + {{/bodyParam}} + + {{#authMethods}} + // authentication ({{name}}) required + {{#isApiKey}} + {{#isKeyInCookie}} + // cookie parameter support + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.Cookies.Add(new Cookie("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInCookie}} + {{#isKeyInHeader}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.HeaderParameters.Add("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}")); + } + {{/isKeyInHeader}} + {{#isKeyInQuery}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("", "{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInQuery}} + {{/isApiKey}} + {{#isBasicBasic}} + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + {{packageName}}.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + {{/isBasicBasic}} + {{#isBasicBearer}} + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isBasicBearer}} + {{#isOAuth}} + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isOAuth}} + {{#isHttpSignature}} + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "{{{httpMethod}}}", "{{{path}}}", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + {{/isHttpSignature}} + {{/authMethods}} + + // make the HTTP request + var localVarResponse = this.Client.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("{{operationId}}", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + {{#supportsAsync}} + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// Task of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}void{{/returnType}} + {{#returnType}}public async System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false); + return localVarResponse.Data;{{/returnType}}{{^returnType}}await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false);{{/returnType}} + } + + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// Task of ApiResponse{{#returnType}} ({{returnType}}){{/returnType}} + public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + {{#allParams}} + {{#required}} + {{^vendorExtensions.x-csharp-value-type}} + // verify the required parameter '{{paramName}}' is set + if ({{paramName}} == null) + throw new {{packageName}}.Client.ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); + + {{/vendorExtensions.x-csharp-value-type}} + {{/required}} + {{/allParams}} + + {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + {{#consumes}} + "{{{mediaType}}}"{{^-last}}, {{/-last}} + {{/consumes}} + }; + + // to determine the Accept header + string[] _accepts = new string[] { + {{#produces}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/produces}} + }; + + + var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + {{#pathParams}} + {{#required}} + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + } + {{/required}} + {{/pathParams}} + {{#queryParams}} + {{#required}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + } + {{/required}} + {{/queryParams}} + {{#headerParams}} + {{#required}} + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + } + {{/required}} + {{/headerParams}} + {{#formParams}} + {{#required}} + {{#isFile}} + localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + {{/isFile}} + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + {{#isFile}} + localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + {{/isFile}} + } + {{/required}} + {{/formParams}} + {{#bodyParam}} + localVarRequestOptions.Data = {{paramName}}; + {{/bodyParam}} + + {{#authMethods}} + // authentication ({{name}}) required + {{#isApiKey}} + {{#isKeyInCookie}} + // cookie parameter support + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.Cookies.Add(new Cookie("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInCookie}} + {{#isKeyInHeader}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.HeaderParameters.Add("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}")); + } + {{/isKeyInHeader}} + {{#isKeyInQuery}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("", "{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInQuery}} + {{/isApiKey}} + {{#isBasic}} + {{#isBasicBasic}} + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + {{packageName}}.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + {{/isBasicBasic}} + {{#isBasicBearer}} + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isBasicBearer}} + {{/isBasic}} + {{#isOAuth}} + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isOAuth}} + {{#isHttpSignature}} + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "{{{httpMethod}}}", "{{{path}}}", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + {{/isHttpSignature}} + {{/authMethods}} + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}Async<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("{{operationId}}", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + {{/supportsAsync}} + {{/operation}} + } + {{/operations}} +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/api_doc.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/api_doc.mustache new file mode 100644 index 000000000000..d12ee22ea388 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/api_doc.mustache @@ -0,0 +1,134 @@ +# {{packageName}}.{{apiPackage}}.{{classname}}{{#description}} +{{description}}{{/description}} + +All URIs are relative to *{{{basePath}}}* + +Method | HTTP request | Description +------------- | ------------- | ------------- +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{/operation}}{{/operations}} + +{{#operations}} +{{#operation}} + +# **{{{operationId}}}** +> {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + +{{{summary}}}{{#notes}} + +{{{notes}}}{{/notes}} + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +{{#useHttpClient}} +using System.Net.Http; +{{/useHttpClient}} +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.Client; +using {{packageName}}.{{modelPackage}}; + +namespace Example +{ + public class {{operationId}}Example + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "{{{basePath}}}"; + {{#hasAuthMethods}} + {{#authMethods}} + {{#isBasicBasic}} + // Configure HTTP basic authorization: {{{name}}} + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + {{/isBasicBasic}} + {{#isBasicBearer}} + // Configure Bearer token for authorization: {{{name}}} + config.AccessToken = "YOUR_BEARER_TOKEN"; + {{/isBasicBearer}} + {{#isApiKey}} + // Configure API key authorization: {{{name}}} + config.AddApiKey("{{{keyParamName}}}", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("{{{keyParamName}}}", "Bearer"); + {{/isApiKey}} + {{#isOAuth}} + // Configure OAuth2 access token for authorization: {{{name}}} + config.AccessToken = "YOUR_ACCESS_TOKEN"; + {{/isOAuth}} + {{/authMethods}} + + {{/hasAuthMethods}} + {{#useHttpClient}} + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new {{classname}}(httpClient, config, httpClientHandler); + {{/useHttpClient}} + {{^useHttpClient}} + var apiInstance = new {{classname}}(config); + {{/useHttpClient}} + {{#allParams}} + {{#isPrimitiveType}} + var {{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + var {{paramName}} = new {{{dataType}}}(); // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/isPrimitiveType}} + {{/allParams}} + + try + { + {{#summary}} + // {{{.}}} + {{/summary}} + {{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + Debug.WriteLine(result);{{/returnType}} + } + catch (ApiException e) + { + Debug.Print("Exception when calling {{classname}}.{{operationId}}: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} +Name | Type | Description | Notes +------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} +{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{dataType}}**]({{#isContainer}}{{baseType}}{{/isContainer}}{{^isContainer}}{{dataType}}{{/isContainer}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} +{{/allParams}} + +### Return type + +{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{returnType}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}} + +### Authorization + +{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}} + +### HTTP request headers + + - **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} + - **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} + +{{#responses.0}} + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +{{#responses}} +| **{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}}
    {{/headers}}{{^headers.0}} - {{/headers.0}} | +{{/responses}} +{{/responses.0}} + +[[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) + +{{/operation}} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/api_test.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/api_test.mustache new file mode 100644 index 000000000000..02ca26b5f169 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/api_test.mustache @@ -0,0 +1,73 @@ +{{>partial_header}} +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +{{#useRestSharp}} +using RestSharp; +{{/useRestSharp}} +using Xunit; + +using {{packageName}}.Client; +using {{packageName}}.{{apiPackage}}; +{{#hasImport}} +// uncomment below to import models +//using {{packageName}}.{{modelPackage}}; +{{/hasImport}} + +namespace {{packageName}}.Test.Api +{ + /// + /// Class for testing {{classname}} + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the API endpoint. + /// + public class {{classname}}Tests : IDisposable + { + private {{classname}} instance; + + public {{classname}}Tests() + { + instance = new {{classname}}(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of {{classname}} + /// + [Fact] + public void {{operationId}}InstanceTest() + { + // TODO uncomment below to test 'IsType' {{classname}} + //Assert.IsType<{{classname}}>(instance); + } + {{#operations}} + {{#operation}} + + /// + /// Test {{operationId}} + /// + [Fact] + public void {{operationId}}Test() + { + // TODO uncomment below to test the method and replace null with proper value + {{#allParams}} + //{{{dataType}}} {{paramName}} = null; + {{/allParams}} + //{{#returnType}}var response = {{/returnType}}instance.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + {{#returnType}} + //Assert.IsType<{{{returnType}}}>(response); + {{/returnType}} + } + {{/operation}} + {{/operations}} + } +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/appveyor.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/appveyor.mustache new file mode 100644 index 000000000000..eb85fc2a85b3 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/appveyor.mustache @@ -0,0 +1,9 @@ +# auto-generated by OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator) +# +image: Visual Studio 2019 +clone_depth: 1 +build_script: +- dotnet build -c Release +- dotnet test -c Release +after_build: +- dotnet pack .\src\{{{packageName}}}\{{{packageName}}}.csproj -o ../../output -c Release --no-build diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/functions.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/functions.mustache new file mode 100644 index 000000000000..4709282deadf --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/functions.mustache @@ -0,0 +1,28 @@ +{{>partial_header}} + +using System; +using System.Net; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Azure.WebJobs; +using Microsoft.Azure.WebJobs.Extensions.Http; + +namespace {{packageName}}.{{apiPackage}} +{ {{#operations}} + public partial {{#classModifier}}{{classModifier}} {{/classModifier}}class {{classname}} + { {{#operation}} + [FunctionName("{{classname}}_{{operationId}}")] + public async Task _{{operationId}}([HttpTrigger(AuthorizationLevel.Anonymous, "{{httpMethod}}", Route = "{{{apiBasePath}}}{{{path}}}")]HttpRequest req, ExecutionContext context{{#allParams}}{{#isPathParam}}, {{>pathParam}}{{/isPathParam}}{{/allParams}}) + { + var method = this.GetType().GetMethod("{{operationId}}"); + + return method != null + ? (await ((Task)method.Invoke(this, new object[] { req, context{{#allParams}}{{#isPathParam}}, {{/isPathParam}}{{/allParams}} })).ConfigureAwait(false)) + : new StatusCodeResult((int)HttpStatusCode.NotImplemented); + } + {{/operation}} + } +} + {{/operations}} + diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/git_push.sh.mustache new file mode 100644 index 000000000000..8b3f689c9121 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/git_push.sh.mustache @@ -0,0 +1,58 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="{{{gitUserId}}}" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="{{{gitRepoId}}}" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="{{{releaseNote}}}" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/gitignore.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/gitignore.mustache new file mode 100644 index 000000000000..1ee53850b84c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/gitignore.mustache @@ -0,0 +1,362 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/libraries/httpclient/ApiClient.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/libraries/httpclient/ApiClient.mustache new file mode 100644 index 000000000000..e9c39ea9f6d6 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/libraries/httpclient/ApiClient.mustache @@ -0,0 +1,739 @@ +{{>partial_header}} + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Formatters; +using System.Text; +using System.Threading; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +{{^netStandard}} +using System.Web; +{{/netStandard}} +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs; +{{#useWebRequest}} +using System.Net.Http; +{{/useWebRequest}} +using System.Net.Http; +using System.Net.Http.Headers; +{{#supportsRetry}} +using Polly; +{{/supportsRetry}} + +namespace {{packageName}}.Client +{ + /// + /// To Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON. + /// + internal class CustomJsonCodec + { + private readonly IReadableConfiguration _configuration; + private static readonly string _contentType = "application/json"; + private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + public CustomJsonCodec(IReadableConfiguration configuration) + { + _configuration = configuration; + } + + public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) + { + _serializerSettings = serializerSettings; + _configuration = configuration; + } + + /// + /// Serialize the object into a JSON string. + /// + /// Object to be serialized. + /// A JSON string. + public string Serialize(object obj) + { + if (obj != null && obj is {{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema) + { + // the object to be serialized is an oneOf/anyOf schema + return (({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema)obj).ToJson(); + } + else + { + return JsonConvert.SerializeObject(obj, _serializerSettings); + } + } + + public async Task Deserialize(HttpResponseMessage response) + { + var result = (T) await Deserialize(response, typeof(T)); + return result; + } + + /// + /// Deserialize the JSON string into a proper object. + /// + /// The HTTP response. + /// Object type. + /// Object representation of the JSON string. + internal async Task Deserialize(HttpResponseMessage response, Type type) + { + IList headers = response.Headers.Select(x => x.Key + "=" + x.Value).ToList(); + + if (type == typeof(byte[])) // return byte array + { + return await response.Content.ReadAsByteArrayAsync(); + } + + // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) + if (type == typeof(Stream)) + { + var bytes = await response.Content.ReadAsByteArrayAsync(); + if (headers != null) + { + var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) + ? Path.GetTempPath() + : _configuration.TempFolderPath; + var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); + foreach (var header in headers) + { + var match = regex.Match(header.ToString()); + if (match.Success) + { + string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); + File.WriteAllBytes(fileName, bytes); + return new FileStream(fileName, FileMode.Open); + } + } + } + var stream = new MemoryStream(bytes); + return stream; + } + + if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object + { + return DateTime.Parse(await response.Content.ReadAsStringAsync(), null, System.Globalization.DateTimeStyles.RoundtripKind); + } + + if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type + { + return Convert.ChangeType(await response.Content.ReadAsStringAsync(), type); + } + + // at this point, it must be a model (json) + try + { + return JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync(), type, _serializerSettings); + } + catch (Exception e) + { + throw new ApiException(500, e.Message); + } + } + + public string RootElement { get; set; } + public string Namespace { get; set; } + public string DateFormat { get; set; } + + public string ContentType + { + get { return _contentType; } + set { throw new InvalidOperationException("Not allowed to set content type."); } + } + } + /// + /// Provides a default implementation of an Api client (both synchronous and asynchronous implementatios), + /// encapsulating general REST accessor use cases. + /// + /// + /// The Dispose method will manage the HttpClient lifecycle when not passed by constructor. + /// + {{>visibility}} partial class ApiClient : IDisposable, ISynchronousClient{{#supportsAsync}}, IAsynchronousClient{{/supportsAsync}} + { + private readonly string _baseUrl; + + private readonly HttpClientHandler _httpClientHandler; + private readonly HttpClient _httpClient; + private readonly bool _disposeClient; + + /// + /// Specifies the settings on a object. + /// These settings can be adjusted to accomodate custom serialization rules. + /// + public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Initializes a new instance of the , defaulting to the global configurations' base url. + /// **IMPORTANT** This will also create an istance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHander. + /// + public ApiClient() : + this({{packageName}}.Client.GlobalConfiguration.Instance.BasePath) + { + } + + /// + /// Initializes a new instance of the . + /// **IMPORTANT** This will also create an istance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHander. + /// + /// The target service's base path in URL format. + /// + public ApiClient(string basePath) + { + if (string.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); + + _httpClientHandler = new HttpClientHandler(); + _httpClient = new HttpClient(_httpClientHandler, true); + _disposeClient = true; + _baseUrl = basePath; + } + + /// + /// Initializes a new instance of the , defaulting to the global configurations' base url. + /// + /// An instance of HttpClient. + /// An optional instance of HttpClientHandler that is used by HttpClient. + /// + /// + /// Some configuration settings will not be applied without passing an HttpClientHandler. + /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. + /// + public ApiClient(HttpClient client, HttpClientHandler handler = null) : + this(client, {{packageName}}.Client.GlobalConfiguration.Instance.BasePath, handler) + { + } + + /// + /// Initializes a new instance of the . + /// + /// An instance of HttpClient. + /// The target service's base path in URL format. + /// An optional instance of HttpClientHandler that is used by HttpClient. + /// + /// + /// + /// Some configuration settings will not be applied without passing an HttpClientHandler. + /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. + /// + public ApiClient(HttpClient client, string basePath, HttpClientHandler handler = null) + { + if (client == null) throw new ArgumentNullException("client cannot be null"); + if (string.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); + + _httpClientHandler = handler; + _httpClient = client; + _baseUrl = basePath; + } + + /// + /// Disposes resources if they were created by us + /// + public void Dispose() + { + if(_disposeClient) { + _httpClient.Dispose(); + } + } + + /// Prepares multipart/form-data content + {{! TODO: Add handling of improper usage }} + HttpContent PrepareMultipartFormDataContent(RequestOptions options) + { + string boundary = "---------" + Guid.NewGuid().ToString().ToUpperInvariant(); + var multipartContent = new MultipartFormDataContent(boundary); + foreach (var formParameter in options.FormParameters) + { + multipartContent.Add(new StringContent(formParameter.Value), formParameter.Key); + } + + if (options.FileParameters != null && options.FileParameters.Count > 0) + { + foreach (var fileParam in options.FileParameters) + { + var content = new StreamContent(fileParam.Value.Content); + content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream"); + multipartContent.Add(content, fileParam.Key, + fileParam.Value.Name); + } + } + return multipartContent; + } + + /// + /// Provides all logic for constructing a new HttpRequestMessage. + /// At this point, all information for querying the service is known. Here, it is simply + /// mapped into the a HttpRequestMessage. + /// + /// The http verb. + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// [private] A new HttpRequestMessage instance. + /// + private HttpRequestMessage NewRequest( + HttpMethod method, + string path, + RequestOptions options, + IReadableConfiguration configuration) + { + if (path == null) throw new ArgumentNullException("path"); + if (options == null) throw new ArgumentNullException("options"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + WebRequestPathBuilder builder = new WebRequestPathBuilder(_baseUrl, path); + + builder.AddPathParameters(options.PathParameters); + + builder.AddQueryParameters(options.QueryParameters); + + HttpRequestMessage request = new HttpRequestMessage(method, builder.GetFullUri()); + + if (configuration.UserAgent != null) + { + request.Headers.TryAddWithoutValidation("User-Agent", configuration.UserAgent); + } + + if (configuration.DefaultHeaders != null) + { + foreach (var headerParam in configuration.DefaultHeaders) + { + request.Headers.Add(headerParam.Key, headerParam.Value); + } + } + + if (options.HeaderParameters != null) + { + foreach (var headerParam in options.HeaderParameters) + { + foreach (var value in headerParam.Value) + { + // Todo make content headers actually content headers + request.Headers.TryAddWithoutValidation(headerParam.Key, value); + } + } + } + + List> contentList = new List>(); + + string contentType = null; + if (options.HeaderParameters != null && options.HeaderParameters.ContainsKey("Content-Type")) + { + var contentTypes = options.HeaderParameters["Content-Type"]; + contentType = contentTypes.FirstOrDefault(); + } + + {{!// TODO Add error handling in case of improper usage}} + if (contentType == "multipart/form-data") + { + request.Content = PrepareMultipartFormDataContent(options); + } + else if (contentType == "application/x-www-form-urlencoded") + { + request.Content = new FormUrlEncodedContent(options.FormParameters); + } + else + { + if (options.Data != null) + { + if (options.Data is FileParameter fp) + { + contentType = contentType ?? "application/octet-stream"; + + var streamContent = new StreamContent(fp.Content); + streamContent.Headers.ContentType = new MediaTypeHeaderValue(contentType); + request.Content = streamContent; + } + else + { + var serializer = new CustomJsonCodec(SerializerSettings, configuration); + request.Content = new StringContent(serializer.Serialize(options.Data), new UTF8Encoding(), + "application/json"); + } + } + } + + + + // TODO provide an alternative that allows cookies per request instead of per API client + if (options.Cookies != null && options.Cookies.Count > 0) + { + request.Properties["CookieContainer"] = options.Cookies; + } + + return request; + } + + partial void InterceptRequest(HttpRequestMessage req); + partial void InterceptResponse(HttpRequestMessage req, HttpResponseMessage response); + + private async Task> ToApiResponse(HttpResponseMessage response, object responseData, Uri uri) + { + T result = (T) responseData; + string rawContent = await response.Content.ReadAsStringAsync(); + + var transformed = new ApiResponse(response.StatusCode, new Multimap({{#caseInsensitiveResponseHeaders}}StringComparer.OrdinalIgnoreCase{{/caseInsensitiveResponseHeaders}}), result, rawContent) + { + ErrorText = response.ReasonPhrase, + Cookies = new List() + }; + + // process response headers, e.g. Access-Control-Allow-Methods + if (response.Headers != null) + { + foreach (var responseHeader in response.Headers) + { + transformed.Headers.Add(responseHeader.Key, ClientUtils.ParameterToString(responseHeader.Value)); + } + } + + // process response content headers, e.g. Content-Type + if (response.Content.Headers != null) + { + foreach (var responseHeader in response.Content.Headers) + { + transformed.Headers.Add(responseHeader.Key, ClientUtils.ParameterToString(responseHeader.Value)); + } + } + + if (_httpClientHandler != null && response != null) + { + try { + foreach (Cookie cookie in _httpClientHandler.CookieContainer.GetCookies(uri)) + { + transformed.Cookies.Add(cookie); + } + } + catch (PlatformNotSupportedException) {} + } + + return transformed; + } + + private ApiResponse Exec(HttpRequestMessage req, IReadableConfiguration configuration) + { + return ExecAsync(req, configuration).GetAwaiter().GetResult(); + } + + private async Task> ExecAsync(HttpRequestMessage req, + IReadableConfiguration configuration, + System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var deserializer = new CustomJsonCodec(SerializerSettings, configuration); + + var finalToken = cancellationToken; + + if (configuration.Timeout > 0) + { + var tokenSource = new CancellationTokenSource(configuration.Timeout); + finalToken = CancellationTokenSource.CreateLinkedTokenSource(finalToken, tokenSource.Token).Token; + } + + if (configuration.Proxy != null) + { + if(_httpClientHandler == null) throw new InvalidOperationException("Configuration `Proxy` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); + _httpClientHandler.Proxy = configuration.Proxy; + } + + if (configuration.ClientCertificates != null) + { + if(_httpClientHandler == null) throw new InvalidOperationException("Configuration `ClientCertificates` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); + _httpClientHandler.ClientCertificates.AddRange(configuration.ClientCertificates); + } + + var cookieContainer = req.Properties.ContainsKey("CookieContainer") ? req.Properties["CookieContainer"] as List : null; + + if (cookieContainer != null) + { + if(_httpClientHandler == null) throw new InvalidOperationException("Request property `CookieContainer` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); + foreach (var cookie in cookieContainer) + { + _httpClientHandler.CookieContainer.Add(cookie); + } + } + + InterceptRequest(req); + + HttpResponseMessage response; +{{#supportsRetry}} + if (RetryConfiguration.AsyncRetryPolicy != null) + { + var policy = RetryConfiguration.AsyncRetryPolicy; + var policyResult = await policy + .ExecuteAndCaptureAsync(() => _httpClient.SendAsync(req, cancellationToken)) + .ConfigureAwait(false); + response = (policyResult.Outcome == OutcomeType.Successful) ? + policyResult.Result : new HttpResponseMessage() + { + ReasonPhrase = policyResult.FinalException.ToString(), + RequestMessage = req + }; + } + else + { +{{/supportsRetry}} + response = await _httpClient.SendAsync(req, cancellationToken).ConfigureAwait(false); +{{#supportsRetry}} + } +{{/supportsRetry}} + + if (!response.IsSuccessStatusCode) + { + return await ToApiResponse(response, default(T), req.RequestUri); + } + + object responseData = await deserializer.Deserialize(response); + + // if the response type is oneOf/anyOf, call FromJSON to deserialize the data + if (typeof({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + { + responseData = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + } + else if (typeof(T).Name == "Stream") // for binary response + { + responseData = (T) (object) await response.Content.ReadAsStreamAsync(); + } + + InterceptResponse(req, response); + + return await ToApiResponse(response, responseData, req.RequestUri); + } + + {{#supportsAsync}} + #region IAsynchronousClient + /// + /// Make a HTTP GET request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP POST request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP PUT request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP DELETE request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP HEAD request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP OPTION request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP PATCH request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(new HttpMethod("PATCH"), path, options, config), config, cancellationToken); + } + #endregion IAsynchronousClient + {{/supportsAsync}} + + #region ISynchronousClient + /// + /// Make a HTTP GET request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Get, path, options, config), config); + } + + /// + /// Make a HTTP POST request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Post, path, options, config), config); + } + + /// + /// Make a HTTP PUT request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Put, path, options, config), config); + } + + /// + /// Make a HTTP DELETE request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Delete, path, options, config), config); + } + + /// + /// Make a HTTP HEAD request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Head, path, options, config), config); + } + + /// + /// Make a HTTP OPTION request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Options, path, options, config), config); + } + + /// + /// Make a HTTP PATCH request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(new HttpMethod("PATCH"), path, options, config), config); + } + #endregion ISynchronousClient + } +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/libraries/httpclient/FileParameter.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/libraries/httpclient/FileParameter.mustache new file mode 100644 index 000000000000..3fa243ed54fc --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/libraries/httpclient/FileParameter.mustache @@ -0,0 +1,54 @@ +{{>partial_header}} + +using System.IO; + +namespace {{packageName}}.Client +{ + + /// + /// Represents a File passed to the API as a Parameter, allows using different backends for files + /// + public class FileParameter + { + /// + /// The filename + /// + public string Name { get; set; } = "no_name_provided"; + + /// + /// The content of the file + /// + public Stream Content { get; set; } + + /// + /// Construct a FileParameter just from the contents, will extract the filename from a filestream + /// + /// The file content + public FileParameter(Stream content) + { + if (content is FileStream fs) + { + Name = fs.Name; + } + Content = content; + } + + /// + /// Construct a FileParameter from name and content + /// + /// The filename + /// The file content + public FileParameter(string filename, Stream content) + { + Name = filename; + Content = content; + } + + /// + /// Implicit conversion of stream to file parameter. Useful for backwards compatibility. + /// + /// Stream to convert + /// FileParameter + public static implicit operator FileParameter(Stream s) => new FileParameter(s); + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/libraries/httpclient/RequestOptions.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/libraries/httpclient/RequestOptions.mustache new file mode 100644 index 000000000000..bc5a8e348b8f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/libraries/httpclient/RequestOptions.mustache @@ -0,0 +1,66 @@ +{{>partial_header}} + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; + +namespace {{packageName}}.Client +{ + /// + /// A container for generalized request inputs. This type allows consumers to extend the request functionality + /// by abstracting away from the default (built-in) request framework (e.g. RestSharp). + /// + public class RequestOptions + { + /// + /// Parameters to be bound to path parts of the Request's URL + /// + public Dictionary PathParameters { get; set; } + + /// + /// Query parameters to be applied to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap QueryParameters { get; set; } + + /// + /// Header parameters to be applied to to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap HeaderParameters { get; set; } + + /// + /// Form parameters to be sent along with the request. + /// + public Dictionary FormParameters { get; set; } + + /// + /// File parameters to be sent along with the request. + /// + public Dictionary FileParameters { get; set; } + + /// + /// Cookies to be sent along with the request. + /// + public List Cookies { get; set; } + + /// + /// Any data associated with a request body. + /// + public Object Data { get; set; } + + /// + /// Constructs a new instance of + /// + public RequestOptions() + { + PathParameters = new Dictionary(); + QueryParameters = new Multimap(); + HeaderParameters = new Multimap(); + FormParameters = new Dictionary(); + FileParameters = new Dictionary(); + Cookies = new List(); + } + } +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/libraries/httpclient/api.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/libraries/httpclient/api.mustache new file mode 100644 index 000000000000..20ddfe96b989 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/libraries/httpclient/api.mustache @@ -0,0 +1,724 @@ +{{>partial_header}} + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Net.Mime; +using {{packageName}}.Client; +{{#hasImport}}using {{packageName}}.{{modelPackage}}; +{{/hasImport}} + +namespace {{packageName}}.{{apiPackage}} +{ + {{#operations}} + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} interface {{interfacePrefix}}{{classname}}Sync : IApiAccessor + { + #region Synchronous Operations + {{#operation}} + /// + /// {{summary}} + /// + {{#notes}} + /// + /// {{notes}} + /// + {{/notes}} + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}}/// {{#returnType}}{{returnType}}{{/returnType}} + {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); + + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}}/// ApiResponse of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Object(void){{/returnType}} + ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); + {{/operation}} + #endregion Synchronous Operations + } + + {{#supportsAsync}} + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} interface {{interfacePrefix}}{{classname}}Async : IApiAccessor + { + #region Asynchronous Operations + {{#operation}} + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// Task of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}void{{/returnType}} + {{#returnType}}System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// Task of ApiResponse{{#returnType}} ({{returnType}}){{/returnType}} + System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + {{/operation}} + #endregion Asynchronous Operations + } + {{/supportsAsync}} + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} interface {{interfacePrefix}}{{classname}} : {{interfacePrefix}}{{classname}}Sync{{#supportsAsync}}, {{interfacePrefix}}{{classname}}Async{{/supportsAsync}} + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} partial class {{classname}} : IDisposable, {{interfacePrefix}}{{classname}} + { + private {{packageName}}.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// **IMPORTANT** This will also create an istance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHander. + /// + /// + public {{classname}}() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// **IMPORTANT** This will also create an istance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHander. + /// + /// The target service's base path in URL format. + /// + /// + public {{classname}}(string basePath) + { + this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( + {{packageName}}.Client.GlobalConfiguration.Instance, + new {{packageName}}.Client.Configuration { BasePath = basePath } + ); + this.ApiClient = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); + this.Client = this.ApiClient; + {{#supportsAsync}} + this.AsynchronousClient = this.ApiClient; + {{/supportsAsync}} + this.ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class using Configuration object. + /// **IMPORTANT** This will also create an istance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHander. + /// + /// An instance of Configuration. + /// + /// + public {{classname}}({{packageName}}.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( + {{packageName}}.Client.GlobalConfiguration.Instance, + configuration + ); + this.ApiClient = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); + this.Client = this.ApiClient; + {{#supportsAsync}} + this.AsynchronousClient = this.ApiClient; + {{/supportsAsync}} + ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class. + /// + /// An instance of HttpClient. + /// An optional instance of HttpClientHandler that is used by HttpClient. + /// + /// + /// + /// Some configuration settings will not be applied without passing an HttpClientHandler. + /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. + /// + public {{classname}}(HttpClient client, HttpClientHandler handler = null) : this(client, (string)null, handler) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// An instance of HttpClient. + /// The target service's base path in URL format. + /// An optional instance of HttpClientHandler that is used by HttpClient. + /// + /// + /// + /// + /// Some configuration settings will not be applied without passing an HttpClientHandler. + /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. + /// + public {{classname}}(HttpClient client, string basePath, HttpClientHandler handler = null) + { + if (client == null) throw new ArgumentNullException("client"); + + this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( + {{packageName}}.Client.GlobalConfiguration.Instance, + new {{packageName}}.Client.Configuration { BasePath = basePath } + ); + this.ApiClient = new {{packageName}}.Client.ApiClient(client, this.Configuration.BasePath, handler); + this.Client = this.ApiClient; + {{#supportsAsync}} + this.AsynchronousClient = this.ApiClient; + {{/supportsAsync}} + this.ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class using Configuration object. + /// + /// An instance of HttpClient. + /// An instance of Configuration. + /// An optional instance of HttpClientHandler that is used by HttpClient. + /// + /// + /// + /// Some configuration settings will not be applied without passing an HttpClientHandler. + /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. + /// + public {{classname}}(HttpClient client, {{packageName}}.Client.Configuration configuration, HttpClientHandler handler = null) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + if (client == null) throw new ArgumentNullException("client"); + + this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( + {{packageName}}.Client.GlobalConfiguration.Instance, + configuration + ); + this.ApiClient = new {{packageName}}.Client.ApiClient(client, this.Configuration.BasePath, handler); + this.Client = this.ApiClient; + {{#supportsAsync}} + this.AsynchronousClient = this.ApiClient; + {{/supportsAsync}} + ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using a Configuration object and client instance. + /// + /// The client interface for synchronous API access.{{#supportsAsync}} + /// The client interface for asynchronous API access.{{/supportsAsync}} + /// The configuration object. + /// + public {{classname}}({{packageName}}.Client.ISynchronousClient client, {{#supportsAsync}}{{packageName}}.Client.IAsynchronousClient asyncClient, {{/supportsAsync}}{{packageName}}.Client.IReadableConfiguration configuration) + { + if (client == null) throw new ArgumentNullException("client"); + {{#supportsAsync}} + if (asyncClient == null) throw new ArgumentNullException("asyncClient"); + {{/supportsAsync}} + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Client = client; + {{#supportsAsync}} + this.AsynchronousClient = asyncClient; + {{/supportsAsync}} + this.Configuration = configuration; + this.ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Disposes resources if they were created by us + /// + public void Dispose() + { + this.ApiClient?.Dispose(); + } + + /// + /// Holds the ApiClient if created + /// + public {{packageName}}.Client.ApiClient ApiClient { get; set; } = null; + + {{#supportsAsync}} + /// + /// The client for accessing this underlying API asynchronously. + /// + public {{packageName}}.Client.IAsynchronousClient AsynchronousClient { get; set; } + {{/supportsAsync}} + + /// + /// The client for accessing this underlying API synchronously. + /// + public {{packageName}}.Client.ISynchronousClient Client { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public {{packageName}}.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public {{packageName}}.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + {{#operation}} + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}}/// {{#returnType}}{{returnType}}{{/returnType}} + public {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + { + {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + return localVarResponse.Data;{{/returnType}}{{^returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/returnType}} + } + + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}}/// ApiResponse of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Object(void){{/returnType}} + public {{packageName}}.Client.ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + { + {{#allParams}} + {{#required}} + {{^vendorExtensions.x-csharp-value-type}} + // verify the required parameter '{{paramName}}' is set + if ({{paramName}} == null) + throw new {{packageName}}.Client.ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); + + {{/vendorExtensions.x-csharp-value-type}} + {{/required}} + {{/allParams}} + {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + {{#consumes}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/consumes}} + }; + + // to determine the Accept header + string[] _accepts = new string[] { + {{#produces}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/produces}} + }; + + var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + {{#pathParams}} + {{#required}} + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + } + {{/required}} + {{/pathParams}} + {{#queryParams}} + {{#required}} + {{#isDeepObject}} + {{#items.vars}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); + {{/items.vars}} + {{^items}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); + {{/items}} + {{/isDeepObject}} + {{^isDeepObject}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/isDeepObject}} + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + {{#isDeepObject}} + {{#items.vars}} + if ({{paramName}}.{{name}} != null) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); + } + {{/items.vars}} + {{^items}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); + {{/items}} + {{/isDeepObject}} + {{^isDeepObject}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/isDeepObject}} + } + {{/required}} + {{/queryParams}} + {{#headerParams}} + {{#required}} + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + } + {{/required}} + {{/headerParams}} + {{#formParams}} + {{#required}} + {{#isFile}} + localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + {{/isFile}} + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + {{#isFile}} + localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + {{/isFile}} + } + {{/required}} + {{/formParams}} + {{#bodyParam}} + localVarRequestOptions.Data = {{paramName}}; + {{/bodyParam}} + + {{#authMethods}} + // authentication ({{name}}) required + {{#isApiKey}} + {{#isKeyInCookie}} + // cookie parameter support + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.Cookies.Add(new Cookie("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInCookie}} + {{#isKeyInHeader}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.HeaderParameters.Add("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}")); + } + {{/isKeyInHeader}} + {{#isKeyInQuery}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("", "{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInQuery}} + {{/isApiKey}} + {{#isBasicBasic}} + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + {{packageName}}.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + {{/isBasicBasic}} + {{#isBasicBearer}} + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isBasicBearer}} + {{#isOAuth}} + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isOAuth}} + {{#isHttpSignature}} + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "{{{httpMethod}}}", "{{{path}}}", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + {{/isHttpSignature}} + {{/authMethods}} + + // make the HTTP request + var localVarResponse = this.Client.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("{{operationId}}", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + {{#supportsAsync}} + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// Task of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}void{{/returnType}} + {{#returnType}}public async System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false); + return localVarResponse.Data;{{/returnType}}{{^returnType}}await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false);{{/returnType}} + } + + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// Task of ApiResponse{{#returnType}} ({{returnType}}){{/returnType}} + public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + {{#allParams}} + {{#required}} + {{^vendorExtensions.x-csharp-value-type}} + // verify the required parameter '{{paramName}}' is set + if ({{paramName}} == null) + throw new {{packageName}}.Client.ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); + + {{/vendorExtensions.x-csharp-value-type}} + {{/required}} + {{/allParams}} + + {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + {{#consumes}} + "{{{mediaType}}}"{{^-last}}, {{/-last}} + {{/consumes}} + }; + + // to determine the Accept header + string[] _accepts = new string[] { + {{#produces}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/produces}} + }; + + + var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + {{#pathParams}} + {{#required}} + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + } + {{/required}} + {{/pathParams}} + {{#queryParams}} + {{#required}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + } + {{/required}} + {{/queryParams}} + {{#headerParams}} + {{#required}} + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + } + {{/required}} + {{/headerParams}} + {{#formParams}} + {{#required}} + {{#isFile}} + localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + {{/isFile}} + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + {{#isFile}} + localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + {{/isFile}} + } + {{/required}} + {{/formParams}} + {{#bodyParam}} + localVarRequestOptions.Data = {{paramName}}; + {{/bodyParam}} + + {{#authMethods}} + // authentication ({{name}}) required + {{#isApiKey}} + {{#isKeyInCookie}} + // cookie parameter support + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.Cookies.Add(new Cookie("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInCookie}} + {{#isKeyInHeader}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.HeaderParameters.Add("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}")); + } + {{/isKeyInHeader}} + {{#isKeyInQuery}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("", "{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInQuery}} + {{/isApiKey}} + {{#isBasic}} + {{#isBasicBasic}} + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + {{packageName}}.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + {{/isBasicBasic}} + {{#isBasicBearer}} + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isBasicBearer}} + {{/isBasic}} + {{#isOAuth}} + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isOAuth}} + {{#isHttpSignature}} + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "{{{httpMethod}}}", "{{{path}}}", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + {{/isHttpSignature}} + {{/authMethods}} + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}Async<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("{{operationId}}", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + {{/supportsAsync}} + {{/operation}} + } + {{/operations}} +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/libraries/httpclient/model.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/libraries/httpclient/model.mustache new file mode 100644 index 000000000000..0de1e05e5140 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/libraries/httpclient/model.mustache @@ -0,0 +1,48 @@ +{{>partial_header}} + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +{{#models}} +{{#model}} +{{#discriminator}} +using JsonSubTypes; +{{/discriminator}} +{{/model}} +{{/models}} +{{#validatable}} +using System.ComponentModel.DataAnnotations; +{{/validatable}} +using FileParameter = {{packageName}}.Client.FileParameter; +using OpenAPIDateConverter = {{packageName}}.Client.OpenAPIDateConverter; +{{#useCompareNetObjects}} +using OpenAPIClientUtils = {{packageName}}.Client.ClientUtils; +{{/useCompareNetObjects}} +{{#models}} +{{#model}} +{{#oneOf}} +{{#-first}} +using System.Reflection; +{{/-first}} +{{/oneOf}} +{{#aneOf}} +{{#-first}} +using System.Reflection; +{{/-first}} +{{/aneOf}} + +namespace {{packageName}}.{{modelPackage}} +{ +{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#oneOf}}{{#-first}}{{>modelOneOf}}{{/-first}}{{/oneOf}}{{#anyOf}}{{#-first}}{{>modelAnyOf}}{{/-first}}{{/anyOf}}{{^oneOf}}{{^anyOf}}{{>modelGeneric}}{{/anyOf}}{{/oneOf}}{{/isEnum}} +{{/model}} +{{/models}} +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/model.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/model.mustache new file mode 100644 index 000000000000..339a6d2f76b7 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/model.mustache @@ -0,0 +1,47 @@ +{{>partial_header}} + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +{{#models}} +{{#model}} +{{#discriminator}} +using JsonSubTypes; +{{/discriminator}} +{{/model}} +{{/models}} +{{#validatable}} +using System.ComponentModel.DataAnnotations; +{{/validatable}} +using OpenAPIDateConverter = {{packageName}}.Client.OpenAPIDateConverter; +{{#useCompareNetObjects}} +using OpenAPIClientUtils = {{packageName}}.Client.ClientUtils; +{{/useCompareNetObjects}} +{{#models}} +{{#model}} +{{#oneOf}} +{{#-first}} +using System.Reflection; +{{/-first}} +{{/oneOf}} +{{#aneOf}} +{{#-first}} +using System.Reflection; +{{/-first}} +{{/aneOf}} + +namespace {{packageName}}.{{modelPackage}} +{ +{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#oneOf}}{{#-first}}{{>modelOneOf}}{{/-first}}{{/oneOf}}{{#anyOf}}{{#-first}}{{>modelAnyOf}}{{/-first}}{{/anyOf}}{{^oneOf}}{{^anyOf}}{{>modelGeneric}}{{/anyOf}}{{/oneOf}}{{/isEnum}} +{{/model}} +{{/models}} +} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/modelAnyOf.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/modelAnyOf.mustache new file mode 100644 index 000000000000..931f7646da8a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/modelAnyOf.mustache @@ -0,0 +1,227 @@ + /// + /// {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} + /// + [JsonConverter(typeof({{classname}}JsonConverter))] + [DataContract(Name = "{{{name}}}")] + {{>visibility}} partial class {{classname}} : AbstractOpenAPISchema, {{#parent}}{{{parent}}}, {{/parent}}IEquatable<{{classname}}>{{#validatable}}, IValidatableObject{{/validatable}} + { + {{#isNullable}} + /// + /// Initializes a new instance of the class. + /// + public {{classname}}() + { + this.IsNullable = true; + this.SchemaType= "anyOf"; + } + + {{/isNullable}} + {{#anyOf}} + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of {{{.}}}. + public {{classname}}({{{.}}} actualInstance) + { + this.IsNullable = {{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}; + this.SchemaType= "anyOf"; + this.ActualInstance = actualInstance{{^isNullable}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isNullable}}; + } + + {{/anyOf}} + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + {{#anyOf}} + {{^-first}}else {{/-first}}if (value.GetType() == typeof({{{.}}})) + { + this._actualInstance = value; + } + {{/anyOf}} + else + { + throw new ArgumentException("Invalid instance found. Must be the following types:{{#anyOf}} {{{.}}}{{^-last}},{{/-last}}{{/anyOf}}"); + } + } + } + {{#anyOf}} + + /// + /// Get the actual instance of `{{{.}}}`. If the actual instanct is not `{{{.}}}`, + /// the InvalidClassException will be thrown + /// + /// An instance of {{{.}}} + public {{{.}}} Get{{{.}}}() + { + return ({{{.}}})this.ActualInstance; + } + {{/anyOf}} + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class {{classname}} {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, {{classname}}.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of {{classname}} + /// + /// JSON string + /// An instance of {{classname}} + public static {{classname}} FromJson(string jsonString) + { + {{classname}} new{{classname}} = null; + + if (jsonString == null) + { + return new{{classname}}; + } + {{#anyOf}} + + try + { + new{{classname}} = new {{classname}}(JsonConvert.DeserializeObject<{{{.}}}>(jsonString, {{classname}}.SerializerSettings)); + // deserialization is considered successful at this point if no exception has been thrown. + return new{{classname}}; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into {{{.}}}: {1}", jsonString, exception.ToString())); + } + {{/anyOf}} + + // no match found, throw an exception + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + {{#useCompareNetObjects}} + return OpenAPIClientUtils.compareLogic.Compare(this, input as {{classname}}).AreEqual; + {{/useCompareNetObjects}} + {{^useCompareNetObjects}} + return this.Equals(input as {{classname}}); + {{/useCompareNetObjects}} + } + + /// + /// Returns true if {{classname}} instances are equal + /// + /// Instance of {{classname}} to be compared + /// Boolean + public bool Equals({{classname}} input) + { + {{#useCompareNetObjects}} + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + {{/useCompareNetObjects}} + {{^useCompareNetObjects}} + if (input == null) + return false; + + return this.ActualInstance.Equals(input.ActualInstance); + {{/useCompareNetObjects}} + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for {{classname}} + /// + public class {{classname}}JsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof({{classname}}).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return {{classname}}.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/modelEnum.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/modelEnum.mustache new file mode 100644 index 000000000000..39bcd2eddc1f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/modelEnum.mustache @@ -0,0 +1,30 @@ + /// + /// {{^description}}Defines {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// + {{#description}} + /// {{description}} + {{/description}} + {{#allowableValues}} + {{#enumVars}} + {{#-first}} + {{#isString}} + [JsonConverter(typeof(StringEnumConverter))] + {{/isString}} + {{/-first}} + {{/enumVars}} + {{/allowableValues}} + {{>visibility}} enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#vendorExtensions.x-enum-byte}}: byte{{/vendorExtensions.x-enum-byte}} + { + {{#allowableValues}} + {{#enumVars}} + /// + /// Enum {{name}} for value: {{{value}}} + /// + {{#isString}} + [EnumMember(Value = "{{{value}}}")] + {{/isString}} + {{name}}{{^isString}} = {{{value}}}{{/isString}}{{#isString}} = {{-index}}{{/isString}}{{^-last}},{{/-last}} + + {{/enumVars}} + {{/allowableValues}} + }{{! NOTE: This model's enumVars is modified to look like CodegenProperty}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/modelGeneric.mustache new file mode 100644 index 000000000000..6eb1a2359d03 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/modelGeneric.mustache @@ -0,0 +1,456 @@ + /// + /// {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} + /// + [DataContract(Name = "{{{name}}}")] + {{#discriminator}} + [JsonConverter(typeof(JsonSubtypes), "{{{discriminatorName}}}")] + {{#mappedModels}} + [JsonSubtypes.KnownSubType(typeof({{{modelName}}}), "{{^vendorExtensions.x-discriminator-value}}{{{mappingName}}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{.}}}{{/vendorExtensions.x-discriminator-value}}")] + {{/mappedModels}} + {{/discriminator}} + {{>visibility}} partial class {{classname}} : {{#parent}}{{{parent}}}, {{/parent}}IEquatable<{{classname}}>{{#validatable}}, IValidatableObject{{/validatable}} + { + {{#vars}} + {{#items.isEnum}} + {{#items}} + {{^complexType}} +{{>modelInnerEnum}} + {{/complexType}} + {{/items}} + {{/items.isEnum}} + {{#isEnum}} + {{^complexType}} +{{>modelInnerEnum}} + {{/complexType}} + {{/isEnum}} + {{#isEnum}} + + /// + /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// + {{#description}} + /// {{description}} + {{/description}} + {{^conditionalSerialization}} + [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/vendorExtensions.x-emit-default-value}})] + public {{#complexType}}{{{complexType}}}{{/complexType}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} { get; set; } + {{#isReadOnly}} + + /// + /// Returns false as {{name}} should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerialize{{name}}() + { + return false; + } + {{/isReadOnly}} + {{/conditionalSerialization}} + {{#conditionalSerialization}} + {{#isReadOnly}} + [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/vendorExtensions.x-emit-default-value}})] + public {{#complexType}}{{{complexType}}}{{/complexType}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} { get; set; } + + + /// + /// Returns false as {{name}} should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerialize{{name}}() + { + return false; + } + {{/isReadOnly}} + + {{^isReadOnly}} + [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/vendorExtensions.x-emit-default-value}})] + public {{#complexType}}{{{complexType}}}{{/complexType}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} + { + get{ return _{{name}};} + set + { + _{{name}} = value; + _flag{{name}} = true; + } + } + private {{#complexType}}{{{complexType}}}{{/complexType}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} _{{name}}; + private bool _flag{{name}}; + + /// + /// Returns false as {{name}} should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerialize{{name}}() + { + return _flag{{name}}; + } + {{/isReadOnly}} + {{/conditionalSerialization}} + {{/isEnum}} + {{/vars}} + {{#hasRequired}} + {{^hasOnlyReadOnly}} + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + {{^isAdditionalPropertiesTrue}} + protected {{classname}}() { } + {{/isAdditionalPropertiesTrue}} + {{#isAdditionalPropertiesTrue}} + protected {{classname}}() + { + this.AdditionalProperties = new Dictionary(); + } + {{/isAdditionalPropertiesTrue}} + {{/hasOnlyReadOnly}} + {{/hasRequired}} + /// + /// Initializes a new instance of the class. + /// + {{#readWriteVars}} + /// {{#description}}{{description}}{{/description}}{{^description}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{defaultValue}}){{/defaultValue}}. + {{/readWriteVars}} + {{#hasOnlyReadOnly}} + [JsonConstructorAttribute] + {{/hasOnlyReadOnly}} + public {{classname}}({{#readWriteVars}}{{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}} {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = {{#defaultValue}}{{^isDateTime}}{{{defaultValue}}}{{/isDateTime}}{{#isDateTime}}default({{{datatypeWithEnum}}}){{/isDateTime}}{{/defaultValue}}{{^defaultValue}}default({{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}}){{/defaultValue}}{{^-last}}, {{/-last}}{{/readWriteVars}}){{#parent}} : base({{#parentVars}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{^-last}}, {{/-last}}{{/parentVars}}){{/parent}} + { + {{#vars}} + {{^isInherited}} + {{^isReadOnly}} + {{#required}} + {{^conditionalSerialization}} + {{^vendorExtensions.x-csharp-value-type}} + // to ensure "{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}" is required (not null) + this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} ?? throw new ArgumentNullException("{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} is a required property for {{classname}} and cannot be null"); + {{/vendorExtensions.x-csharp-value-type}} + {{#vendorExtensions.x-csharp-value-type}} + this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + {{/vendorExtensions.x-csharp-value-type}} + {{/conditionalSerialization}} + {{#conditionalSerialization}} + {{^vendorExtensions.x-csharp-value-type}} + // to ensure "{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}" is required (not null) + this._{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} ?? throw new ArgumentNullException("{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} is a required property for {{classname}} and cannot be null"); + {{/vendorExtensions.x-csharp-value-type}} + {{#vendorExtensions.x-csharp-value-type}} + this._{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + {{/vendorExtensions.x-csharp-value-type}} + {{/conditionalSerialization}} + {{/required}} + {{/isReadOnly}} + {{/isInherited}} + {{/vars}} + {{#vars}} + {{^isInherited}} + {{^isReadOnly}} + {{^required}} + {{#defaultValue}} + {{^vendorExtensions.x-csharp-value-type}} + // use default value if no "{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}" provided + this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} ?? {{{defaultValue}}}; + {{/vendorExtensions.x-csharp-value-type}} + {{#vendorExtensions.x-csharp-value-type}} + this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + {{/vendorExtensions.x-csharp-value-type}} + {{/defaultValue}} + {{^defaultValue}} + {{^conditionalSerialization}} + this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + {{/conditionalSerialization}} + {{#conditionalSerialization}} + this._{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + {{/conditionalSerialization}} + {{/defaultValue}} + {{/required}} + {{/isReadOnly}} + {{/isInherited}} + {{/vars}} + {{#isAdditionalPropertiesTrue}} + this.AdditionalProperties = new Dictionary(); + {{/isAdditionalPropertiesTrue}} + } + + {{#vars}} + {{^isInherited}} + {{^isEnum}} + /// + /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// {{#description}} + /// {{description}}{{/description}} + {{^conditionalSerialization}} + [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/vendorExtensions.x-emit-default-value}})] + {{#isDate}} + [JsonConverter(typeof(OpenAPIDateConverter))] + {{/isDate}} + public {{{dataType}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; } + + {{#isReadOnly}} + /// + /// Returns false as {{name}} should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerialize{{name}}() + { + return false; + } + {{/isReadOnly}} + {{/conditionalSerialization}} + {{#conditionalSerialization}} + {{#isReadOnly}} + [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/vendorExtensions.x-emit-default-value}})] + {{#isDate}} + [JsonConverter(typeof(OpenAPIDateConverter))] + {{/isDate}} + public {{{dataType}}} {{name}} { get; private set; } + + /// + /// Returns false as {{name}} should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerialize{{name}}() + { + return false; + } + {{/isReadOnly}} + {{^isReadOnly}} + {{#isDate}} + [JsonConverter(typeof(OpenAPIDateConverter))] + {{/isDate}} + [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/vendorExtensions.x-emit-default-value}})] + public {{{dataType}}} {{name}} + { + get{ return _{{name}};} + set + { + _{{name}} = value; + _flag{{name}} = true; + } + } + private {{{dataType}}} _{{name}}; + private bool _flag{{name}}; + + /// + /// Returns false as {{name}} should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerialize{{name}}() + { + return _flag{{name}}; + } + {{/isReadOnly}} + {{/conditionalSerialization}} + {{/isEnum}} + {{/isInherited}} + {{/vars}} + {{#isAdditionalPropertiesTrue}} + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + {{/isAdditionalPropertiesTrue}} + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class {{classname}} {\n"); + {{#parent}} + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + {{/parent}} + {{#vars}} + sb.Append(" {{name}}: ").Append({{name}}).Append("\n"); + {{/vars}} + {{#isAdditionalPropertiesTrue}} + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + {{/isAdditionalPropertiesTrue}} + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public {{#parent}}{{^isArray}}{{^isMap}}override {{/isMap}}{{/isArray}}{{/parent}}{{^parent}}virtual {{/parent}}string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + {{#useCompareNetObjects}} + return OpenAPIClientUtils.compareLogic.Compare(this, input as {{classname}}).AreEqual; + {{/useCompareNetObjects}} + {{^useCompareNetObjects}} + return this.Equals(input as {{classname}}); + {{/useCompareNetObjects}} + } + + /// + /// Returns true if {{classname}} instances are equal + /// + /// Instance of {{classname}} to be compared + /// Boolean + public bool Equals({{classname}} input) + { + {{#useCompareNetObjects}} + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + {{/useCompareNetObjects}} + {{^useCompareNetObjects}} + if (input == null) + return false; + + return {{#vars}}{{#parent}}base.Equals(input) && {{/parent}}{{^isContainer}} + ( + this.{{name}} == input.{{name}} || + {{^vendorExtensions.x-is-value-type}} + (this.{{name}} != null && + this.{{name}}.Equals(input.{{name}})) + {{/vendorExtensions.x-is-value-type}} + {{#vendorExtensions.x-is-value-type}} + this.{{name}}.Equals(input.{{name}}) + {{/vendorExtensions.x-is-value-type}} + ){{^-last}} && {{/-last}}{{/isContainer}}{{#isContainer}} + ( + this.{{name}} == input.{{name}} || + {{^vendorExtensions.x-is-value-type}}this.{{name}} != null && + input.{{name}} != null && + {{/vendorExtensions.x-is-value-type}}this.{{name}}.SequenceEqual(input.{{name}}) + ){{^-last}} && {{/-last}}{{/isContainer}}{{/vars}}{{^vars}}{{#parent}}base.Equals(input){{/parent}}{{^parent}}false{{/parent}}{{/vars}}{{^isAdditionalPropertiesTrue}};{{/isAdditionalPropertiesTrue}} + {{#isAdditionalPropertiesTrue}} + && (this.AdditionalProperties.Count == input.AdditionalProperties.Count && !this.AdditionalProperties.Except(input.AdditionalProperties).Any()); + {{/isAdditionalPropertiesTrue}} + {{/useCompareNetObjects}} + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + {{#parent}} + int hashCode = base.GetHashCode(); + {{/parent}} + {{^parent}} + int hashCode = 41; + {{/parent}} + {{#vars}} + {{^vendorExtensions.x-is-value-type}} + if (this.{{name}} != null) + hashCode = hashCode * 59 + this.{{name}}.GetHashCode(); + {{/vendorExtensions.x-is-value-type}} + {{#vendorExtensions.x-is-value-type}} + hashCode = hashCode * 59 + this.{{name}}.GetHashCode(); + {{/vendorExtensions.x-is-value-type}} + {{/vars}} + {{#isAdditionalPropertiesTrue}} + if (this.AdditionalProperties != null) + hashCode = hashCode * 59 + this.AdditionalProperties.GetHashCode(); + {{/isAdditionalPropertiesTrue}} + return hashCode; + } + } + +{{#validatable}} +{{#discriminator}} + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { +{{/discriminator}} +{{^discriminator}} + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { +{{/discriminator}} + {{#parent}} + {{^isArray}} + {{^isMap}} + foreach(var x in BaseValidate(validationContext)) yield return x; + {{/isMap}} + {{/isArray}} + {{/parent}} + {{#vars}} + {{#hasValidation}} + {{^isEnum}} + {{#maxLength}} + // {{{name}}} ({{{dataType}}}) maxLength + if(this.{{{name}}} != null && this.{{{name}}}.Length > {{maxLength}}) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, length must be less than {{maxLength}}.", new [] { "{{{name}}}" }); + } + + {{/maxLength}} + {{#minLength}} + // {{{name}}} ({{{dataType}}}) minLength + if(this.{{{name}}} != null && this.{{{name}}}.Length < {{minLength}}) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, length must be greater than {{minLength}}.", new [] { "{{{name}}}" }); + } + + {{/minLength}} + {{#maximum}} + // {{{name}}} ({{{dataType}}}) maximum + if(this.{{{name}}} > ({{{dataType}}}){{maximum}}) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, must be a value less than or equal to {{maximum}}.", new [] { "{{{name}}}" }); + } + + {{/maximum}} + {{#minimum}} + // {{{name}}} ({{{dataType}}}) minimum + if(this.{{{name}}} < ({{{dataType}}}){{minimum}}) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, must be a value greater than or equal to {{minimum}}.", new [] { "{{{name}}}" }); + } + + {{/minimum}} + {{#pattern}} + {{^isByteArray}} + // {{{name}}} ({{{dataType}}}) pattern + Regex regex{{{name}}} = new Regex(@"{{{vendorExtensions.x-regex}}}"{{#vendorExtensions.x-modifiers}}{{#-first}}, {{/-first}}RegexOptions.{{{.}}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}); + if (false == regex{{{name}}}.Match(this.{{{name}}}).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, must match a pattern of " + regex{{{name}}}, new [] { "{{{name}}}" }); + } + + {{/isByteArray}} + {{/pattern}} + {{/isEnum}} + {{/hasValidation}} + {{/vars}} + yield break; + } +{{/validatable}} + } diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/modelInnerEnum.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/modelInnerEnum.mustache new file mode 100644 index 000000000000..d9e96dccdb3c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/modelInnerEnum.mustache @@ -0,0 +1,26 @@ + {{^isContainer}} + /// + /// {{^description}}Defines {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// + {{#description}} + /// {{description}} + {{/description}} + {{#isString}} + [JsonConverter(typeof(StringEnumConverter))] + {{/isString}} + {{>visibility}} enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#vendorExtensions.x-enum-byte}}: byte{{/vendorExtensions.x-enum-byte}} + { + {{#allowableValues}} + {{#enumVars}} + /// + /// Enum {{name}} for value: {{{value}}} + /// + {{#isString}} + [EnumMember(Value = "{{{value}}}")] + {{/isString}} + {{name}}{{^isString}} = {{{value}}}{{/isString}}{{#isString}} = {{-index}}{{/isString}}{{^-last}},{{/-last}} + + {{/enumVars}} + {{/allowableValues}} + } + {{/isContainer}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/modelOneOf.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/modelOneOf.mustache new file mode 100644 index 000000000000..d2d6e28b3f91 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/modelOneOf.mustache @@ -0,0 +1,264 @@ + /// + /// {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} + /// + [JsonConverter(typeof({{classname}}JsonConverter))] + [DataContract(Name = "{{{name}}}")] + {{>visibility}} partial class {{classname}} : AbstractOpenAPISchema, {{#parent}}{{{parent}}}, {{/parent}}IEquatable<{{classname}}>{{#validatable}}, IValidatableObject{{/validatable}} + { + {{#isNullable}} + /// + /// Initializes a new instance of the class. + /// + public {{classname}}() + { + this.IsNullable = true; + this.SchemaType= "oneOf"; + } + + {{/isNullable}} + {{#oneOf}} + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of {{{.}}}. + public {{classname}}({{{.}}} actualInstance) + { + this.IsNullable = {{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance{{^isNullable}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isNullable}}; + } + + {{/oneOf}} + + private Object _actualInstance; + + /// + /// Gets or Sets ActualInstance + /// + public override Object ActualInstance + { + get + { + return _actualInstance; + } + set + { + {{#oneOf}} + {{^-first}}else {{/-first}}if (value.GetType() == typeof({{{.}}})) + { + this._actualInstance = value; + } + {{/oneOf}} + else + { + throw new ArgumentException("Invalid instance found. Must be the following types:{{#oneOf}} {{{.}}}{{^-last}},{{/-last}}{{/oneOf}}"); + } + } + } + {{#oneOf}} + + /// + /// Get the actual instance of `{{{.}}}`. If the actual instanct is not `{{{.}}}`, + /// the InvalidClassException will be thrown + /// + /// An instance of {{{.}}} + public {{{.}}} Get{{{.}}}() + { + return ({{{.}}})this.ActualInstance; + } + {{/oneOf}} + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class {{classname}} {\n"); + sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this.ActualInstance, {{classname}}.SerializerSettings); + } + + /// + /// Converts the JSON string into an instance of {{classname}} + /// + /// JSON string + /// An instance of {{classname}} + public static {{classname}} FromJson(string jsonString) + { + {{classname}} new{{classname}} = null; + + if (jsonString == null) + { + return new{{classname}}; + } + {{#useOneOfDiscriminatorLookup}} + {{#discriminator}} + + string discriminatorValue = JObject.Parse(jsonString)["{{{propertyBaseName}}}"].ToString(); + switch (discriminatorValue) + { + {{#mappedModels}} + case "{{{mappingName}}}": + new{{classname}} = new {{classname}}(JsonConvert.DeserializeObject<{{{modelName}}}>(jsonString, {{classname}}.AdditionalPropertiesSerializerSettings)); + return new{{classname}}; + {{/mappedModels}} + default: + System.Diagnostics.Debug.WriteLine(string.Format("Failed to lookup discriminator value `{0}` for {{classname}}. Possible values:{{#mappedModels}} {{{mappingName}}}{{/mappedModels}}", discriminatorValue)); + break; + } + + {{/discriminator}} + {{/useOneOfDiscriminatorLookup}} + int match = 0; + List matchedTypes = new List(); + {{#oneOf}} + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof({{{.}}}).GetProperty("AdditionalProperties") == null) + { + new{{classname}} = new {{classname}}(JsonConvert.DeserializeObject<{{{.}}}>(jsonString, {{classname}}.SerializerSettings)); + } + else + { + new{{classname}} = new {{classname}}(JsonConvert.DeserializeObject<{{{.}}}>(jsonString, {{classname}}.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("{{{.}}}"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into {{{.}}}: {1}", jsonString, exception.ToString())); + } + {{/oneOf}} + + if (match == 0) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); + } + else if (match > 1) + { + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + } + + // deserialization is considered successful at this point if no exception has been thrown. + return new{{classname}}; + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + {{#useCompareNetObjects}} + return OpenAPIClientUtils.compareLogic.Compare(this, input as {{classname}}).AreEqual; + {{/useCompareNetObjects}} + {{^useCompareNetObjects}} + return this.Equals(input as {{classname}}); + {{/useCompareNetObjects}} + } + + /// + /// Returns true if {{classname}} instances are equal + /// + /// Instance of {{classname}} to be compared + /// Boolean + public bool Equals({{classname}} input) + { + {{#useCompareNetObjects}} + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + {{/useCompareNetObjects}} + {{^useCompareNetObjects}} + if (input == null) + return false; + + return this.ActualInstance.Equals(input.ActualInstance); + {{/useCompareNetObjects}} + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ActualInstance != null) + hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// Custom JSON converter for {{classname}} + /// + public class {{classname}}JsonConverter : JsonConverter + { + /// + /// To write the JSON string + /// + /// JSON writer + /// Object to be converted into a JSON string + /// JSON Serializer + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteRawValue((string)(typeof({{classname}}).GetMethod("ToJson").Invoke(value, null))); + } + + /// + /// To convert a JSON string into an object + /// + /// JSON reader + /// Object type + /// Existing value + /// JSON Serializer + /// The object converted from the JSON string + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if(reader.TokenType != JsonToken.Null) + { + return {{classname}}.FromJson(JObject.Load(reader).ToString(Formatting.None)); + } + return null; + } + + /// + /// Check if the object can be converted + /// + /// Object type + /// True if the object can be converted + public override bool CanConvert(Type objectType) + { + return false; + } + } diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/model_doc.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/model_doc.mustache new file mode 100644 index 000000000000..babf25481c4e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/model_doc.mustache @@ -0,0 +1,22 @@ +{{#models}} +{{#model}} +# {{{packageName}}}.{{modelPackage}}.{{{classname}}} +{{#description}}{{&description}} +{{/description}} + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +{{#parent}} +{{#parentVars}} +**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} +{{/parentVars}} +{{/parent}} +{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} +{{/vars}} + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/model_test.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/model_test.mustache new file mode 100644 index 000000000000..b4aefe51005e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/model_test.mustache @@ -0,0 +1,81 @@ +{{>partial_header}} + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.{{modelPackage}}; +using {{packageName}}.Client; +using System.Reflection; +using Newtonsoft.Json; + +{{#models}} +{{#model}} +namespace {{packageName}}.Test.Model +{ + /// + /// Class for testing {{classname}} + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class {{classname}}Tests : IDisposable + { + // TODO uncomment below to declare an instance variable for {{classname}} + //private {{classname}} instance; + + public {{classname}}Tests() + { + // TODO uncomment below to create an instance of {{classname}} + //instance = new {{classname}}(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of {{classname}} + /// + [Fact] + public void {{classname}}InstanceTest() + { + // TODO uncomment below to test "IsType" {{classname}} + //Assert.IsType<{{classname}}>(instance); + } + + {{#discriminator}} + {{#children}} + /// + /// Test deserialize a {{classname}} from type {{parent}} + /// + [Fact] + public void {{classname}}DeserializeFrom{{parent}}Test() + { + // TODO uncomment below to test deserialize a {{classname}} from type {{parent}} + //Assert.IsType<{{parent}}>(JsonConvert.DeserializeObject<{{parent}}>(new {{classname}}().ToJson())); + } + {{/children}} + {{/discriminator}} + + {{#vars}} + /// + /// Test the property '{{name}}' + /// + [Fact] + public void {{name}}Test() + { + // TODO unit test for the property '{{name}}' + } + {{/vars}} + + } + +} +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/netcore_project.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/netcore_project.mustache new file mode 100644 index 000000000000..4f29dcf3d34c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/netcore_project.mustache @@ -0,0 +1,44 @@ + + + + false + {{targetFramework}} + {{packageName}} + {{packageName}} + Library + {{packageAuthors}} + {{packageCompany}} + {{packageTitle}} + {{packageDescription}} + {{packageCopyright}} + {{packageName}} + {{packageVersion}} + bin\$(Configuration)\$(TargetFramework)\{{packageName}}.xml{{#licenseId}} + {{licenseId}}{{/licenseId}} + https://{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}.git + git{{#releaseNote}} + {{releaseNote}}{{/releaseNote}}{{#packageTags}} + {{{packageTags}}}{{/packageTags}} + {{#nullableReferenceTypes}} + annotations + {{/nullableReferenceTypes}} + + + + {{#useCompareNetObjects}} + + {{/useCompareNetObjects}} + + + {{#useRestSharp}} + + {{/useRestSharp}} + {{#supportsRetry}} + + {{/supportsRetry}} + {{#validatable}} + + {{/validatable}} + + + diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/netcore_testproject.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/netcore_testproject.mustache new file mode 100644 index 000000000000..b20a94c76c1a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/netcore_testproject.mustache @@ -0,0 +1,20 @@ + + + + {{testPackageName}} + {{testPackageName}} + {{testTargetFramework}} + false + + + + + + + + + + + + + diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/nuspec.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/nuspec.mustache new file mode 100644 index 000000000000..66254acffd40 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/nuspec.mustache @@ -0,0 +1,52 @@ + + + + + $id$ + {{packageTitle}} + + + $version$ + + + $author$ + + + $author$ + false + false + + + {{packageDescription}} + {{#termsOfService}} + {{termsOfService}} + {{/termsOfService}} + {{#licenseUrl}} + {{licenseUrl}} + {{/licenseUrl}} + + + + + + + {{#useCompareNetObjects}} + + {{/useCompareNetObjects}} + + {{#validatable}} + + {{/validatable}} + + + + + + + + + + + diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/partial_header.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/partial_header.mustache new file mode 100644 index 000000000000..755e937d23b5 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/partial_header.mustache @@ -0,0 +1,17 @@ +/* + {{#appName}} + * {{{appName}}} + * + {{/appName}} + {{#appDescription}} + * {{{appDescription}}} + * + {{/appDescription}} + {{#version}} + * The version of the OpenAPI document: {{{version}}} + {{/version}} + {{#infoEmail}} + * Contact: {{{infoEmail}}} + {{/infoEmail}} + * Generated by: https://github.com/openapitools/openapi-generator.git + */ diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/pathParam.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/pathParam.mustache new file mode 100644 index 000000000000..e8767cac94cf --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/pathParam.mustache @@ -0,0 +1 @@ +{{#isPathParam}}{{#pattern}}[RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/project.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/project.mustache new file mode 100644 index 000000000000..d5d3017c2162 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/project.mustache @@ -0,0 +1,12 @@ +{ + "supports": {}, + "dependencies": { + "FubarCoder.RestSharp.Portable.Core": "4.0.7", + "FubarCoder.RestSharp.Portable.HttpClient": "4.0.7", + "Newtonsoft.Json": "10.0.3", + "JsonSubTypes": "1.2.0" + }, + "frameworks": { + "netstandard1.3": {} + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore-functions/visibility.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/visibility.mustache new file mode 100644 index 000000000000..a1d1f4163d41 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/csharp-netcore-functions/visibility.mustache @@ -0,0 +1 @@ +{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp-netcore-functions/CsharpNetcoreFunctionsServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp-netcore-functions/CsharpNetcoreFunctionsServerCodegenTest.java new file mode 100644 index 000000000000..a62b73e7fae3 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp-netcore-functions/CsharpNetcoreFunctionsServerCodegenTest.java @@ -0,0 +1,40 @@ +/* + * Copyright 2020 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.CsharpNetcoreFunctionsServerCodegen; + +import org.openapitools.codegen.languages.CsharpNetcoreFunctionsServerCodegen; +import org.testng.Assert; +import org.testng.annotations.Test; + +public class CsharpNetcoreFunctionsServerCodegenTest { + + @Test + public void testToEnumVarName() throws Exception { + final CsharpNetcoreFunctionsServerCodegen codegen = new CsharpNetcoreFunctionsServerCodegen(); + codegen.processOpts(); + + Assert.assertEquals(codegen.toEnumVarName("FooBar", "string"), "FooBar"); + Assert.assertEquals(codegen.toEnumVarName("fooBar", "string"), "FooBar"); + Assert.assertEquals(codegen.toEnumVarName("foo-bar", "string"), "FooBar"); + Assert.assertEquals(codegen.toEnumVarName("foo_bar", "string"), "FooBar"); + Assert.assertEquals(codegen.toEnumVarName("foo bar", "string"), "FooBar"); + + // The below cases do not work currently, camelize doesn't support uppercase + // Assert.assertEquals(codegen.toEnumVarName("FOO-BAR", "string"), "FooBar"); + // Assert.assertEquals(codegen.toEnumVarName("FOO_BAR", "string"), "FooBar"); + } +} From 15f45711a8e39f19c0166829485fc7d8a45b73df Mon Sep 17 00:00:00 2001 From: Jarrod Parkes Date: Sat, 4 Dec 2021 00:05:51 -0500 Subject: [PATCH 059/117] add swift5 option for generating frozen enums (#11013) * add swift5 option for generating frozen enums * use case unknownDefault to avoid conflicts * update comments to reflect unknownDefault case * set default values for unknown case to avoid conflict * dont need vendor extensions to detect enum raw data type * move CaseIterableDefaultsLast into models mustache template * comment catch all case and add support for other types * add frozen enums to ci pipeline * remove extraneous edit to extensions template * remove left over protocols files * small comment and case adjustments --- bin/configs/swift5-frozenEnums.yaml | 12 + docs/generators/swift5.md | 1 + .../languages/Swift5ClientCodegen.java | 16 + .../src/main/resources/swift5/Models.mustache | 22 + .../main/resources/swift5/modelEnum.mustache | 27 +- .../modelInlineEnumDeclaration.mustache | 30 +- .../options/Swift5OptionsProvider.java | 2 + .../codegen/swift5/Swift5OptionsTest.java | 1 + pom.xml | 1 + .../Classes/OpenAPIs/Models.swift | 22 + .../Classes/OpenAPIs/Models.swift | 22 + .../Classes/OpenAPIs/Models.swift | 22 + .../Classes/OpenAPIs/Models.swift | 22 + .../Classes/OpenAPIs/Models.swift | 22 + .../petstore/swift5/frozenEnums/.gitignore | 105 +++ .../frozenEnums/.openapi-generator-ignore | 23 + .../frozenEnums/.openapi-generator/FILES | 110 +++ .../frozenEnums/.openapi-generator/VERSION | 1 + .../petstore/swift5/frozenEnums/Cartfile | 1 + .../swift5/frozenEnums/Package.resolved | 16 + .../petstore/swift5/frozenEnums/Package.swift | 33 + .../swift5/frozenEnums/PetstoreClient.podspec | 15 + .../Classes/OpenAPIs/APIHelper.swift | 86 +++ .../Classes/OpenAPIs/APIs.swift | 72 ++ .../OpenAPIs/APIs/AnotherFakeAPI.swift | 58 ++ .../Classes/OpenAPIs/APIs/FakeAPI.swift | 699 ++++++++++++++++++ .../APIs/FakeClassnameTags123API.swift | 61 ++ .../Classes/OpenAPIs/APIs/PetAPI.swift | 495 +++++++++++++ .../Classes/OpenAPIs/APIs/StoreAPI.swift | 196 +++++ .../Classes/OpenAPIs/APIs/UserAPI.swift | 377 ++++++++++ .../Classes/OpenAPIs/CodableHelper.swift | 49 ++ .../Classes/OpenAPIs/Configuration.swift | 15 + .../Classes/OpenAPIs/Extensions.swift | 158 ++++ .../Classes/OpenAPIs/JSONDataEncoding.swift | 53 ++ .../Classes/OpenAPIs/JSONEncodingHelper.swift | 45 ++ .../Classes/OpenAPIs/Models.swift | 80 ++ .../Models/AdditionalPropertiesClass.swift | 36 + .../Classes/OpenAPIs/Models/Animal.swift | 36 + .../Classes/OpenAPIs/Models/AnimalFarm.swift | 13 + .../Classes/OpenAPIs/Models/ApiResponse.swift | 40 + .../Models/ArrayOfArrayOfNumberOnly.swift | 32 + .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 32 + .../Classes/OpenAPIs/Models/ArrayTest.swift | 40 + .../OpenAPIs/Models/Capitalization.swift | 53 ++ .../Classes/OpenAPIs/Models/Cat.swift | 40 + .../Classes/OpenAPIs/Models/CatAllOf.swift | 32 + .../Classes/OpenAPIs/Models/Category.swift | 36 + .../Classes/OpenAPIs/Models/ClassModel.swift | 33 + .../Classes/OpenAPIs/Models/Client.swift | 32 + .../Classes/OpenAPIs/Models/Dog.swift | 40 + .../Classes/OpenAPIs/Models/DogAllOf.swift | 32 + .../Classes/OpenAPIs/Models/EnumArrays.swift | 54 ++ .../Classes/OpenAPIs/Models/EnumClass.swift | 22 + .../Classes/OpenAPIs/Models/EnumTest.swift | 96 +++ .../Classes/OpenAPIs/Models/File.swift | 34 + .../OpenAPIs/Models/FileSchemaTestClass.swift | 36 + .../Classes/OpenAPIs/Models/FormatTest.swift | 80 ++ .../OpenAPIs/Models/HasOnlyReadOnly.swift | 36 + .../Classes/OpenAPIs/Models/List.swift | 32 + .../Classes/OpenAPIs/Models/MapTest.swift | 53 ++ ...opertiesAndAdditionalPropertiesClass.swift | 40 + .../OpenAPIs/Models/Model200Response.swift | 37 + .../Classes/OpenAPIs/Models/Name.swift | 45 ++ .../Classes/OpenAPIs/Models/NumberOnly.swift | 32 + .../Classes/OpenAPIs/Models/Order.swift | 63 ++ .../OpenAPIs/Models/OuterComposite.swift | 40 + .../Classes/OpenAPIs/Models/OuterEnum.swift | 22 + .../Classes/OpenAPIs/Models/Pet.swift | 63 ++ .../OpenAPIs/Models/ReadOnlyFirst.swift | 36 + .../Classes/OpenAPIs/Models/Return.swift | 33 + .../OpenAPIs/Models/SpecialModelName.swift | 32 + .../OpenAPIs/Models/StringBooleanMap.swift | 52 ++ .../Classes/OpenAPIs/Models/Tag.swift | 36 + .../OpenAPIs/Models/TypeHolderDefault.swift | 48 ++ .../OpenAPIs/Models/TypeHolderExample.swift | 48 ++ .../Classes/OpenAPIs/Models/User.swift | 61 ++ .../OpenAPIs/OpenISO8601DateFormatter.swift | 44 ++ .../OpenAPIs/SynchronizedDictionary.swift | 36 + .../OpenAPIs/URLSessionImplementations.swift | 609 +++++++++++++++ .../petstore/swift5/frozenEnums/README.md | 141 ++++ .../docs/AdditionalPropertiesClass.md | 11 + .../swift5/frozenEnums/docs/Animal.md | 11 + .../swift5/frozenEnums/docs/AnimalFarm.md | 9 + .../swift5/frozenEnums/docs/AnotherFakeAPI.md | 59 ++ .../swift5/frozenEnums/docs/ApiResponse.md | 12 + .../docs/ArrayOfArrayOfNumberOnly.md | 10 + .../frozenEnums/docs/ArrayOfNumberOnly.md | 10 + .../swift5/frozenEnums/docs/ArrayTest.md | 12 + .../swift5/frozenEnums/docs/Capitalization.md | 15 + .../petstore/swift5/frozenEnums/docs/Cat.md | 10 + .../swift5/frozenEnums/docs/CatAllOf.md | 10 + .../swift5/frozenEnums/docs/Category.md | 11 + .../swift5/frozenEnums/docs/ClassModel.md | 10 + .../swift5/frozenEnums/docs/Client.md | 10 + .../petstore/swift5/frozenEnums/docs/Dog.md | 10 + .../swift5/frozenEnums/docs/DogAllOf.md | 10 + .../swift5/frozenEnums/docs/EnumArrays.md | 11 + .../swift5/frozenEnums/docs/EnumClass.md | 9 + .../swift5/frozenEnums/docs/EnumTest.md | 14 + .../swift5/frozenEnums/docs/FakeAPI.md | 662 +++++++++++++++++ .../docs/FakeClassnameTags123API.md | 59 ++ .../petstore/swift5/frozenEnums/docs/File.md | 10 + .../frozenEnums/docs/FileSchemaTestClass.md | 11 + .../swift5/frozenEnums/docs/FormatTest.md | 22 + .../frozenEnums/docs/HasOnlyReadOnly.md | 11 + .../petstore/swift5/frozenEnums/docs/List.md | 10 + .../swift5/frozenEnums/docs/MapTest.md | 13 + ...dPropertiesAndAdditionalPropertiesClass.md | 12 + .../frozenEnums/docs/Model200Response.md | 11 + .../petstore/swift5/frozenEnums/docs/Name.md | 13 + .../swift5/frozenEnums/docs/NumberOnly.md | 10 + .../petstore/swift5/frozenEnums/docs/Order.md | 15 + .../swift5/frozenEnums/docs/OuterComposite.md | 12 + .../swift5/frozenEnums/docs/OuterEnum.md | 9 + .../petstore/swift5/frozenEnums/docs/Pet.md | 15 + .../swift5/frozenEnums/docs/PetAPI.md | 469 ++++++++++++ .../swift5/frozenEnums/docs/ReadOnlyFirst.md | 11 + .../swift5/frozenEnums/docs/Return.md | 10 + .../frozenEnums/docs/SpecialModelName.md | 10 + .../swift5/frozenEnums/docs/StoreAPI.md | 206 ++++++ .../frozenEnums/docs/StringBooleanMap.md | 9 + .../petstore/swift5/frozenEnums/docs/Tag.md | 11 + .../frozenEnums/docs/TypeHolderDefault.md | 14 + .../frozenEnums/docs/TypeHolderExample.md | 14 + .../petstore/swift5/frozenEnums/docs/User.md | 17 + .../swift5/frozenEnums/docs/UserAPI.md | 406 ++++++++++ .../petstore/swift5/frozenEnums/git_push.sh | 57 ++ .../petstore/swift5/frozenEnums/pom.xml | 43 ++ .../petstore/swift5/frozenEnums/project.yml | 15 + .../swift5/frozenEnums/run_spmbuild.sh | 3 + .../Classes/OpenAPIs/Models.swift | 22 + .../Classes/OpenAPIs/Models.swift | 22 + .../Classes/OpenAPIs/Models.swift | 22 + .../Classes/OpenAPIs/Models.swift | 22 + .../Classes/OpenAPIs/Models.swift | 22 + .../Classes/OpenAPIs/Models.swift | 22 + .../Classes/OpenAPIs/Models.swift | 22 + .../client/petstore/swift5/swift5_test_all.sh | 1 + .../Sources/PetstoreClient/Models.swift | 22 + .../Classes/OpenAPIs/Models.swift | 22 + 140 files changed, 8099 insertions(+), 2 deletions(-) create mode 100644 bin/configs/swift5-frozenEnums.yaml create mode 100644 samples/client/petstore/swift5/frozenEnums/.gitignore create mode 100644 samples/client/petstore/swift5/frozenEnums/.openapi-generator-ignore create mode 100644 samples/client/petstore/swift5/frozenEnums/.openapi-generator/FILES create mode 100644 samples/client/petstore/swift5/frozenEnums/.openapi-generator/VERSION create mode 100644 samples/client/petstore/swift5/frozenEnums/Cartfile create mode 100644 samples/client/petstore/swift5/frozenEnums/Package.resolved create mode 100644 samples/client/petstore/swift5/frozenEnums/Package.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient.podspec create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIHelper.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Configuration.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Extensions.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Category.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Client.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/File.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/List.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Name.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Order.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Return.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/User.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/OpenISO8601DateFormatter.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/SynchronizedDictionary.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift create mode 100644 samples/client/petstore/swift5/frozenEnums/README.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/AdditionalPropertiesClass.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/Animal.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/AnimalFarm.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/AnotherFakeAPI.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/ApiResponse.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/ArrayOfNumberOnly.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/ArrayTest.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/Capitalization.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/Cat.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/CatAllOf.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/Category.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/ClassModel.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/Client.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/Dog.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/DogAllOf.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/EnumArrays.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/EnumClass.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/EnumTest.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/FakeAPI.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/FakeClassnameTags123API.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/File.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/FileSchemaTestClass.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/FormatTest.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/HasOnlyReadOnly.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/List.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/MapTest.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/Model200Response.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/Name.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/NumberOnly.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/Order.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/OuterComposite.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/OuterEnum.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/Pet.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/PetAPI.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/ReadOnlyFirst.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/Return.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/SpecialModelName.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/StoreAPI.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/StringBooleanMap.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/Tag.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/TypeHolderDefault.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/TypeHolderExample.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/User.md create mode 100644 samples/client/petstore/swift5/frozenEnums/docs/UserAPI.md create mode 100644 samples/client/petstore/swift5/frozenEnums/git_push.sh create mode 100644 samples/client/petstore/swift5/frozenEnums/pom.xml create mode 100644 samples/client/petstore/swift5/frozenEnums/project.yml create mode 100755 samples/client/petstore/swift5/frozenEnums/run_spmbuild.sh diff --git a/bin/configs/swift5-frozenEnums.yaml b/bin/configs/swift5-frozenEnums.yaml new file mode 100644 index 000000000000..64dc04a4f81b --- /dev/null +++ b/bin/configs/swift5-frozenEnums.yaml @@ -0,0 +1,12 @@ +generatorName: swift5 +outputDir: samples/client/petstore/swift5/frozenEnums +inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/swift5 +generateAliasAsModel: true +additionalProperties: + podAuthors: "" + podSummary: PetstoreClient + sortParamsByRequiredFlag: false + generateFrozenEnums: false + projectName: PetstoreClient + podHomepage: https://github.com/openapitools/openapi-generator diff --git a/docs/generators/swift5.md b/docs/generators/swift5.md index e74a239be255..ddcb3bc3db0b 100644 --- a/docs/generators/swift5.md +++ b/docs/generators/swift5.md @@ -11,6 +11,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |apiNamePrefix|Prefix that will be appended to all API names ('tags'). Default: empty string. e.g. Pet => Pet.| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|generateFrozenEnums|Generate model enums that are "frozen". A frozen enum strictly represents the cases described in the spec, and nothing else. A non-frozen enum includes an unknown case that can represent future cases not yet described in the spec. (default: true)| |true| |generateModelAdditionalProperties|Generate model additional properties (default: true)| |true| |hashableModels|Make hashable models (default: true)| |true| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java index 31614ac9b656..2cd6ebd8dd45 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java @@ -66,6 +66,7 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig public static final String SWIFT_PACKAGE_PATH = "swiftPackagePath"; public static final String USE_CLASSES = "useClasses"; public static final String USE_BACKTICK_ESCAPES = "useBacktickEscapes"; + public static final String GENERATE_FROZEN_ENUMS = "generateFrozenEnums"; public static final String GENERATE_MODEL_ADDITIONAL_PROPERTIES = "generateModelAdditionalProperties"; public static final String HASHABLE_MODELS = "hashableModels"; public static final String MAP_FILE_BINARY_TO_DATA = "mapFileBinaryToData"; @@ -90,6 +91,7 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig protected boolean useClasses = false; protected boolean useBacktickEscapes = false; protected boolean generateModelAdditionalProperties = true; + protected boolean generateFrozenEnums = true; protected boolean hashableModels = true; protected boolean mapFileBinaryToData = false; protected String[] responseAs = new String[0]; @@ -281,6 +283,9 @@ public Swift5ClientCodegen() { cliOptions.add(new CliOption(USE_BACKTICK_ESCAPES, "Escape reserved words using backticks (default: false)") .defaultValue(Boolean.FALSE.toString())); + cliOptions.add(new CliOption(GENERATE_FROZEN_ENUMS, + "Generate frozen enums (default: true)") + .defaultValue(Boolean.TRUE.toString())); cliOptions.add(new CliOption(GENERATE_MODEL_ADDITIONAL_PROPERTIES, "Generate model additional properties (default: true)") .defaultValue(Boolean.TRUE.toString())); @@ -485,6 +490,13 @@ public void processOpts() { setUseBacktickEscapes(convertPropertyToBooleanAndWriteBack(USE_BACKTICK_ESCAPES)); } + // Setup generateFrozenEnums option. If true, enums will strictly include + // cases matching the spec. If false, enums will also include an extra catch-all case. + if (additionalProperties.containsKey(GENERATE_FROZEN_ENUMS)) { + setGenerateFrozenEnums(convertPropertyToBooleanAndWriteBack(GENERATE_FROZEN_ENUMS)); + } + additionalProperties.put(GENERATE_FROZEN_ENUMS, generateFrozenEnums); + if (additionalProperties.containsKey(GENERATE_MODEL_ADDITIONAL_PROPERTIES)) { setGenerateModelAdditionalProperties(convertPropertyToBooleanAndWriteBack(GENERATE_MODEL_ADDITIONAL_PROPERTIES)); } @@ -943,6 +955,10 @@ public void setUseBacktickEscapes(boolean useBacktickEscapes) { this.useBacktickEscapes = useBacktickEscapes; } + public void setGenerateFrozenEnums(boolean generateFrozenEnums) { + this.generateFrozenEnums = generateFrozenEnums; + } + public void setGenerateModelAdditionalProperties(boolean generateModelAdditionalProperties) { this.generateModelAdditionalProperties = generateModelAdditionalProperties; } diff --git a/modules/openapi-generator/src/main/resources/swift5/Models.mustache b/modules/openapi-generator/src/main/resources/swift5/Models.mustache index 3b2c5eafce1b..1195d5ea9c42 100644 --- a/modules/openapi-generator/src/main/resources/swift5/Models.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/Models.mustache @@ -14,6 +14,28 @@ extension JSONEncodable { func encodeToJSON() -> Any { self } } +/// An enum where the last case value can be used as a default catch-all. +protocol CaseIterableDefaultsLast: Decodable & CaseIterable & RawRepresentable +where RawValue: Decodable, AllCases: BidirectionalCollection {} + +extension CaseIterableDefaultsLast { + /// Initializes an enum such that if a known raw value is found, then it is decoded. + /// Otherwise the last case is used. + /// - Parameter decoder: A decoder. + public init(from decoder: Decoder) throws { + if let value = try Self(rawValue: decoder.singleValueContainer().decode(RawValue.self)) { + self = value + } else if let lastValue = Self.allCases.last { + self = lastValue + } else { + throw DecodingError.valueNotFound( + Self.Type.self, + .init(codingPath: decoder.codingPath, debugDescription: "CaseIterableDefaultsLast") + ) + } + } +} + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } diff --git a/modules/openapi-generator/src/main/resources/swift5/modelEnum.mustache b/modules/openapi-generator/src/main/resources/swift5/modelEnum.mustache index 4d868682a1e3..08f7bf9ee40d 100644 --- a/modules/openapi-generator/src/main/resources/swift5/modelEnum.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/modelEnum.mustache @@ -1,7 +1,32 @@ -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{classname}}: {{dataType}}, {{#useVapor}}Content, Hashable{{/useVapor}}{{^useVapor}}Codable{{/useVapor}}, CaseIterable { +{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{classname}}: {{dataType}}, {{#useVapor}}Content, Hashable{{/useVapor}}{{^useVapor}}Codable{{/useVapor}}, CaseIterable{{^generateFrozenEnums}}{{#isInteger}}, CaseIterableDefaultsLast{{/isInteger}}{{#isFloat}}, CaseIterableDefaultsLast{{/isFloat}}{{#isDouble}}, CaseIterableDefaultsLast{{/isDouble}}{{#isString}}, CaseIterableDefaultsLast{{/isString}}{{/generateFrozenEnums}} { {{#allowableValues}} {{#enumVars}} case {{{name}}} = {{{value}}} {{/enumVars}} {{/allowableValues}} +{{^generateFrozenEnums}} + // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". + // If new enum cases are added that are unknown to the spec/client, they are safely + // decoded to this case. The raw value of this case is a dummy value that attempts + // to avoids collisions with previously specified cases. +{{#isString}} + case unknownDefaultOpenAPI = "unknown_default_open_api" +{{/isString}} +{{#isNumeric}} + // + // 192, used to calculate the raw value, was the Swift Evolution proposal for + // frozen/non-frozen enums. + // [SE-0192](https://github.com/apple/swift-evolution/blob/master/proposals/0192-non-exhaustive-enums.md) + // +{{/isNumeric}} +{{#isInteger}} + case unknownDefaultOpenAPI = -11184809 // Int.min / 192 +{{/isInteger}} +{{#isDouble}} + case unknownDefaultOpenAPI = -11184809 // Int.min / 192 +{{/isDouble}} +{{#isFloat}} + case unknownDefaultOpenAPI = -11184809 // Int.min / 192 +{{/isFloat}} +{{/generateFrozenEnums}} } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/swift5/modelInlineEnumDeclaration.mustache b/modules/openapi-generator/src/main/resources/swift5/modelInlineEnumDeclaration.mustache index 039bae3cb73d..1dd9c55b16fd 100644 --- a/modules/openapi-generator/src/main/resources/swift5/modelInlineEnumDeclaration.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/modelInlineEnumDeclaration.mustache @@ -1,7 +1,35 @@ - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{enumName}}: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}String{{/isContainer}}, {{#useVapor}}Content, Hashable{{/useVapor}}{{^useVapor}}Codable{{/useVapor}}, CaseIterable { + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{enumName}}: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}String{{/isContainer}}, {{#useVapor}}Content, Hashable{{/useVapor}}{{^useVapor}}Codable{{/useVapor}}, CaseIterable{{^generateFrozenEnums}}{{#isInteger}}, CaseIterableDefaultsLast{{/isInteger}}{{#isFloat}}, CaseIterableDefaultsLast{{/isFloat}}{{#isDouble}}, CaseIterableDefaultsLast{{/isDouble}}{{#isString}}, CaseIterableDefaultsLast{{/isString}}{{#isContainer}}, CaseIterableDefaultsLast{{/isContainer}}{{/generateFrozenEnums}} { {{#allowableValues}} {{#enumVars}} case {{{name}}} = {{{value}}} {{/enumVars}} {{/allowableValues}} + {{^generateFrozenEnums}} + // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". + // If new enum cases are added that are unknown to the spec/client, they are safely + // decoded to this case. The raw value of this case is a dummy value that attempts + // to avoids collisions with previously specified cases. + {{#isString}} + case unknownDefaultOpenAPI = "unknown_default_open_api" + {{/isString}} + {{#isContainer}} + case unknownDefaultOpenAPI = "unknown_default_open_api" + {{/isContainer}} + {{#isNumeric}} + // + // 192, used to calculate the raw value, was the Swift Evolution proposal for + // frozen/non-frozen enums. + // [SE-0192](https://github.com/apple/swift-evolution/blob/master/proposals/0192-non-exhaustive-enums.md) + // + {{/isNumeric}} + {{#isInteger}} + case unknownDefaultOpenAPI = -11184809 // Int.min / 192 + {{/isInteger}} + {{#isDouble}} + case unknownDefaultOpenAPI = -11184809 // Int.min / 192 + {{/isDouble}} + {{#isFloat}} + case unknownDefaultOpenAPI = -11184809 // Int.min / 192 + {{/isFloat}} + {{/generateFrozenEnums}} } \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift5OptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift5OptionsProvider.java index cf6b8ba3bfa8..4df5b89d5ba7 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift5OptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift5OptionsProvider.java @@ -48,6 +48,7 @@ public class Swift5OptionsProvider implements OptionsProvider { public static final String REMOVE_MIGRATION_PROJECT_NAME_CLASS_VALUE = "false"; public static final String SWIFT_USE_API_NAMESPACE_VALUE = "swiftUseApiNamespace"; public static final String USE_BACKTICKS_ESCAPES_VALUE = "false"; + public static final String GENERATE_FROZEN_ENUMS_VALUE = "true"; public static final String GENERATE_MODEL_ADDITIONAL_PROPERTIES_VALUE = "true"; public static final String HASHABLE_MODELS_VALUE = "true"; public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; @@ -95,6 +96,7 @@ public Map createOptions() { .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") .put(Swift5ClientCodegen.USE_SPM_FILE_STRUCTURE, USE_SPM_FILE_STRUCTURE_VALUE) .put(Swift5ClientCodegen.SWIFT_PACKAGE_PATH, SWIFT_PACKAGE_PATH_VALUE) + .put(Swift5ClientCodegen.GENERATE_FROZEN_ENUMS, GENERATE_FROZEN_ENUMS_VALUE) .put(Swift5ClientCodegen.GENERATE_MODEL_ADDITIONAL_PROPERTIES, GENERATE_MODEL_ADDITIONAL_PROPERTIES_VALUE) .put(Swift5ClientCodegen.HASHABLE_MODELS, HASHABLE_MODELS_VALUE) .put(Swift5ClientCodegen.MAP_FILE_BINARY_TO_DATA, "false") diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5OptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5OptionsTest.java index 15a06885bc06..0550f03de295 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5OptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5OptionsTest.java @@ -49,6 +49,7 @@ protected void verifyOptions() { verify(clientCodegen).setPrependFormOrBodyParameters(Boolean.valueOf(Swift5OptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); verify(clientCodegen).setReadonlyProperties(Boolean.parseBoolean(Swift5OptionsProvider.READONLY_PROPERTIES_VALUE)); verify(clientCodegen).setRemoveMigrationProjectNameClass(Boolean.parseBoolean(Swift5OptionsProvider.REMOVE_MIGRATION_PROJECT_NAME_CLASS_VALUE)); + verify(clientCodegen).setGenerateFrozenEnums(Boolean.parseBoolean(Swift5OptionsProvider.GENERATE_FROZEN_ENUMS_VALUE)); verify(clientCodegen).setGenerateModelAdditionalProperties(Boolean.parseBoolean(Swift5OptionsProvider.GENERATE_MODEL_ADDITIONAL_PROPERTIES_VALUE)); verify(clientCodegen).setHashableModels(Boolean.parseBoolean(Swift5OptionsProvider.HASHABLE_MODELS_VALUE)); } diff --git a/pom.xml b/pom.xml index bc3598547173..d55abd2e50d7 100644 --- a/pom.xml +++ b/pom.xml @@ -1434,6 +1434,7 @@ samples/client/petstore/swift5/combineLibrary samples/client/petstore/swift5/default samples/client/petstore/swift5/deprecated + samples/client/petstore/swift5/frozenEnums samples/client/petstore/swift5/nonPublicApi samples/client/petstore/swift5/objcCompatible samples/client/petstore/swift5/promisekitLibrary 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 ab4165a9b450..7787127c40d8 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -14,6 +14,28 @@ extension JSONEncodable { func encodeToJSON() -> Any { self } } +/// An enum where the last case value can be used as a default catch-all. +protocol CaseIterableDefaultsLast: Decodable & CaseIterable & RawRepresentable +where RawValue: Decodable, AllCases: BidirectionalCollection {} + +extension CaseIterableDefaultsLast { + /// Initializes an enum such that if a known raw value is found, then it is decoded. + /// Otherwise the last case is used. + /// - Parameter decoder: A decoder. + public init(from decoder: Decoder) throws { + if let value = try Self(rawValue: decoder.singleValueContainer().decode(RawValue.self)) { + self = value + } else if let lastValue = Self.allCases.last { + self = lastValue + } else { + throw DecodingError.valueNotFound( + Self.Type.self, + .init(codingPath: decoder.codingPath, debugDescription: "CaseIterableDefaultsLast") + ) + } + } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index ab4165a9b450..7787127c40d8 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -14,6 +14,28 @@ extension JSONEncodable { func encodeToJSON() -> Any { self } } +/// An enum where the last case value can be used as a default catch-all. +protocol CaseIterableDefaultsLast: Decodable & CaseIterable & RawRepresentable +where RawValue: Decodable, AllCases: BidirectionalCollection {} + +extension CaseIterableDefaultsLast { + /// Initializes an enum such that if a known raw value is found, then it is decoded. + /// Otherwise the last case is used. + /// - Parameter decoder: A decoder. + public init(from decoder: Decoder) throws { + if let value = try Self(rawValue: decoder.singleValueContainer().decode(RawValue.self)) { + self = value + } else if let lastValue = Self.allCases.last { + self = lastValue + } else { + throw DecodingError.valueNotFound( + Self.Type.self, + .init(codingPath: decoder.codingPath, debugDescription: "CaseIterableDefaultsLast") + ) + } + } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } 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 ab4165a9b450..7787127c40d8 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -14,6 +14,28 @@ extension JSONEncodable { func encodeToJSON() -> Any { self } } +/// An enum where the last case value can be used as a default catch-all. +protocol CaseIterableDefaultsLast: Decodable & CaseIterable & RawRepresentable +where RawValue: Decodable, AllCases: BidirectionalCollection {} + +extension CaseIterableDefaultsLast { + /// Initializes an enum such that if a known raw value is found, then it is decoded. + /// Otherwise the last case is used. + /// - Parameter decoder: A decoder. + public init(from decoder: Decoder) throws { + if let value = try Self(rawValue: decoder.singleValueContainer().decode(RawValue.self)) { + self = value + } else if let lastValue = Self.allCases.last { + self = lastValue + } else { + throw DecodingError.valueNotFound( + Self.Type.self, + .init(codingPath: decoder.codingPath, debugDescription: "CaseIterableDefaultsLast") + ) + } + } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } 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 ab4165a9b450..7787127c40d8 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -14,6 +14,28 @@ extension JSONEncodable { func encodeToJSON() -> Any { self } } +/// An enum where the last case value can be used as a default catch-all. +protocol CaseIterableDefaultsLast: Decodable & CaseIterable & RawRepresentable +where RawValue: Decodable, AllCases: BidirectionalCollection {} + +extension CaseIterableDefaultsLast { + /// Initializes an enum such that if a known raw value is found, then it is decoded. + /// Otherwise the last case is used. + /// - Parameter decoder: A decoder. + public init(from decoder: Decoder) throws { + if let value = try Self(rawValue: decoder.singleValueContainer().decode(RawValue.self)) { + self = value + } else if let lastValue = Self.allCases.last { + self = lastValue + } else { + throw DecodingError.valueNotFound( + Self.Type.self, + .init(codingPath: decoder.codingPath, debugDescription: "CaseIterableDefaultsLast") + ) + } + } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift index ab4165a9b450..7787127c40d8 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -14,6 +14,28 @@ extension JSONEncodable { func encodeToJSON() -> Any { self } } +/// An enum where the last case value can be used as a default catch-all. +protocol CaseIterableDefaultsLast: Decodable & CaseIterable & RawRepresentable +where RawValue: Decodable, AllCases: BidirectionalCollection {} + +extension CaseIterableDefaultsLast { + /// Initializes an enum such that if a known raw value is found, then it is decoded. + /// Otherwise the last case is used. + /// - Parameter decoder: A decoder. + public init(from decoder: Decoder) throws { + if let value = try Self(rawValue: decoder.singleValueContainer().decode(RawValue.self)) { + self = value + } else if let lastValue = Self.allCases.last { + self = lastValue + } else { + throw DecodingError.valueNotFound( + Self.Type.self, + .init(codingPath: decoder.codingPath, debugDescription: "CaseIterableDefaultsLast") + ) + } + } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } diff --git a/samples/client/petstore/swift5/frozenEnums/.gitignore b/samples/client/petstore/swift5/frozenEnums/.gitignore new file mode 100644 index 000000000000..627d360a903c --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/.gitignore @@ -0,0 +1,105 @@ +# Created by https://www.toptal.com/developers/gitignore/api/swift,xcode +# Edit at https://www.toptal.com/developers/gitignore?templates=swift,xcode + +### Swift ### +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## User settings +xcuserdata/ + +## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) +*.xcscmblueprint +*.xccheckout + +## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) +build/ +DerivedData/ +*.moved-aside +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 + +## Obj-C/Swift specific +*.hmap + +## App packaging +*.ipa +*.dSYM.zip +*.dSYM + +## Playgrounds +timeline.xctimeline +playground.xcworkspace + +# Swift Package Manager +# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. +# Packages/ +# Package.pins +# Package.resolved +# *.xcodeproj +# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata +# hence it is not needed unless you have added a package configuration file to your project +# .swiftpm + +.build/ + +# CocoaPods +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# Pods/ +# Add this line if you want to avoid checking in source code from the Xcode workspace +# *.xcworkspace + +# Carthage +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + +Carthage/Build/ + +# Add this lines if you are using Accio dependency management (Deprecated since Xcode 12) +# Dependencies/ +# .accio/ + +# fastlane +# It is recommended to not store the screenshots in the git repo. +# Instead, use fastlane to re-generate the screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://docs.fastlane.tools/best-practices/source-control/#source-control + +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots/**/*.png +fastlane/test_output + +# Code Injection +# After new code Injection tools there's a generated folder /iOSInjectionProject +# https://github.com/johnno1962/injectionforxcode + +iOSInjectionProject/ + +### Xcode ### +# Xcode +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + + + + +## Gcc Patch +/*.gcno + +### Xcode Patch ### +*.xcodeproj/* +!*.xcodeproj/project.pbxproj +!*.xcodeproj/xcshareddata/ +!*.xcworkspace/contents.xcworkspacedata +**/xcshareddata/WorkspaceSettings.xcsettings + +# End of https://www.toptal.com/developers/gitignore/api/swift,xcode diff --git a/samples/client/petstore/swift5/frozenEnums/.openapi-generator-ignore b/samples/client/petstore/swift5/frozenEnums/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/swift5/frozenEnums/.openapi-generator/FILES b/samples/client/petstore/swift5/frozenEnums/.openapi-generator/FILES new file mode 100644 index 000000000000..c81943baf2af --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/.openapi-generator/FILES @@ -0,0 +1,110 @@ +.gitignore +Cartfile +Package.swift +PetstoreClient.podspec +PetstoreClient/Classes/OpenAPIs/APIHelper.swift +PetstoreClient/Classes/OpenAPIs/APIs.swift +PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +PetstoreClient/Classes/OpenAPIs/Configuration.swift +PetstoreClient/Classes/OpenAPIs/Extensions.swift +PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift +PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +PetstoreClient/Classes/OpenAPIs/Models.swift +PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +PetstoreClient/Classes/OpenAPIs/Models/Category.swift +PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +PetstoreClient/Classes/OpenAPIs/Models/Client.swift +PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +PetstoreClient/Classes/OpenAPIs/Models/File.swift +PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +PetstoreClient/Classes/OpenAPIs/Models/List.swift +PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +PetstoreClient/Classes/OpenAPIs/Models/Name.swift +PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +PetstoreClient/Classes/OpenAPIs/Models/Order.swift +PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +PetstoreClient/Classes/OpenAPIs/Models/Return.swift +PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +PetstoreClient/Classes/OpenAPIs/Models/User.swift +PetstoreClient/Classes/OpenAPIs/OpenISO8601DateFormatter.swift +PetstoreClient/Classes/OpenAPIs/SynchronizedDictionary.swift +PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +README.md +docs/AdditionalPropertiesClass.md +docs/Animal.md +docs/AnimalFarm.md +docs/AnotherFakeAPI.md +docs/ApiResponse.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeAPI.md +docs/FakeClassnameTags123API.md +docs/File.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/List.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetAPI.md +docs/ReadOnlyFirst.md +docs/Return.md +docs/SpecialModelName.md +docs/StoreAPI.md +docs/StringBooleanMap.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserAPI.md +git_push.sh +project.yml diff --git a/samples/client/petstore/swift5/frozenEnums/.openapi-generator/VERSION b/samples/client/petstore/swift5/frozenEnums/.openapi-generator/VERSION new file mode 100644 index 000000000000..4077803655c0 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/frozenEnums/Cartfile b/samples/client/petstore/swift5/frozenEnums/Cartfile new file mode 100644 index 000000000000..3f7e6304cab0 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/Cartfile @@ -0,0 +1 @@ +github "Flight-School/AnyCodable" ~> 0.6.1 diff --git a/samples/client/petstore/swift5/frozenEnums/Package.resolved b/samples/client/petstore/swift5/frozenEnums/Package.resolved new file mode 100644 index 000000000000..730957420e19 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/Package.resolved @@ -0,0 +1,16 @@ +{ + "object": { + "pins": [ + { + "package": "AnyCodable", + "repositoryURL": "https://github.com/Flight-School/AnyCodable", + "state": { + "branch": null, + "revision": "b1a7a8a6186f2fcb28f7bda67cfc545de48b3c80", + "version": "0.6.2" + } + } + ] + }, + "version": 1 +} diff --git a/samples/client/petstore/swift5/frozenEnums/Package.swift b/samples/client/petstore/swift5/frozenEnums/Package.swift new file mode 100644 index 000000000000..87bb775fb728 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/Package.swift @@ -0,0 +1,33 @@ +// swift-tools-version:5.1 + +import PackageDescription + +let package = Package( + name: "PetstoreClient", + platforms: [ + .iOS(.v9), + .macOS(.v10_11), + .tvOS(.v9), + .watchOS(.v3), + ], + products: [ + // Products define the executables and libraries produced by a package, and make them visible to other packages. + .library( + name: "PetstoreClient", + targets: ["PetstoreClient"] + ), + ], + dependencies: [ + // Dependencies declare other packages that this package depends on. + .package(url: "https://github.com/Flight-School/AnyCodable", from: "0.6.1"), + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages which this package depends on. + .target( + name: "PetstoreClient", + dependencies: ["AnyCodable", ], + path: "PetstoreClient/Classes" + ), + ] +) diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient.podspec b/samples/client/petstore/swift5/frozenEnums/PetstoreClient.podspec new file mode 100644 index 000000000000..0e6bf7ec0242 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient.podspec @@ -0,0 +1,15 @@ +Pod::Spec.new do |s| + s.name = 'PetstoreClient' + s.ios.deployment_target = '9.0' + s.osx.deployment_target = '10.11' + s.tvos.deployment_target = '9.0' + s.watchos.deployment_target = '3.0' + s.version = '1.0.0' + s.source = { :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v1.0.0' } + s.authors = '' + s.license = 'Proprietary' + s.homepage = 'https://github.com/openapitools/openapi-generator' + s.summary = 'PetstoreClient' + s.source_files = 'PetstoreClient/Classes/**/*.swift' + s.dependency 'AnyCodable-FlightSchool', '~> 0.6.1' +end diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIHelper.swift new file mode 100644 index 000000000000..049b7f655f17 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -0,0 +1,86 @@ +// APIHelper.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +public struct APIHelper { + public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + let destination = source.reduce(into: [String: Any]()) { result, item in + if let value = item.value { + result[item.key] = value + } + } + + if destination.isEmpty { + return nil + } + return destination + } + + public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + return source.reduce(into: [String: String]()) { result, item in + if let collection = item.value as? [Any?] { + result[item.key] = collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .joined(separator: ",") + } else if let value: Any = item.value { + result[item.key] = "\(value)" + } + } + } + + public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + guard let source = source else { + return nil + } + + return source.reduce(into: [String: Any]()) { result, item in + switch item.value { + case let x as Bool: + result[item.key] = x.description + default: + result[item.key] = item.value + } + } + } + + public static func mapValueToPathItem(_ source: Any) -> Any { + if let collection = source as? [Any?] { + return collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .joined(separator: ",") + } + return source + } + + public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + let destination = source.filter { $0.value != nil }.reduce(into: [URLQueryItem]()) { result, item in + if let collection = item.value as? [Any?] { + collection + .compactMap { value in + guard let value = value else { return nil } + return "\(value)" + } + .forEach { value in + result.append(URLQueryItem(name: item.key, value: value)) + } + } else if let value = item.value { + result.append(URLQueryItem(name: item.key, value: "\(value)")) + } + } + + if destination.isEmpty { + return nil + } + return destination + } +} diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs.swift new file mode 100644 index 000000000000..a7933c418ad4 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -0,0 +1,72 @@ +// APIs.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +// We reverted the change of PetstoreClientAPI to PetstoreClient introduced in https://github.com/OpenAPITools/openapi-generator/pull/9624 +// Because it was causing the following issue https://github.com/OpenAPITools/openapi-generator/issues/9953 +// If you are affected by this issue, please consider removing the following two lines, +// By setting the option removeMigrationProjectNameClass to true in the generator +@available(*, deprecated, renamed: "PetstoreClientAPI") +public typealias PetstoreClient = PetstoreClientAPI + +open class PetstoreClientAPI { + public static var basePath = "http://petstore.swagger.io:80/v2" + public static var customHeaders: [String: String] = [:] + public static var credential: URLCredential? + public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() + public static var apiResponseQueue: DispatchQueue = .main +} + +open class RequestBuilder { + var credential: URLCredential? + var headers: [String: String] + public let parameters: [String: Any]? + public let method: String + public let URLString: String + + /// Optional block to obtain a reference to the request's progress instance when available. + /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. + /// If you need to get the request's progress in older OS versions, please use Alamofire http client. + public var onProgressReady: ((Progress) -> Void)? + + required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:]) { + self.method = method + self.URLString = URLString + self.parameters = parameters + self.headers = headers + + addHeaders(PetstoreClientAPI.customHeaders) + } + + open func addHeaders(_ aHeaders: [String: String]) { + for (header, value) in aHeaders { + headers[header] = value + } + } + + @discardableResult + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + return nil + } + + public func addHeader(name: String, value: String) -> Self { + if !value.isEmpty { + headers[name] = value + } + return self + } + + open func addCredential() -> Self { + credential = PetstoreClientAPI.credential + return self + } +} + +public protocol RequestBuilderFactory { + func getNonDecodableBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type +} diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift new file mode 100644 index 000000000000..ac45c1f454b7 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -0,0 +1,58 @@ +// +// AnotherFakeAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +open class AnotherFakeAPI { + + /** + To test special tags + + - parameter body: (body) client model + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + @discardableResult + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + return call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + switch result { + case let .success(response): + completion(response.body, nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + To test special tags + - PATCH /another-fake/dummy + - To test special tags and operation ID starting with number + - parameter body: (body) client model + - returns: RequestBuilder + */ + open class func call123testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { + let localVariablePath = "/another-fake/dummy" + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "PATCH", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } +} diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift new file mode 100644 index 000000000000..9f5c7a495e18 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -0,0 +1,699 @@ +// +// FakeAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +open class FakeAPI { + + /** + + - 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 + */ + @discardableResult + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> URLSessionTask? { + return fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + switch result { + case let .success(response): + completion(response.body, nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + - POST /fake/outer/boolean + - Test serialization of outer boolean types + - parameter body: (body) Input boolean as post body (optional) + - returns: RequestBuilder + */ + open class func fakeOuterBooleanSerializeWithRequestBuilder(body: Bool? = nil) -> RequestBuilder { + let localVariablePath = "/fake/outer/boolean" + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + + /** + + - parameter body: (body) Input composite 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 + */ + @discardableResult + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> URLSessionTask? { + return fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + switch result { + case let .success(response): + completion(response.body, nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + - POST /fake/outer/composite + - Test serialization of object with outer number type + - parameter body: (body) Input composite as post body (optional) + - returns: RequestBuilder + */ + open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { + let localVariablePath = "/fake/outer/composite" + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + + /** + + - parameter body: (body) Input number 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 + */ + @discardableResult + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> URLSessionTask? { + return fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + switch result { + case let .success(response): + completion(response.body, nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + - POST /fake/outer/number + - Test serialization of outer number types + - parameter body: (body) Input number as post body (optional) + - returns: RequestBuilder + */ + open class func fakeOuterNumberSerializeWithRequestBuilder(body: Double? = nil) -> RequestBuilder { + let localVariablePath = "/fake/outer/number" + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + + /** + + - parameter body: (body) Input string 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 + */ + @discardableResult + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + return fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + switch result { + case let .success(response): + completion(response.body, nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + - POST /fake/outer/string + - Test serialization of outer string types + - parameter body: (body) Input string as post body (optional) + - returns: RequestBuilder + */ + open class func fakeOuterStringSerializeWithRequestBuilder(body: String? = nil) -> RequestBuilder { + let localVariablePath = "/fake/outer/string" + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + + /** + + - parameter body: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + @discardableResult + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + switch result { + case .success: + completion((), nil) + case let .failure(error): + completion(nil, 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 localVariablePath = "/fake/body-with-file-schema" + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + + /** + + - parameter query: (query) + - parameter body: (body) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + @discardableResult + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in + switch result { + case .success: + completion((), nil) + case let .failure(error): + completion(nil, 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 localVariablePath = "/fake/body-with-query-params" + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + var localVariableUrlComponents = URLComponents(string: localVariableURLString) + localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "query": query.encodeToJSON(), + ]) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + + /** + To test \"client\" model + + - parameter body: (body) client model + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + @discardableResult + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + switch result { + case let .success(response): + completion(response.body, nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + To test \"client\" model + - PATCH /fake + - To test \"client\" model + - parameter body: (body) client model + - returns: RequestBuilder + */ + open class func testClientModelWithRequestBuilder(body: Client) -> RequestBuilder { + let localVariablePath = "/fake" + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "PATCH", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + + /** + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + + - parameter integer: (form) None (optional) + - parameter int32: (form) None (optional) + - parameter int64: (form) None (optional) + - parameter number: (form) None + - parameter float: (form) None (optional) + - parameter double: (form) None + - parameter string: (form) None (optional) + - parameter patternWithoutDelimiter: (form) None + - parameter byte: (form) None + - parameter binary: (form) None (optional) + - parameter date: (form) None (optional) + - parameter dateTime: (form) None (optional) + - parameter password: (form) None (optional) + - parameter callback: (form) None (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + @discardableResult + open class func 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)) -> URLSessionTask? { + return 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 in + switch result { + case .success: + completion((), nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + - POST /fake + - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + - BASIC: + - type: http + - name: http_basic_test + - parameter integer: (form) None (optional) + - parameter int32: (form) None (optional) + - parameter int64: (form) None (optional) + - parameter number: (form) None + - parameter float: (form) None (optional) + - parameter double: (form) None + - parameter string: (form) None (optional) + - parameter patternWithoutDelimiter: (form) None + - parameter byte: (form) None + - parameter binary: (form) None (optional) + - parameter date: (form) None (optional) + - parameter dateTime: (form) None (optional) + - parameter password: (form) None (optional) + - parameter callback: (form) None (optional) + - returns: RequestBuilder + */ + open 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 localVariablePath = "/fake" + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableFormParams: [String: Any?] = [ + "integer": integer?.encodeToJSON(), + "int32": int32?.encodeToJSON(), + "int64": int64?.encodeToJSON(), + "number": number.encodeToJSON(), + "float": float?.encodeToJSON(), + "double": double.encodeToJSON(), + "string": string?.encodeToJSON(), + "pattern_without_delimiter": patternWithoutDelimiter.encodeToJSON(), + "byte": byte.encodeToJSON(), + "binary": binary?.encodeToJSON(), + "date": date?.encodeToJSON(), + "dateTime": dateTime?.encodeToJSON(), + "password": password?.encodeToJSON(), + "callback": callback?.encodeToJSON(), + ] + + let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + "Content-Type": "application/x-www-form-urlencoded", + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + + /** + * enum for parameter enumHeaderStringArray + */ + public enum EnumHeaderStringArray_testEnumParameters: String, CaseIterable { + case greaterThan = ">" + case dollar = "$" + } + + /** + * enum for parameter enumHeaderString + */ + public enum EnumHeaderString_testEnumParameters: String, CaseIterable { + case abc = "_abc" + case efg = "-efg" + case xyz = "(xyz)" + } + + /** + * enum for parameter enumQueryStringArray + */ + public enum EnumQueryStringArray_testEnumParameters: String, CaseIterable { + case greaterThan = ">" + case dollar = "$" + } + + /** + * enum for parameter enumQueryString + */ + public enum EnumQueryString_testEnumParameters: String, CaseIterable { + case abc = "_abc" + case efg = "-efg" + case xyz = "(xyz)" + } + + /** + * enum for parameter enumQueryInteger + */ + public enum EnumQueryInteger_testEnumParameters: Int, CaseIterable { + case _1 = 1 + case number2 = -2 + } + + /** + * enum for parameter enumQueryDouble + */ + public enum EnumQueryDouble_testEnumParameters: Double, CaseIterable { + case _11 = 1.1 + case number12 = -1.2 + } + + /** + * enum for parameter enumFormStringArray + */ + public enum EnumFormStringArray_testEnumParameters: String, CaseIterable { + case greaterThan = ">" + case dollar = "$" + } + + /** + * enum for parameter enumFormString + */ + public enum EnumFormString_testEnumParameters: String, CaseIterable { + case abc = "_abc" + case efg = "-efg" + case xyz = "(xyz)" + } + + /** + To test enum parameters + + - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) + - parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to .efg) + - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) + - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to .efg) + - 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, default to .dollar) + - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + @discardableResult + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in + switch result { + case .success: + completion((), nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + To test enum parameters + - GET /fake + - To test enum parameters + - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) + - parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to .efg) + - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) + - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to .efg) + - 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, default to .dollar) + - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) + - returns: RequestBuilder + */ + open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { + let localVariablePath = "/fake" + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableFormParams: [String: Any?] = [ + "enum_form_string_array": enumFormStringArray?.encodeToJSON(), + "enum_form_string": enumFormString?.encodeToJSON(), + ] + + let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + + var localVariableUrlComponents = URLComponents(string: localVariableURLString) + localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_double": enumQueryDouble?.encodeToJSON(), + ]) + + let localVariableNillableHeaders: [String: Any?] = [ + "Content-Type": "application/x-www-form-urlencoded", + "enum_header_string_array": enumHeaderStringArray?.encodeToJSON(), + "enum_header_string": enumHeaderString?.encodeToJSON(), + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + + /** + 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 apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + @discardableResult + open class func 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)) -> URLSessionTask? { + return testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in + switch result { + case .success: + completion((), nil) + case let .failure(error): + completion(nil, 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: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { + let localVariablePath = "/fake" + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableParameters: [String: Any]? = nil + + var localVariableUrlComponents = URLComponents(string: localVariableURLString) + localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), + "int64_group": int64Group?.encodeToJSON(), + ]) + + let localVariableNillableHeaders: [String: Any?] = [ + "required_boolean_group": requiredBooleanGroup.encodeToJSON(), + "boolean_group": booleanGroup?.encodeToJSON(), + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + + /** + test inline additionalProperties + + - parameter param: (body) request body + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + @discardableResult + open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in + switch result { + case .success: + completion((), nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + test inline additionalProperties + - POST /fake/inline-additionalProperties + - parameter param: (body) request body + - returns: RequestBuilder + */ + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { + let localVariablePath = "/fake/inline-additionalProperties" + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + + /** + test json serialization of form data + + - parameter param: (form) field1 + - parameter param2: (form) field2 + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + @discardableResult + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in + switch result { + case .success: + completion((), nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + test json serialization of form data + - GET /fake/jsonFormData + - parameter param: (form) field1 + - parameter param2: (form) field2 + - returns: RequestBuilder + */ + open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { + let localVariablePath = "/fake/jsonFormData" + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableFormParams: [String: Any?] = [ + "param": param.encodeToJSON(), + "param2": param2.encodeToJSON(), + ] + + let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + "Content-Type": "application/x-www-form-urlencoded", + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } +} diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift new file mode 100644 index 000000000000..ac274a7c550a --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -0,0 +1,61 @@ +// +// FakeClassnameTags123API.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +open class FakeClassnameTags123API { + + /** + To test class name in snake case + + - parameter body: (body) client model + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + @discardableResult + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + return testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + switch result { + case let .success(response): + completion(response.body, nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + To test class name in snake case + - PATCH /fake_classname_test + - To test class name in snake case + - API Key: + - type: apiKey api_key_query (QUERY) + - name: api_key_query + - parameter body: (body) client model + - returns: RequestBuilder + */ + open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder { + let localVariablePath = "/fake_classname_test" + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "PATCH", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } +} diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift new file mode 100644 index 000000000000..2baca7e644ac --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -0,0 +1,495 @@ +// +// PetAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +open class PetAPI { + + /** + Add a new pet to the store + + - parameter body: (body) Pet object that needs to be added to the store + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + @discardableResult + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + switch result { + case .success: + completion((), nil) + case let .failure(error): + completion(nil, 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 + - returns: RequestBuilder + */ + open class func addPetWithRequestBuilder(body: Pet) -> RequestBuilder { + let localVariablePath = "/pet" + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + + /** + Deletes a pet + + - parameter apiKey: (header) (optional) + - parameter petId: (path) Pet id to delete + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + @discardableResult + open class func deletePet(apiKey: String? = nil, petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return deletePetWithRequestBuilder(apiKey: apiKey, petId: petId).execute(apiResponseQueue) { result in + switch result { + case .success: + completion((), nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Deletes a pet + - DELETE /pet/{petId} + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter apiKey: (header) (optional) + - parameter petId: (path) Pet id to delete + - returns: RequestBuilder + */ + open class func deletePetWithRequestBuilder(apiKey: String? = nil, petId: Int64) -> RequestBuilder { + var localVariablePath = "/pet/{petId}" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableParameters: [String: Any]? = nil + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + "api_key": apiKey?.encodeToJSON(), + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + + /** + * enum for parameter status + */ + public enum Status_findPetsByStatus: String, CaseIterable { + case available = "available" + case pending = "pending" + case sold = "sold" + } + + /** + Finds Pets by status + + - parameter status: (query) Status values that need to be considered for filter + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + @discardableResult + open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in + switch result { + case let .success(response): + completion(response.body, nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Finds Pets by status + - GET /pet/findByStatus + - Multiple status values can be provided with comma separated strings + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter status: (query) Status values that need to be considered for filter + - returns: RequestBuilder<[Pet]> + */ + open class func findPetsByStatusWithRequestBuilder(status: [Status_findPetsByStatus]) -> RequestBuilder<[Pet]> { + let localVariablePath = "/pet/findByStatus" + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableParameters: [String: Any]? = nil + + var localVariableUrlComponents = URLComponents(string: localVariableURLString) + localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "status": status.encodeToJSON(), + ]) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + + /** + Finds Pets by tags + + - parameter tags: (query) Tags to filter by + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + @available(*, deprecated, message: "This operation is deprecated.") + @discardableResult + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + return findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in + switch result { + case let .success(response): + completion(response.body, nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Finds Pets by tags + - GET /pet/findByTags + - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter tags: (query) Tags to filter by + - returns: RequestBuilder<[Pet]> + */ + @available(*, deprecated, message: "This operation is deprecated.") + open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { + let localVariablePath = "/pet/findByTags" + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableParameters: [String: Any]? = nil + + var localVariableUrlComponents = URLComponents(string: localVariableURLString) + localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "tags": tags.encodeToJSON(), + ]) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + + /** + Find pet by ID + + - parameter petId: (path) ID of pet to return + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + @discardableResult + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in + switch result { + case let .success(response): + completion(response.body, nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Find pet by ID + - GET /pet/{petId} + - Returns a single pet + - API Key: + - type: apiKey api_key + - name: api_key + - parameter petId: (path) ID of pet to return + - returns: RequestBuilder + */ + open class func getPetByIdWithRequestBuilder(petId: Int64) -> RequestBuilder { + var localVariablePath = "/pet/{petId}" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableParameters: [String: Any]? = nil + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + + /** + Update an existing pet + + - parameter body: (body) Pet object that needs to be added to the store + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + @discardableResult + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + switch result { + case .success: + completion((), nil) + case let .failure(error): + completion(nil, 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 + - returns: RequestBuilder + */ + open class func updatePetWithRequestBuilder(body: Pet) -> RequestBuilder { + let localVariablePath = "/pet" + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + + /** + Updates a pet in the store with form data + + - parameter petId: (path) ID of pet that needs to be updated + - parameter name: (form) Updated name of the pet (optional) + - parameter status: (form) Updated status of the pet (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + @discardableResult + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in + switch result { + case .success: + completion((), nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Updates a pet in the store with form data + - POST /pet/{petId} + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter petId: (path) ID of pet that needs to be updated + - parameter name: (form) Updated name of the pet (optional) + - parameter status: (form) Updated status of the pet (optional) + - returns: RequestBuilder + */ + open class func updatePetWithFormWithRequestBuilder(petId: Int64, name: String? = nil, status: String? = nil) -> RequestBuilder { + var localVariablePath = "/pet/{petId}" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableFormParams: [String: Any?] = [ + "name": name?.encodeToJSON(), + "status": status?.encodeToJSON(), + ] + + let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + "Content-Type": "application/x-www-form-urlencoded", + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + + /** + uploads an image + + - parameter petId: (path) ID of pet to update + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - parameter file: (form) file to upload (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + @discardableResult + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + return uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in + switch result { + case let .success(response): + completion(response.body, nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + uploads an image + - POST /pet/{petId}/uploadImage + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter petId: (path) ID of pet to update + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - parameter file: (form) file to upload (optional) + - returns: RequestBuilder + */ + open class func uploadFileWithRequestBuilder(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> RequestBuilder { + var localVariablePath = "/pet/{petId}/uploadImage" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableFormParams: [String: Any?] = [ + "additionalMetadata": additionalMetadata?.encodeToJSON(), + "file": file?.encodeToJSON(), + ] + + let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + "Content-Type": "multipart/form-data", + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + + /** + uploads an image (required) + + - parameter petId: (path) ID of pet to update + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - parameter requiredFile: (form) file to upload + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + @discardableResult + open class func uploadFileWithRequiredFile(petId: Int64, additionalMetadata: String? = nil, requiredFile: URL, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + return uploadFileWithRequiredFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, requiredFile: requiredFile).execute(apiResponseQueue) { result in + switch result { + case let .success(response): + completion(response.body, nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + uploads an image (required) + - POST /fake/{petId}/uploadImageWithRequiredFile + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter petId: (path) ID of pet to update + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - parameter requiredFile: (form) file to upload + - returns: RequestBuilder + */ + open class func uploadFileWithRequiredFileWithRequestBuilder(petId: Int64, additionalMetadata: String? = nil, requiredFile: URL) -> RequestBuilder { + var localVariablePath = "/fake/{petId}/uploadImageWithRequiredFile" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableFormParams: [String: Any?] = [ + "additionalMetadata": additionalMetadata?.encodeToJSON(), + "requiredFile": requiredFile.encodeToJSON(), + ] + + let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + "Content-Type": "multipart/form-data", + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } +} diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift new file mode 100644 index 000000000000..f25392268665 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -0,0 +1,196 @@ +// +// StoreAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +open class StoreAPI { + + /** + Delete purchase order by ID + + - parameter orderId: (path) ID of the order that needs to be deleted + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + @discardableResult + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + switch result { + case .success: + completion((), nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Delete purchase order by ID + - DELETE /store/order/{order_id} + - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + - parameter orderId: (path) ID of the order that needs to be deleted + - returns: RequestBuilder + */ + open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { + var localVariablePath = "/store/order/{order_id}" + let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" + let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableParameters: [String: Any]? = nil + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + + /** + Returns pet inventories by status + + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + @discardableResult + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in + switch result { + case let .success(response): + completion(response.body, nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Returns pet inventories by status + - GET /store/inventory + - Returns a map of status codes to quantities + - API Key: + - type: apiKey api_key + - name: api_key + - returns: RequestBuilder<[String: Int]> + */ + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + let localVariablePath = "/store/inventory" + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableParameters: [String: Any]? = nil + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + + /** + Find purchase order by ID + + - parameter orderId: (path) ID of pet that needs to be fetched + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + @discardableResult + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + switch result { + case let .success(response): + completion(response.body, nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Find purchase order by ID + - GET /store/order/{order_id} + - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + - parameter orderId: (path) ID of pet that needs to be fetched + - returns: RequestBuilder + */ + open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { + var localVariablePath = "/store/order/{order_id}" + let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" + let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableParameters: [String: Any]? = nil + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + + /** + Place an order for a pet + + - parameter body: (body) order placed for purchasing the pet + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + @discardableResult + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + return placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + switch result { + case let .success(response): + completion(response.body, nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Place an order for a pet + - POST /store/order + - parameter body: (body) order placed for purchasing the pet + - returns: RequestBuilder + */ + open class func placeOrderWithRequestBuilder(body: Order) -> RequestBuilder { + let localVariablePath = "/store/order" + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } +} diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift new file mode 100644 index 000000000000..3fc59f9ef4fc --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -0,0 +1,377 @@ +// +// UserAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +open class UserAPI { + + /** + Create user + + - parameter body: (body) Created user object + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + @discardableResult + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + switch result { + case .success: + completion((), nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Create user + - POST /user + - This can only be done by the logged in user. + - parameter body: (body) Created user object + - returns: RequestBuilder + */ + open class func createUserWithRequestBuilder(body: User) -> RequestBuilder { + let localVariablePath = "/user" + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + + /** + Creates list of users with given input array + + - parameter body: (body) List of user object + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + @discardableResult + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + switch result { + case .success: + completion((), nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Creates list of users with given input array + - POST /user/createWithArray + - parameter body: (body) List of user object + - returns: RequestBuilder + */ + open class func createUsersWithArrayInputWithRequestBuilder(body: [User]) -> RequestBuilder { + let localVariablePath = "/user/createWithArray" + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + + /** + Creates list of users with given input array + + - parameter body: (body) List of user object + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + @discardableResult + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + switch result { + case .success: + completion((), nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Creates list of users with given input array + - POST /user/createWithList + - parameter body: (body) List of user object + - returns: RequestBuilder + */ + open class func createUsersWithListInputWithRequestBuilder(body: [User]) -> RequestBuilder { + let localVariablePath = "/user/createWithList" + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + + /** + Delete user + + - parameter username: (path) The name that needs to be deleted + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + @discardableResult + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + switch result { + case .success: + completion((), nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Delete user + - DELETE /user/{username} + - This can only be done by the logged in user. + - parameter username: (path) The name that needs to be deleted + - returns: RequestBuilder + */ + open class func deleteUserWithRequestBuilder(username: String) -> RequestBuilder { + var localVariablePath = "/user/{username}" + let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" + let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableParameters: [String: Any]? = nil + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + + /** + Get user by user name + + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + @discardableResult + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> URLSessionTask? { + return getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + switch result { + case let .success(response): + completion(response.body, nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Get user by user name + - GET /user/{username} + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - returns: RequestBuilder + */ + open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { + var localVariablePath = "/user/{username}" + let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" + let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableParameters: [String: Any]? = nil + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + + /** + Logs user into the system + + - parameter username: (query) The user name for login + - parameter password: (query) The password for login in clear text + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + @discardableResult + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + return loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in + switch result { + case let .success(response): + completion(response.body, nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Logs user into the system + - GET /user/login + - responseHeaders: [X-Rate-Limit(Int), X-Expires-After(Date)] + - parameter username: (query) The user name for login + - parameter password: (query) The password for login in clear text + - returns: RequestBuilder + */ + open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { + let localVariablePath = "/user/login" + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableParameters: [String: Any]? = nil + + var localVariableUrlComponents = URLComponents(string: localVariableURLString) + localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "username": username.encodeToJSON(), + "password": password.encodeToJSON(), + ]) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + + /** + Logs out current logged in user session + + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + @discardableResult + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in + switch result { + case .success: + completion((), nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Logs out current logged in user session + - GET /user/logout + - returns: RequestBuilder + */ + open class func logoutUserWithRequestBuilder() -> RequestBuilder { + let localVariablePath = "/user/logout" + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableParameters: [String: Any]? = nil + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + + /** + Updated user + + - parameter username: (path) name that need to be deleted + - parameter body: (body) Updated user object + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + @discardableResult + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + return updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in + switch result { + case .success: + completion((), nil) + case let .failure(error): + completion(nil, 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 + - returns: RequestBuilder + */ + open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { + var localVariablePath = "/user/{username}" + let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" + let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) + let localVariableURLString = PetstoreClientAPI.basePath + localVariablePath + let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } +} diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift new file mode 100644 index 000000000000..09c82e53e132 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -0,0 +1,49 @@ +// +// CodableHelper.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +open class CodableHelper { + private static var customDateFormatter: DateFormatter? + private static var defaultDateFormatter: DateFormatter = OpenISO8601DateFormatter() + + private static var customJSONDecoder: JSONDecoder? + private static var defaultJSONDecoder: JSONDecoder = { + let decoder = JSONDecoder() + decoder.dateDecodingStrategy = .formatted(CodableHelper.dateFormatter) + return decoder + }() + + private static var customJSONEncoder: JSONEncoder? + private static var defaultJSONEncoder: JSONEncoder = { + let encoder = JSONEncoder() + encoder.dateEncodingStrategy = .formatted(CodableHelper.dateFormatter) + encoder.outputFormatting = .prettyPrinted + return encoder + }() + + public static var dateFormatter: DateFormatter { + get { return customDateFormatter ?? defaultDateFormatter } + set { customDateFormatter = newValue } + } + public static var jsonDecoder: JSONDecoder { + get { return customJSONDecoder ?? defaultJSONDecoder } + set { customJSONDecoder = newValue } + } + public static var jsonEncoder: JSONEncoder { + get { return customJSONEncoder ?? defaultJSONEncoder } + set { customJSONEncoder = newValue } + } + + open class func decode(_ type: T.Type, from data: Data) -> Swift.Result where T: Decodable { + return Swift.Result { try jsonDecoder.decode(type, from: data) } + } + + open class func encode(_ value: T) -> Swift.Result where T: Encodable { + return Swift.Result { try jsonEncoder.encode(value) } + } +} diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Configuration.swift new file mode 100644 index 000000000000..8fb053318894 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -0,0 +1,15 @@ +// Configuration.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +open class Configuration { + + // This value is used to configure the date formatter that is used to serialize dates into JSON format. + // You must set it prior to encoding any dates, and it will only be read once. + @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") + public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" +} diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Extensions.swift new file mode 100644 index 000000000000..e2b73073804d --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -0,0 +1,158 @@ +// Extensions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +extension Bool: JSONEncodable {} +extension Float: JSONEncodable {} +extension Int: JSONEncodable {} +extension Int32: JSONEncodable {} +extension Int64: JSONEncodable {} +extension Double: JSONEncodable {} +extension String: JSONEncodable {} +extension URL: JSONEncodable {} +extension UUID: JSONEncodable {} + +extension RawRepresentable where RawValue: JSONEncodable { + func encodeToJSON() -> Any { return self.rawValue } +} + +private func encodeIfPossible(_ object: T) -> Any { + if let encodableObject = object as? JSONEncodable { + return encodableObject.encodeToJSON() + } else { + return object + } +} + +extension Array: JSONEncodable { + func encodeToJSON() -> Any { + return self.map(encodeIfPossible) + } +} + +extension Set: JSONEncodable { + func encodeToJSON() -> Any { + return Array(self).encodeToJSON() + } +} + +extension Dictionary: JSONEncodable { + func encodeToJSON() -> Any { + var dictionary = [AnyHashable: Any]() + for (key, value) in self { + dictionary[key] = encodeIfPossible(value) + } + return dictionary + } +} + +extension Data: JSONEncodable { + func encodeToJSON() -> Any { + return self.base64EncodedString(options: Data.Base64EncodingOptions()) + } +} + +extension Date: JSONEncodable { + func encodeToJSON() -> Any { + return CodableHelper.dateFormatter.string(from: self) + } +} + +extension String: CodingKey { + + public var stringValue: String { + return self + } + + public init?(stringValue: String) { + self.init(stringLiteral: stringValue) + } + + public var intValue: Int? { + return nil + } + + public init?(intValue: Int) { + return nil + } + +} + +extension KeyedEncodingContainerProtocol { + + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + var arrayContainer = nestedUnkeyedContainer(forKey: key) + try arrayContainer.encode(contentsOf: values) + } + + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + if let values = values { + try encodeArray(values, forKey: key) + } + } + + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + for (key, value) in pairs { + try encode(value, forKey: key) + } + } + + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + if let pairs = pairs { + try encodeMap(pairs) + } + } + +} + +extension KeyedDecodingContainerProtocol { + + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + var tmpArray = [T]() + + var nestedContainer = try nestedUnkeyedContainer(forKey: key) + while !nestedContainer.isAtEnd { + let arrayValue = try nestedContainer.decode(T.self) + tmpArray.append(arrayValue) + } + + return tmpArray + } + + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { + var tmpArray: [T]? + + if contains(key) { + tmpArray = try decodeArray(T.self, forKey: key) + } + + return tmpArray + } + + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { + var map: [Self.Key: T] = [:] + + for key in allKeys { + if !excludedKeys.contains(key) { + let value = try decode(T.self, forKey: key) + map[key] = value + } + } + + return map + } + +} + +extension HTTPURLResponse { + var isStatusCodeSuccessful: Bool { + return (200 ..< 300).contains(statusCode) + } +} diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift new file mode 100644 index 000000000000..b79e9f5e64d5 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -0,0 +1,53 @@ +// +// JSONDataEncoding.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +public struct JSONDataEncoding { + + // MARK: Properties + + private static let jsonDataKey = "jsonData" + + // MARK: Encoding + + /// Creates a URL request by encoding parameters and applying them onto an existing request. + /// + /// - parameter urlRequest: The request to have parameters applied. + /// - parameter parameters: The parameters to apply. This should have a single key/value + /// pair with "jsonData" as the key and a Data object as the value. + /// + /// - throws: An `Error` if the encoding process encounters an error. + /// + /// - returns: The encoded request. + public func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) -> URLRequest { + var urlRequest = urlRequest + + guard let jsonData = parameters?[JSONDataEncoding.jsonDataKey] as? Data, !jsonData.isEmpty else { + return urlRequest + } + + if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { + urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") + } + + urlRequest.httpBody = jsonData + + return urlRequest + } + + public static func encodingParameters(jsonData: Data?) -> [String: Any]? { + var returnedParams: [String: Any]? + if let jsonData = jsonData, !jsonData.isEmpty { + var params: [String: Any] = [:] + params[jsonDataKey] = jsonData + returnedParams = params + } + return returnedParams + } + +} diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift new file mode 100644 index 000000000000..02f78ffb4705 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -0,0 +1,45 @@ +// +// JSONEncodingHelper.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +open class JSONEncodingHelper { + + open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? + + // Encode the Encodable object + if let encodableObj = encodableObj { + let encodeResult = CodableHelper.encode(encodableObj) + do { + let data = try encodeResult.get() + params = JSONDataEncoding.encodingParameters(jsonData: data) + } catch { + print(error.localizedDescription) + } + } + + return params + } + + open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { + var params: [String: Any]? + + if let encodableObj = encodableObj { + do { + let data = try JSONSerialization.data(withJSONObject: encodableObj, options: .prettyPrinted) + params = JSONDataEncoding.encodingParameters(jsonData: data) + } catch { + print(error.localizedDescription) + return nil + } + } + + return params + } + +} diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models.swift new file mode 100644 index 000000000000..7787127c40d8 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -0,0 +1,80 @@ +// Models.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +protocol JSONEncodable { + func encodeToJSON() -> Any +} + +extension JSONEncodable { + func encodeToJSON() -> Any { self } +} + +/// An enum where the last case value can be used as a default catch-all. +protocol CaseIterableDefaultsLast: Decodable & CaseIterable & RawRepresentable +where RawValue: Decodable, AllCases: BidirectionalCollection {} + +extension CaseIterableDefaultsLast { + /// Initializes an enum such that if a known raw value is found, then it is decoded. + /// Otherwise the last case is used. + /// - Parameter decoder: A decoder. + public init(from decoder: Decoder) throws { + if let value = try Self(rawValue: decoder.singleValueContainer().decode(RawValue.self)) { + self = value + } else if let lastValue = Self.allCases.last { + self = lastValue + } else { + throw DecodingError.valueNotFound( + Self.Type.self, + .init(codingPath: decoder.codingPath, debugDescription: "CaseIterableDefaultsLast") + ) + } + } +} + +public enum ErrorResponse: Error { + case error(Int, Data?, URLResponse?, Error) +} + +public enum DownloadException: Error { + case responseDataMissing + case responseFailed + case requestMissing + case requestMissingPath + case requestMissingURL +} + +public enum DecodableRequestBuilderError: Error { + case emptyDataResponse + case nilHTTPResponse + case unsuccessfulHTTPStatusCode + case jsonDecoding(DecodingError) + case generalError(Error) +} + +open class Response { + public let statusCode: Int + public let header: [String: String] + public let body: T + + public init(statusCode: Int, header: [String: String], body: T) { + self.statusCode = statusCode + self.header = header + self.body = body + } + + public convenience init(response: HTTPURLResponse, body: T) { + let rawHeader = response.allHeaderFields + var header = [String: String]() + for (key, value) in rawHeader { + if let key = key.base as? String, let value = value as? String { + header[key] = value + } + } + self.init(statusCode: response.statusCode, header: header, body: body) + } +} diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift new file mode 100644 index 000000000000..621afb93561d --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -0,0 +1,36 @@ +// +// AdditionalPropertiesClass.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct AdditionalPropertiesClass: Codable, Hashable { + + public var mapString: [String: String]? + public var mapMapString: [String: [String: String]]? + + public init(mapString: [String: String]? = nil, mapMapString: [String: [String: String]]? = nil) { + self.mapString = mapString + self.mapMapString = mapMapString + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case mapString = "map_string" + case mapMapString = "map_map_string" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(mapString, forKey: .mapString) + try container.encodeIfPresent(mapMapString, forKey: .mapMapString) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift new file mode 100644 index 000000000000..cdd4f5335b98 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -0,0 +1,36 @@ +// +// Animal.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct Animal: Codable, Hashable { + + public var className: String + public var color: String? = "red" + + public init(className: String, color: String? = "red") { + self.className = className + self.color = color + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case className + case color + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(className, forKey: .className) + try container.encodeIfPresent(color, forKey: .color) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift new file mode 100644 index 000000000000..a0b09cb97615 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -0,0 +1,13 @@ +// +// AnimalFarm.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift new file mode 100644 index 000000000000..c365505ab9d8 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -0,0 +1,40 @@ +// +// ApiResponse.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct ApiResponse: Codable, Hashable { + + public var code: Int? + public var type: String? + public var message: String? + + public init(code: Int? = nil, type: String? = nil, message: String? = nil) { + self.code = code + self.type = type + self.message = message + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case code + case type + case message + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(code, forKey: .code) + try container.encodeIfPresent(type, forKey: .type) + try container.encodeIfPresent(message, forKey: .message) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift new file mode 100644 index 000000000000..226f74561811 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -0,0 +1,32 @@ +// +// ArrayOfArrayOfNumberOnly.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct ArrayOfArrayOfNumberOnly: Codable, Hashable { + + public var arrayArrayNumber: [[Double]]? + + public init(arrayArrayNumber: [[Double]]? = nil) { + self.arrayArrayNumber = arrayArrayNumber + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case arrayArrayNumber = "ArrayArrayNumber" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(arrayArrayNumber, forKey: .arrayArrayNumber) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift new file mode 100644 index 000000000000..398311278715 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -0,0 +1,32 @@ +// +// ArrayOfNumberOnly.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct ArrayOfNumberOnly: Codable, Hashable { + + public var arrayNumber: [Double]? + + public init(arrayNumber: [Double]? = nil) { + self.arrayNumber = arrayNumber + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case arrayNumber = "ArrayNumber" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(arrayNumber, forKey: .arrayNumber) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift new file mode 100644 index 000000000000..8865d76bef23 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -0,0 +1,40 @@ +// +// ArrayTest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct ArrayTest: Codable, Hashable { + + public var arrayOfString: [String]? + public var arrayArrayOfInteger: [[Int64]]? + public var arrayArrayOfModel: [[ReadOnlyFirst]]? + + public init(arrayOfString: [String]? = nil, arrayArrayOfInteger: [[Int64]]? = nil, arrayArrayOfModel: [[ReadOnlyFirst]]? = nil) { + self.arrayOfString = arrayOfString + self.arrayArrayOfInteger = arrayArrayOfInteger + self.arrayArrayOfModel = arrayArrayOfModel + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case arrayOfString = "array_of_string" + case arrayArrayOfInteger = "array_array_of_integer" + case arrayArrayOfModel = "array_array_of_model" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(arrayOfString, forKey: .arrayOfString) + try container.encodeIfPresent(arrayArrayOfInteger, forKey: .arrayArrayOfInteger) + try container.encodeIfPresent(arrayArrayOfModel, forKey: .arrayArrayOfModel) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift new file mode 100644 index 000000000000..71cd93bce5fe --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -0,0 +1,53 @@ +// +// Capitalization.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct Capitalization: Codable, Hashable { + + public var smallCamel: String? + public var capitalCamel: String? + public var smallSnake: String? + public var capitalSnake: String? + public var sCAETHFlowPoints: String? + /** Name of the pet */ + public var ATT_NAME: String? + + public init(smallCamel: String? = nil, capitalCamel: String? = nil, smallSnake: String? = nil, capitalSnake: String? = nil, sCAETHFlowPoints: String? = nil, ATT_NAME: String? = nil) { + self.smallCamel = smallCamel + self.capitalCamel = capitalCamel + self.smallSnake = smallSnake + self.capitalSnake = capitalSnake + self.sCAETHFlowPoints = sCAETHFlowPoints + self.ATT_NAME = ATT_NAME + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case smallCamel + case capitalCamel = "CapitalCamel" + case smallSnake = "small_Snake" + case capitalSnake = "Capital_Snake" + case sCAETHFlowPoints = "SCA_ETH_Flow_Points" + case ATT_NAME + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(smallCamel, forKey: .smallCamel) + try container.encodeIfPresent(capitalCamel, forKey: .capitalCamel) + try container.encodeIfPresent(smallSnake, forKey: .smallSnake) + try container.encodeIfPresent(capitalSnake, forKey: .capitalSnake) + try container.encodeIfPresent(sCAETHFlowPoints, forKey: .sCAETHFlowPoints) + try container.encodeIfPresent(ATT_NAME, forKey: .ATT_NAME) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift new file mode 100644 index 000000000000..457e04bd475e --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -0,0 +1,40 @@ +// +// Cat.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct Cat: Codable, Hashable { + + public var className: String + public var color: String? = "red" + public var declawed: Bool? + + public init(className: String, color: String? = "red", declawed: Bool? = nil) { + self.className = className + self.color = color + self.declawed = declawed + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case className + case color + case declawed + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(className, forKey: .className) + try container.encodeIfPresent(color, forKey: .color) + try container.encodeIfPresent(declawed, forKey: .declawed) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift new file mode 100644 index 000000000000..8caebb1c2065 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -0,0 +1,32 @@ +// +// CatAllOf.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct CatAllOf: Codable, Hashable { + + public var declawed: Bool? + + public init(declawed: Bool? = nil) { + self.declawed = declawed + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case declawed + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(declawed, forKey: .declawed) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Category.swift new file mode 100644 index 000000000000..89016ca353d8 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -0,0 +1,36 @@ +// +// Category.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct Category: Codable, Hashable { + + public var id: Int64? + public var name: String? = "default-name" + + public init(id: Int64? = nil, name: String? = "default-name") { + self.id = id + self.name = name + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case id + case name + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(id, forKey: .id) + try container.encode(name, forKey: .name) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift new file mode 100644 index 000000000000..16e69e560bdf --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -0,0 +1,33 @@ +// +// ClassModel.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +/** Model for testing model with \"_class\" property */ +public struct ClassModel: Codable, Hashable { + + public var _class: String? + + public init(_class: String? = nil) { + self._class = _class + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case _class + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(_class, forKey: ._class) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Client.swift new file mode 100644 index 000000000000..60dbc5dc5c1c --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -0,0 +1,32 @@ +// +// Client.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct Client: Codable, Hashable { + + public var client: String? + + public init(client: String? = nil) { + self.client = client + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case client + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(client, forKey: .client) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift new file mode 100644 index 000000000000..658732a7f36f --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -0,0 +1,40 @@ +// +// Dog.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct Dog: Codable, Hashable { + + public var className: String + public var color: String? = "red" + public var breed: String? + + public init(className: String, color: String? = "red", breed: String? = nil) { + self.className = className + self.color = color + self.breed = breed + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case className + case color + case breed + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(className, forKey: .className) + try container.encodeIfPresent(color, forKey: .color) + try container.encodeIfPresent(breed, forKey: .breed) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift new file mode 100644 index 000000000000..82b0dedf35bf --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -0,0 +1,32 @@ +// +// DogAllOf.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct DogAllOf: Codable, Hashable { + + public var breed: String? + + public init(breed: String? = nil) { + self.breed = breed + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case breed + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(breed, forKey: .breed) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift new file mode 100644 index 000000000000..321066b9f4ed --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -0,0 +1,54 @@ +// +// EnumArrays.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct EnumArrays: Codable, Hashable { + + public enum JustSymbol: String, Codable, CaseIterable, CaseIterableDefaultsLast { + case greaterThanOrEqualTo = ">=" + case dollar = "$" + // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". + // If new enum cases are added that are unknown to the spec/client, they are safely + // decoded to this case. The raw value of this case is a dummy value that attempts + // to avoids collisions with previously specified cases. + case unknownDefaultOpenAPI = "unknown_default_open_api" + } + public enum ArrayEnum: String, Codable, CaseIterable, CaseIterableDefaultsLast { + case fish = "fish" + case crab = "crab" + // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". + // If new enum cases are added that are unknown to the spec/client, they are safely + // decoded to this case. The raw value of this case is a dummy value that attempts + // to avoids collisions with previously specified cases. + case unknownDefaultOpenAPI = "unknown_default_open_api" + } + public var justSymbol: JustSymbol? + public var arrayEnum: [ArrayEnum]? + + public init(justSymbol: JustSymbol? = nil, arrayEnum: [ArrayEnum]? = nil) { + self.justSymbol = justSymbol + self.arrayEnum = arrayEnum + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case justSymbol = "just_symbol" + case arrayEnum = "array_enum" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(justSymbol, forKey: .justSymbol) + try container.encodeIfPresent(arrayEnum, forKey: .arrayEnum) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift new file mode 100644 index 000000000000..eef3045b2915 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -0,0 +1,22 @@ +// +// EnumClass.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public enum EnumClass: String, Codable, CaseIterable, CaseIterableDefaultsLast { + case abc = "_abc" + case efg = "-efg" + case xyz = "(xyz)" + // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". + // If new enum cases are added that are unknown to the spec/client, they are safely + // decoded to this case. The raw value of this case is a dummy value that attempts + // to avoids collisions with previously specified cases. + case unknownDefaultOpenAPI = "unknown_default_open_api" +} diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift new file mode 100644 index 000000000000..d6a96c72d97e --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -0,0 +1,96 @@ +// +// EnumTest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct EnumTest: Codable, Hashable { + + public enum EnumString: String, Codable, CaseIterable, CaseIterableDefaultsLast { + case upper = "UPPER" + case lower = "lower" + case empty = "" + // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". + // If new enum cases are added that are unknown to the spec/client, they are safely + // decoded to this case. The raw value of this case is a dummy value that attempts + // to avoids collisions with previously specified cases. + case unknownDefaultOpenAPI = "unknown_default_open_api" + } + public enum EnumStringRequired: String, Codable, CaseIterable, CaseIterableDefaultsLast { + case upper = "UPPER" + case lower = "lower" + case empty = "" + // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". + // If new enum cases are added that are unknown to the spec/client, they are safely + // decoded to this case. The raw value of this case is a dummy value that attempts + // to avoids collisions with previously specified cases. + case unknownDefaultOpenAPI = "unknown_default_open_api" + } + public enum EnumInteger: Int, Codable, CaseIterable, CaseIterableDefaultsLast { + case _1 = 1 + case number1 = -1 + // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". + // If new enum cases are added that are unknown to the spec/client, they are safely + // decoded to this case. The raw value of this case is a dummy value that attempts + // to avoids collisions with previously specified cases. + // + // 192, used to calculate the raw value, was the Swift Evolution proposal for + // frozen/non-frozen enums. + // [SE-0192](https://github.com/apple/swift-evolution/blob/master/proposals/0192-non-exhaustive-enums.md) + // + case unknownDefaultOpenAPI = -11184809 // Int.min / 192 + } + public enum EnumNumber: Double, Codable, CaseIterable, CaseIterableDefaultsLast { + case _11 = 1.1 + case number12 = -1.2 + // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". + // If new enum cases are added that are unknown to the spec/client, they are safely + // decoded to this case. The raw value of this case is a dummy value that attempts + // to avoids collisions with previously specified cases. + // + // 192, used to calculate the raw value, was the Swift Evolution proposal for + // frozen/non-frozen enums. + // [SE-0192](https://github.com/apple/swift-evolution/blob/master/proposals/0192-non-exhaustive-enums.md) + // + case unknownDefaultOpenAPI = -11184809 // Int.min / 192 + } + 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) { + self.enumString = enumString + self.enumStringRequired = enumStringRequired + self.enumInteger = enumInteger + self.enumNumber = enumNumber + self.outerEnum = outerEnum + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case enumString = "enum_string" + case enumStringRequired = "enum_string_required" + case enumInteger = "enum_integer" + case enumNumber = "enum_number" + case outerEnum + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(enumString, forKey: .enumString) + try container.encode(enumStringRequired, forKey: .enumStringRequired) + try container.encodeIfPresent(enumInteger, forKey: .enumInteger) + try container.encodeIfPresent(enumNumber, forKey: .enumNumber) + try container.encodeIfPresent(outerEnum, forKey: .outerEnum) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/File.swift new file mode 100644 index 000000000000..05dd5b1a825e --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -0,0 +1,34 @@ +// +// File.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +/** Must be named `File` for test. */ +public struct File: Codable, Hashable { + + /** Test capitalization */ + public var sourceURI: String? + + public init(sourceURI: String? = nil) { + self.sourceURI = sourceURI + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case sourceURI + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(sourceURI, forKey: .sourceURI) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift new file mode 100644 index 000000000000..3ca66a313590 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -0,0 +1,36 @@ +// +// FileSchemaTestClass.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct FileSchemaTestClass: Codable, Hashable { + + public var file: File? + public var files: [File]? + + public init(file: File? = nil, files: [File]? = nil) { + self.file = file + self.files = files + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case file + case files + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(file, forKey: .file) + try container.encodeIfPresent(files, forKey: .files) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift new file mode 100644 index 000000000000..a7a4b39e7207 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -0,0 +1,80 @@ +// +// FormatTest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct FormatTest: Codable, Hashable { + + public var integer: Int? + public var int32: Int? + public var int64: Int64? + public var number: Double + public var float: Float? + public var double: Double? + public var string: String? + public var byte: Data + public var binary: URL? + public var date: Date + public var dateTime: Date? + public var uuid: UUID? + public var password: String + + public init(integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, number: Double, float: Float? = nil, double: Double? = nil, string: String? = nil, byte: Data, binary: URL? = nil, date: Date, dateTime: Date? = nil, uuid: UUID? = nil, password: String) { + self.integer = integer + self.int32 = int32 + self.int64 = int64 + self.number = number + self.float = float + self.double = double + self.string = string + self.byte = byte + self.binary = binary + self.date = date + self.dateTime = dateTime + self.uuid = uuid + self.password = password + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case integer + case int32 + case int64 + case number + case float + case double + case string + case byte + case binary + case date + case dateTime + case uuid + case password + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(integer, forKey: .integer) + try container.encodeIfPresent(int32, forKey: .int32) + try container.encodeIfPresent(int64, forKey: .int64) + try container.encode(number, forKey: .number) + try container.encodeIfPresent(float, forKey: .float) + try container.encodeIfPresent(double, forKey: .double) + try container.encodeIfPresent(string, forKey: .string) + try container.encode(byte, forKey: .byte) + try container.encodeIfPresent(binary, forKey: .binary) + try container.encode(date, forKey: .date) + try container.encodeIfPresent(dateTime, forKey: .dateTime) + try container.encodeIfPresent(uuid, forKey: .uuid) + try container.encode(password, forKey: .password) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift new file mode 100644 index 000000000000..54ed8a723c64 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -0,0 +1,36 @@ +// +// HasOnlyReadOnly.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct HasOnlyReadOnly: Codable, Hashable { + + public var bar: String? + public var foo: String? + + public init(bar: String? = nil, foo: String? = nil) { + self.bar = bar + self.foo = foo + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case bar + case foo + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(bar, forKey: .bar) + try container.encodeIfPresent(foo, forKey: .foo) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/List.swift new file mode 100644 index 000000000000..67e3048469fe --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -0,0 +1,32 @@ +// +// List.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct List: Codable, Hashable { + + public var _123list: String? + + public init(_123list: String? = nil) { + self._123list = _123list + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case _123list = "123-list" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(_123list, forKey: ._123list) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift new file mode 100644 index 000000000000..c0b5a369451d --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -0,0 +1,53 @@ +// +// MapTest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct MapTest: Codable, Hashable { + + public enum MapOfEnumString: String, Codable, CaseIterable, CaseIterableDefaultsLast { + case upper = "UPPER" + case lower = "lower" + // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". + // If new enum cases are added that are unknown to the spec/client, they are safely + // decoded to this case. The raw value of this case is a dummy value that attempts + // to avoids collisions with previously specified cases. + case unknownDefaultOpenAPI = "unknown_default_open_api" + } + 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]]? = nil, mapOfEnumString: [String: String]? = nil, directMap: [String: Bool]? = nil, indirectMap: StringBooleanMap? = nil) { + self.mapMapOfString = mapMapOfString + self.mapOfEnumString = mapOfEnumString + self.directMap = directMap + self.indirectMap = indirectMap + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case mapMapOfString = "map_map_of_string" + case mapOfEnumString = "map_of_enum_string" + case directMap = "direct_map" + case indirectMap = "indirect_map" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(mapMapOfString, forKey: .mapMapOfString) + try container.encodeIfPresent(mapOfEnumString, forKey: .mapOfEnumString) + try container.encodeIfPresent(directMap, forKey: .directMap) + try container.encodeIfPresent(indirectMap, forKey: .indirectMap) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift new file mode 100644 index 000000000000..c79ca459217e --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -0,0 +1,40 @@ +// +// MixedPropertiesAndAdditionalPropertiesClass.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashable { + + public var uuid: UUID? + public var dateTime: Date? + public var map: [String: Animal]? + + public init(uuid: UUID? = nil, dateTime: Date? = nil, map: [String: Animal]? = nil) { + self.uuid = uuid + self.dateTime = dateTime + self.map = map + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case uuid + case dateTime + case map + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(uuid, forKey: .uuid) + try container.encodeIfPresent(dateTime, forKey: .dateTime) + try container.encodeIfPresent(map, forKey: .map) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift new file mode 100644 index 000000000000..23402143f718 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -0,0 +1,37 @@ +// +// Model200Response.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +/** Model for testing model name starting with number */ +public struct Model200Response: Codable, Hashable { + + public var name: Int? + public var _class: String? + + public init(name: Int? = nil, _class: String? = nil) { + self.name = name + self._class = _class + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case name + case _class = "class" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(name, forKey: .name) + try container.encodeIfPresent(_class, forKey: ._class) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Name.swift new file mode 100644 index 000000000000..a28f46a33ce7 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -0,0 +1,45 @@ +// +// Name.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +/** Model for testing model name same as property name */ +public struct Name: Codable, Hashable { + + public var name: Int + public var snakeCase: Int? + public var property: String? + public var _123number: Int? + + public init(name: Int, snakeCase: Int? = nil, property: String? = nil, _123number: Int? = nil) { + self.name = name + self.snakeCase = snakeCase + self.property = property + self._123number = _123number + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case name + case snakeCase = "snake_case" + case property + case _123number = "123Number" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(name, forKey: .name) + try container.encodeIfPresent(snakeCase, forKey: .snakeCase) + try container.encodeIfPresent(property, forKey: .property) + try container.encodeIfPresent(_123number, forKey: ._123number) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift new file mode 100644 index 000000000000..87ceb64bb973 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -0,0 +1,32 @@ +// +// NumberOnly.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct NumberOnly: Codable, Hashable { + + public var justNumber: Double? + + public init(justNumber: Double? = nil) { + self.justNumber = justNumber + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case justNumber = "JustNumber" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(justNumber, forKey: .justNumber) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Order.swift new file mode 100644 index 000000000000..5615d10ff4c5 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -0,0 +1,63 @@ +// +// Order.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct Order: Codable, Hashable { + + public enum Status: String, Codable, CaseIterable, CaseIterableDefaultsLast { + case placed = "placed" + case approved = "approved" + case delivered = "delivered" + // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". + // If new enum cases are added that are unknown to the spec/client, they are safely + // decoded to this case. The raw value of this case is a dummy value that attempts + // to avoids collisions with previously specified cases. + case unknownDefaultOpenAPI = "unknown_default_open_api" + } + public var id: Int64? + public var petId: Int64? + public var quantity: Int? + public var shipDate: Date? + /** Order Status */ + public var status: Status? + public var complete: Bool? = false + + public init(id: Int64? = nil, petId: Int64? = nil, quantity: Int? = nil, shipDate: Date? = nil, status: Status? = nil, complete: Bool? = false) { + self.id = id + self.petId = petId + self.quantity = quantity + self.shipDate = shipDate + self.status = status + self.complete = complete + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case id + case petId + case quantity + case shipDate + case status + case complete + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(id, forKey: .id) + try container.encodeIfPresent(petId, forKey: .petId) + try container.encodeIfPresent(quantity, forKey: .quantity) + try container.encodeIfPresent(shipDate, forKey: .shipDate) + try container.encodeIfPresent(status, forKey: .status) + try container.encodeIfPresent(complete, forKey: .complete) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift new file mode 100644 index 000000000000..edeaccaeaa6f --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -0,0 +1,40 @@ +// +// OuterComposite.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct OuterComposite: Codable, Hashable { + + public var myNumber: Double? + public var myString: String? + public var myBoolean: Bool? + + public init(myNumber: Double? = nil, myString: String? = nil, myBoolean: Bool? = nil) { + self.myNumber = myNumber + self.myString = myString + self.myBoolean = myBoolean + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case myNumber = "my_number" + case myString = "my_string" + case myBoolean = "my_boolean" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(myNumber, forKey: .myNumber) + try container.encodeIfPresent(myString, forKey: .myString) + try container.encodeIfPresent(myBoolean, forKey: .myBoolean) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift new file mode 100644 index 000000000000..e418b2c445bb --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -0,0 +1,22 @@ +// +// OuterEnum.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public enum OuterEnum: String, Codable, CaseIterable, CaseIterableDefaultsLast { + case placed = "placed" + case approved = "approved" + case delivered = "delivered" + // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". + // If new enum cases are added that are unknown to the spec/client, they are safely + // decoded to this case. The raw value of this case is a dummy value that attempts + // to avoids collisions with previously specified cases. + case unknownDefaultOpenAPI = "unknown_default_open_api" +} diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift new file mode 100644 index 000000000000..81afbc4b2a16 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -0,0 +1,63 @@ +// +// Pet.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct Pet: Codable, Hashable { + + public enum Status: String, Codable, CaseIterable, CaseIterableDefaultsLast { + case available = "available" + case pending = "pending" + case sold = "sold" + // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". + // If new enum cases are added that are unknown to the spec/client, they are safely + // decoded to this case. The raw value of this case is a dummy value that attempts + // to avoids collisions with previously specified cases. + case unknownDefaultOpenAPI = "unknown_default_open_api" + } + public var id: Int64? + public var category: Category? + public var name: String + public var photoUrls: [String] + public var tags: [Tag]? + /** pet status in the store */ + public var status: Status? + + public init(id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: Status? = nil) { + self.id = id + self.category = category + self.name = name + self.photoUrls = photoUrls + self.tags = tags + self.status = status + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case id + case category + case name + case photoUrls + case tags + case status + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(id, forKey: .id) + try container.encodeIfPresent(category, forKey: .category) + try container.encode(name, forKey: .name) + try container.encode(photoUrls, forKey: .photoUrls) + try container.encodeIfPresent(tags, forKey: .tags) + try container.encodeIfPresent(status, forKey: .status) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift new file mode 100644 index 000000000000..57ba3f577c87 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -0,0 +1,36 @@ +// +// ReadOnlyFirst.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct ReadOnlyFirst: Codable, Hashable { + + public var bar: String? + public var baz: String? + + public init(bar: String? = nil, baz: String? = nil) { + self.bar = bar + self.baz = baz + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case bar + case baz + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(bar, forKey: .bar) + try container.encodeIfPresent(baz, forKey: .baz) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Return.swift new file mode 100644 index 000000000000..afc2b51f8f38 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -0,0 +1,33 @@ +// +// Return.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +/** Model for testing reserved words */ +public struct Return: Codable, Hashable { + + public var _return: Int? + + public init(_return: Int? = nil) { + self._return = _return + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case _return = "return" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(_return, forKey: ._return) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift new file mode 100644 index 000000000000..bfe9723f888f --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -0,0 +1,32 @@ +// +// SpecialModelName.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct SpecialModelName: Codable, Hashable { + + public var specialPropertyName: Int64? + + public init(specialPropertyName: Int64? = nil) { + self.specialPropertyName = specialPropertyName + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case specialPropertyName = "$special[property.name]" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(specialPropertyName, forKey: .specialPropertyName) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift new file mode 100644 index 000000000000..126c35c85a6a --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -0,0 +1,52 @@ +// +// StringBooleanMap.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct StringBooleanMap: Codable, Hashable { + + + public enum CodingKeys: CodingKey, CaseIterable { + } + + public var additionalProperties: [String: Bool] = [:] + + public subscript(key: String) -> Bool? { + get { + if let value = additionalProperties[key] { + return value + } + return nil + } + + set { + additionalProperties[key] = newValue + } + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + var additionalPropertiesContainer = encoder.container(keyedBy: String.self) + try additionalPropertiesContainer.encodeMap(additionalProperties) + } + + // Decodable protocol methods + + public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + var nonAdditionalPropertyKeys = Set() + let additionalPropertiesContainer = try decoder.container(keyedBy: String.self) + additionalProperties = try additionalPropertiesContainer.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift new file mode 100644 index 000000000000..07b826264f36 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -0,0 +1,36 @@ +// +// Tag.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct Tag: Codable, Hashable { + + public var id: Int64? + public var name: String? + + public init(id: Int64? = nil, name: String? = nil) { + self.id = id + self.name = name + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case id + case name + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(id, forKey: .id) + try container.encodeIfPresent(name, forKey: .name) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift new file mode 100644 index 000000000000..e58eecd960f2 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -0,0 +1,48 @@ +// +// TypeHolderDefault.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct TypeHolderDefault: Codable, Hashable { + + public var stringItem: String = "what" + public var numberItem: Double + public var integerItem: Int + public var boolItem: Bool = true + public var arrayItem: [Int] + + public init(stringItem: String = "what", numberItem: Double, integerItem: Int, boolItem: Bool = true, arrayItem: [Int]) { + self.stringItem = stringItem + self.numberItem = numberItem + self.integerItem = integerItem + self.boolItem = boolItem + self.arrayItem = arrayItem + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case stringItem = "string_item" + case numberItem = "number_item" + case integerItem = "integer_item" + case boolItem = "bool_item" + case arrayItem = "array_item" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(stringItem, forKey: .stringItem) + try container.encode(numberItem, forKey: .numberItem) + try container.encode(integerItem, forKey: .integerItem) + try container.encode(boolItem, forKey: .boolItem) + try container.encode(arrayItem, forKey: .arrayItem) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift new file mode 100644 index 000000000000..6c22fdbae7aa --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -0,0 +1,48 @@ +// +// TypeHolderExample.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct TypeHolderExample: Codable, Hashable { + + public var stringItem: String + public var numberItem: Double + public var integerItem: Int + public var boolItem: Bool + public var arrayItem: [Int] + + public init(stringItem: String, numberItem: Double, integerItem: Int, boolItem: Bool, arrayItem: [Int]) { + self.stringItem = stringItem + self.numberItem = numberItem + self.integerItem = integerItem + self.boolItem = boolItem + self.arrayItem = arrayItem + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case stringItem = "string_item" + case numberItem = "number_item" + case integerItem = "integer_item" + case boolItem = "bool_item" + case arrayItem = "array_item" + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(stringItem, forKey: .stringItem) + try container.encode(numberItem, forKey: .numberItem) + try container.encode(integerItem, forKey: .integerItem) + try container.encode(boolItem, forKey: .boolItem) + try container.encode(arrayItem, forKey: .arrayItem) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/User.swift new file mode 100644 index 000000000000..7afe359ae409 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -0,0 +1,61 @@ +// +// User.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct User: Codable, Hashable { + + public var id: Int64? + public var username: String? + public var firstName: String? + public var lastName: String? + public var email: String? + public var password: String? + public var phone: String? + /** User Status */ + public var userStatus: Int? + + public init(id: Int64? = nil, username: String? = nil, firstName: String? = nil, lastName: String? = nil, email: String? = nil, password: String? = nil, phone: String? = nil, userStatus: Int? = nil) { + self.id = id + self.username = username + self.firstName = firstName + self.lastName = lastName + self.email = email + self.password = password + self.phone = phone + self.userStatus = userStatus + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case id + case username + case firstName + case lastName + case email + case password + case phone + case userStatus + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(id, forKey: .id) + try container.encodeIfPresent(username, forKey: .username) + try container.encodeIfPresent(firstName, forKey: .firstName) + try container.encodeIfPresent(lastName, forKey: .lastName) + try container.encodeIfPresent(email, forKey: .email) + try container.encodeIfPresent(password, forKey: .password) + try container.encodeIfPresent(phone, forKey: .phone) + try container.encodeIfPresent(userStatus, forKey: .userStatus) + } +} + diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/OpenISO8601DateFormatter.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/OpenISO8601DateFormatter.swift new file mode 100644 index 000000000000..e06208074cd9 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/OpenISO8601DateFormatter.swift @@ -0,0 +1,44 @@ +// +// OpenISO8601DateFormatter.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +// https://stackoverflow.com/a/50281094/976628 +public class OpenISO8601DateFormatter: DateFormatter { + static let withoutSeconds: DateFormatter = { + let formatter = DateFormatter() + formatter.calendar = Calendar(identifier: .iso8601) + formatter.locale = Locale(identifier: "en_US_POSIX") + formatter.timeZone = TimeZone(secondsFromGMT: 0) + formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZZZZZ" + return formatter + }() + + private func setup() { + calendar = Calendar(identifier: .iso8601) + locale = Locale(identifier: "en_US_POSIX") + timeZone = TimeZone(secondsFromGMT: 0) + dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" + } + + override init() { + super.init() + setup() + } + + required init?(coder aDecoder: NSCoder) { + super.init(coder: aDecoder) + setup() + } + + override public func date(from string: String) -> Date? { + if let result = super.date(from: string) { + return result + } + return OpenISO8601DateFormatter.withoutSeconds.date(from: string) + } +} diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/SynchronizedDictionary.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/SynchronizedDictionary.swift new file mode 100644 index 000000000000..acf7ff4031bd --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/SynchronizedDictionary.swift @@ -0,0 +1,36 @@ +// SynchronizedDictionary.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +internal struct SynchronizedDictionary { + + private var dictionary = [K: V]() + private let queue = DispatchQueue( + label: "SynchronizedDictionary", + qos: DispatchQoS.userInitiated, + attributes: [DispatchQueue.Attributes.concurrent], + autoreleaseFrequency: DispatchQueue.AutoreleaseFrequency.inherit, + target: nil + ) + + internal subscript(key: K) -> V? { + get { + var value: V? + + queue.sync { + value = self.dictionary[key] + } + + return value + } + set { + queue.sync(flags: DispatchWorkItemFlags.barrier) { + self.dictionary[key] = newValue + } + } + } +} diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift new file mode 100644 index 000000000000..fe7fb6683bcf --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -0,0 +1,609 @@ +// URLSessionImplementations.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if !os(macOS) +import MobileCoreServices +#endif + +class URLSessionRequestBuilderFactory: RequestBuilderFactory { + func getNonDecodableBuilder() -> RequestBuilder.Type { + return URLSessionRequestBuilder.self + } + + func getBuilder() -> RequestBuilder.Type { + return URLSessionDecodableRequestBuilder.self + } +} + +public typealias PetstoreClientAPIChallengeHandler = ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?)) + +// Store the URLSession's delegate to retain its reference +private let sessionDelegate = SessionDelegate() + +// Store the URLSession to retain its reference +private let defaultURLSession = URLSession(configuration: .default, delegate: sessionDelegate, delegateQueue: nil) + +// Store current taskDidReceiveChallenge for every URLSessionTask +private var challengeHandlerStore = SynchronizedDictionary() + +// Store current URLCredential for every URLSessionTask +private var credentialStore = SynchronizedDictionary() + +open class URLSessionRequestBuilder: RequestBuilder { + + /** + May be assigned if you want to control the authentication challenges. + */ + public var taskDidReceiveChallenge: PetstoreClientAPIChallengeHandler? + + /** + May be assigned if you want to do any of those things: + - control the task completion + - intercept and handle errors like authorization + - retry the request. + */ + @available(*, deprecated, message: "Please override execute() method to intercept and handle errors like authorization or retry the request. Check the Wiki for more info. https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-do-i-implement-bearer-token-authentication-with-urlsession-on-the-swift-api-client") + public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? + + required public init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:]) { + super.init(method: method, URLString: URLString, parameters: parameters, headers: headers) + } + + /** + May be overridden by a subclass if you want to control the URLSession + configuration. + */ + open func createURLSession() -> URLSession { + return defaultURLSession + } + + /** + May be overridden by a subclass if you want to control the Content-Type + that is given to an uploaded form part. + + Return nil to use the default behavior (inferring the Content-Type from + the file extension). Return the desired Content-Type otherwise. + */ + open func contentTypeForFormPart(fileURL: URL) -> String? { + return nil + } + + /** + May be overridden by a subclass if you want to control the URLRequest + configuration (e.g. to override the cache policy). + */ + open func createURLRequest(urlSession: 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 + + headers.forEach { key, value in + originalRequest.setValue(value, forHTTPHeaderField: key) + } + + buildHeaders().forEach { key, value in + originalRequest.setValue(value, forHTTPHeaderField: key) + } + + let modifiedRequest = try encoding.encode(originalRequest, with: parameters) + + return modifiedRequest + } + + @discardableResult + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + let urlSession = createURLSession() + + guard let xMethod = HTTPMethod(rawValue: method) else { + fatalError("Unsupported Http method - \(method)") + } + + let encoding: ParameterEncoding + + switch xMethod { + case .get, .head: + encoding = URLEncoding() + + case .options, .post, .put, .patch, .delete, .trace, .connect: + let contentType = headers["Content-Type"] ?? "application/json" + + if contentType == "application/json" { + encoding = JSONDataEncoding() + } else if contentType == "multipart/form-data" { + encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) + } else if contentType == "application/x-www-form-urlencoded" { + encoding = FormURLEncoding() + } else { + fatalError("Unsupported Media Type - \(contentType)") + } + } + + do { + let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) + + var taskIdentifier: Int? + let cleanupRequest = { + if let taskIdentifier = taskIdentifier { + challengeHandlerStore[taskIdentifier] = nil + credentialStore[taskIdentifier] = nil + } + } + + let dataTask = urlSession.dataTask(with: request) { data, response, error in + + if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { + + taskCompletionShouldRetry(data, response, error) { shouldRetry in + + if shouldRetry { + cleanupRequest() + self.execute(apiResponseQueue, completion) + } else { + apiResponseQueue.async { + self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) + cleanupRequest() + } + } + } + } else { + apiResponseQueue.async { + self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) + cleanupRequest() + } + } + } + + if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { + onProgressReady?(dataTask.progress) + } + + taskIdentifier = dataTask.taskIdentifier + challengeHandlerStore[dataTask.taskIdentifier] = taskDidReceiveChallenge + credentialStore[dataTask.taskIdentifier] = credential + + dataTask.resume() + + return dataTask + } catch { + apiResponseQueue.async { + completion(.failure(ErrorResponse.error(415, nil, nil, error))) + } + + return nil + } + } + + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { + + if let error = error { + completion(.failure(ErrorResponse.error(-1, data, response, error))) + return + } + + guard let httpResponse = response as? HTTPURLResponse else { + completion(.failure(ErrorResponse.error(-2, data, response, DecodableRequestBuilderError.nilHTTPResponse))) + return + } + + guard httpResponse.isStatusCodeSuccessful else { + completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, response, DecodableRequestBuilderError.unsuccessfulHTTPStatusCode))) + return + } + + switch T.self { + case is Void.Type: + + completion(.success(Response(response: httpResponse, body: () as! T))) + + default: + fatalError("Unsupported Response Body Type - \(String(describing: T.self))") + } + + } + + open func buildHeaders() -> [String: String] { + var httpHeaders: [String: String] = [:] + for (key, value) in headers { + httpHeaders[key] = value + } + for (key, value) in PetstoreClientAPI.customHeaders { + httpHeaders[key] = value + } + return httpHeaders + } + + fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + + guard let contentDisposition = contentDisposition else { + return nil + } + + let items = contentDisposition.components(separatedBy: ";") + + var filename: String? + + for contentItem in items { + + let filenameKey = "filename=" + guard let range = contentItem.range(of: filenameKey) else { + continue + } + + filename = contentItem + return filename? + .replacingCharacters(in: range, with: "") + .replacingOccurrences(of: "\"", with: "") + .trimmingCharacters(in: .whitespacesAndNewlines) + } + + return filename + + } + + fileprivate func getPath(from url: URL) throws -> String { + + guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { + throw DownloadException.requestMissingPath + } + + if path.hasPrefix("/") { + path.remove(at: path.startIndex) + } + + return path + + } + + fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + + guard let url = urlRequest.url else { + throw DownloadException.requestMissingURL + } + + return url + } + +} + +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { + override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { + + if let error = error { + completion(.failure(ErrorResponse.error(-1, data, response, error))) + return + } + + guard let httpResponse = response as? HTTPURLResponse else { + completion(.failure(ErrorResponse.error(-2, data, response, DecodableRequestBuilderError.nilHTTPResponse))) + return + } + + guard httpResponse.isStatusCodeSuccessful else { + completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, response, DecodableRequestBuilderError.unsuccessfulHTTPStatusCode))) + return + } + + switch T.self { + case is String.Type: + + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" + + completion(.success(Response(response: httpResponse, body: body as! T))) + + case is URL.Type: + do { + + guard error == nil else { + throw DownloadException.responseFailed + } + + guard let data = data else { + throw DownloadException.responseDataMissing + } + + let fileManager = FileManager.default + let cachesDirectory = fileManager.urls(for: .cachesDirectory, in: .userDomainMask)[0] + let requestURL = try getURL(from: urlRequest) + + var requestPath = try getPath(from: requestURL) + + if let headerFileName = getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { + requestPath = requestPath.appending("/\(headerFileName)") + } else { + requestPath = requestPath.appending("/tmp.PetstoreClient.\(UUID().uuidString)") + } + + let filePath = cachesDirectory.appendingPathComponent(requestPath) + let directoryPath = filePath.deletingLastPathComponent().path + + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) + try data.write(to: filePath, options: .atomic) + + completion(.success(Response(response: httpResponse, body: filePath as! T))) + + } catch let requestParserError as DownloadException { + completion(.failure(ErrorResponse.error(400, data, response, requestParserError))) + } catch { + completion(.failure(ErrorResponse.error(400, data, response, error))) + } + + case is Void.Type: + + completion(.success(Response(response: httpResponse, body: () as! T))) + + 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, response, DecodableRequestBuilderError.emptyDataResponse))) + return + } + + let decodeResult = CodableHelper.decode(T.self, from: data) + + switch decodeResult { + case let .success(decodableObj): + completion(.success(Response(response: httpResponse, body: decodableObj))) + case let .failure(error): + completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, response, error))) + } + } + } +} + +private class SessionDelegate: NSObject, URLSessionTaskDelegate { + func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { + + var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling + + var credential: URLCredential? + + if let taskDidReceiveChallenge = challengeHandlerStore[task.taskIdentifier] { + (disposition, credential) = taskDidReceiveChallenge(session, task, challenge) + } else { + if challenge.previousFailureCount > 0 { + disposition = .rejectProtectionSpace + } else { + credential = credentialStore[task.taskIdentifier] ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) + + if credential != nil { + disposition = .useCredential + } + } + } + + completionHandler(disposition, credential) + } +} + +public enum HTTPMethod: String { + case options = "OPTIONS" + case get = "GET" + case head = "HEAD" + case post = "POST" + case put = "PUT" + case patch = "PATCH" + case delete = "DELETE" + case trace = "TRACE" + case connect = "CONNECT" +} + +public protocol ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest +} + +private class URLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { + + var urlRequest = urlRequest + + guard let parameters = parameters else { return urlRequest } + + guard let url = urlRequest.url else { + throw DownloadException.requestMissingURL + } + + if var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: false), !parameters.isEmpty { + urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) + urlRequest.url = urlComponents.url + } + + return urlRequest + } +} + +private class FormDataEncoding: ParameterEncoding { + + let contentTypeForFormPart: (_ fileURL: URL) -> String? + + init(contentTypeForFormPart: @escaping (_ fileURL: URL) -> String?) { + self.contentTypeForFormPart = contentTypeForFormPart + } + + func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { + + var urlRequest = urlRequest + + guard let parameters = parameters, !parameters.isEmpty else { + return urlRequest + } + + let boundary = "Boundary-\(UUID().uuidString)" + + urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") + + for (key, value) in parameters { + switch value { + case let fileURL as URL: + + urlRequest = try configureFileUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + fileURL: fileURL + ) + + case let string as String: + + if let data = string.data(using: .utf8) { + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + } + + case let number as NSNumber: + + if let data = number.stringValue.data(using: .utf8) { + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + } + + default: + fatalError("Unprocessable value \(value) with key \(key)") + } + } + + var body = urlRequest.httpBody.orEmpty + + body.append("\r\n--\(boundary)--\r\n") + + urlRequest.httpBody = body + + return urlRequest + } + + private func configureFileUploadRequest(urlRequest: URLRequest, boundary: String, name: String, fileURL: URL) throws -> URLRequest { + + var urlRequest = urlRequest + + var body = urlRequest.httpBody.orEmpty + + let fileData = try Data(contentsOf: fileURL) + + let mimetype = contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) + + let fileName = fileURL.lastPathComponent + + // If we already added something then we need an additional newline. + if body.count > 0 { + body.append("\r\n") + } + + // Value boundary. + body.append("--\(boundary)\r\n") + + // Value headers. + body.append("Content-Disposition: form-data; name=\"\(name)\"; filename=\"\(fileName)\"\r\n") + body.append("Content-Type: \(mimetype)\r\n") + + // Separate headers and body. + body.append("\r\n") + + // The value data. + body.append(fileData) + + urlRequest.httpBody = body + + return urlRequest + } + + private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { + + var urlRequest = urlRequest + + var body = urlRequest.httpBody.orEmpty + + // If we already added something then we need an additional newline. + if body.count > 0 { + body.append("\r\n") + } + + // Value boundary. + body.append("--\(boundary)\r\n") + + // Value headers. + body.append("Content-Disposition: form-data; name=\"\(name)\"\r\n") + + // Separate headers and body. + body.append("\r\n") + + // The value data. + body.append(data) + + urlRequest.httpBody = body + + return urlRequest + + } + + func mimeType(for url: URL) -> String { + let pathExtension = url.pathExtension + + if let uti = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, pathExtension as NSString, nil)?.takeRetainedValue() { + if let mimetype = UTTypeCopyPreferredTagWithClass(uti, kUTTagClassMIMEType)?.takeRetainedValue() { + return mimetype as String + } + } + return "application/octet-stream" + } + +} + +private class FormURLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { + + var urlRequest = urlRequest + + var requestBodyComponents = URLComponents() + requestBodyComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters ?? [:]) + + if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { + urlRequest.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type") + } + + urlRequest.httpBody = requestBodyComponents.query?.data(using: .utf8) + + return urlRequest + } +} + +private extension Data { + /// Append string to Data + /// + /// Rather than littering my code with calls to `dataUsingEncoding` to convert strings to Data, and then add that data to the Data, this wraps it in a nice convenient little extension to Data. This converts using UTF-8. + /// + /// - parameter string: The string to be added to the `Data`. + + mutating func append(_ string: String) { + if let data = string.data(using: .utf8) { + append(data) + } + } +} + +private extension Optional where Wrapped == Data { + var orEmpty: Data { + self ?? Data() + } +} + +extension JSONDataEncoding: ParameterEncoding {} diff --git a/samples/client/petstore/swift5/frozenEnums/README.md b/samples/client/petstore/swift5/frozenEnums/README.md new file mode 100644 index 000000000000..1725415f7e04 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/README.md @@ -0,0 +1,141 @@ +# Swift5 API client for PetstoreClient + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build package: org.openapitools.codegen.languages.Swift5ClientCodegen + +## Installation + +### Carthage + +Run `carthage update` + +### CocoaPods + +Run `pod install` + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AnotherFakeAPI* | [**call123testSpecialTags**](docs/AnotherFakeAPI.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags +*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 | +*FakeAPI* | [**fakeOuterStringSerialize**](docs/FakeAPI.md#fakeouterstringserialize) | **POST** /fake/outer/string | +*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* | [**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 +*FakeAPI* | [**testJsonFormData**](docs/FakeAPI.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeClassnameTags123API* | [**testClassname**](docs/FakeClassnameTags123API.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case +*PetAPI* | [**addPet**](docs/PetAPI.md#addpet) | **POST** /pet | Add a new pet to the store +*PetAPI* | [**deletePet**](docs/PetAPI.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetAPI* | [**findPetsByStatus**](docs/PetAPI.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetAPI* | [**findPetsByTags**](docs/PetAPI.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetAPI* | [**getPetById**](docs/PetAPI.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetAPI* | [**updatePet**](docs/PetAPI.md#updatepet) | **PUT** /pet | Update an existing pet +*PetAPI* | [**updatePetWithForm**](docs/PetAPI.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetAPI* | [**uploadFile**](docs/PetAPI.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*PetAPI* | [**uploadFileWithRequiredFile**](docs/PetAPI.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +*StoreAPI* | [**deleteOrder**](docs/StoreAPI.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*StoreAPI* | [**getInventory**](docs/StoreAPI.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreAPI* | [**getOrderById**](docs/StoreAPI.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID +*StoreAPI* | [**placeOrder**](docs/StoreAPI.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserAPI* | [**createUser**](docs/UserAPI.md#createuser) | **POST** /user | Create user +*UserAPI* | [**createUsersWithArrayInput**](docs/UserAPI.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserAPI* | [**createUsersWithListInput**](docs/UserAPI.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserAPI* | [**deleteUser**](docs/UserAPI.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserAPI* | [**getUserByName**](docs/UserAPI.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserAPI* | [**loginUser**](docs/UserAPI.md#loginuser) | **GET** /user/login | Logs user into the system +*UserAPI* | [**logoutUser**](docs/UserAPI.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserAPI* | [**updateUser**](docs/UserAPI.md#updateuser) | **PUT** /user/{username} | Updated user + + +## Documentation For Models + + - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [Animal](docs/Animal.md) + - [AnimalFarm](docs/AnimalFarm.md) + - [ApiResponse](docs/ApiResponse.md) + - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [ArrayTest](docs/ArrayTest.md) + - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) + - [CatAllOf](docs/CatAllOf.md) + - [Category](docs/Category.md) + - [ClassModel](docs/ClassModel.md) + - [Client](docs/Client.md) + - [Dog](docs/Dog.md) + - [DogAllOf](docs/DogAllOf.md) + - [EnumArrays](docs/EnumArrays.md) + - [EnumClass](docs/EnumClass.md) + - [EnumTest](docs/EnumTest.md) + - [File](docs/File.md) + - [FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [FormatTest](docs/FormatTest.md) + - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [List](docs/List.md) + - [MapTest](docs/MapTest.md) + - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model200Response](docs/Model200Response.md) + - [Name](docs/Name.md) + - [NumberOnly](docs/NumberOnly.md) + - [Order](docs/Order.md) + - [OuterComposite](docs/OuterComposite.md) + - [OuterEnum](docs/OuterEnum.md) + - [Pet](docs/Pet.md) + - [ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [Return](docs/Return.md) + - [SpecialModelName](docs/SpecialModelName.md) + - [StringBooleanMap](docs/StringBooleanMap.md) + - [Tag](docs/Tag.md) + - [TypeHolderDefault](docs/TypeHolderDefault.md) + - [TypeHolderExample](docs/TypeHolderExample.md) + - [User](docs/User.md) + + +## Documentation For Authorization + + +## api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + +## api_key_query + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + +## http_basic_test + +- **Type**: HTTP basic authentication + +## petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - **write:pets**: modify pets in your account + - **read:pets**: read your pets + + +## Author + + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/AdditionalPropertiesClass.md b/samples/client/petstore/swift5/frozenEnums/docs/AdditionalPropertiesClass.md new file mode 100644 index 000000000000..1f222244134e --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/AdditionalPropertiesClass.md @@ -0,0 +1,11 @@ +# AdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapString** | **[String: String]** | | [optional] +**mapMapString** | [String: [String: String]] | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/Animal.md b/samples/client/petstore/swift5/frozenEnums/docs/Animal.md new file mode 100644 index 000000000000..69c601455cd8 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/Animal.md @@ -0,0 +1,11 @@ +# Animal + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] [default to "red"] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/AnimalFarm.md b/samples/client/petstore/swift5/frozenEnums/docs/AnimalFarm.md new file mode 100644 index 000000000000..df6bab21dae8 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/AnimalFarm.md @@ -0,0 +1,9 @@ +# AnimalFarm + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/AnotherFakeAPI.md b/samples/client/petstore/swift5/frozenEnums/docs/AnotherFakeAPI.md new file mode 100644 index 000000000000..26346e81a4cb --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/AnotherFakeAPI.md @@ -0,0 +1,59 @@ +# AnotherFakeAPI + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**call123testSpecialTags**](AnotherFakeAPI.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags + + +# **call123testSpecialTags** +```swift + open class func call123testSpecialTags(body: Client, completion: @escaping (_ data: Client?, _ error: Error?) -> Void) +``` + +To test special tags + +To test special tags and operation ID starting with number + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let body = Client(client: "client_example") // Client | client model + +// To test special tags +AnotherFakeAPI.call123testSpecialTags(body: body) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md) | client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/ApiResponse.md b/samples/client/petstore/swift5/frozenEnums/docs/ApiResponse.md new file mode 100644 index 000000000000..c6d9768fe9bf --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/ApiResponse.md @@ -0,0 +1,12 @@ +# ApiResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **Int** | | [optional] +**type** | **String** | | [optional] +**message** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/swift5/frozenEnums/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 000000000000..c6fceff5e08d --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,10 @@ +# ArrayOfArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayArrayNumber** | [[Double]] | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/ArrayOfNumberOnly.md b/samples/client/petstore/swift5/frozenEnums/docs/ArrayOfNumberOnly.md new file mode 100644 index 000000000000..f09f8fa6f70f --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/ArrayOfNumberOnly.md @@ -0,0 +1,10 @@ +# ArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayNumber** | **[Double]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/ArrayTest.md b/samples/client/petstore/swift5/frozenEnums/docs/ArrayTest.md new file mode 100644 index 000000000000..bf416b8330cc --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/ArrayTest.md @@ -0,0 +1,12 @@ +# ArrayTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayOfString** | **[String]** | | [optional] +**arrayArrayOfInteger** | [[Int64]] | | [optional] +**arrayArrayOfModel** | [[ReadOnlyFirst]] | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/Capitalization.md b/samples/client/petstore/swift5/frozenEnums/docs/Capitalization.md new file mode 100644 index 000000000000..95374216c773 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/Capitalization.md @@ -0,0 +1,15 @@ +# Capitalization + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**smallCamel** | **String** | | [optional] +**capitalCamel** | **String** | | [optional] +**smallSnake** | **String** | | [optional] +**capitalSnake** | **String** | | [optional] +**sCAETHFlowPoints** | **String** | | [optional] +**ATT_NAME** | **String** | Name of the pet | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/Cat.md b/samples/client/petstore/swift5/frozenEnums/docs/Cat.md new file mode 100644 index 000000000000..fb5949b15761 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/Cat.md @@ -0,0 +1,10 @@ +# Cat + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **Bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/CatAllOf.md b/samples/client/petstore/swift5/frozenEnums/docs/CatAllOf.md new file mode 100644 index 000000000000..79789be61c01 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/CatAllOf.md @@ -0,0 +1,10 @@ +# CatAllOf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **Bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/Category.md b/samples/client/petstore/swift5/frozenEnums/docs/Category.md new file mode 100644 index 000000000000..5ca5408c0f96 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/Category.md @@ -0,0 +1,11 @@ +# Category + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Int64** | | [optional] +**name** | **String** | | [default to "default-name"] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/ClassModel.md b/samples/client/petstore/swift5/frozenEnums/docs/ClassModel.md new file mode 100644 index 000000000000..e3912fdf0fd5 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/ClassModel.md @@ -0,0 +1,10 @@ +# ClassModel + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_class** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/Client.md b/samples/client/petstore/swift5/frozenEnums/docs/Client.md new file mode 100644 index 000000000000..0de1b238c36f --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/Client.md @@ -0,0 +1,10 @@ +# Client + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/Dog.md b/samples/client/petstore/swift5/frozenEnums/docs/Dog.md new file mode 100644 index 000000000000..4824786da049 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/Dog.md @@ -0,0 +1,10 @@ +# Dog + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/DogAllOf.md b/samples/client/petstore/swift5/frozenEnums/docs/DogAllOf.md new file mode 100644 index 000000000000..9302ef52e938 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/DogAllOf.md @@ -0,0 +1,10 @@ +# DogAllOf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/EnumArrays.md b/samples/client/petstore/swift5/frozenEnums/docs/EnumArrays.md new file mode 100644 index 000000000000..b9a9807d3c8e --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/EnumArrays.md @@ -0,0 +1,11 @@ +# EnumArrays + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justSymbol** | **String** | | [optional] +**arrayEnum** | **[String]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/EnumClass.md b/samples/client/petstore/swift5/frozenEnums/docs/EnumClass.md new file mode 100644 index 000000000000..67f017becd0c --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/EnumClass.md @@ -0,0 +1,9 @@ +# EnumClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/EnumTest.md b/samples/client/petstore/swift5/frozenEnums/docs/EnumTest.md new file mode 100644 index 000000000000..bc9b036dd769 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/EnumTest.md @@ -0,0 +1,14 @@ +# EnumTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumString** | **String** | | [optional] +**enumStringRequired** | **String** | | +**enumInteger** | **Int** | | [optional] +**enumNumber** | **Double** | | [optional] +**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/FakeAPI.md b/samples/client/petstore/swift5/frozenEnums/docs/FakeAPI.md new file mode 100644 index 000000000000..e33bd2d35fbc --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/FakeAPI.md @@ -0,0 +1,662 @@ +# FakeAPI + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fakeOuterBooleanSerialize**](FakeAPI.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | +[**fakeOuterCompositeSerialize**](FakeAPI.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | +[**fakeOuterNumberSerialize**](FakeAPI.md#fakeouternumberserialize) | **POST** /fake/outer/number | +[**fakeOuterStringSerialize**](FakeAPI.md#fakeouterstringserialize) | **POST** /fake/outer/string | +[**testBodyWithFileSchema**](FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | +[**testBodyWithQueryParams**](FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | +[**testClientModel**](FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model +[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEnumParameters**](FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters +[**testGroupParameters**](FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +[**testInlineAdditionalProperties**](FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**testJsonFormData**](FakeAPI.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data + + +# **fakeOuterBooleanSerialize** +```swift + open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping (_ data: Bool?, _ error: Error?) -> Void) +``` + + + +Test serialization of outer boolean types + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let body = true // Bool | Input boolean as post body (optional) + +FakeAPI.fakeOuterBooleanSerialize(body: body) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **Bool** | Input boolean as post body | [optional] + +### Return type + +**Bool** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **fakeOuterCompositeSerialize** +```swift + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping (_ data: OuterComposite?, _ error: Error?) -> Void) +``` + + + +Test serialization of object with outer number type + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let body = OuterComposite(myNumber: 123, myString: "myString_example", myBoolean: false) // OuterComposite | Input composite as post body (optional) + +FakeAPI.fakeOuterCompositeSerialize(body: body) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterComposite**](OuterComposite.md) | Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **fakeOuterNumberSerialize** +```swift + open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping (_ data: Double?, _ error: Error?) -> Void) +``` + + + +Test serialization of outer number types + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let body = 987 // Double | Input number as post body (optional) + +FakeAPI.fakeOuterNumberSerialize(body: body) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **Double** | Input number as post body | [optional] + +### Return type + +**Double** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **fakeOuterStringSerialize** +```swift + open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping (_ data: String?, _ error: Error?) -> Void) +``` + + + +Test serialization of outer string types + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let body = "body_example" // String | Input string as post body (optional) + +FakeAPI.fakeOuterStringSerialize(body: body) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **String** | Input string as post body | [optional] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **testBodyWithFileSchema** +```swift + open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + + + +For this test, the body for this request much reference a schema named `File`. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let body = FileSchemaTestClass(file: File(sourceURI: "sourceURI_example"), files: [nil]) // FileSchemaTestClass | + +FakeAPI.testBodyWithFileSchema(body: body) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md) | | + +### Return type + +Void (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) + +# **testBodyWithQueryParams** +```swift + open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + + + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let query = "query_example" // String | +let body = User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123) // User | + +FakeAPI.testBodyWithQueryParams(query: query, body: body) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **String** | | + **body** | [**User**](User.md) | | + +### Return type + +Void (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) + +# **testClientModel** +```swift + open class func testClientModel(body: Client, completion: @escaping (_ data: Client?, _ error: Error?) -> Void) +``` + +To test \"client\" model + +To test \"client\" model + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let body = Client(client: "client_example") // Client | client model + +// To test \"client\" model +FakeAPI.testClientModel(body: body) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md) | client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **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) + +# **testEndpointParameters** +```swift + open class func testEndpointParameters(integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, number: Double, float: Float? = nil, double: Double, string: String? = nil, patternWithoutDelimiter: String, byte: Data, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let integer = 987 // Int | None (optional) +let int32 = 987 // Int | None (optional) +let int64 = 987 // Int64 | None (optional) +let number = 987 // Double | None +let float = 987 // Float | None (optional) +let double = 987 // Double | None +let string = "string_example" // String | None (optional) +let patternWithoutDelimiter = "patternWithoutDelimiter_example" // String | None +let byte = Data([9, 8, 7]) // Data | None +let binary = URL(string: "https://example.com")! // URL | None (optional) +let date = Date() // Date | None (optional) +let dateTime = Date() // Date | None (optional) +let password = "password_example" // String | None (optional) +let callback = "callback_example" // String | None (optional) + +// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +FakeAPI.testEndpointParameters(integer: integer, int32: int32, int64: int64, number: number, float: float, double: double, string: string, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **integer** | **Int** | None | [optional] + **int32** | **Int** | None | [optional] + **int64** | **Int64** | None | [optional] + **number** | **Double** | None | + **float** | **Float** | None | [optional] + **double** | **Double** | None | + **string** | **String** | None | [optional] + **patternWithoutDelimiter** | **String** | None | + **byte** | **Data** | None | + **binary** | **URL** | None | [optional] + **date** | **Date** | None | [optional] + **dateTime** | **Date** | None | [optional] + **password** | **String** | None | [optional] + **callback** | **String** | None | [optional] + +### Return type + +Void (empty response body) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testEnumParameters** +```swift + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +To test enum parameters + +To test enum parameters + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let enumHeaderStringArray = ["enumHeaderStringArray_example"] // [String] | Header parameter enum test (string array) (optional) +let enumHeaderString = "enumHeaderString_example" // String | Header parameter enum test (string) (optional) (default to .efg) +let enumQueryStringArray = ["enumQueryStringArray_example"] // [String] | Query parameter enum test (string array) (optional) +let enumQueryString = "enumQueryString_example" // String | Query parameter enum test (string) (optional) (default to .efg) +let enumQueryInteger = 987 // Int | Query parameter enum test (double) (optional) +let enumQueryDouble = 987 // Double | Query parameter enum test (double) (optional) +let enumFormStringArray = ["inner_example"] // [String] | Form parameter enum test (string array) (optional) (default to .dollar) +let enumFormString = "enumFormString_example" // String | Form parameter enum test (string) (optional) (default to .efg) + +// To test enum parameters +FakeAPI.testEnumParameters(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enumHeaderStringArray** | [**[String]**](String.md) | Header parameter enum test (string array) | [optional] + **enumHeaderString** | **String** | Header parameter enum test (string) | [optional] [default to .efg] + **enumQueryStringArray** | [**[String]**](String.md) | Query parameter enum test (string array) | [optional] + **enumQueryString** | **String** | Query parameter enum test (string) | [optional] [default to .efg] + **enumQueryInteger** | **Int** | Query parameter enum test (double) | [optional] + **enumQueryDouble** | **Double** | Query parameter enum test (double) | [optional] + **enumFormStringArray** | [**[String]**](String.md) | Form parameter enum test (string array) | [optional] [default to .dollar] + **enumFormString** | **String** | Form parameter enum test (string) | [optional] [default to .efg] + +### Return type + +Void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testGroupParameters** +```swift + 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) +``` + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let requiredStringGroup = 987 // Int | Required String in group parameters +let requiredBooleanGroup = true // Bool | Required Boolean in group parameters +let requiredInt64Group = 987 // Int64 | Required Integer in group parameters +let stringGroup = 987 // Int | String in group parameters (optional) +let booleanGroup = true // Bool | Boolean in group parameters (optional) +let int64Group = 987 // Int64 | Integer in group parameters (optional) + +// Fake endpoint to test group parameters (optional) +FakeAPI.testGroupParameters(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requiredStringGroup** | **Int** | Required String in group parameters | + **requiredBooleanGroup** | **Bool** | Required Boolean in group parameters | + **requiredInt64Group** | **Int64** | Required Integer in group parameters | + **stringGroup** | **Int** | String in group parameters | [optional] + **booleanGroup** | **Bool** | Boolean in group parameters | [optional] + **int64Group** | **Int64** | Integer in group parameters | [optional] + +### Return type + +Void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testInlineAdditionalProperties** +```swift + open class func testInlineAdditionalProperties(param: [String: String], completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +test inline additionalProperties + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let param = "TODO" // [String: String] | request body + +// test inline additionalProperties +FakeAPI.testInlineAdditionalProperties(param: param) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | [**[String: String]**](String.md) | request body | + +### Return type + +Void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **testJsonFormData** +```swift + open class func testJsonFormData(param: String, param2: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +test json serialization of form data + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let param = "param_example" // String | field1 +let param2 = "param2_example" // String | field2 + +// test json serialization of form data +FakeAPI.testJsonFormData(param: param, param2: param2) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **String** | field1 | + **param2** | **String** | field2 | + +### Return type + +Void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/FakeClassnameTags123API.md b/samples/client/petstore/swift5/frozenEnums/docs/FakeClassnameTags123API.md new file mode 100644 index 000000000000..5b9b66073fe0 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/FakeClassnameTags123API.md @@ -0,0 +1,59 @@ +# FakeClassnameTags123API + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testClassname**](FakeClassnameTags123API.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case + + +# **testClassname** +```swift + open class func testClassname(body: Client, completion: @escaping (_ data: Client?, _ error: Error?) -> Void) +``` + +To test class name in snake case + +To test class name in snake case + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let body = Client(client: "client_example") // Client | client model + +// To test class name in snake case +FakeClassnameTags123API.testClassname(body: body) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md) | client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/File.md b/samples/client/petstore/swift5/frozenEnums/docs/File.md new file mode 100644 index 000000000000..3edfef17b794 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/File.md @@ -0,0 +1,10 @@ +# File + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/FileSchemaTestClass.md b/samples/client/petstore/swift5/frozenEnums/docs/FileSchemaTestClass.md new file mode 100644 index 000000000000..afdacc60b2c3 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/FileSchemaTestClass.md @@ -0,0 +1,11 @@ +# FileSchemaTestClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file** | [**File**](File.md) | | [optional] +**files** | [File] | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/FormatTest.md b/samples/client/petstore/swift5/frozenEnums/docs/FormatTest.md new file mode 100644 index 000000000000..f74d94f6c46a --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/FormatTest.md @@ -0,0 +1,22 @@ +# FormatTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **Int** | | [optional] +**int32** | **Int** | | [optional] +**int64** | **Int64** | | [optional] +**number** | **Double** | | +**float** | **Float** | | [optional] +**double** | **Double** | | [optional] +**string** | **String** | | [optional] +**byte** | **Data** | | +**binary** | **URL** | | [optional] +**date** | **Date** | | +**dateTime** | **Date** | | [optional] +**uuid** | **UUID** | | [optional] +**password** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/HasOnlyReadOnly.md b/samples/client/petstore/swift5/frozenEnums/docs/HasOnlyReadOnly.md new file mode 100644 index 000000000000..57b6e3a17e67 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/HasOnlyReadOnly.md @@ -0,0 +1,11 @@ +# HasOnlyReadOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] [readonly] +**foo** | **String** | | [optional] [readonly] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/List.md b/samples/client/petstore/swift5/frozenEnums/docs/List.md new file mode 100644 index 000000000000..b77718302edf --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/List.md @@ -0,0 +1,10 @@ +# List + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/MapTest.md b/samples/client/petstore/swift5/frozenEnums/docs/MapTest.md new file mode 100644 index 000000000000..73f9e0d50acf --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/MapTest.md @@ -0,0 +1,13 @@ +# MapTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapMapOfString** | [String: [String: String]] | | [optional] +**mapOfEnumString** | **[String: String]** | | [optional] +**directMap** | **[String: Bool]** | | [optional] +**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/swift5/frozenEnums/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 000000000000..3fdfd03f0e31 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,12 @@ +# MixedPropertiesAndAdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **UUID** | | [optional] +**dateTime** | **Date** | | [optional] +**map** | [String: Animal] | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/Model200Response.md b/samples/client/petstore/swift5/frozenEnums/docs/Model200Response.md new file mode 100644 index 000000000000..5865ea690cc3 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/Model200Response.md @@ -0,0 +1,11 @@ +# Model200Response + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **Int** | | [optional] +**_class** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/Name.md b/samples/client/petstore/swift5/frozenEnums/docs/Name.md new file mode 100644 index 000000000000..f7b180292cd6 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/Name.md @@ -0,0 +1,13 @@ +# Name + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **Int** | | +**snakeCase** | **Int** | | [optional] [readonly] +**property** | **String** | | [optional] +**_123number** | **Int** | | [optional] [readonly] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/NumberOnly.md b/samples/client/petstore/swift5/frozenEnums/docs/NumberOnly.md new file mode 100644 index 000000000000..72bd361168b5 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/NumberOnly.md @@ -0,0 +1,10 @@ +# NumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justNumber** | **Double** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/Order.md b/samples/client/petstore/swift5/frozenEnums/docs/Order.md new file mode 100644 index 000000000000..15487f01175c --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/Order.md @@ -0,0 +1,15 @@ +# Order + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Int64** | | [optional] +**petId** | **Int64** | | [optional] +**quantity** | **Int** | | [optional] +**shipDate** | **Date** | | [optional] +**status** | **String** | Order Status | [optional] +**complete** | **Bool** | | [optional] [default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/OuterComposite.md b/samples/client/petstore/swift5/frozenEnums/docs/OuterComposite.md new file mode 100644 index 000000000000..d6b3583bc3ff --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/OuterComposite.md @@ -0,0 +1,12 @@ +# OuterComposite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**myNumber** | **Double** | | [optional] +**myString** | **String** | | [optional] +**myBoolean** | **Bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/OuterEnum.md b/samples/client/petstore/swift5/frozenEnums/docs/OuterEnum.md new file mode 100644 index 000000000000..06d413b01680 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/OuterEnum.md @@ -0,0 +1,9 @@ +# OuterEnum + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/Pet.md b/samples/client/petstore/swift5/frozenEnums/docs/Pet.md new file mode 100644 index 000000000000..5c05f98fad4a --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/Pet.md @@ -0,0 +1,15 @@ +# Pet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Int64** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**name** | **String** | | +**photoUrls** | **[String]** | | +**tags** | [Tag] | | [optional] +**status** | **String** | pet status in the store | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/PetAPI.md b/samples/client/petstore/swift5/frozenEnums/docs/PetAPI.md new file mode 100644 index 000000000000..37226f18b855 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/PetAPI.md @@ -0,0 +1,469 @@ +# PetAPI + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](PetAPI.md#addpet) | **POST** /pet | Add a new pet to the store +[**deletePet**](PetAPI.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +[**findPetsByStatus**](PetAPI.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](PetAPI.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +[**getPetById**](PetAPI.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +[**updatePet**](PetAPI.md#updatepet) | **PUT** /pet | Update an existing pet +[**updatePetWithForm**](PetAPI.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**uploadFile**](PetAPI.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +[**uploadFileWithRequiredFile**](PetAPI.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) + + +# **addPet** +```swift + open class func addPet(body: Pet, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +Add a new pet to the store + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let body = Pet(id: 123, category: Category(id: 123, name: "name_example"), name: "name_example", photoUrls: ["photoUrls_example"], tags: [Tag(id: 123, name: "name_example")], status: "status_example") // Pet | Pet object that needs to be added to the store + +// Add a new pet to the store +PetAPI.addPet(body: body) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | + +### Return type + +Void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deletePet** +```swift + open class func deletePet(apiKey: String? = nil, petId: Int64, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +Deletes a pet + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let apiKey = "apiKey_example" // String | (optional) +let petId = 987 // Int64 | Pet id to delete + +// Deletes a pet +PetAPI.deletePet(apiKey: apiKey, petId: petId) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **apiKey** | **String** | | [optional] + **petId** | **Int64** | Pet id to delete | + +### Return type + +Void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByStatus** +```swift + open class func findPetsByStatus(status: [Status_findPetsByStatus], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) +``` + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let status = ["status_example"] // [String] | Status values that need to be considered for filter + +// Finds Pets by status +PetAPI.findPetsByStatus(status: status) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**[String]**](String.md) | Status values that need to be considered for filter | + +### Return type + +[**[Pet]**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByTags** +```swift + open class func findPetsByTags(tags: [String], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) +``` + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let tags = ["inner_example"] // [String] | Tags to filter by + +// Finds Pets by tags +PetAPI.findPetsByTags(tags: tags) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**[String]**](String.md) | Tags to filter by | + +### Return type + +[**[Pet]**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getPetById** +```swift + open class func getPetById(petId: Int64, completion: @escaping (_ data: Pet?, _ error: Error?) -> Void) +``` + +Find pet by ID + +Returns a single pet + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let petId = 987 // Int64 | ID of pet to return + +// Find pet by ID +PetAPI.getPetById(petId: petId) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Int64** | ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePet** +```swift + open class func updatePet(body: Pet, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +Update an existing pet + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let body = Pet(id: 123, category: Category(id: 123, name: "name_example"), name: "name_example", photoUrls: ["photoUrls_example"], tags: [Tag(id: 123, name: "name_example")], status: "status_example") // Pet | Pet object that needs to be added to the store + +// Update an existing pet +PetAPI.updatePet(body: body) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | + +### Return type + +Void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePetWithForm** +```swift + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +Updates a pet in the store with form data + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let petId = 987 // Int64 | ID of pet that needs to be updated +let name = "name_example" // String | Updated name of the pet (optional) +let status = "status_example" // String | Updated status of the pet (optional) + +// Updates a pet in the store with form data +PetAPI.updatePetWithForm(petId: petId, name: name, status: status) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Int64** | ID of pet that needs to be updated | + **name** | **String** | Updated name of the pet | [optional] + **status** | **String** | Updated status of the pet | [optional] + +### Return type + +Void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **uploadFile** +```swift + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping (_ data: ApiResponse?, _ error: Error?) -> Void) +``` + +uploads an image + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let petId = 987 // Int64 | ID of pet to update +let additionalMetadata = "additionalMetadata_example" // String | Additional data to pass to server (optional) +let file = URL(string: "https://example.com")! // URL | file to upload (optional) + +// uploads an image +PetAPI.uploadFile(petId: petId, additionalMetadata: additionalMetadata, file: file) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Int64** | ID of pet to update | + **additionalMetadata** | **String** | Additional data to pass to server | [optional] + **file** | **URL** | file to upload | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **uploadFileWithRequiredFile** +```swift + open class func uploadFileWithRequiredFile(petId: Int64, additionalMetadata: String? = nil, requiredFile: URL, completion: @escaping (_ data: ApiResponse?, _ error: Error?) -> Void) +``` + +uploads an image (required) + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let petId = 987 // Int64 | ID of pet to update +let additionalMetadata = "additionalMetadata_example" // String | Additional data to pass to server (optional) +let requiredFile = URL(string: "https://example.com")! // URL | file to upload + +// uploads an image (required) +PetAPI.uploadFileWithRequiredFile(petId: petId, additionalMetadata: additionalMetadata, requiredFile: requiredFile) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Int64** | ID of pet to update | + **additionalMetadata** | **String** | Additional data to pass to server | [optional] + **requiredFile** | **URL** | file to upload | + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/ReadOnlyFirst.md b/samples/client/petstore/swift5/frozenEnums/docs/ReadOnlyFirst.md new file mode 100644 index 000000000000..ed537b87598b --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/ReadOnlyFirst.md @@ -0,0 +1,11 @@ +# ReadOnlyFirst + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] [readonly] +**baz** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/Return.md b/samples/client/petstore/swift5/frozenEnums/docs/Return.md new file mode 100644 index 000000000000..66d17c27c887 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/Return.md @@ -0,0 +1,10 @@ +# Return + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_return** | **Int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/SpecialModelName.md b/samples/client/petstore/swift5/frozenEnums/docs/SpecialModelName.md new file mode 100644 index 000000000000..3ec27a38c2ac --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/SpecialModelName.md @@ -0,0 +1,10 @@ +# SpecialModelName + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**specialPropertyName** | **Int64** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/StoreAPI.md b/samples/client/petstore/swift5/frozenEnums/docs/StoreAPI.md new file mode 100644 index 000000000000..b023aa9e4523 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/StoreAPI.md @@ -0,0 +1,206 @@ +# StoreAPI + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](StoreAPI.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +[**getInventory**](StoreAPI.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +[**getOrderById**](StoreAPI.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID +[**placeOrder**](StoreAPI.md#placeorder) | **POST** /store/order | Place an order for a pet + + +# **deleteOrder** +```swift + open class func deleteOrder(orderId: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let orderId = "orderId_example" // String | ID of the order that needs to be deleted + +// Delete purchase order by ID +StoreAPI.deleteOrder(orderId: orderId) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **String** | ID of the order that needs to be deleted | + +### Return type + +Void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getInventory** +```swift + open class func getInventory(completion: @escaping (_ data: [String: Int]?, _ error: Error?) -> Void) +``` + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + + +// Returns pet inventories by status +StoreAPI.getInventory() { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**[String: Int]** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getOrderById** +```swift + open class func getOrderById(orderId: Int64, completion: @escaping (_ data: Order?, _ error: Error?) -> Void) +``` + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let orderId = 987 // Int64 | ID of pet that needs to be fetched + +// Find purchase order by ID +StoreAPI.getOrderById(orderId: orderId) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **Int64** | ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **placeOrder** +```swift + open class func placeOrder(body: Order, completion: @escaping (_ data: Order?, _ error: Error?) -> Void) +``` + +Place an order for a pet + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let body = Order(id: 123, petId: 123, quantity: 123, shipDate: Date(), status: "status_example", complete: false) // Order | order placed for purchasing the pet + +// Place an order for a pet +StoreAPI.placeOrder(body: body) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Order**](Order.md) | order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/StringBooleanMap.md b/samples/client/petstore/swift5/frozenEnums/docs/StringBooleanMap.md new file mode 100644 index 000000000000..7abf11ec68b1 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/StringBooleanMap.md @@ -0,0 +1,9 @@ +# StringBooleanMap + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/Tag.md b/samples/client/petstore/swift5/frozenEnums/docs/Tag.md new file mode 100644 index 000000000000..ff4ac8aa4519 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/Tag.md @@ -0,0 +1,11 @@ +# Tag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Int64** | | [optional] +**name** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/TypeHolderDefault.md b/samples/client/petstore/swift5/frozenEnums/docs/TypeHolderDefault.md new file mode 100644 index 000000000000..5161394bdc3e --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/TypeHolderDefault.md @@ -0,0 +1,14 @@ +# TypeHolderDefault + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**stringItem** | **String** | | [default to "what"] +**numberItem** | **Double** | | +**integerItem** | **Int** | | +**boolItem** | **Bool** | | [default to true] +**arrayItem** | **[Int]** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/TypeHolderExample.md b/samples/client/petstore/swift5/frozenEnums/docs/TypeHolderExample.md new file mode 100644 index 000000000000..46d0471cd71a --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/TypeHolderExample.md @@ -0,0 +1,14 @@ +# TypeHolderExample + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**stringItem** | **String** | | +**numberItem** | **Double** | | +**integerItem** | **Int** | | +**boolItem** | **Bool** | | +**arrayItem** | **[Int]** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/User.md b/samples/client/petstore/swift5/frozenEnums/docs/User.md new file mode 100644 index 000000000000..5a439de0ff95 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/User.md @@ -0,0 +1,17 @@ +# User + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Int64** | | [optional] +**username** | **String** | | [optional] +**firstName** | **String** | | [optional] +**lastName** | **String** | | [optional] +**email** | **String** | | [optional] +**password** | **String** | | [optional] +**phone** | **String** | | [optional] +**userStatus** | **Int** | User Status | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/frozenEnums/docs/UserAPI.md b/samples/client/petstore/swift5/frozenEnums/docs/UserAPI.md new file mode 100644 index 000000000000..5fc9160daf47 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/docs/UserAPI.md @@ -0,0 +1,406 @@ +# UserAPI + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserAPI.md#createuser) | **POST** /user | Create user +[**createUsersWithArrayInput**](UserAPI.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserAPI.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +[**deleteUser**](UserAPI.md#deleteuser) | **DELETE** /user/{username} | Delete user +[**getUserByName**](UserAPI.md#getuserbyname) | **GET** /user/{username} | Get user by user name +[**loginUser**](UserAPI.md#loginuser) | **GET** /user/login | Logs user into the system +[**logoutUser**](UserAPI.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +[**updateUser**](UserAPI.md#updateuser) | **PUT** /user/{username} | Updated user + + +# **createUser** +```swift + open class func createUser(body: User, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +Create user + +This can only be done by the logged in user. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let body = User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123) // User | Created user object + +// Create user +UserAPI.createUser(body: body) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**User**](User.md) | Created user object | + +### Return type + +Void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithArrayInput** +```swift + open class func createUsersWithArrayInput(body: [User], completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +Creates list of users with given input array + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let body = [User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123)] // [User] | List of user object + +// Creates list of users with given input array +UserAPI.createUsersWithArrayInput(body: body) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**[User]**](User.md) | List of user object | + +### Return type + +Void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithListInput** +```swift + open class func createUsersWithListInput(body: [User], completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +Creates list of users with given input array + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let body = [User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123)] // [User] | List of user object + +// Creates list of users with given input array +UserAPI.createUsersWithListInput(body: body) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**[User]**](User.md) | List of user object | + +### Return type + +Void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deleteUser** +```swift + open class func deleteUser(username: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +Delete user + +This can only be done by the logged in user. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let username = "username_example" // String | The name that needs to be deleted + +// Delete user +UserAPI.deleteUser(username: username) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String** | The name that needs to be deleted | + +### Return type + +Void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getUserByName** +```swift + open class func getUserByName(username: String, completion: @escaping (_ data: User?, _ error: Error?) -> Void) +``` + +Get user by user name + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let username = "username_example" // String | The name that needs to be fetched. Use user1 for testing. + +// Get user by user name +UserAPI.getUserByName(username: username) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String** | The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **loginUser** +```swift + open class func loginUser(username: String, password: String, completion: @escaping (_ data: String?, _ error: Error?) -> Void) +``` + +Logs user into the system + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let username = "username_example" // String | The user name for login +let password = "password_example" // String | The password for login in clear text + +// Logs user into the system +UserAPI.loginUser(username: username, password: password) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String** | The user name for login | + **password** | **String** | The password for login in clear text | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **logoutUser** +```swift + open class func logoutUser(completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +Logs out current logged in user session + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + + +// Logs out current logged in user session +UserAPI.logoutUser() { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +Void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updateUser** +```swift + open class func updateUser(username: String, body: User, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +Updated user + +This can only be done by the logged in user. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let username = "username_example" // String | name that need to be deleted +let body = User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123) // User | Updated user object + +// Updated user +UserAPI.updateUser(username: username, body: body) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String** | name that need to be deleted | + **body** | [**User**](User.md) | Updated user object | + +### Return type + +Void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/swift5/frozenEnums/git_push.sh b/samples/client/petstore/swift5/frozenEnums/git_push.sh new file mode 100644 index 000000000000..f53a75d4fabe --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/swift5/frozenEnums/pom.xml b/samples/client/petstore/swift5/frozenEnums/pom.xml new file mode 100644 index 000000000000..c1b201eb3b4c --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/pom.xml @@ -0,0 +1,43 @@ + + 4.0.0 + io.swagger + Swift5PetstoreClientTests + pom + 1.0-SNAPSHOT + Swift5 Swagger Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + xcodebuild-test + integration-test + + exec + + + ./run_spmbuild.sh + + + + + + + diff --git a/samples/client/petstore/swift5/frozenEnums/project.yml b/samples/client/petstore/swift5/frozenEnums/project.yml new file mode 100644 index 000000000000..0493cf65896e --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/project.yml @@ -0,0 +1,15 @@ +name: PetstoreClient +targets: + PetstoreClient: + type: framework + platform: iOS + deploymentTarget: "9.0" + sources: [PetstoreClient] + info: + path: ./Info.plist + version: 1.0.0 + settings: + APPLICATION_EXTENSION_API_ONLY: true + scheme: {} + dependencies: + - carthage: AnyCodable diff --git a/samples/client/petstore/swift5/frozenEnums/run_spmbuild.sh b/samples/client/petstore/swift5/frozenEnums/run_spmbuild.sh new file mode 100755 index 000000000000..1a9f585ad054 --- /dev/null +++ b/samples/client/petstore/swift5/frozenEnums/run_spmbuild.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +swift build && exit ${PIPESTATUS[0]} 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 0c1c75488981..60869f63ef61 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -14,6 +14,28 @@ extension JSONEncodable { func encodeToJSON() -> Any { self } } +/// An enum where the last case value can be used as a default catch-all. +protocol CaseIterableDefaultsLast: Decodable & CaseIterable & RawRepresentable +where RawValue: Decodable, AllCases: BidirectionalCollection {} + +extension CaseIterableDefaultsLast { + /// Initializes an enum such that if a known raw value is found, then it is decoded. + /// Otherwise the last case is used. + /// - Parameter decoder: A decoder. + public init(from decoder: Decoder) throws { + if let value = try Self(rawValue: decoder.singleValueContainer().decode(RawValue.self)) { + self = value + } else if let lastValue = Self.allCases.last { + self = lastValue + } else { + throw DecodingError.valueNotFound( + Self.Type.self, + .init(codingPath: decoder.codingPath, debugDescription: "CaseIterableDefaultsLast") + ) + } + } +} + internal enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } 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 ab4165a9b450..7787127c40d8 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -14,6 +14,28 @@ extension JSONEncodable { func encodeToJSON() -> Any { self } } +/// An enum where the last case value can be used as a default catch-all. +protocol CaseIterableDefaultsLast: Decodable & CaseIterable & RawRepresentable +where RawValue: Decodable, AllCases: BidirectionalCollection {} + +extension CaseIterableDefaultsLast { + /// Initializes an enum such that if a known raw value is found, then it is decoded. + /// Otherwise the last case is used. + /// - Parameter decoder: A decoder. + public init(from decoder: Decoder) throws { + if let value = try Self(rawValue: decoder.singleValueContainer().decode(RawValue.self)) { + self = value + } else if let lastValue = Self.allCases.last { + self = lastValue + } else { + throw DecodingError.valueNotFound( + Self.Type.self, + .init(codingPath: decoder.codingPath, debugDescription: "CaseIterableDefaultsLast") + ) + } + } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models.swift index ab4165a9b450..7787127c40d8 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -14,6 +14,28 @@ extension JSONEncodable { func encodeToJSON() -> Any { self } } +/// An enum where the last case value can be used as a default catch-all. +protocol CaseIterableDefaultsLast: Decodable & CaseIterable & RawRepresentable +where RawValue: Decodable, AllCases: BidirectionalCollection {} + +extension CaseIterableDefaultsLast { + /// Initializes an enum such that if a known raw value is found, then it is decoded. + /// Otherwise the last case is used. + /// - Parameter decoder: A decoder. + public init(from decoder: Decoder) throws { + if let value = try Self(rawValue: decoder.singleValueContainer().decode(RawValue.self)) { + self = value + } else if let lastValue = Self.allCases.last { + self = lastValue + } else { + throw DecodingError.valueNotFound( + Self.Type.self, + .init(codingPath: decoder.codingPath, debugDescription: "CaseIterableDefaultsLast") + ) + } + } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } 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 ab4165a9b450..7787127c40d8 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -14,6 +14,28 @@ extension JSONEncodable { func encodeToJSON() -> Any { self } } +/// An enum where the last case value can be used as a default catch-all. +protocol CaseIterableDefaultsLast: Decodable & CaseIterable & RawRepresentable +where RawValue: Decodable, AllCases: BidirectionalCollection {} + +extension CaseIterableDefaultsLast { + /// Initializes an enum such that if a known raw value is found, then it is decoded. + /// Otherwise the last case is used. + /// - Parameter decoder: A decoder. + public init(from decoder: Decoder) throws { + if let value = try Self(rawValue: decoder.singleValueContainer().decode(RawValue.self)) { + self = value + } else if let lastValue = Self.allCases.last { + self = lastValue + } else { + throw DecodingError.valueNotFound( + Self.Type.self, + .init(codingPath: decoder.codingPath, debugDescription: "CaseIterableDefaultsLast") + ) + } + } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift index ab4165a9b450..7787127c40d8 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -14,6 +14,28 @@ extension JSONEncodable { func encodeToJSON() -> Any { self } } +/// An enum where the last case value can be used as a default catch-all. +protocol CaseIterableDefaultsLast: Decodable & CaseIterable & RawRepresentable +where RawValue: Decodable, AllCases: BidirectionalCollection {} + +extension CaseIterableDefaultsLast { + /// Initializes an enum such that if a known raw value is found, then it is decoded. + /// Otherwise the last case is used. + /// - Parameter decoder: A decoder. + public init(from decoder: Decoder) throws { + if let value = try Self(rawValue: decoder.singleValueContainer().decode(RawValue.self)) { + self = value + } else if let lastValue = Self.allCases.last { + self = lastValue + } else { + throw DecodingError.valueNotFound( + Self.Type.self, + .init(codingPath: decoder.codingPath, debugDescription: "CaseIterableDefaultsLast") + ) + } + } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } 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 ab4165a9b450..7787127c40d8 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -14,6 +14,28 @@ extension JSONEncodable { func encodeToJSON() -> Any { self } } +/// An enum where the last case value can be used as a default catch-all. +protocol CaseIterableDefaultsLast: Decodable & CaseIterable & RawRepresentable +where RawValue: Decodable, AllCases: BidirectionalCollection {} + +extension CaseIterableDefaultsLast { + /// Initializes an enum such that if a known raw value is found, then it is decoded. + /// Otherwise the last case is used. + /// - Parameter decoder: A decoder. + public init(from decoder: Decoder) throws { + if let value = try Self(rawValue: decoder.singleValueContainer().decode(RawValue.self)) { + self = value + } else if let lastValue = Self.allCases.last { + self = lastValue + } else { + throw DecodingError.valueNotFound( + Self.Type.self, + .init(codingPath: decoder.codingPath, debugDescription: "CaseIterableDefaultsLast") + ) + } + } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } 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 ab4165a9b450..7787127c40d8 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -14,6 +14,28 @@ extension JSONEncodable { func encodeToJSON() -> Any { self } } +/// An enum where the last case value can be used as a default catch-all. +protocol CaseIterableDefaultsLast: Decodable & CaseIterable & RawRepresentable +where RawValue: Decodable, AllCases: BidirectionalCollection {} + +extension CaseIterableDefaultsLast { + /// Initializes an enum such that if a known raw value is found, then it is decoded. + /// Otherwise the last case is used. + /// - Parameter decoder: A decoder. + public init(from decoder: Decoder) throws { + if let value = try Self(rawValue: decoder.singleValueContainer().decode(RawValue.self)) { + self = value + } else if let lastValue = Self.allCases.last { + self = lastValue + } else { + throw DecodingError.valueNotFound( + Self.Type.self, + .init(codingPath: decoder.codingPath, debugDescription: "CaseIterableDefaultsLast") + ) + } + } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } diff --git a/samples/client/petstore/swift5/swift5_test_all.sh b/samples/client/petstore/swift5/swift5_test_all.sh index f621187c4633..faeb4ca6aa14 100755 --- a/samples/client/petstore/swift5/swift5_test_all.sh +++ b/samples/client/petstore/swift5/swift5_test_all.sh @@ -19,6 +19,7 @@ mvn -f $DIRECTORY/alamofireLibrary/pom.xml integration-test mvn -f $DIRECTORY/combineLibrary/pom.xml integration-test mvn -f $DIRECTORY/default/pom.xml integration-test mvn -f $DIRECTORY/deprecated/pom.xml integration-test +mvn -f $DIRECTORY/frozenEnums/pom.xml integration-test mvn -f $DIRECTORY/nonPublicApi/pom.xml integration-test mvn -f $DIRECTORY/objcCompatible/pom.xml integration-test mvn -f $DIRECTORY/oneOf/pom.xml integration-test diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models.swift index ab4165a9b450..7787127c40d8 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models.swift @@ -14,6 +14,28 @@ extension JSONEncodable { func encodeToJSON() -> Any { self } } +/// An enum where the last case value can be used as a default catch-all. +protocol CaseIterableDefaultsLast: Decodable & CaseIterable & RawRepresentable +where RawValue: Decodable, AllCases: BidirectionalCollection {} + +extension CaseIterableDefaultsLast { + /// Initializes an enum such that if a known raw value is found, then it is decoded. + /// Otherwise the last case is used. + /// - Parameter decoder: A decoder. + public init(from decoder: Decoder) throws { + if let value = try Self(rawValue: decoder.singleValueContainer().decode(RawValue.self)) { + self = value + } else if let lastValue = Self.allCases.last { + self = lastValue + } else { + throw DecodingError.valueNotFound( + Self.Type.self, + .init(codingPath: decoder.codingPath, debugDescription: "CaseIterableDefaultsLast") + ) + } + } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models.swift index ab4165a9b450..7787127c40d8 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -14,6 +14,28 @@ extension JSONEncodable { func encodeToJSON() -> Any { self } } +/// An enum where the last case value can be used as a default catch-all. +protocol CaseIterableDefaultsLast: Decodable & CaseIterable & RawRepresentable +where RawValue: Decodable, AllCases: BidirectionalCollection {} + +extension CaseIterableDefaultsLast { + /// Initializes an enum such that if a known raw value is found, then it is decoded. + /// Otherwise the last case is used. + /// - Parameter decoder: A decoder. + public init(from decoder: Decoder) throws { + if let value = try Self(rawValue: decoder.singleValueContainer().decode(RawValue.self)) { + self = value + } else if let lastValue = Self.allCases.last { + self = lastValue + } else { + throw DecodingError.valueNotFound( + Self.Type.self, + .init(codingPath: decoder.codingPath, debugDescription: "CaseIterableDefaultsLast") + ) + } + } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } From 8fc6172c6d1f4bbf47d42123123c82a89f1fc154 Mon Sep 17 00:00:00 2001 From: Tal Kirshboim Date: Sat, 4 Dec 2021 06:06:37 +0100 Subject: [PATCH 060/117] Build and test Kotlin Multiplatform samples in CI (#11023) --- .github/workflows/samples-kotlin.yaml | 3 +-- .../libraries/multiplatform/build.gradle.kts.mustache | 3 +++ samples/client/petstore/kotlin-multiplatform/build.gradle.kts | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/samples-kotlin.yaml b/.github/workflows/samples-kotlin.yaml index c6f6f3745c0f..d1d812cbadbe 100644 --- a/.github/workflows/samples-kotlin.yaml +++ b/.github/workflows/samples-kotlin.yaml @@ -30,8 +30,7 @@ jobs: #- samples/client/petstore/kotlin-json-request-string - samples/client/petstore/kotlin-jvm-okhttp4-coroutines - samples/client/petstore/kotlin-moshi-codegen - # need some special setup - #- samples/client/petstore/kotlin-multiplatform + - samples/client/petstore/kotlin-multiplatform - samples/client/petstore/kotlin-nonpublic - samples/client/petstore/kotlin-nullable - samples/client/petstore/kotlin-okhttp3 diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/build.gradle.kts.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/build.gradle.kts.mustache index 2a620721ba49..4a09e4daf46e 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/build.gradle.kts.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/build.gradle.kts.mustache @@ -93,4 +93,7 @@ tasks { } } } + register("test") { + dependsOn("allTests") + } } diff --git a/samples/client/petstore/kotlin-multiplatform/build.gradle.kts b/samples/client/petstore/kotlin-multiplatform/build.gradle.kts index 2c891e8fa4fd..eb33cf023bf7 100644 --- a/samples/client/petstore/kotlin-multiplatform/build.gradle.kts +++ b/samples/client/petstore/kotlin-multiplatform/build.gradle.kts @@ -93,4 +93,7 @@ tasks { } } } + register("test") { + dependsOn("allTests") + } } From 8bc069778f2274eae74493923671ab56f1dabd49 Mon Sep 17 00:00:00 2001 From: jzorn <46689904+jzorn@users.noreply.github.com> Date: Sat, 4 Dec 2021 06:18:06 +0100 Subject: [PATCH 061/117] Compare security schema names case-insensitive (#10989) According to RFC 7235 (HTTP/1.1: Authentication), schema tokens are handled case-insensitive (Section 2.1: Challenge and Response). This change compares the known token values basic, bearer, and signature case-insensitive. - https://datatracker.ietf.org/doc/html/rfc7235#section-2.1 --- .../main/java/org/openapitools/codegen/DefaultCodegen.java | 6 +++--- 1 file 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 042ffc089c38..32fdb6058bf1 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 @@ -4774,12 +4774,12 @@ public List fromSecurity(Map securitySc final CodegenSecurity cs = defaultCodegenSecurity(key, securityScheme); cs.isKeyInHeader = cs.isKeyInQuery = cs.isKeyInCookie = cs.isApiKey = cs.isOAuth = false; cs.isBasic = true; - if ("basic".equals(securityScheme.getScheme())) { + if ("basic".equalsIgnoreCase(securityScheme.getScheme())) { cs.isBasicBasic = true; - } else if ("bearer".equals(securityScheme.getScheme())) { + } else if ("bearer".equalsIgnoreCase(securityScheme.getScheme())) { cs.isBasicBearer = true; cs.bearerFormat = securityScheme.getBearerFormat(); - } else if ("signature".equals(securityScheme.getScheme())) { + } else if ("signature".equalsIgnoreCase(securityScheme.getScheme())) { // HTTP signature as defined in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ // The registry of security schemes is maintained by IANA. // https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml From 1799e9cd12b41f81ea228fa7992e80e4ca057045 Mon Sep 17 00:00:00 2001 From: WILLIAM CHENG Date: Sat, 4 Dec 2021 13:18:29 +0800 Subject: [PATCH 062/117] update doc --- docs/generators.md | 2 +- docs/generators/swift5.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/generators.md b/docs/generators.md index 088acf1b859c..8d8433cd23f5 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -85,8 +85,8 @@ The following generators are available: * [cpp-pistache-server](generators/cpp-pistache-server.md) * [cpp-qt-qhttpengine-server](generators/cpp-qt-qhttpengine-server.md) * [cpp-restbed-server](generators/cpp-restbed-server.md) -* [csharp-netcore-functions](generators/csharp-netcore-functions.md) * [csharp-nancyfx](generators/csharp-nancyfx.md) +* [csharp-netcore-functions](generators/csharp-netcore-functions.md) * [erlang-server](generators/erlang-server.md) * [fsharp-functions (beta)](generators/fsharp-functions.md) * [fsharp-giraffe-server (beta)](generators/fsharp-giraffe-server.md) diff --git a/docs/generators/swift5.md b/docs/generators/swift5.md index ddcb3bc3db0b..9404a2fd458d 100644 --- a/docs/generators/swift5.md +++ b/docs/generators/swift5.md @@ -11,7 +11,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |apiNamePrefix|Prefix that will be appended to all API names ('tags'). Default: empty string. e.g. Pet => Pet.| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| -|generateFrozenEnums|Generate model enums that are "frozen". A frozen enum strictly represents the cases described in the spec, and nothing else. A non-frozen enum includes an unknown case that can represent future cases not yet described in the spec. (default: true)| |true| +|generateFrozenEnums|Generate frozen enums (default: true)| |true| |generateModelAdditionalProperties|Generate model additional properties (default: true)| |true| |hashableModels|Make hashable models (default: true)| |true| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| From 85985e8bfb62639fed92d3181f0b7da642b09d93 Mon Sep 17 00:00:00 2001 From: Peter Leibiger Date: Sat, 4 Dec 2021 07:31:55 +0100 Subject: [PATCH 063/117] [dart][dio] Fix int64 based enums not correctly generated (#11014) --- .../dart/libraries/dio/serialization/built_value/enum.mustache | 2 +- .../dio/serialization/built_value/enum_inline.mustache | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum.mustache index e3cc6755362e..0668b2e7b1dc 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum.mustache @@ -11,7 +11,7 @@ class {{classname}} extends EnumClass { {{#description}} /// {{{.}}} {{/description}} - @BuiltValueEnumConst({{#isInteger}}wireNumber: {{{value}}}{{/isInteger}}{{^isInteger}}wireName: r{{{value}}}{{/isInteger}}) + @BuiltValueEnumConst({{#isInteger}}wireNumber: {{{value}}}{{/isInteger}}{{#isLong}}wireNumber: {{{value}}}{{/isLong}}{{^isInteger}}{{^isLong}}wireName: r{{{value}}}{{/isLong}}{{/isInteger}}) static const {{classname}} {{name}} = _${{name}}; {{/enumVars}} {{/allowableValues}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum_inline.mustache index 5f5dfd499135..c6452b7f6f5f 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum_inline.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum_inline.mustache @@ -5,7 +5,7 @@ class {{{enumName}}} extends EnumClass { {{#description}} /// {{{.}}} {{/description}} - @BuiltValueEnumConst({{#isInteger}}wireNumber: {{{value}}}{{/isInteger}}{{^isInteger}}wireName: r{{{value}}}{{/isInteger}}) + @BuiltValueEnumConst({{#isInteger}}wireNumber: {{{value}}}{{/isInteger}}{{#isLong}}wireNumber: {{{value}}}{{/isLong}}{{^isInteger}}{{^isLong}}wireName: r{{{value}}}{{/isLong}}{{/isInteger}}) static const {{{enumName}}} {{name}} = _${{#lambda.camelcase}}{{{enumName}}}{{/lambda.camelcase}}_{{name}}; {{/enumVars}} {{/allowableValues}} From ecddd4cff1e75667ea490b1d9b009e0ad285b97b Mon Sep 17 00:00:00 2001 From: Peter Leibiger Date: Sat, 4 Dec 2021 07:32:36 +0100 Subject: [PATCH 064/117] [dart][dio][built_value] Fix missing serializer factory builders for additionalProperties (#11011) Refactor the addition of custom serializer factories. --- .../languages/AbstractDartCodegen.java | 6 +- .../languages/DartDioNextClientCodegen.java | 110 +++++++++++++++--- .../built_value/serializers.mustache | 12 +- .../lib/src/serializers.dart | 20 ++-- .../lib/src/serializers.dart | 20 ++-- 5 files changed, 121 insertions(+), 47 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java index 86af0181b3da..75e466165a55 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractDartCodegen.java @@ -505,7 +505,7 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert super.postProcessModelProperty(model, property); if (!model.isEnum && property.isEnum) { // These are inner enums, enums which do not exist as models, just as properties. - // They are handled via the enum_inline template and and are generated in the + // They are handled via the enum_inline template and are generated in the // same file as the containing class. To prevent name clashes the inline enum classes // are prefix with the classname of the containing class in the template. // Here the datatypeWithEnum template variable gets updated to match that scheme. @@ -529,9 +529,9 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert public CodegenOperation fromOperation(String path, String httpMethod, Operation operation, List servers) { final CodegenOperation op = super.fromOperation(path, httpMethod, operation, servers); for (CodegenResponse r : op.responses) { - // By default only set types are automatically added to operation imports, not sure why. + // By default, only set types are automatically added to operation imports, not sure why. // Add all container type imports here, by default 'dart:core' imports are skipped - // but other sub classes may required specific container type imports. + // but other sub-classes may require specific container type imports. if (r.containerType != null && typeMapping().containsKey(r.containerType)) { final String value = typeMapping().get(r.containerType); if (needToImport(value)) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java index 9acfe364003b..5f438eb6f8b3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java @@ -323,6 +323,21 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert // enums are generated with built_value and make use of BuiltSet model.imports.add("BuiltSet"); } + + if (property.isContainer) { + // Figure out if there are any container type additionalProperties + // that need a custom serializer builder factory added. + final CodegenProperty items = property.items; + if (items.getAdditionalProperties() != null) { + addBuiltValueSerializer(new BuiltValueSerializer( + items.isArray, + items.getUniqueItems(), + items.isMap, + items.items.isNullable, + items.getAdditionalProperties().dataType + )); + } + } } } @@ -332,7 +347,6 @@ public Map postProcessOperationsWithModels(Map o Map operations = (Map) objs.get("operations"); List operationList = (List) operations.get("operation"); - Set> serializers = new HashSet<>(); Set resultImports = new HashSet<>(); for (CodegenOperation op : operationList) { @@ -370,12 +384,13 @@ public Map postProcessOperationsWithModels(Map o // Generate serializer factories for all container type parameters. // But skip binary and file parameters, JSON serializers don't make sense there. if (param.isContainer && !(param.isBinary || param.isFile )) { - final Map serializer = new HashMap<>(); - serializer.put("isArray", param.isArray); - serializer.put("uniqueItems", param.uniqueItems); - serializer.put("isMap", param.isMap); - serializer.put("baseType", param.baseType); - serializers.add(serializer); + addBuiltValueSerializer(new BuiltValueSerializer( + param.isArray, + param.uniqueItems, + param.isMap, + param.items.isNullable, + param.baseType + )); } } @@ -387,17 +402,17 @@ public Map postProcessOperationsWithModels(Map o // Generate serializer factories for response types. // But skip binary and file response, JSON serializers don't make sense there. if (op.returnContainer != null && !(op.isResponseBinary || op.isResponseFile)) { - final Map serializer = new HashMap<>(); - serializer.put("isArray", Objects.equals("array", op.returnContainer) || Objects.equals("set", op.returnContainer)); - serializer.put("uniqueItems", op.uniqueItems); - serializer.put("isMap", Objects.equals("map", op.returnContainer)); - serializer.put("baseType", op.returnBaseType); - serializers.add(serializer); + addBuiltValueSerializer(new BuiltValueSerializer( + Objects.equals("array", op.returnContainer) || Objects.equals("set", op.returnContainer), + op.uniqueItems, + Objects.equals("map", op.returnContainer), + false, + op.returnBaseType + )); } } objs.put("imports", resultImports.stream().sorted().collect(Collectors.toList())); - objs.put("serializers", serializers); return objs; } @@ -410,6 +425,19 @@ private void addBuiltValueSerializerImport(String type) { }); } + /** + * Adds the serializer to the global list of custom built_value serializers. + * @param serializer + */ + private void addBuiltValueSerializer(BuiltValueSerializer serializer) { + System.out.println("######## Add serializer!"); + additionalProperties.compute("builtValueSerializers", (k, v) -> { + Set serializers = v == null ? Sets.newHashSet() : ((Set) v); + serializers.add(serializer); + return serializers; + }); + } + private Set rewriteImports(Set originalImports, boolean isModel) { Set resultImports = Sets.newHashSet(); for (String modelImport : originalImports) { @@ -428,4 +456,58 @@ private Set rewriteImports(Set originalImports, boolean isModel) } return resultImports; } + + static class BuiltValueSerializer { + + final boolean isArray; + + final boolean uniqueItems; + + final boolean isMap; + + final boolean isNullable; + + final String dataType; + + private BuiltValueSerializer(boolean isArray, boolean uniqueItems, boolean isMap, boolean isNullable, String dataType) { + this.isArray = isArray; + this.uniqueItems = uniqueItems; + this.isMap = isMap; + this.isNullable = isNullable; + this.dataType = dataType; + } + + public boolean isArray() { + return isArray; + } + + public boolean isUniqueItems() { + return uniqueItems; + } + + public boolean isMap() { + return isMap; + } + + public boolean isNullable() { + return isNullable; + } + + public String getDataType() { + return dataType; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + BuiltValueSerializer that = (BuiltValueSerializer) o; + return isArray == that.isArray && uniqueItems == that.uniqueItems && isMap == that.isMap && isNullable == that.isNullable && dataType.equals(that.dataType); + } + + @Override + public int hashCode() { + return Objects.hash(isArray, uniqueItems, isMap, isNullable, dataType); + } + } } diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/serializers.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/serializers.mustache index e1f3dbe1df5f..c558f153c890 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/serializers.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/serializers.mustache @@ -19,17 +19,17 @@ part 'serializers.g.dart'; @SerializersFor([{{#models}}{{#model}} {{classname}},{{/model}}{{/models}} ]) -Serializers serializers = (_$serializers.toBuilder(){{#apiInfo}}{{#apis}}{{#serializers}} +Serializers serializers = (_$serializers.toBuilder(){{#builtValueSerializers}} ..addBuilderFactory( {{#isArray}} - const FullType(Built{{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}, [FullType({{baseType}})]), - () => {{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}Builder<{{baseType}}>(), + const FullType(Built{{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}, [FullType{{#isNullable}}.nullable{{/isNullable}}({{dataType}})]), + () => {{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}Builder<{{dataType}}>(), {{/isArray}} {{#isMap}} - const FullType(BuiltMap, [FullType(String), FullType({{baseType}})]), - () => MapBuilder(), + const FullType(BuiltMap, [FullType(String), FullType{{#isNullable}}.nullable{{/isNullable}}({{dataType}})]), + () => MapBuilder(), {{/isMap}} - ){{/serializers}}{{/apis}}{{/apiInfo}}{{#useDateLibTimeMachine}} + ){{/builtValueSerializers}}{{#useDateLibTimeMachine}} ..add(const OffsetDateSerializer()) ..add(const OffsetDateTimeSerializer()){{/useDateLibTimeMachine}}{{#useDateLibCore}} ..add(const DateSerializer()) diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/serializers.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/serializers.dart index 1b807addf9e7..5ee82d7b5019 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/serializers.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/serializers.dart @@ -110,26 +110,22 @@ part 'serializers.g.dart'; User, ]) Serializers serializers = (_$serializers.toBuilder() - ..addBuilderFactory( - const FullType(BuiltList, [FullType(String)]), - () => ListBuilder(), - ) ..addBuilderFactory( const FullType(BuiltMap, [FullType(String), FullType(String)]), () => MapBuilder(), ) ..addBuilderFactory( - const FullType(BuiltList, [FullType(String)]), - () => ListBuilder(), - ) - ..addBuilderFactory( - const FullType(BuiltSet, [FullType(Pet)]), - () => SetBuilder(), + const FullType(BuiltList, [FullType(User)]), + () => ListBuilder(), ) ..addBuilderFactory( const FullType(BuiltSet, [FullType(String)]), () => SetBuilder(), ) + ..addBuilderFactory( + const FullType(BuiltSet, [FullType(Pet)]), + () => SetBuilder(), + ) ..addBuilderFactory( const FullType(BuiltList, [FullType(Pet)]), () => ListBuilder(), @@ -139,8 +135,8 @@ Serializers serializers = (_$serializers.toBuilder() () => MapBuilder(), ) ..addBuilderFactory( - const FullType(BuiltList, [FullType(User)]), - () => ListBuilder(), + const FullType(BuiltList, [FullType(String)]), + () => ListBuilder(), ) ..add(const DateSerializer()) ..add(Iso8601DateTimeSerializer())) diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/lib/src/serializers.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/lib/src/serializers.dart index 1b807addf9e7..5ee82d7b5019 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/lib/src/serializers.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/lib/src/serializers.dart @@ -110,26 +110,22 @@ part 'serializers.g.dart'; User, ]) Serializers serializers = (_$serializers.toBuilder() - ..addBuilderFactory( - const FullType(BuiltList, [FullType(String)]), - () => ListBuilder(), - ) ..addBuilderFactory( const FullType(BuiltMap, [FullType(String), FullType(String)]), () => MapBuilder(), ) ..addBuilderFactory( - const FullType(BuiltList, [FullType(String)]), - () => ListBuilder(), - ) - ..addBuilderFactory( - const FullType(BuiltSet, [FullType(Pet)]), - () => SetBuilder(), + const FullType(BuiltList, [FullType(User)]), + () => ListBuilder(), ) ..addBuilderFactory( const FullType(BuiltSet, [FullType(String)]), () => SetBuilder(), ) + ..addBuilderFactory( + const FullType(BuiltSet, [FullType(Pet)]), + () => SetBuilder(), + ) ..addBuilderFactory( const FullType(BuiltList, [FullType(Pet)]), () => ListBuilder(), @@ -139,8 +135,8 @@ Serializers serializers = (_$serializers.toBuilder() () => MapBuilder(), ) ..addBuilderFactory( - const FullType(BuiltList, [FullType(User)]), - () => ListBuilder(), + const FullType(BuiltList, [FullType(String)]), + () => ListBuilder(), ) ..add(const DateSerializer()) ..add(Iso8601DateTimeSerializer())) From 96ee13bbb2e261bd42096ebf709d735afd8902a5 Mon Sep 17 00:00:00 2001 From: WILLIAM CHENG Date: Sat, 4 Dec 2021 14:43:32 +0800 Subject: [PATCH 065/117] replace tab with spaces --- .../CsharpNetcoreFunctionsServerCodegen.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CsharpNetcoreFunctionsServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CsharpNetcoreFunctionsServerCodegen.java index fb99c5a149af..f2ab9939c34b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CsharpNetcoreFunctionsServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CsharpNetcoreFunctionsServerCodegen.java @@ -39,10 +39,10 @@ public CsharpNetcoreFunctionsServerCodegen() { embeddedTemplateDir = templateDir = "csharp-netcore-functions"; apiPackage = "Apis"; modelPackage = "Models"; - String clientPackageDir = "generatedSrc/Client"; + String clientPackageDir = "generatedSrc/Client"; supportingFiles.add(new SupportingFile("README.mustache", "generatedSrc", "README.md")); supportingFiles.add(new SupportingFile("project.mustache", "generatedSrc", "project.json")); - + supportingFiles.add(new SupportingFile("IApiAccessor.mustache", clientPackageDir, "IApiAccessor.cs")); supportingFiles.add(new SupportingFile("Configuration.mustache", @@ -58,13 +58,13 @@ public CsharpNetcoreFunctionsServerCodegen() { supportingFiles.add(new SupportingFile("OpenAPIDateConverter.mustache", clientPackageDir, "OpenAPIDateConverter.cs")); } - - @Override + + @Override public String apiFileFolder() { return outputFolder + File.separator + "generatedSrc" + File.separator + "Functions"; } - - @Override + + @Override public String modelFileFolder() { return outputFolder + File.separator + "generatedSrc" + File.separator + "Models"; } From 03b4ac736f0b686f8ecd3a873447873dec4a5c28 Mon Sep 17 00:00:00 2001 From: Alexey Makhrov Date: Sat, 4 Dec 2021 08:43:52 -0800 Subject: [PATCH 066/117] [typescript-angular] taggedUnions=true: Support recursive schemas (#11016) * typescript-angular: taggedUnions=true: Preserve import to the parent model from the child if the child property has a direct reference to it * Fix javadoc --- .../openapitools/codegen/DefaultCodegen.java | 60 +++++++++++++------ .../TypeScriptAngularClientCodegen.java | 11 ++++ .../TypeScriptAngularClientCodegenTest.java | 52 ++++++++++++++-- ...f_composition_discriminator_recursive.yaml | 51 ++++++++++++++++ 4 files changed, 151 insertions(+), 23 deletions(-) create mode 100644 modules/openapi-generator/src/test/resources/3_0/allOf_composition_discriminator_recursive.yaml 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 32fdb6058bf1..f1736f0e5321 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 @@ -570,14 +570,7 @@ public Map updateAllModels(Map objs) { List> models = (List>) inner.get("models"); for (Map mo : models) { CodegenModel cm = (CodegenModel) mo.get("model"); - for (CodegenProperty cp : cm.allVars) { - // detect self import - if (cp.dataType.equalsIgnoreCase(cm.classname) || - (cp.isContainer && cp.items != null && cp.items.dataType.equalsIgnoreCase(cm.classname))) { - cm.imports.remove(cm.classname); // remove self import - cp.isSelfReference = true; - } - } + removeSelfReferenceImports(cm); } } setCircularReferences(allModels); @@ -585,6 +578,23 @@ public Map updateAllModels(Map objs) { return objs; } + /** + * Removes imports from the model that points to itself + * Marks a self referencing property, if detected + * + * @param model Self imports will be removed from this model.imports collection + */ + protected void removeSelfReferenceImports(CodegenModel model) { + for (CodegenProperty cp : model.allVars) { + // detect self import + if (cp.dataType.equalsIgnoreCase(model.classname) || + (cp.isContainer && cp.items != null && cp.items.dataType.equalsIgnoreCase(model.classname))) { + model.imports.remove(model.classname); // remove self import + cp.isSelfReference = true; + } + } + } + public void setCircularReferences(Map models) { final Map> dependencyMap = models.entrySet().stream() .collect(Collectors.toMap(Entry::getKey, entry -> getModelDependencies(entry.getValue()))); @@ -5168,17 +5178,7 @@ private void addVars(IJsonSchemaValidationProperties m, List va cm.hasOnlyReadOnly = false; } - // TODO revise the logic to include map - if (cp.isContainer) { - addImport(cm, typeMapping.get("array")); - } - - addImport(cm, cp.baseType); - CodegenProperty innerCp = cp; - while (innerCp != null) { - addImport(cm, innerCp.complexType); - innerCp = innerCp.items; - } + addImportsForPropertyType(cm, cp); // if required, add to the list "requiredVars" if (Boolean.TRUE.equals(cp.required)) { @@ -5199,6 +5199,28 @@ private void addVars(IJsonSchemaValidationProperties m, List va return; } + /** + * For a given property, adds all needed imports to the model + * This includes a flat property type (e.g. property type: ReferencedModel) + * as well as container type (property type: array of ReferencedModel's) + * + * @param model The codegen representation of the OAS schema. + * @param property The codegen representation of the OAS schema's property. + */ + protected void addImportsForPropertyType(CodegenModel model, CodegenProperty property) { + // TODO revise the logic to include map + if (property.isContainer) { + addImport(model, typeMapping.get("array")); + } + + addImport(model, property.baseType); + CodegenProperty innerCp = property; + while (innerCp != null) { + addImport(model, innerCp.complexType); + innerCp = innerCp.items; + } + } + /** * Determine all of the types in the model definitions (schemas) that are aliases of * simple types. diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java index 858e33d0c535..d2ab116ab1eb 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java @@ -549,8 +549,19 @@ public Map postProcessAllModels(Map objs) { setChildDiscriminatorValue(cm, child); } } + + // with tagged union, a child model doesn't extend the parent (all properties are just copied over) + // it means we don't need to import that parent any more if (cm.parent != null) { cm.imports.remove(cm.parent); + + // however, it's possible that the child model contains a recursive reference to the parent + // in order to support this case, we update the list of imports from properties once again + for (CodegenProperty cp: cm.allVars) { + addImportsForPropertyType(cm, cp); + } + removeSelfReferenceImports(cm); + } } // Add additional filename information for imports diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientCodegenTest.java index e5a76bd02a30..612314729979 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientCodegenTest.java @@ -8,14 +8,18 @@ import io.swagger.v3.oas.models.media.StringSchema; import io.swagger.v3.oas.models.responses.ApiResponse; import io.swagger.v3.oas.models.responses.ApiResponses; -import org.openapitools.codegen.CodegenConstants; -import org.openapitools.codegen.CodegenOperation; -import org.openapitools.codegen.CodegenProperty; -import org.openapitools.codegen.TestUtils; +import org.openapitools.codegen.*; +import org.openapitools.codegen.config.CodegenConfigurator; import org.openapitools.codegen.languages.TypeScriptAngularClientCodegen; import org.testng.Assert; import org.testng.annotations.Test; +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.HashMap; +import java.util.Map; + public class TypeScriptAngularClientCodegenTest { @Test @@ -267,4 +271,44 @@ public void testCorrectlyProducesImportsWithImportMapping() { codegen.importMapping().put(importedModel, importName); Assert.assertEquals(codegen.toModelImport(importedModel), importName); } + + @Test + public void testTaggedUnionImports() throws Exception { + final String specPath = "src/test/resources/3_0/allOf_composition_discriminator_recursive.yaml"; + + Map properties = new HashMap<>(); + properties.put(TypeScriptAngularClientCodegen.TAGGED_UNIONS, "true"); + + File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("typescript-angular") + .setInputSpec(specPath) + .setAdditionalProperties(properties) + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + final ClientOptInput clientOptInput = configurator.toClientOptInput(); + + Generator generator = new DefaultGenerator(); + generator.opts(clientOptInput).generate(); + + TestUtils.assertFileContains( + Paths.get(output + "/model/expressionToken.ts"), + "import { Token } from './token'", // imports the parent schema + "import { TokenMetadata } from './tokenMetadata'", // imports a schema referenced in an inherited property + "export interface ExpressionToken {" // no inheritance + ); + + TestUtils.assertFileNotContains( + Paths.get(output + "/model/stringToken.ts"), + "import { Token } from './token'" + ); + + TestUtils.assertFileContains( + Paths.get(output + "/model/token.ts"), + "import { ExpressionToken } from './expressionToken'", + "export type Token = ExpressionToken | StringToken" + ); + } } diff --git a/modules/openapi-generator/src/test/resources/3_0/allOf_composition_discriminator_recursive.yaml b/modules/openapi-generator/src/test/resources/3_0/allOf_composition_discriminator_recursive.yaml new file mode 100644 index 000000000000..de3b9f211771 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/allOf_composition_discriminator_recursive.yaml @@ -0,0 +1,51 @@ +openapi: 3.0.2 +info: + title: OAI Specification example for Polymorphism + version: 1.0.0 +paths: + /status: + get: + responses: + '201': + description: desc + +components: + schemas: + TokenMetadata: + type: object + properties: + tag1: + type: string + + Token: + type: object + required: + - type + properties: + type: + type: string + metadata: + $ref: '#/components/schemas/TokenMetadata' + discriminator: + propertyName: type + mapping: + string: '#/components/schemas/StringToken' + expression: '#/components/schemas/ExpressionToken' + + StringToken: + allOf: + - $ref: '#/components/schemas/Token' + - type: object + properties: + value: + type: string + + ExpressionToken: + allOf: + - $ref: '#/components/schemas/Token' + - type: object + properties: + tokens: + type: array + items: + $ref: '#/components/schemas/Token' \ No newline at end of file From 186842ea197bf914cc16345643126d7e25699856 Mon Sep 17 00:00:00 2001 From: Yuriy Belenko Date: Sun, 5 Dec 2021 10:47:12 +0300 Subject: [PATCH 067/117] [php-slim4] Bump required PHP version to 7.4 (#11039) * Change minimum PHP version to 7.4 * Refresh samples --- .../src/main/resources/php-slim4-server/README.mustache | 2 +- .../src/main/resources/php-slim4-server/composer.mustache | 2 +- .../src/main/resources/php-slim4-server/licenseInfo.mustache | 2 +- samples/server/petstore/php-slim4/README.md | 2 +- samples/server/petstore/php-slim4/composer.json | 2 +- samples/server/petstore/php-slim4/config/dev/example.inc.php | 2 +- samples/server/petstore/php-slim4/config/prod/example.inc.php | 2 +- samples/server/petstore/php-slim4/lib/Api/AbstractPetApi.php | 2 +- samples/server/petstore/php-slim4/lib/Api/AbstractStoreApi.php | 2 +- samples/server/petstore/php-slim4/lib/Api/AbstractUserApi.php | 2 +- .../petstore/php-slim4/lib/Auth/AbstractAuthenticator.php | 2 +- samples/server/petstore/php-slim4/lib/BaseModel.php | 2 +- .../php-slim4/lib/Middleware/JsonBodyParserMiddleware.php | 2 +- samples/server/petstore/php-slim4/lib/Model/ApiResponse.php | 2 +- samples/server/petstore/php-slim4/lib/Model/Category.php | 2 +- samples/server/petstore/php-slim4/lib/Model/Order.php | 2 +- samples/server/petstore/php-slim4/lib/Model/Pet.php | 2 +- samples/server/petstore/php-slim4/lib/Model/Tag.php | 2 +- samples/server/petstore/php-slim4/lib/Model/User.php | 2 +- samples/server/petstore/php-slim4/lib/SlimRouter.php | 2 +- samples/server/petstore/php-slim4/public/index.php | 2 +- samples/server/petstore/php-slim4/tests/BaseModelTest.php | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/README.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/README.mustache index 0a5ecca3d6ba..9435bf7f24a0 100644 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/README.mustache +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/README.mustache @@ -19,7 +19,7 @@ This server has been generated with [Laminas (Zend) PSR-7 implementation](https: ## Requirements * Web server with URL rewriting -* PHP 7.3 or newer +* PHP 7.4 or newer This package contains `.htaccess` for Apache configuration. If you use another server(Nginx, HHVM, IIS, lighttpd) check out [Web Servers](https://www.slimframework.com/docs/v3/start/web-servers.html) doc. diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/composer.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/composer.mustache index 4375a02d56a3..803a0c140cde 100644 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/composer.mustache +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/composer.mustache @@ -8,7 +8,7 @@ } ], "require": { - "php": "^7.3 || ^8.0", + "php": "^7.4 || ^8.0", "slim/slim": "^4.5.0", "dyorg/slim-token-authentication": "dev-slim4", "ybelenko/openapi-data-mocker": "^1.0", diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/licenseInfo.mustache index b3278a2920e9..8a61a5402ff4 100644 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/licenseInfo.mustache @@ -2,7 +2,7 @@ {{#appName}} * {{{.}}} {{/appName}} - * PHP version 7.3 + * PHP version 7.4 * * @package {{invokerPackage}} * @author OpenAPI Generator team diff --git a/samples/server/petstore/php-slim4/README.md b/samples/server/petstore/php-slim4/README.md index 5dc80231b176..ac51de45d1eb 100644 --- a/samples/server/petstore/php-slim4/README.md +++ b/samples/server/petstore/php-slim4/README.md @@ -8,7 +8,7 @@ This server has been generated with [Slim PSR-7](https://github.com/slimphp/Slim ## Requirements * Web server with URL rewriting -* PHP 7.3 or newer +* PHP 7.4 or newer This package contains `.htaccess` for Apache configuration. If you use another server(Nginx, HHVM, IIS, lighttpd) check out [Web Servers](https://www.slimframework.com/docs/v3/start/web-servers.html) doc. diff --git a/samples/server/petstore/php-slim4/composer.json b/samples/server/petstore/php-slim4/composer.json index da7b26a6d4f5..529f8f937153 100644 --- a/samples/server/petstore/php-slim4/composer.json +++ b/samples/server/petstore/php-slim4/composer.json @@ -8,7 +8,7 @@ } ], "require": { - "php": "^7.3 || ^8.0", + "php": "^7.4 || ^8.0", "slim/slim": "^4.5.0", "dyorg/slim-token-authentication": "dev-slim4", "ybelenko/openapi-data-mocker": "^1.0", diff --git a/samples/server/petstore/php-slim4/config/dev/example.inc.php b/samples/server/petstore/php-slim4/config/dev/example.inc.php index 9d461dca3805..2a2e65d4a599 100644 --- a/samples/server/petstore/php-slim4/config/dev/example.inc.php +++ b/samples/server/petstore/php-slim4/config/dev/example.inc.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * PHP version 7.3 + * PHP version 7.4 * * @package OpenAPIServer * @author OpenAPI Generator team diff --git a/samples/server/petstore/php-slim4/config/prod/example.inc.php b/samples/server/petstore/php-slim4/config/prod/example.inc.php index 9d461dca3805..2a2e65d4a599 100644 --- a/samples/server/petstore/php-slim4/config/prod/example.inc.php +++ b/samples/server/petstore/php-slim4/config/prod/example.inc.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * PHP version 7.3 + * PHP version 7.4 * * @package OpenAPIServer * @author OpenAPI Generator team diff --git a/samples/server/petstore/php-slim4/lib/Api/AbstractPetApi.php b/samples/server/petstore/php-slim4/lib/Api/AbstractPetApi.php index 3565cbc42c62..ff8c72245264 100644 --- a/samples/server/petstore/php-slim4/lib/Api/AbstractPetApi.php +++ b/samples/server/petstore/php-slim4/lib/Api/AbstractPetApi.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * PHP version 7.3 + * PHP version 7.4 * * @package OpenAPIServer * @author OpenAPI Generator team diff --git a/samples/server/petstore/php-slim4/lib/Api/AbstractStoreApi.php b/samples/server/petstore/php-slim4/lib/Api/AbstractStoreApi.php index af982bec7856..2542047a669d 100644 --- a/samples/server/petstore/php-slim4/lib/Api/AbstractStoreApi.php +++ b/samples/server/petstore/php-slim4/lib/Api/AbstractStoreApi.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * PHP version 7.3 + * PHP version 7.4 * * @package OpenAPIServer * @author OpenAPI Generator team diff --git a/samples/server/petstore/php-slim4/lib/Api/AbstractUserApi.php b/samples/server/petstore/php-slim4/lib/Api/AbstractUserApi.php index ee99c33e8ae2..eee2c7d2ccf1 100644 --- a/samples/server/petstore/php-slim4/lib/Api/AbstractUserApi.php +++ b/samples/server/petstore/php-slim4/lib/Api/AbstractUserApi.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * PHP version 7.3 + * PHP version 7.4 * * @package OpenAPIServer * @author OpenAPI Generator team diff --git a/samples/server/petstore/php-slim4/lib/Auth/AbstractAuthenticator.php b/samples/server/petstore/php-slim4/lib/Auth/AbstractAuthenticator.php index 42ea8a34d493..de2e60113645 100644 --- a/samples/server/petstore/php-slim4/lib/Auth/AbstractAuthenticator.php +++ b/samples/server/petstore/php-slim4/lib/Auth/AbstractAuthenticator.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * PHP version 7.3 + * PHP version 7.4 * * @package OpenAPIServer * @author OpenAPI Generator team diff --git a/samples/server/petstore/php-slim4/lib/BaseModel.php b/samples/server/petstore/php-slim4/lib/BaseModel.php index a83301779735..b0040c1a5575 100644 --- a/samples/server/petstore/php-slim4/lib/BaseModel.php +++ b/samples/server/petstore/php-slim4/lib/BaseModel.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * PHP version 7.3 + * PHP version 7.4 * * @package OpenAPIServer * @author OpenAPI Generator team diff --git a/samples/server/petstore/php-slim4/lib/Middleware/JsonBodyParserMiddleware.php b/samples/server/petstore/php-slim4/lib/Middleware/JsonBodyParserMiddleware.php index 993224f6c875..b1199ffd84a2 100644 --- a/samples/server/petstore/php-slim4/lib/Middleware/JsonBodyParserMiddleware.php +++ b/samples/server/petstore/php-slim4/lib/Middleware/JsonBodyParserMiddleware.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * PHP version 7.3 + * PHP version 7.4 * * @package OpenAPIServer * @author OpenAPI Generator team diff --git a/samples/server/petstore/php-slim4/lib/Model/ApiResponse.php b/samples/server/petstore/php-slim4/lib/Model/ApiResponse.php index 6368eb2c726b..bd0edc18f10a 100644 --- a/samples/server/petstore/php-slim4/lib/Model/ApiResponse.php +++ b/samples/server/petstore/php-slim4/lib/Model/ApiResponse.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * PHP version 7.3 + * PHP version 7.4 * * @package OpenAPIServer * @author OpenAPI Generator team diff --git a/samples/server/petstore/php-slim4/lib/Model/Category.php b/samples/server/petstore/php-slim4/lib/Model/Category.php index 8e1c6e1b6533..584fe5d7d3b0 100644 --- a/samples/server/petstore/php-slim4/lib/Model/Category.php +++ b/samples/server/petstore/php-slim4/lib/Model/Category.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * PHP version 7.3 + * PHP version 7.4 * * @package OpenAPIServer * @author OpenAPI Generator team diff --git a/samples/server/petstore/php-slim4/lib/Model/Order.php b/samples/server/petstore/php-slim4/lib/Model/Order.php index 52dfff78c0a7..1422e6efcf4b 100644 --- a/samples/server/petstore/php-slim4/lib/Model/Order.php +++ b/samples/server/petstore/php-slim4/lib/Model/Order.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * PHP version 7.3 + * PHP version 7.4 * * @package OpenAPIServer * @author OpenAPI Generator team diff --git a/samples/server/petstore/php-slim4/lib/Model/Pet.php b/samples/server/petstore/php-slim4/lib/Model/Pet.php index c400e3208de4..f249c10dfac4 100644 --- a/samples/server/petstore/php-slim4/lib/Model/Pet.php +++ b/samples/server/petstore/php-slim4/lib/Model/Pet.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * PHP version 7.3 + * PHP version 7.4 * * @package OpenAPIServer * @author OpenAPI Generator team diff --git a/samples/server/petstore/php-slim4/lib/Model/Tag.php b/samples/server/petstore/php-slim4/lib/Model/Tag.php index 4606b83ae88c..81d7a6e26a6f 100644 --- a/samples/server/petstore/php-slim4/lib/Model/Tag.php +++ b/samples/server/petstore/php-slim4/lib/Model/Tag.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * PHP version 7.3 + * PHP version 7.4 * * @package OpenAPIServer * @author OpenAPI Generator team diff --git a/samples/server/petstore/php-slim4/lib/Model/User.php b/samples/server/petstore/php-slim4/lib/Model/User.php index 5fb9f025cd08..68494ec67b5c 100644 --- a/samples/server/petstore/php-slim4/lib/Model/User.php +++ b/samples/server/petstore/php-slim4/lib/Model/User.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * PHP version 7.3 + * PHP version 7.4 * * @package OpenAPIServer * @author OpenAPI Generator team diff --git a/samples/server/petstore/php-slim4/lib/SlimRouter.php b/samples/server/petstore/php-slim4/lib/SlimRouter.php index fcc1a818d6cc..c0b9c2bda9f4 100644 --- a/samples/server/petstore/php-slim4/lib/SlimRouter.php +++ b/samples/server/petstore/php-slim4/lib/SlimRouter.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * PHP version 7.3 + * PHP version 7.4 * * @package OpenAPIServer * @author OpenAPI Generator team diff --git a/samples/server/petstore/php-slim4/public/index.php b/samples/server/petstore/php-slim4/public/index.php index 17511cbfb7ac..07ab220a086e 100644 --- a/samples/server/petstore/php-slim4/public/index.php +++ b/samples/server/petstore/php-slim4/public/index.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * PHP version 7.3 + * PHP version 7.4 * * @package OpenAPIServer * @author OpenAPI Generator team diff --git a/samples/server/petstore/php-slim4/tests/BaseModelTest.php b/samples/server/petstore/php-slim4/tests/BaseModelTest.php index 49927e56871b..33325cc198c9 100644 --- a/samples/server/petstore/php-slim4/tests/BaseModelTest.php +++ b/samples/server/petstore/php-slim4/tests/BaseModelTest.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * PHP version 7.3 + * PHP version 7.4 * * @package OpenAPIServer * @author OpenAPI Generator team From 5451b77d424d5eb17cb50a94f4efa7737ffd36cc Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 5 Dec 2021 17:43:17 +0800 Subject: [PATCH 068/117] [CodegenResponse] various enhancements and bug fixes (#10984) * add more response tests, fix simpleType * samples update * replace simpleType with containerType * update doc template * fix typo in mustache tag --- .../codegen/CodegenOperation.java | 8 +- .../openapitools/codegen/DefaultCodegen.java | 12 +- .../languages/ElixirClientCodegen.java | 7 +- .../asciidoc-documentation/index.mustache | 2 +- .../main/resources/htmlDocs/index.mustache | 2 +- .../codegen/DefaultCodegenTest.java | 53 ++ .../test/resources/3_0/response-tests.yaml | 571 ++++++++++++++++++ 7 files changed, 643 insertions(+), 12 deletions(-) create mode 100644 modules/openapi-generator/src/test/resources/3_0/response-tests.yaml diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java index ef348bbb2665..83413a9ee11e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java @@ -29,7 +29,8 @@ public class CodegenOperation { isArray, isMultipart, isResponseBinary = false, isResponseFile = false, hasReference = false, isRestfulIndex, isRestfulShow, isRestfulCreate, isRestfulUpdate, isRestfulDestroy, - isRestful, isDeprecated, isCallbackRequest, uniqueItems, hasDefaultResponse = false; + isRestful, isDeprecated, isCallbackRequest, uniqueItems, hasDefaultResponse = false, + hasErrorResponseObject; // if 4xx, 5xx repsonses have at least one error object defined public String path, operationId, returnType, returnFormat, httpMethod, returnBaseType, returnContainer, summary, unescapedNotes, notes, baseName, defaultResponse; public CodegenDiscriminator discriminator; @@ -297,6 +298,7 @@ public String toString() { sb.append(", isResponseFile=").append(isResponseFile); sb.append(", hasReference=").append(hasReference); sb.append(", hasDefaultResponse=").append(hasDefaultResponse); + sb.append(", hasErrorResponseObject=").append(hasErrorResponseObject); sb.append(", isRestfulIndex=").append(isRestfulIndex); sb.append(", isRestfulShow=").append(isRestfulShow); sb.append(", isRestfulCreate=").append(isRestfulCreate); @@ -371,6 +373,7 @@ public boolean equals(Object o) { isResponseFile == that.isResponseFile && hasReference == that.hasReference && hasDefaultResponse == that.hasDefaultResponse && + hasErrorResponseObject == that.hasErrorResponseObject && isRestfulIndex == that.isRestfulIndex && isRestfulShow == that.isRestfulShow && isRestfulCreate == that.isRestfulCreate && @@ -435,6 +438,7 @@ public int hashCode() { produces, prioritizedContentTypes, servers, bodyParam, allParams, bodyParams, pathParams, queryParams, headerParams, formParams, cookieParams, requiredParams, optionalParams, authMethods, tags, responses, callbacks, imports, examples, requestBodyExamples, externalDocs, vendorExtensions, - nickname, operationIdOriginal, operationIdLowerCase, operationIdCamelCase, operationIdSnakeCase); + nickname, operationIdOriginal, operationIdLowerCase, operationIdCamelCase, operationIdSnakeCase, + hasErrorResponseObject); } } 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 f1736f0e5321..e97a6caf557e 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 @@ -3976,6 +3976,12 @@ public CodegenOperation fromOperation(String path, if (Boolean.TRUE.equals(r.isFile) && Boolean.TRUE.equals(r.is2xx) && Boolean.FALSE.equals(op.isResponseFile)) { op.isResponseFile = Boolean.TRUE; } + + // check if any 4xx or 5xx reponse has an error response object defined + if ((Boolean.TRUE.equals(r.is4xx) || Boolean.TRUE.equals(r.is5xx)) && + Boolean.FALSE.equals(r.primitiveType) && Boolean.FALSE.equals(r.simpleType)) { + op.hasErrorResponseObject = Boolean.TRUE; + } } op.responses.sort((a, b) -> { int aScore = a.isWildcard() ? 2 : a.isRange() ? 1 : 0; @@ -4269,6 +4275,7 @@ public CodegenResponse fromResponse(String responseCode, ApiResponse response) { r.setComposedSchemas(getComposedSchemas(responseSchema)); if (ModelUtils.isArraySchema(responseSchema)) { r.simpleType = false; + r.isArray = true; r.containerType = cp.containerType; ArraySchema as = (ArraySchema) responseSchema; CodegenProperty items = fromProperty("response", getSchemaItems(as)); @@ -4324,6 +4331,8 @@ public CodegenResponse fromResponse(String responseCode, ApiResponse response) { } else if (ModelUtils.isTypeObjectSchema(responseSchema)) { if (ModelUtils.isFreeFormObject(openAPI, responseSchema)) { r.isFreeFormObject = true; + } else { + r.isModel = true; } r.simpleType = false; r.containerType = cp.containerType; @@ -4335,9 +4344,6 @@ public CodegenResponse fromResponse(String responseCode, ApiResponse response) { LOGGER.debug("Property type is not primitive: {}", cp.dataType); } - if (!r.isMap && !r.isArray) { - r.simpleType = true; - } r.primitiveType = (r.baseType == null || languageSpecificPrimitives().contains(r.baseType)); if (r.baseType == null) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java index 9903908d4e0b..62c9d6dcc5f5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java @@ -613,7 +613,7 @@ public String decodedStruct() { return "%{}"; } // Primitive return type, don't even try to decode - if (baseType == null || (simpleType && primitiveType)) { + if (baseType == null || (containerType == null && primitiveType)) { return "false"; } else if (isArray && languageSpecificPrimitives().contains(baseType)) { return "[]"; @@ -733,16 +733,13 @@ public String typespec() { StringBuilder returnEntry = new StringBuilder(); if (exResponse.baseType == null) { returnEntry.append("nil"); - } else if (exResponse.simpleType) { + } else if (exResponse.containerType == null) { // not container (array, map, set) if (!exResponse.primitiveType) { returnEntry.append(moduleName); returnEntry.append(".Model."); } returnEntry.append(exResponse.baseType); returnEntry.append(".t"); - } else if (exResponse.containerType == null) { - returnEntry.append(returnBaseType); - returnEntry.append(".t"); } else { if (exResponse.containerType.equals("array") || exResponse.containerType.equals("set")) { diff --git a/modules/openapi-generator/src/main/resources/asciidoc-documentation/index.mustache b/modules/openapi-generator/src/main/resources/asciidoc-documentation/index.mustache index 48d810d038ac..483ee5870f4c 100644 --- a/modules/openapi-generator/src/main/resources/asciidoc-documentation/index.mustache +++ b/modules/openapi-generator/src/main/resources/asciidoc-documentation/index.mustache @@ -104,7 +104,7 @@ Operation Id:: {{nickname}} | {{code}} | {{message}} -| {{^simpleType}}{{dataType}}[<<{{baseType}}>>]{{/simpleType}} {{#simpleType}}<<{{dataType}}>>{{/simpleType}} +| {{#containerType}}{{dataType}}[<<{{baseType}}>>]{{/containerType}} {{^containerType}}<<{{dataType}}>>{{/containerType}} {{/responses}} |=== diff --git a/modules/openapi-generator/src/main/resources/htmlDocs/index.mustache b/modules/openapi-generator/src/main/resources/htmlDocs/index.mustache index a5ad68cc9c8f..2f3f276c4767 100644 --- a/modules/openapi-generator/src/main/resources/htmlDocs/index.mustache +++ b/modules/openapi-generator/src/main/resources/htmlDocs/index.mustache @@ -134,7 +134,7 @@ {{#responses}}

    {{code}}

    {{message}} - {{#simpleType}}{{dataType}}{{/simpleType}} + {{^containerType}}{{dataType}}{{/containerType}} {{#examples}}

    Example data

    Content-Type: {{{contentType}}}
    diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java index 87486da4c36e..949bc1a9243b 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java @@ -3877,6 +3877,59 @@ public void testByteArrayTypeInSchemas() { } @Test + public void testResponses() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/response-tests.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + codegen.setDisallowAdditionalPropertiesIfNotPresent(false); + + String path; + Operation operation; + CodegenOperation co; + CodegenParameter cpa; + CodegenResponse cr; + + path = "/pet/{petId}"; + operation = openAPI.getPaths().get(path).getGet(); + co = codegen.fromOperation(path, "GET", operation, null); + //assertTrue(co.hasErrorResponseObject); + cr = co.responses.get(0); + assertTrue(cr.is2xx); + assertFalse(cr.simpleType); + assertFalse(cr.primitiveType); + cr = co.responses.get(3); + assertTrue(cr.is5xx); + assertFalse(cr.simpleType); + assertFalse(cr.primitiveType); + + path = "/pet"; + operation = openAPI.getPaths().get(path).getPut(); + co = codegen.fromOperation(path, "PUT", operation, null); + assertTrue(co.hasErrorResponseObject); + + // 200 response + cr = co.responses.get(0); + assertTrue(cr.is2xx); + assertFalse(cr.simpleType); + assertFalse(cr.primitiveType); + + // 400 response + cr = co.responses.get(1); + assertTrue(cr.is4xx); + assertEquals(cr.code, "400"); + assertFalse(cr.simpleType); + assertFalse(cr.primitiveType); + + path = "/pet/findByTags"; + operation = openAPI.getPaths().get(path).getGet(); + co = codegen.fromOperation(path, "GET", operation, null); + assertFalse(co.hasErrorResponseObject); + cr = co.responses.get(0); + assertTrue(cr.is2xx); + assertFalse(cr.simpleType); + assertFalse(cr.primitiveType); + } + public void testParameterContent() { DefaultCodegen codegen = new DefaultCodegen(); final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/content-data.yaml"); diff --git a/modules/openapi-generator/src/test/resources/3_0/response-tests.yaml b/modules/openapi-generator/src/test/resources/3_0/response-tests.yaml new file mode 100644 index 000000000000..e17881606db7 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/response-tests.yaml @@ -0,0 +1,571 @@ +openapi: 3.0.0 +servers: + - url: 'http://petstore.swagger.io/v2' +info: + description: >- + This is a sample server Petstore server. For this sample, you can use the api key + `special-key` to test the authorization filters. + version: 1.0.0 + title: OpenAPI Petstore + license: + name: Apache-2.0 + url: 'https://www.apache.org/licenses/LICENSE-2.0.html' +tags: + - name: pet + description: Everything about your Pets + - name: store + description: Access to Petstore orders + - name: user + description: Operations about user +paths: + /pet: + post: + tags: + - pet + summary: Add a new pet to the store + description: '' + operationId: addPet + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + put: + tags: + - pet + summary: Update an existing pet + description: '' + operationId: updatePet + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid ID supplied + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + '404': + description: Pet not found + '405': + description: Validation exception + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + /pet/findByStatus: + get: + tags: + - pet + summary: Finds Pets by status + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - name: status + in: query + description: Status values that need to be considered for filter + required: true + style: form + explode: false + deprecated: true + schema: + type: array + items: + type: string + enum: + - available + - pending + - sold + default: available + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid status value + security: + - petstore_auth: + - 'read:pets' + /pet/findByTags: + get: + tags: + - pet + summary: Finds Pets by tags + description: >- + Multiple tags can be provided with comma separated strings. Use tag1, + tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - name: tags + in: query + description: Tags to filter by + required: true + style: form + explode: false + schema: + type: array + items: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid tag value + security: + - petstore_auth: + - 'read:pets' + deprecated: true + '/pet/{petId}': + get: + tags: + - pet + summary: Find pet by ID + description: Returns a single pet + operationId: getPetById + parameters: + - name: petId + in: path + description: ID of pet to return + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid ID supplied + '404': + description: Pet not found + '500': + description: Server error + content: + application/application: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - api_key: [] + post: + tags: + - pet + summary: Updates a pet in the store with form data + description: '' + operationId: updatePetWithForm + parameters: + - name: petId + in: path + description: ID of pet that needs to be updated + required: true + schema: + type: integer + format: int64 + responses: + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + delete: + tags: + - pet + summary: Deletes a pet + description: '' + operationId: deletePet + parameters: + - name: api_key + in: header + required: false + schema: + type: string + - name: petId + in: path + description: Pet id to delete + required: true + schema: + type: integer + format: int64 + responses: + '400': + description: Invalid pet value + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + '/pet/{petId}/uploadImage': + post: + tags: + - pet + summary: uploads an image + description: '' + operationId: uploadFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + type: string + format: binary + '/store/order/{orderId}': + get: + tags: + - store + summary: Find purchase order by ID + description: >- + For valid response try integer IDs with value <= 5 or > 10. Other values + will generated exceptions + operationId: getOrderById + parameters: + - name: orderId + in: path + description: ID of pet that needs to be fetched + required: true + schema: + type: integer + format: int64 + minimum: 1 + maximum: 5 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid ID supplied + '404': + description: Order not found + '500': + description: Server error + delete: + tags: + - store + summary: Delete purchase order by ID + description: >- + For valid response try integer IDs with value < 1000. Anything above + 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - name: orderId + in: path + description: ID of the order that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid ID supplied + '404': + description: Order not found + /user/login: + get: + tags: + - user + summary: Logs user into the system + description: '' + operationId: loginUser + parameters: + - name: username + in: query + description: The user name for login + required: true + schema: + type: string + pattern: '^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$' + - name: password + in: query + description: The password for login in clear text + required: true + schema: + type: string + responses: + '200': + description: successful operation + headers: + Set-Cookie: + description: >- + Cookie authentication key for use with the `api_key` + apiKey authentication. + schema: + type: string + example: AUTH_KEY=abcde12345; Path=/; HttpOnly + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + type: integer + format: int32 + X-Expires-After: + description: date in UTC when token expires + schema: + type: string + format: date-time + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + '400': + description: Invalid username/password supplied +externalDocs: + description: Find out more about Swagger + url: 'http://swagger.io' +components: + requestBodies: + UserArray: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + description: List of user object + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + securitySchemes: + petstore_auth: + type: oauth2 + flows: + implicit: + authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog' + scopes: + 'write:pets': modify pets in your account + 'read:pets': read your pets + api_key: + type: apiKey + name: api_key + in: header + schemas: + Order: + title: Pet Order + description: An order for a pets from the pet store + type: object + properties: + id: + type: integer + format: int64 + petId: + type: integer + format: int64 + quantity: + type: integer + format: int32 + shipDate: + type: string + format: date-time + status: + type: string + description: Order Status + enum: + - placed + - approved + - delivered + complete: + type: boolean + default: false + xml: + name: Order + Category: + title: Pet category + description: A category for a pet + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + pattern: '^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$' + xml: + name: Category + User: + title: a User + description: A User who is purchasing from the pet store + type: object + properties: + id: + type: integer + format: int64 + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + type: integer + format: int32 + description: User Status + xml: + name: User + Tag: + title: Pet Tag + description: A tag for a pet + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + xml: + name: Tag + Pet: + title: a Pet + description: A pet for sale in the pet store + type: object + required: + - name + - photoUrls + properties: + id: + type: integer + format: int64 + category: + $ref: '#/components/schemas/Category' + name: + type: string + example: doggie + photoUrls: + type: array + xml: + name: photoUrl + wrapped: true + items: + type: string + tags: + type: array + xml: + name: tag + wrapped: true + items: + $ref: '#/components/schemas/Tag' + status: + type: string + description: pet status in the store + deprecated: true + enum: + - available + - pending + - sold + xml: + name: Pet + ApiResponse: + title: An uploaded response + description: Describes the result of uploading an image resource + type: object + properties: + code: + type: integer + format: int32 + type: + type: string + message: + type: string From 5a62ae6628fb30d2fd61c42c8d1961614ea757f1 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 5 Dec 2021 17:58:55 +0800 Subject: [PATCH 069/117] Add links to blog posts, remove nmuesch remove java tech comm (#11040) * add links to blog posts, remove nmuesch remove java tech comm * fix link --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7241d3bf309d..210de6791d24 100644 --- a/README.md +++ b/README.md @@ -844,6 +844,8 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - 2021-10-02 - [How to Write Fewer Lines of Code with the OpenAPI Generator](https://hackernoon.com/how-to-write-fewer-lines-of-code-with-the-openapi-generator) by [Mikhail Alfa](https://hackernoon.com/u/alphamikle) - 2021-10-12 - [OpenAPI Generator : 4000 étoiles sur GitHub et des spaghettis](https://www.youtube.com/watch?v=9hEsNBSqTFk) by [Jérémie Bresson](https://github.com/jmini) at [Devoxx FR 2021](https://cfp.devoxx.fr/2021/speaker/jeremie_bresson) - 2021-10-17 - [Generate a TypeScript HTTP Client From An OpenAPI Spec In DotNET 5](https://richardwillis.info/blog/generate-a-type-script-http-client-from-an-open-api-spec-in-dot-net-5) by [Richard Willis](https://github.com/badsyntax) +- 2021-11-06 - [スタートアップの開発で意識したこと](https://zenn.dev/woo_noo/articles/5cb09f8e2899ae782ad1) by [woo-noo](https://zenn.dev/woo_noo) +- 2021-11-09 - [Effective Software Development using OpenAPI Generator](https://apexlabs.ai/post/effective-software-development-using-openapi-generator) by Ajil Oomme ## [6 - About Us](#table-of-contents) @@ -1060,7 +1062,7 @@ If you want to join the committee, please kindly apply by sending an email to te | GraphQL | @renepardon (2018/12) | | Groovy | | | Haskell | | -| Java | @bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10) @nmuesch (2021/01) | +| Java | @bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10) | | JMeter | @kannkyo (2021/01) | | Kotlin | @jimschubert (2017/09) [:heart:](https://www.patreon.com/jimschubert), @dr4ke616 (2018/08) @karismann (2019/03) @Zomzog (2019/04) @andrewemery (2019/10) @4brunu (2019/11) @yutaka0m (2020/03) | | Lua | @daurnimator (2017/08) | From 95377f68bfa1e054097ddafc62548de8fd5ca3a1 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 6 Dec 2021 23:18:48 +0800 Subject: [PATCH 070/117] [C#][functions] minor improvements. (#11034) * better code format * mark generator as beta * update readme * minor code format change * remove docs * add Docs * remove docs * add back docs * mv yaml --- README.md | 3 +- .../other/csharp-netcore-functions.yaml | 6 + docs/generators.md | 2 +- .../CSharpNetCoreReducedClientCodegen.java | 26 +- .../CsharpNetcoreFunctionsServerCodegen.java | 29 +- .../csharp-netcore-functions/.gitignore | 362 ++++++++ .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 51 ++ .../.openapi-generator/VERSION | 1 + .../csharp-netcore-functions/README.md | 159 ++++ .../Tests/Tests/Apis/PetApiTests.cs | 156 ++++ .../Tests/Tests/Apis/StoreApiTests.cs | 103 +++ .../Tests/Tests/Apis/UserApiTests.cs | 148 +++ .../csharp-netcore-functions/appveyor.yml | 9 + .../docs/ApiResponse.md | 13 + .../csharp-netcore-functions/docs/Category.md | 12 + .../csharp-netcore-functions/docs/Order.md | 16 + .../csharp-netcore-functions/docs/Pet.md | 16 + .../csharp-netcore-functions/docs/PetApi.md | 616 +++++++++++++ .../csharp-netcore-functions/docs/StoreApi.md | 298 ++++++ .../csharp-netcore-functions/docs/Tag.md | 12 + .../csharp-netcore-functions/docs/User.md | 18 + .../csharp-netcore-functions/docs/UserApi.md | 603 ++++++++++++ .../generatedSrc/Client/ApiClient.cs | 860 ++++++++++++++++++ .../generatedSrc/Client/ApiException.cs | 68 ++ .../generatedSrc/Client/ApiResponse.cs | 166 ++++ .../generatedSrc/Client/Configuration.cs | 515 +++++++++++ .../generatedSrc/Client/ExceptionFactory.cs | 22 + .../generatedSrc/Client/IApiAccessor.cs | 37 + .../Client/OpenAPIDateConverter.cs | 29 + .../generatedSrc/Functions/PetApi.cs | 104 +++ .../generatedSrc/Functions/StoreApi.cs | 64 ++ .../generatedSrc/Functions/UserApi.cs | 104 +++ .../generatedSrc/Models/ApiResponse.cs | 155 ++++ .../generatedSrc/Models/Category.cs | 146 +++ .../generatedSrc/Models/Order.cs | 223 +++++ .../generatedSrc/Models/Pet.cs | 238 +++++ .../generatedSrc/Models/Tag.cs | 139 +++ .../generatedSrc/Models/User.cs | 234 +++++ .../generatedSrc/README.md | 159 ++++ .../generatedSrc/project.json | 12 + .../csharp-netcore-functions/git_push.sh | 58 ++ .../Models/ApiResponseTests.cs | 86 ++ .../Models/CategoryTests.cs | 78 ++ .../Models/OrderTests.cs | 110 +++ .../Org.OpenAPITools.Test/Models/PetTests.cs | 110 +++ .../Org.OpenAPITools.Test/Models/TagTests.cs | 78 ++ .../Org.OpenAPITools.Test/Models/UserTests.cs | 126 +++ .../src/Org.OpenAPITools/Client/ApiClient.cs | 860 ++++++++++++++++++ .../Org.OpenAPITools/Client/ApiException.cs | 68 ++ .../Org.OpenAPITools/Client/ApiResponse.cs | 166 ++++ .../Org.OpenAPITools/Client/ClientUtils.cs | 229 +++++ .../Org.OpenAPITools/Client/Configuration.cs | 515 +++++++++++ .../Client/ExceptionFactory.cs | 22 + .../Client/GlobalConfiguration.cs | 67 ++ .../src/Org.OpenAPITools/Client/HttpMethod.cs | 33 + .../Org.OpenAPITools/Client/IApiAccessor.cs | 37 + .../Client/IAsynchronousClient.cs | 100 ++ .../Client/IReadableConfiguration.cs | 115 +++ .../Client/ISynchronousClient.cs | 93 ++ .../src/Org.OpenAPITools/Client/Multimap.cs | 295 ++++++ .../Client/OpenAPIDateConverter.cs | 29 + .../Org.OpenAPITools/Client/RequestOptions.cs | 74 ++ .../Client/RetryConfiguration.cs | 21 + .../Models/AbstractOpenAPISchema.cs | 76 ++ 65 files changed, 9385 insertions(+), 18 deletions(-) create mode 100644 bin/configs/other/csharp-netcore-functions.yaml create mode 100644 samples/client/petstore/csharp-netcore-functions/.gitignore create mode 100644 samples/client/petstore/csharp-netcore-functions/.openapi-generator-ignore create mode 100644 samples/client/petstore/csharp-netcore-functions/.openapi-generator/FILES create mode 100644 samples/client/petstore/csharp-netcore-functions/.openapi-generator/VERSION create mode 100644 samples/client/petstore/csharp-netcore-functions/README.md create mode 100644 samples/client/petstore/csharp-netcore-functions/Tests/Tests/Apis/PetApiTests.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/Tests/Tests/Apis/StoreApiTests.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/Tests/Tests/Apis/UserApiTests.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/appveyor.yml create mode 100644 samples/client/petstore/csharp-netcore-functions/docs/ApiResponse.md create mode 100644 samples/client/petstore/csharp-netcore-functions/docs/Category.md create mode 100644 samples/client/petstore/csharp-netcore-functions/docs/Order.md create mode 100644 samples/client/petstore/csharp-netcore-functions/docs/Pet.md create mode 100644 samples/client/petstore/csharp-netcore-functions/docs/PetApi.md create mode 100644 samples/client/petstore/csharp-netcore-functions/docs/StoreApi.md create mode 100644 samples/client/petstore/csharp-netcore-functions/docs/Tag.md create mode 100644 samples/client/petstore/csharp-netcore-functions/docs/User.md create mode 100644 samples/client/petstore/csharp-netcore-functions/docs/UserApi.md create mode 100644 samples/client/petstore/csharp-netcore-functions/generatedSrc/Client/ApiClient.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/generatedSrc/Client/ApiException.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/generatedSrc/Client/ApiResponse.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/generatedSrc/Client/Configuration.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/generatedSrc/Client/ExceptionFactory.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/generatedSrc/Client/IApiAccessor.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/generatedSrc/Client/OpenAPIDateConverter.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/generatedSrc/Functions/PetApi.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/generatedSrc/Functions/StoreApi.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/generatedSrc/Functions/UserApi.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/generatedSrc/Models/ApiResponse.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/generatedSrc/Models/Category.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/generatedSrc/Models/Order.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/generatedSrc/Models/Pet.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/generatedSrc/Models/Tag.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/generatedSrc/Models/User.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/generatedSrc/README.md create mode 100644 samples/client/petstore/csharp-netcore-functions/generatedSrc/project.json create mode 100644 samples/client/petstore/csharp-netcore-functions/git_push.sh create mode 100644 samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools.Test/Models/ApiResponseTests.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools.Test/Models/CategoryTests.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools.Test/Models/OrderTests.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools.Test/Models/PetTests.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools.Test/Models/TagTests.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools.Test/Models/UserTests.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/ApiClient.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/ApiException.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/ApiResponse.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/ClientUtils.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/Configuration.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/ExceptionFactory.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/GlobalConfiguration.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/HttpMethod.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/IApiAccessor.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/IAsynchronousClient.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/IReadableConfiguration.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/ISynchronousClient.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/Multimap.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/RequestOptions.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/RetryConfiguration.cs create mode 100644 samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Models/AbstractOpenAPISchema.cs diff --git a/README.md b/README.md index 210de6791d24..804104dd9627 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se | | Languages/Frameworks | | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.0, .NET Core 2.0, .NET 5.0. Libraries: RestSharp, HttpClient), **C++** (Arduino, cpp-restsdk, Qt5, Tizen, Unreal Engine 4), **Clojure**, **Crystal**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Apache HttpClient, Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client, MicroProfile Rest Client), **k6**, **Kotlin**, **Lua**, **Nim**, **Node.js/JavaScript** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types, Apollo GraphQL DataStore), **Objective-C**, **OCaml**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (hyper, reqwest, rust-server), **Scala** (akka, http4s, scalaz, sttp, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x, 5.x), **Typescript** (AngularJS, Angular (2.x - 11.x), Aurelia, Axios, Fetch, Inversify, jQuery, Nestjs, Node, redux-query, Rxjs) | -| **Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin, Echo), **Haskell** (Servant, Yesod), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, Jersey, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples), [Vert.x](https://vertx.io/)), **Kotlin** (Spring Boot, Ktor, Vertx), **PHP** (Laravel, Lumen, [Mezzio (fka Zend Expressive)](https://github.com/mezzio/mezzio), Slim, Silex, [Symfony](https://symfony.com/)), **Python** (FastAPI, Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** (Akka, [Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), Scalatra) | +| **Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx, Azure Functions), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin, Echo), **Haskell** (Servant, Yesod), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, Jersey, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples), [Vert.x](https://vertx.io/)), **Kotlin** (Spring Boot, Ktor, Vertx), **PHP** (Laravel, Lumen, [Mezzio (fka Zend Expressive)](https://github.com/mezzio/mezzio), Slim, Silex, [Symfony](https://symfony.com/)), **Python** (FastAPI, Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** (Akka, [Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), Scalatra) | | **API documentation generators** | **HTML**, **Confluence Wiki**, **Asciidoc**, **Markdown**, **PlantUML** | | **Configuration files** | [**Apache2**](https://httpd.apache.org/) | | **Others** | **GraphQL**, **JMeter**, **Ktorm**, **MySQL Schema**, **Protocol Buffer**, **WSDL** | @@ -954,6 +954,7 @@ Here is a list of template creators: * C# ASP.NET 5: @jimschubert [:heart:](https://www.patreon.com/jimschubert) * C# ASP.NET Core 3.0: @A-Joshi * C# APS.NET Core 3.1: @phatcher + * C# Azure functions: @Abrhm7786 * C# NancyFX: @mstefaniuk * C++ (Qt5 QHttpEngine): @etherealjoy * C++ Pistache: @sebymiano diff --git a/bin/configs/other/csharp-netcore-functions.yaml b/bin/configs/other/csharp-netcore-functions.yaml new file mode 100644 index 000000000000..6d7e9a691b0a --- /dev/null +++ b/bin/configs/other/csharp-netcore-functions.yaml @@ -0,0 +1,6 @@ +generatorName: csharp-netcore-functions +outputDir: samples/client/petstore/csharp-netcore-functions +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/csharp-netcore-functions +#additionalProperties: +# packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' diff --git a/docs/generators.md b/docs/generators.md index 8d8433cd23f5..6ce82ffadbbd 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -86,7 +86,7 @@ The following generators are available: * [cpp-qt-qhttpengine-server](generators/cpp-qt-qhttpengine-server.md) * [cpp-restbed-server](generators/cpp-restbed-server.md) * [csharp-nancyfx](generators/csharp-nancyfx.md) -* [csharp-netcore-functions](generators/csharp-netcore-functions.md) +* [csharp-netcore-functions (beta)](generators/csharp-netcore-functions.md) * [erlang-server](generators/erlang-server.md) * [fsharp-functions (beta)](generators/fsharp-functions.md) * [fsharp-giraffe-server (beta)](generators/fsharp-giraffe-server.md) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreReducedClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreReducedClientCodegen.java index 8f189b444ba6..d0447bd69684 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreReducedClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreReducedClientCodegen.java @@ -266,10 +266,10 @@ public CSharpNetCoreReducedClientCodegen() { addSwitch(CodegenConstants.OPTIONAL_EMIT_DEFAULT_VALUES, CodegenConstants.OPTIONAL_EMIT_DEFAULT_VALUES_DESC, this.optionalEmitDefaultValuesFlag); - + addSwitch(CodegenConstants.OPTIONAL_CONDITIONAL_SERIALIZATION, - CodegenConstants.OPTIONAL_CONDITIONAL_SERIALIZATION_DESC, - this.conditionalSerialization); + CodegenConstants.OPTIONAL_CONDITIONAL_SERIALIZATION_DESC, + this.conditionalSerialization); addSwitch(CodegenConstants.OPTIONAL_PROJECT_FILE, CodegenConstants.OPTIONAL_PROJECT_FILE_DESC, @@ -588,7 +588,7 @@ public void processOpts() { additionalProperties.put("multiTarget", true); } else { // just a single value - frameworks = new String [] {inputFramework}; + frameworks = new String[]{inputFramework}; } for (String framework : frameworks) { @@ -600,14 +600,14 @@ public void processOpts() { } if (frameworkStrategy != FrameworkStrategy.NETSTANDARD_2_0 && "restsharp".equals(getLibrary())) { - LOGGER.warn("If using built-in templates, RestSharp only supports netstandard 2.0 or later."); + LOGGER.warn("If using built-in templates, RestSharp only supports netstandard 2.0 or later."); } } if (!strategyMatched) { // throws exception if the input targetFramework is invalid throw new IllegalArgumentException("The input (" + inputFramework + ") contains Invalid .NET framework version: " + - framework + ". List of supported versions: " + + framework + ". List of supported versions: " + frameworkStrategies.stream() .map(p -> p.name) .collect(Collectors.joining(", "))); @@ -634,7 +634,7 @@ public void processOpts() { final AtomicReference excludeTests = new AtomicReference<>(); syncBooleanProperty(additionalProperties, CodegenConstants.EXCLUDE_TESTS, excludeTests::set, false); - syncStringProperty(additionalProperties, "clientPackage", (s) -> { }, clientPackage); + syncStringProperty(additionalProperties, "clientPackage", (s) -> {}, clientPackage); syncStringProperty(additionalProperties, CodegenConstants.API_PACKAGE, this::setApiPackage, apiPackage); syncStringProperty(additionalProperties, CodegenConstants.MODEL_PACKAGE, this::setModelPackage, modelPackage); @@ -669,7 +669,7 @@ public void processOpts() { binRelativePath += "vendor"; additionalProperties.put("binRelativePath", binRelativePath); - if(HTTPCLIENT.equals(getLibrary())) { + if (HTTPCLIENT.equals(getLibrary())) { supportingFiles.add(new SupportingFile("FileParameter.mustache", clientPackageDir, "FileParameter.cs")); typeMapping.put("file", "FileParameter"); } @@ -682,10 +682,10 @@ public void processOpts() { supportingFiles.add(new SupportingFile("ExceptionFactory.mustache", clientPackageDir, "ExceptionFactory.cs")); supportingFiles.add(new SupportingFile("OpenAPIDateConverter.mustache", clientPackageDir, "OpenAPIDateConverter.cs")); supportingFiles.add(new SupportingFile("ClientUtils.mustache", clientPackageDir, "ClientUtils.cs")); - if(needsCustomHttpMethod) { + if (needsCustomHttpMethod) { supportingFiles.add(new SupportingFile("HttpMethod.mustache", clientPackageDir, "HttpMethod.cs")); } - if(needsUriBuilder) { + if (needsUriBuilder) { supportingFiles.add(new SupportingFile("WebRequestPathBuilder.mustache", clientPackageDir, "WebRequestPathBuilder.cs")); } if (ProcessUtils.hasHttpSignatureMethods(openAPI)) { @@ -736,7 +736,7 @@ public void setOptionalEmitDefaultValuesFlag(boolean flag) { this.optionalEmitDefaultValuesFlag = flag; } - public void setConditionalSerialization(boolean flag){ + public void setConditionalSerialization(boolean flag) { this.conditionalSerialization = flag; } @@ -771,8 +771,8 @@ public void setTargetFramework(String dotnetFramework) { throw new IllegalArgumentException("Invalid .NET framework version: " + dotnetFramework + ". List of supported versions: " + frameworkStrategies.stream() - .map(p -> p.name) - .collect(Collectors.joining(", "))); + .map(p -> p.name) + .collect(Collectors.joining(", "))); } else { this.targetFramework = dotnetFramework; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CsharpNetcoreFunctionsServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CsharpNetcoreFunctionsServerCodegen.java index f2ab9939c34b..8e020f3e6413 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CsharpNetcoreFunctionsServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CsharpNetcoreFunctionsServerCodegen.java @@ -1,3 +1,19 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.openapitools.codegen.languages; import org.openapitools.codegen.*; @@ -11,10 +27,12 @@ import org.apache.commons.lang3.StringUtils; +import org.openapitools.codegen.meta.GeneratorMetadata; +import org.openapitools.codegen.meta.Stability; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class CsharpNetcoreFunctionsServerCodegen extends CSharpNetCoreReducedClientCodegen { +public class CsharpNetcoreFunctionsServerCodegen extends CSharpNetCoreReducedClientCodegen { public static final String PROJECT_NAME = "projectName"; final Logger LOGGER = LoggerFactory.getLogger(CsharpNetcoreFunctionsServerCodegen.class); @@ -33,6 +51,11 @@ public String getHelp() { public CsharpNetcoreFunctionsServerCodegen() { super(); + + generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) + .stability(Stability.BETA) + .build(); + outputFolder = "generated-code" + File.separator + "csharp"; modelTemplateFiles.put("model.mustache", ".cs"); apiTemplateFiles.put("functions.mustache", ".cs"); @@ -42,7 +65,7 @@ public CsharpNetcoreFunctionsServerCodegen() { String clientPackageDir = "generatedSrc/Client"; supportingFiles.add(new SupportingFile("README.mustache", "generatedSrc", "README.md")); supportingFiles.add(new SupportingFile("project.mustache", "generatedSrc", "project.json")); - + supportingFiles.add(new SupportingFile("IApiAccessor.mustache", clientPackageDir, "IApiAccessor.cs")); supportingFiles.add(new SupportingFile("Configuration.mustache", @@ -66,7 +89,7 @@ public String apiFileFolder() { @Override public String modelFileFolder() { - return outputFolder + File.separator + "generatedSrc" + File.separator + "Models"; + return outputFolder + File.separator + "generatedSrc" + File.separator + "Models"; } @Override diff --git a/samples/client/petstore/csharp-netcore-functions/.gitignore b/samples/client/petstore/csharp-netcore-functions/.gitignore new file mode 100644 index 000000000000..1ee53850b84c --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/.gitignore @@ -0,0 +1,362 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd diff --git a/samples/client/petstore/csharp-netcore-functions/.openapi-generator-ignore b/samples/client/petstore/csharp-netcore-functions/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/csharp-netcore-functions/.openapi-generator/FILES b/samples/client/petstore/csharp-netcore-functions/.openapi-generator/FILES new file mode 100644 index 000000000000..e6e8df0a401c --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/.openapi-generator/FILES @@ -0,0 +1,51 @@ +.gitignore +Docs/PetApi.md +Docs/StoreApi.md +Docs/UserApi.md +README.md +appveyor.yml +docs/ApiResponse.md +docs/Category.md +docs/Order.md +docs/Pet.md +docs/Tag.md +docs/User.md +generatedSrc/Client/ApiClient.cs +generatedSrc/Client/ApiException.cs +generatedSrc/Client/ApiResponse.cs +generatedSrc/Client/Configuration.cs +generatedSrc/Client/ExceptionFactory.cs +generatedSrc/Client/IApiAccessor.cs +generatedSrc/Client/OpenAPIDateConverter.cs +generatedSrc/Functions/PetApi.cs +generatedSrc/Functions/PetApi.cs +generatedSrc/Functions/StoreApi.cs +generatedSrc/Functions/StoreApi.cs +generatedSrc/Functions/UserApi.cs +generatedSrc/Functions/UserApi.cs +generatedSrc/Models/ApiResponse.cs +generatedSrc/Models/Category.cs +generatedSrc/Models/Order.cs +generatedSrc/Models/Pet.cs +generatedSrc/Models/Tag.cs +generatedSrc/Models/User.cs +generatedSrc/README.md +generatedSrc/project.json +git_push.sh +src/Org.OpenAPITools/Client/ApiClient.cs +src/Org.OpenAPITools/Client/ApiException.cs +src/Org.OpenAPITools/Client/ApiResponse.cs +src/Org.OpenAPITools/Client/ClientUtils.cs +src/Org.OpenAPITools/Client/Configuration.cs +src/Org.OpenAPITools/Client/ExceptionFactory.cs +src/Org.OpenAPITools/Client/GlobalConfiguration.cs +src/Org.OpenAPITools/Client/HttpMethod.cs +src/Org.OpenAPITools/Client/IApiAccessor.cs +src/Org.OpenAPITools/Client/IAsynchronousClient.cs +src/Org.OpenAPITools/Client/IReadableConfiguration.cs +src/Org.OpenAPITools/Client/ISynchronousClient.cs +src/Org.OpenAPITools/Client/Multimap.cs +src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs +src/Org.OpenAPITools/Client/RequestOptions.cs +src/Org.OpenAPITools/Client/RetryConfiguration.cs +src/Org.OpenAPITools/Models/AbstractOpenAPISchema.cs diff --git a/samples/client/petstore/csharp-netcore-functions/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore-functions/.openapi-generator/VERSION new file mode 100644 index 000000000000..4077803655c0 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore-functions/README.md b/samples/client/petstore/csharp-netcore-functions/README.md new file mode 100644 index 000000000000..a531ad1e6029 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/README.md @@ -0,0 +1,159 @@ +# Org.OpenAPITools - the C# library for the OpenAPI Petstore + +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 1.0.0 +- SDK version: 1.0.0 +- Build package: org.openapitools.codegen.languages.CsharpNetcoreFunctionsServerCodegen + + +## Frameworks supported +- .NET Core >=1.0 +- .NET Framework >=4.6 +- Mono/Xamarin >=vNext + + +## Dependencies + +- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.11.7 or later +- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 12.0.3 or later +- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.8.0 or later +- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 5.0.0 or later + +The DLLs included in the package may not be the latest version. We recommend using [NuGet](https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: +``` +Install-Package RestSharp +Install-Package Newtonsoft.Json +Install-Package JsonSubTypes +Install-Package System.ComponentModel.Annotations +``` + +NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See [RestSharp#742](https://github.com/restsharp/RestSharp/issues/742). +NOTE: RestSharp for .Net Core creates a new socket for each api call, which can lead to a socket exhaustion problem. See [RestSharp#1406](https://github.com/restsharp/RestSharp/issues/1406). + + +## Installation +Generate the DLL using your preferred tool (e.g. `dotnet build`) + +Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces: +```csharp +using Org.OpenAPITools.Apis; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Models; +``` + +## Usage + +To use the API client with a HTTP proxy, setup a `System.Net.WebProxy` +```csharp +Configuration c = new Configuration(); +System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/"); +webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials; +c.Proxy = webProxy; +``` + + +## Getting Started + +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Apis; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Models; + +namespace Example +{ + public class Example + { + public static void Main() + { + + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var pet = new Pet(); // Pet | Pet object that needs to be added to the store + + try + { + // Add a new pet to the store + Pet result = apiInstance.AddPet(pet); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.AddPet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + + } + } +} +``` + + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**FindPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**FindPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**GetPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**CreateUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**DeleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**GetUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**LoginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**LogoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**UpdateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + + +## Documentation for Models + + - [Models.ApiResponse](docs/ApiResponse.md) + - [Models.Category](docs/Category.md) + - [Models.Order](docs/Order.md) + - [Models.Pet](docs/Pet.md) + - [Models.Tag](docs/Tag.md) + - [Models.User](docs/User.md) + + + +## Documentation for Authorization + + +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + + +### petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - write:pets: modify pets in your account + - read:pets: read your pets + diff --git a/samples/client/petstore/csharp-netcore-functions/Tests/Tests/Apis/PetApiTests.cs b/samples/client/petstore/csharp-netcore-functions/Tests/Tests/Apis/PetApiTests.cs new file mode 100644 index 000000000000..9ee31e31c3d3 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/Tests/Tests/Apis/PetApiTests.cs @@ -0,0 +1,156 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using RestSharp; +using Xunit; + +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Apis; +// uncomment below to import models +//using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing PetApi + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the API endpoint. + /// + public class PetApiTests : IDisposable + { + private PetApi instance; + + public PetApiTests() + { + instance = new PetApi(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of PetApi + /// + [Fact] + public void InstanceTest() + { + // TODO uncomment below to test 'IsType' PetApi + //Assert.IsType(instance); + } + + /// + /// Test AddPet + /// + [Fact] + public void AddPetTest() + { + // TODO uncomment below to test the method and replace null with proper value + //Pet pet = null; + //var response = instance.AddPet(pet); + //Assert.IsType(response); + } + + /// + /// Test DeletePet + /// + [Fact] + public void DeletePetTest() + { + // TODO uncomment below to test the method and replace null with proper value + //long petId = null; + //string apiKey = null; + //instance.DeletePet(petId, apiKey); + } + + /// + /// Test FindPetsByStatus + /// + [Fact] + public void FindPetsByStatusTest() + { + // TODO uncomment below to test the method and replace null with proper value + //List status = null; + //var response = instance.FindPetsByStatus(status); + //Assert.IsType>(response); + } + + /// + /// Test FindPetsByTags + /// + [Fact] + public void FindPetsByTagsTest() + { + // TODO uncomment below to test the method and replace null with proper value + //List tags = null; + //var response = instance.FindPetsByTags(tags); + //Assert.IsType>(response); + } + + /// + /// Test GetPetById + /// + [Fact] + public void GetPetByIdTest() + { + // TODO uncomment below to test the method and replace null with proper value + //long petId = null; + //var response = instance.GetPetById(petId); + //Assert.IsType(response); + } + + /// + /// Test UpdatePet + /// + [Fact] + public void UpdatePetTest() + { + // TODO uncomment below to test the method and replace null with proper value + //Pet pet = null; + //var response = instance.UpdatePet(pet); + //Assert.IsType(response); + } + + /// + /// Test UpdatePetWithForm + /// + [Fact] + public void UpdatePetWithFormTest() + { + // TODO uncomment below to test the method and replace null with proper value + //long petId = null; + //string name = null; + //string status = null; + //instance.UpdatePetWithForm(petId, name, status); + } + + /// + /// Test UploadFile + /// + [Fact] + public void UploadFileTest() + { + // TODO uncomment below to test the method and replace null with proper value + //long petId = null; + //string additionalMetadata = null; + //System.IO.Stream file = null; + //var response = instance.UploadFile(petId, additionalMetadata, file); + //Assert.IsType(response); + } + } +} diff --git a/samples/client/petstore/csharp-netcore-functions/Tests/Tests/Apis/StoreApiTests.cs b/samples/client/petstore/csharp-netcore-functions/Tests/Tests/Apis/StoreApiTests.cs new file mode 100644 index 000000000000..59206b2a7633 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/Tests/Tests/Apis/StoreApiTests.cs @@ -0,0 +1,103 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using RestSharp; +using Xunit; + +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Apis; +// uncomment below to import models +//using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing StoreApi + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the API endpoint. + /// + public class StoreApiTests : IDisposable + { + private StoreApi instance; + + public StoreApiTests() + { + instance = new StoreApi(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of StoreApi + /// + [Fact] + public void InstanceTest() + { + // TODO uncomment below to test 'IsType' StoreApi + //Assert.IsType(instance); + } + + /// + /// Test DeleteOrder + /// + [Fact] + public void DeleteOrderTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string orderId = null; + //instance.DeleteOrder(orderId); + } + + /// + /// Test GetInventory + /// + [Fact] + public void GetInventoryTest() + { + // TODO uncomment below to test the method and replace null with proper value + //var response = instance.GetInventory(); + //Assert.IsType>(response); + } + + /// + /// Test GetOrderById + /// + [Fact] + public void GetOrderByIdTest() + { + // TODO uncomment below to test the method and replace null with proper value + //long orderId = null; + //var response = instance.GetOrderById(orderId); + //Assert.IsType(response); + } + + /// + /// Test PlaceOrder + /// + [Fact] + public void PlaceOrderTest() + { + // TODO uncomment below to test the method and replace null with proper value + //Order order = null; + //var response = instance.PlaceOrder(order); + //Assert.IsType(response); + } + } +} diff --git a/samples/client/petstore/csharp-netcore-functions/Tests/Tests/Apis/UserApiTests.cs b/samples/client/petstore/csharp-netcore-functions/Tests/Tests/Apis/UserApiTests.cs new file mode 100644 index 000000000000..031e222ca0ba --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/Tests/Tests/Apis/UserApiTests.cs @@ -0,0 +1,148 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using RestSharp; +using Xunit; + +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Apis; +// uncomment below to import models +//using Org.OpenAPITools.Models; + +namespace Org.OpenAPITools.Test.Api +{ + /// + /// Class for testing UserApi + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the API endpoint. + /// + public class UserApiTests : IDisposable + { + private UserApi instance; + + public UserApiTests() + { + instance = new UserApi(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of UserApi + /// + [Fact] + public void InstanceTest() + { + // TODO uncomment below to test 'IsType' UserApi + //Assert.IsType(instance); + } + + /// + /// Test CreateUser + /// + [Fact] + public void CreateUserTest() + { + // TODO uncomment below to test the method and replace null with proper value + //User user = null; + //instance.CreateUser(user); + } + + /// + /// Test CreateUsersWithArrayInput + /// + [Fact] + public void CreateUsersWithArrayInputTest() + { + // TODO uncomment below to test the method and replace null with proper value + //List user = null; + //instance.CreateUsersWithArrayInput(user); + } + + /// + /// Test CreateUsersWithListInput + /// + [Fact] + public void CreateUsersWithListInputTest() + { + // TODO uncomment below to test the method and replace null with proper value + //List user = null; + //instance.CreateUsersWithListInput(user); + } + + /// + /// Test DeleteUser + /// + [Fact] + public void DeleteUserTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string username = null; + //instance.DeleteUser(username); + } + + /// + /// Test GetUserByName + /// + [Fact] + public void GetUserByNameTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string username = null; + //var response = instance.GetUserByName(username); + //Assert.IsType(response); + } + + /// + /// Test LoginUser + /// + [Fact] + public void LoginUserTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string username = null; + //string password = null; + //var response = instance.LoginUser(username, password); + //Assert.IsType(response); + } + + /// + /// Test LogoutUser + /// + [Fact] + public void LogoutUserTest() + { + // TODO uncomment below to test the method and replace null with proper value + //instance.LogoutUser(); + } + + /// + /// Test UpdateUser + /// + [Fact] + public void UpdateUserTest() + { + // TODO uncomment below to test the method and replace null with proper value + //string username = null; + //User user = null; + //instance.UpdateUser(username, user); + } + } +} diff --git a/samples/client/petstore/csharp-netcore-functions/appveyor.yml b/samples/client/petstore/csharp-netcore-functions/appveyor.yml new file mode 100644 index 000000000000..f76f63cee506 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/appveyor.yml @@ -0,0 +1,9 @@ +# auto-generated by OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator) +# +image: Visual Studio 2019 +clone_depth: 1 +build_script: +- dotnet build -c Release +- dotnet test -c Release +after_build: +- dotnet pack .\src\Org.OpenAPITools\Org.OpenAPITools.csproj -o ../../output -c Release --no-build diff --git a/samples/client/petstore/csharp-netcore-functions/docs/ApiResponse.md b/samples/client/petstore/csharp-netcore-functions/docs/ApiResponse.md new file mode 100644 index 000000000000..2bcb247bbd9c --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/docs/ApiResponse.md @@ -0,0 +1,13 @@ +# Org.OpenAPITools.Models.ApiResponse +Describes the result of uploading an image resource + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | **int** | | [optional] +**Type** | **string** | | [optional] +**Message** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp-netcore-functions/docs/Category.md b/samples/client/petstore/csharp-netcore-functions/docs/Category.md new file mode 100644 index 000000000000..ff6c3ede4bb6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/docs/Category.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Models.Category +A category for a pet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long** | | [optional] +**Name** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp-netcore-functions/docs/Order.md b/samples/client/petstore/csharp-netcore-functions/docs/Order.md new file mode 100644 index 000000000000..2f13a5b7d661 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/docs/Order.md @@ -0,0 +1,16 @@ +# Org.OpenAPITools.Models.Order +An order for a pets from the pet store + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long** | | [optional] +**PetId** | **long** | | [optional] +**Quantity** | **int** | | [optional] +**ShipDate** | **DateTime** | | [optional] +**Status** | **string** | Order Status | [optional] +**Complete** | **bool** | | [optional] [default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp-netcore-functions/docs/Pet.md b/samples/client/petstore/csharp-netcore-functions/docs/Pet.md new file mode 100644 index 000000000000..bb37eb83fdb4 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/docs/Pet.md @@ -0,0 +1,16 @@ +# Org.OpenAPITools.Models.Pet +A pet for sale in the pet store + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long** | | [optional] +**Category** | [**Category**](Category.md) | | [optional] +**Name** | **string** | | +**PhotoUrls** | **List<string>** | | +**Tags** | [**List<Tag>**](Tag.md) | | [optional] +**Status** | **string** | pet status in the store | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp-netcore-functions/docs/PetApi.md b/samples/client/petstore/csharp-netcore-functions/docs/PetApi.md new file mode 100644 index 000000000000..5251662068a0 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/docs/PetApi.md @@ -0,0 +1,616 @@ +# Org.OpenAPITools.Apis.PetApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AddPet**](PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +[**DeletePet**](PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +[**FindPetsByStatus**](PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +[**FindPetsByTags**](PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +[**GetPetById**](PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +[**UpdatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +[**UpdatePetWithForm**](PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**UploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image + + + +# **AddPet** +> Pet AddPet (Pet pet) + +Add a new pet to the store + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Apis; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Models; + +namespace Example +{ + public class AddPetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var pet = new Pet(); // Pet | Pet object that needs to be added to the store + + try + { + // Add a new pet to the store + Pet result = apiInstance.AddPet(pet); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.AddPet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DeletePet** +> void DeletePet (long petId, string apiKey = null) + +Deletes a pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Apis; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Models; + +namespace Example +{ + public class DeletePetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var petId = 789; // long | Pet id to delete + var apiKey = apiKey_example; // string | (optional) + + try + { + // Deletes a pet + apiInstance.DeletePet(petId, apiKey); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **long**| Pet id to delete | + **apiKey** | **string**| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid pet value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FindPetsByStatus** +> List<Pet> FindPetsByStatus (List status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Apis; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Models; + +namespace Example +{ + public class FindPetsByStatusExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var status = new List(); // List | Status values that need to be considered for filter + + try + { + // Finds Pets by status + List result = apiInstance.FindPetsByStatus(status); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**List<string>**](string.md)| Status values that need to be considered for filter | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FindPetsByTags** +> List<Pet> FindPetsByTags (List tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Apis; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Models; + +namespace Example +{ + public class FindPetsByTagsExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var tags = new List(); // List | Tags to filter by + + try + { + // Finds Pets by tags + List result = apiInstance.FindPetsByTags(tags); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**List<string>**](string.md)| Tags to filter by | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **GetPetById** +> Pet GetPetById (long petId) + +Find pet by ID + +Returns a single pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Apis; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Models; + +namespace Example +{ + public class GetPetByIdExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io/v2"; + // Configure API key authorization: api_key + config.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key", "Bearer"); + + var apiInstance = new PetApi(config); + var petId = 789; // long | ID of pet to return + + try + { + // Find pet by ID + Pet result = apiInstance.GetPetById(petId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **long**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UpdatePet** +> Pet UpdatePet (Pet pet) + +Update an existing pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Apis; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Models; + +namespace Example +{ + public class UpdatePetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var pet = new Pet(); // Pet | Pet object that needs to be added to the store + + try + { + // Update an existing pet + Pet result = apiInstance.UpdatePet(pet); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UpdatePetWithForm** +> void UpdatePetWithForm (long petId, string name = null, string status = null) + +Updates a pet in the store with form data + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Apis; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Models; + +namespace Example +{ + public class UpdatePetWithFormExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var petId = 789; // long | ID of pet that needs to be updated + var name = name_example; // string | Updated name of the pet (optional) + var status = status_example; // string | Updated status of the pet (optional) + + try + { + // Updates a pet in the store with form data + apiInstance.UpdatePetWithForm(petId, name, status); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **long**| ID of pet that needs to be updated | + **name** | **string**| Updated name of the pet | [optional] + **status** | **string**| Updated status of the pet | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UploadFile** +> ApiResponse UploadFile (long petId, string additionalMetadata = null, System.IO.Stream file = null) + +uploads an image + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Apis; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Models; + +namespace Example +{ + public class UploadFileExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var petId = 789; // long | ID of pet to update + var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) + var file = BINARY_DATA_HERE; // System.IO.Stream | file to upload (optional) + + try + { + // uploads an image + ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **long**| ID of pet to update | + **additionalMetadata** | **string**| Additional data to pass to server | [optional] + **file** | **System.IO.Stream****System.IO.Stream**| file to upload | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp-netcore-functions/docs/StoreApi.md b/samples/client/petstore/csharp-netcore-functions/docs/StoreApi.md new file mode 100644 index 000000000000..a1ad605d05ea --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/docs/StoreApi.md @@ -0,0 +1,298 @@ +# Org.OpenAPITools.Apis.StoreApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**GetInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +[**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +[**PlaceOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet + + + +# **DeleteOrder** +> void DeleteOrder (string orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Apis; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Models; + +namespace Example +{ + public class DeleteOrderExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io/v2"; + var apiInstance = new StoreApi(config); + var orderId = orderId_example; // string | ID of the order that needs to be deleted + + try + { + // Delete purchase order by ID + apiInstance.DeleteOrder(orderId); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **string**| ID of the order that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **GetInventory** +> Dictionary<string, int> GetInventory () + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Apis; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Models; + +namespace Example +{ + public class GetInventoryExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io/v2"; + // Configure API key authorization: api_key + config.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key", "Bearer"); + + var apiInstance = new StoreApi(config); + + try + { + // Returns pet inventories by status + Dictionary result = apiInstance.GetInventory(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**Dictionary** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **GetOrderById** +> Order GetOrderById (long orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Apis; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Models; + +namespace Example +{ + public class GetOrderByIdExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io/v2"; + var apiInstance = new StoreApi(config); + var orderId = 789; // long | ID of pet that needs to be fetched + + try + { + // Find purchase order by ID + Order result = apiInstance.GetOrderById(orderId); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **long**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **PlaceOrder** +> Order PlaceOrder (Order order) + +Place an order for a pet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Apis; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Models; + +namespace Example +{ + public class PlaceOrderExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io/v2"; + var apiInstance = new StoreApi(config); + var order = new Order(); // Order | order placed for purchasing the pet + + try + { + // Place an order for a pet + Order result = apiInstance.PlaceOrder(order); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp-netcore-functions/docs/Tag.md b/samples/client/petstore/csharp-netcore-functions/docs/Tag.md new file mode 100644 index 000000000000..97b08989ea62 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/docs/Tag.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Models.Tag +A tag for a pet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long** | | [optional] +**Name** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp-netcore-functions/docs/User.md b/samples/client/petstore/csharp-netcore-functions/docs/User.md new file mode 100644 index 000000000000..d665fa561934 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/docs/User.md @@ -0,0 +1,18 @@ +# Org.OpenAPITools.Models.User +A User who is purchasing from the pet store + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **long** | | [optional] +**Username** | **string** | | [optional] +**FirstName** | **string** | | [optional] +**LastName** | **string** | | [optional] +**Email** | **string** | | [optional] +**Password** | **string** | | [optional] +**Phone** | **string** | | [optional] +**UserStatus** | **int** | User Status | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp-netcore-functions/docs/UserApi.md b/samples/client/petstore/csharp-netcore-functions/docs/UserApi.md new file mode 100644 index 000000000000..858ec4e2be1b --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/docs/UserApi.md @@ -0,0 +1,603 @@ +# Org.OpenAPITools.Apis.UserApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateUser**](UserApi.md#createuser) | **POST** /user | Create user +[**CreateUsersWithArrayInput**](UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +[**CreateUsersWithListInput**](UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +[**DeleteUser**](UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +[**GetUserByName**](UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +[**LoginUser**](UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +[**LogoutUser**](UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +[**UpdateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + + +# **CreateUser** +> void CreateUser (User user) + +Create user + +This can only be done by the logged in user. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Apis; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Models; + +namespace Example +{ + public class CreateUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io/v2"; + // Configure API key authorization: api_key + config.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key", "Bearer"); + + var apiInstance = new UserApi(config); + var user = new User(); // User | Created user object + + try + { + // Create user + apiInstance.CreateUser(user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**User**](User.md)| Created user object | + +### Return type + +void (empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **CreateUsersWithArrayInput** +> void CreateUsersWithArrayInput (List user) + +Creates list of users with given input array + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Apis; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Models; + +namespace Example +{ + public class CreateUsersWithArrayInputExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io/v2"; + // Configure API key authorization: api_key + config.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key", "Bearer"); + + var apiInstance = new UserApi(config); + var user = new List(); // List | List of user object + + try + { + // Creates list of users with given input array + apiInstance.CreateUsersWithArrayInput(user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**List<User>**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **CreateUsersWithListInput** +> void CreateUsersWithListInput (List user) + +Creates list of users with given input array + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Apis; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Models; + +namespace Example +{ + public class CreateUsersWithListInputExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io/v2"; + // Configure API key authorization: api_key + config.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key", "Bearer"); + + var apiInstance = new UserApi(config); + var user = new List(); // List | List of user object + + try + { + // Creates list of users with given input array + apiInstance.CreateUsersWithListInput(user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**List<User>**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **DeleteUser** +> void DeleteUser (string username) + +Delete user + +This can only be done by the logged in user. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Apis; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Models; + +namespace Example +{ + public class DeleteUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io/v2"; + // Configure API key authorization: api_key + config.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key", "Bearer"); + + var apiInstance = new UserApi(config); + var username = username_example; // string | The name that needs to be deleted + + try + { + // Delete user + apiInstance.DeleteUser(username); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **string**| The name that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **GetUserByName** +> User GetUserByName (string username) + +Get user by user name + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Apis; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Models; + +namespace Example +{ + public class GetUserByNameExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io/v2"; + var apiInstance = new UserApi(config); + var username = username_example; // string | The name that needs to be fetched. Use user1 for testing. + + try + { + // Get user by user name + User result = apiInstance.GetUserByName(username); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **string**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **LoginUser** +> string LoginUser (string username, string password) + +Logs user into the system + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Apis; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Models; + +namespace Example +{ + public class LoginUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io/v2"; + var apiInstance = new UserApi(config); + var username = username_example; // string | The user name for login + var password = password_example; // string | The password for login in clear text + + try + { + // Logs user into the system + string result = apiInstance.LoginUser(username, password); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **string**| The user name for login | + **password** | **string**| The password for login in clear text | + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * Set-Cookie - Cookie authentication key for use with the `api_key` apiKey authentication.
    * X-Rate-Limit - calls per hour allowed by the user
    * X-Expires-After - date in UTC when token expires
    | +| **400** | Invalid username/password supplied | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **LogoutUser** +> void LogoutUser () + +Logs out current logged in user session + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Apis; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Models; + +namespace Example +{ + public class LogoutUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io/v2"; + // Configure API key authorization: api_key + config.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key", "Bearer"); + + var apiInstance = new UserApi(config); + + try + { + // Logs out current logged in user session + apiInstance.LogoutUser(); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UpdateUser** +> void UpdateUser (string username, User user) + +Updated user + +This can only be done by the logged in user. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Apis; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Models; + +namespace Example +{ + public class UpdateUserExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io/v2"; + // Configure API key authorization: api_key + config.AddApiKey("api_key", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("api_key", "Bearer"); + + var apiInstance = new UserApi(config); + var username = username_example; // string | name that need to be deleted + var user = new User(); // User | Updated user object + + try + { + // Updated user + apiInstance.UpdateUser(username, user); + } + catch (ApiException e) + { + Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **string**| name that need to be deleted | + **user** | [**User**](User.md)| Updated user object | + +### Return type + +void (empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp-netcore-functions/generatedSrc/Client/ApiClient.cs b/samples/client/petstore/csharp-netcore-functions/generatedSrc/Client/ApiClient.cs new file mode 100644 index 000000000000..4f68a59871e7 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/generatedSrc/Client/ApiClient.cs @@ -0,0 +1,860 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Formatters; +using System.Text; +using System.Threading; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs; +using RestSharp; +using RestSharp.Deserializers; +using RestSharpMethod = RestSharp.Method; +using Polly; + +namespace Org.OpenAPITools.Client +{ + /// + /// Allows RestSharp to Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON. + /// + internal class CustomJsonCodec : RestSharp.Serializers.ISerializer, RestSharp.Deserializers.IDeserializer + { + private readonly IReadableConfiguration _configuration; + private static readonly string _contentType = "application/json"; + private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + public CustomJsonCodec(IReadableConfiguration configuration) + { + _configuration = configuration; + } + + public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) + { + _serializerSettings = serializerSettings; + _configuration = configuration; + } + + /// + /// Serialize the object into a JSON string. + /// + /// Object to be serialized. + /// A JSON string. + public string Serialize(object obj) + { + if (obj != null && obj is Org.OpenAPITools.Models.AbstractOpenAPISchema) + { + // the object to be serialized is an oneOf/anyOf schema + return ((Org.OpenAPITools.Models.AbstractOpenAPISchema)obj).ToJson(); + } + else + { + return JsonConvert.SerializeObject(obj, _serializerSettings); + } + } + + public T Deserialize(IRestResponse response) + { + var result = (T)Deserialize(response, typeof(T)); + return result; + } + + /// + /// Deserialize the JSON string into a proper object. + /// + /// The HTTP response. + /// Object type. + /// Object representation of the JSON string. + internal object Deserialize(IRestResponse response, Type type) + { + if (type == typeof(byte[])) // return byte array + { + return response.RawBytes; + } + + // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) + if (type == typeof(Stream)) + { + var bytes = response.RawBytes; + if (response.Headers != null) + { + var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) + ? Path.GetTempPath() + : _configuration.TempFolderPath; + var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); + foreach (var header in response.Headers) + { + var match = regex.Match(header.ToString()); + if (match.Success) + { + string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); + File.WriteAllBytes(fileName, bytes); + return new FileStream(fileName, FileMode.Open); + } + } + } + var stream = new MemoryStream(bytes); + return stream; + } + + if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object + { + return DateTime.Parse(response.Content, null, System.Globalization.DateTimeStyles.RoundtripKind); + } + + if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type + { + return Convert.ChangeType(response.Content, type); + } + + // at this point, it must be a model (json) + try + { + return JsonConvert.DeserializeObject(response.Content, type, _serializerSettings); + } + catch (Exception e) + { + throw new ApiException(500, e.Message); + } + } + + public string RootElement { get; set; } + public string Namespace { get; set; } + public string DateFormat { get; set; } + + public string ContentType + { + get { return _contentType; } + set { throw new InvalidOperationException("Not allowed to set content type."); } + } + } + /// + /// Provides a default implementation of an Api client (both synchronous and asynchronous implementatios), + /// encapsulating general REST accessor use cases. + /// + public partial class ApiClient : ISynchronousClient, IAsynchronousClient + { + private readonly string _baseUrl; + + /// + /// Specifies the settings on a object. + /// These settings can be adjusted to accomodate custom serialization rules. + /// + public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Allows for extending request processing for generated code. + /// + /// The RestSharp request object + partial void InterceptRequest(IRestRequest request); + + /// + /// Allows for extending response processing for generated code. + /// + /// The RestSharp request object + /// The RestSharp response object + partial void InterceptResponse(IRestRequest request, IRestResponse response); + + /// + /// Initializes a new instance of the , defaulting to the global configurations' base url. + /// + public ApiClient() + { + _baseUrl = Org.OpenAPITools.Client.GlobalConfiguration.Instance.BasePath; + } + + /// + /// Initializes a new instance of the + /// + /// The target service's base path in URL format. + /// + public ApiClient(string basePath) + { + if (string.IsNullOrEmpty(basePath)) + throw new ArgumentException("basePath cannot be empty"); + + _baseUrl = basePath; + } + + /// + /// Constructs the RestSharp version of an http method + /// + /// Swagger Client Custom HttpMethod + /// RestSharp's HttpMethod instance. + /// + private RestSharpMethod Method(HttpMethod method) + { + RestSharpMethod other; + switch (method) + { + case HttpMethod.Get: + other = RestSharpMethod.GET; + break; + case HttpMethod.Post: + other = RestSharpMethod.POST; + break; + case HttpMethod.Put: + other = RestSharpMethod.PUT; + break; + case HttpMethod.Delete: + other = RestSharpMethod.DELETE; + break; + case HttpMethod.Head: + other = RestSharpMethod.HEAD; + break; + case HttpMethod.Options: + other = RestSharpMethod.OPTIONS; + break; + case HttpMethod.Patch: + other = RestSharpMethod.PATCH; + break; + default: + throw new ArgumentOutOfRangeException("method", method, null); + } + + return other; + } + + /// + /// Provides all logic for constructing a new RestSharp . + /// At this point, all information for querying the service is known. Here, it is simply + /// mapped into the RestSharp request. + /// + /// The http verb. + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// [private] A new RestRequest instance. + /// + private RestRequest NewRequest( + HttpMethod method, + string path, + RequestOptions options, + IReadableConfiguration configuration) + { + if (path == null) throw new ArgumentNullException("path"); + if (options == null) throw new ArgumentNullException("options"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + RestRequest request = new RestRequest(Method(method)) + { + Resource = path, + JsonSerializer = new CustomJsonCodec(SerializerSettings, configuration) + }; + + if (options.PathParameters != null) + { + foreach (var pathParam in options.PathParameters) + { + request.AddParameter(pathParam.Key, pathParam.Value, ParameterType.UrlSegment); + } + } + + if (options.QueryParameters != null) + { + foreach (var queryParam in options.QueryParameters) + { + foreach (var value in queryParam.Value) + { + request.AddQueryParameter(queryParam.Key, value); + } + } + } + + if (configuration.DefaultHeaders != null) + { + foreach (var headerParam in configuration.DefaultHeaders) + { + request.AddHeader(headerParam.Key, headerParam.Value); + } + } + + if (options.HeaderParameters != null) + { + foreach (var headerParam in options.HeaderParameters) + { + foreach (var value in headerParam.Value) + { + request.AddHeader(headerParam.Key, value); + } + } + } + + if (options.FormParameters != null) + { + foreach (var formParam in options.FormParameters) + { + request.AddParameter(formParam.Key, formParam.Value); + } + } + + if (options.Data != null) + { + if (options.Data is Stream stream) + { + var contentType = "application/octet-stream"; + if (options.HeaderParameters != null) + { + var contentTypes = options.HeaderParameters["Content-Type"]; + contentType = contentTypes[0]; + } + + var bytes = ClientUtils.ReadAsBytes(stream); + request.AddParameter(contentType, bytes, ParameterType.RequestBody); + } + else + { + if (options.HeaderParameters != null) + { + var contentTypes = options.HeaderParameters["Content-Type"]; + if (contentTypes == null || contentTypes.Any(header => header.Contains("application/json"))) + { + request.RequestFormat = DataFormat.Json; + } + else + { + // TODO: Generated client user should add additional handlers. RestSharp only supports XML and JSON, with XML as default. + } + } + else + { + // Here, we'll assume JSON APIs are more common. XML can be forced by adding produces/consumes to openapi spec explicitly. + request.RequestFormat = DataFormat.Json; + } + + request.AddJsonBody(options.Data); + } + } + + if (options.FileParameters != null) + { + foreach (var fileParam in options.FileParameters) + { + var bytes = ClientUtils.ReadAsBytes(fileParam.Value); + var fileStream = fileParam.Value as FileStream; + if (fileStream != null) + request.Files.Add(FileParameter.Create(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name))); + else + request.Files.Add(FileParameter.Create(fileParam.Key, bytes, "no_file_name_provided")); + } + } + + if (options.Cookies != null && options.Cookies.Count > 0) + { + foreach (var cookie in options.Cookies) + { + request.AddCookie(cookie.Name, cookie.Value); + } + } + + return request; + } + + private ApiResponse ToApiResponse(IRestResponse response) + { + T result = response.Data; + string rawContent = response.Content; + + var transformed = new ApiResponse(response.StatusCode, new Multimap(), result, rawContent) + { + ErrorText = response.ErrorMessage, + Cookies = new List() + }; + + if (response.Headers != null) + { + foreach (var responseHeader in response.Headers) + { + transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value)); + } + } + + if (response.Cookies != null) + { + foreach (var responseCookies in response.Cookies) + { + transformed.Cookies.Add( + new Cookie( + responseCookies.Name, + responseCookies.Value, + responseCookies.Path, + responseCookies.Domain) + ); + } + } + + return transformed; + } + + private ApiResponse Exec(RestRequest req, IReadableConfiguration configuration) + { + RestClient client = new RestClient(_baseUrl); + + client.ClearHandlers(); + var existingDeserializer = req.JsonSerializer as IDeserializer; + if (existingDeserializer != null) + { + client.AddHandler("application/json", () => existingDeserializer); + client.AddHandler("text/json", () => existingDeserializer); + client.AddHandler("text/x-json", () => existingDeserializer); + client.AddHandler("text/javascript", () => existingDeserializer); + client.AddHandler("*+json", () => existingDeserializer); + } + else + { + var customDeserializer = new CustomJsonCodec(SerializerSettings, configuration); + client.AddHandler("application/json", () => customDeserializer); + client.AddHandler("text/json", () => customDeserializer); + client.AddHandler("text/x-json", () => customDeserializer); + client.AddHandler("text/javascript", () => customDeserializer); + client.AddHandler("*+json", () => customDeserializer); + } + + var xmlDeserializer = new XmlDeserializer(); + client.AddHandler("application/xml", () => xmlDeserializer); + client.AddHandler("text/xml", () => xmlDeserializer); + client.AddHandler("*+xml", () => xmlDeserializer); + client.AddHandler("*", () => xmlDeserializer); + + client.Timeout = configuration.Timeout; + + if (configuration.Proxy != null) + { + client.Proxy = configuration.Proxy; + } + + if (configuration.UserAgent != null) + { + client.UserAgent = configuration.UserAgent; + } + + if (configuration.ClientCertificates != null) + { + client.ClientCertificates = configuration.ClientCertificates; + } + + InterceptRequest(req); + + IRestResponse response; + if (RetryConfiguration.RetryPolicy != null) + { + var policy = RetryConfiguration.RetryPolicy; + var policyResult = policy.ExecuteAndCapture(() => client.Execute(req)); + response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse + { + Request = req, + ErrorException = policyResult.FinalException + }; + } + else + { + response = client.Execute(req); + } + + // if the response type is oneOf/anyOf, call FromJSON to deserialize the data + if (typeof(Org.OpenAPITools.Models.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + { + response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + } + else if (typeof(T).Name == "Stream") // for binary response + { + response.Data = (T)(object)new MemoryStream(response.RawBytes); + } + + InterceptResponse(req, response); + + var result = ToApiResponse(response); + if (response.ErrorMessage != null) + { + result.ErrorText = response.ErrorMessage; + } + + if (response.Cookies != null && response.Cookies.Count > 0) + { + if (result.Cookies == null) result.Cookies = new List(); + foreach (var restResponseCookie in response.Cookies) + { + var cookie = new Cookie( + restResponseCookie.Name, + restResponseCookie.Value, + restResponseCookie.Path, + restResponseCookie.Domain + ) + { + Comment = restResponseCookie.Comment, + CommentUri = restResponseCookie.CommentUri, + Discard = restResponseCookie.Discard, + Expired = restResponseCookie.Expired, + Expires = restResponseCookie.Expires, + HttpOnly = restResponseCookie.HttpOnly, + Port = restResponseCookie.Port, + Secure = restResponseCookie.Secure, + Version = restResponseCookie.Version + }; + + result.Cookies.Add(cookie); + } + } + return result; + } + + private async Task> ExecAsync(RestRequest req, IReadableConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + RestClient client = new RestClient(_baseUrl); + + client.ClearHandlers(); + var existingDeserializer = req.JsonSerializer as IDeserializer; + if (existingDeserializer != null) + { + client.AddHandler("application/json", () => existingDeserializer); + client.AddHandler("text/json", () => existingDeserializer); + client.AddHandler("text/x-json", () => existingDeserializer); + client.AddHandler("text/javascript", () => existingDeserializer); + client.AddHandler("*+json", () => existingDeserializer); + } + else + { + var customDeserializer = new CustomJsonCodec(SerializerSettings, configuration); + client.AddHandler("application/json", () => customDeserializer); + client.AddHandler("text/json", () => customDeserializer); + client.AddHandler("text/x-json", () => customDeserializer); + client.AddHandler("text/javascript", () => customDeserializer); + client.AddHandler("*+json", () => customDeserializer); + } + + var xmlDeserializer = new XmlDeserializer(); + client.AddHandler("application/xml", () => xmlDeserializer); + client.AddHandler("text/xml", () => xmlDeserializer); + client.AddHandler("*+xml", () => xmlDeserializer); + client.AddHandler("*", () => xmlDeserializer); + + client.Timeout = configuration.Timeout; + + if (configuration.Proxy != null) + { + client.Proxy = configuration.Proxy; + } + + if (configuration.UserAgent != null) + { + client.UserAgent = configuration.UserAgent; + } + + if (configuration.ClientCertificates != null) + { + client.ClientCertificates = configuration.ClientCertificates; + } + + InterceptRequest(req); + + IRestResponse response; + if (RetryConfiguration.AsyncRetryPolicy != null) + { + var policy = RetryConfiguration.AsyncRetryPolicy; + var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(req, ct), cancellationToken).ConfigureAwait(false); + response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse + { + Request = req, + ErrorException = policyResult.FinalException + }; + } + else + { + response = await client.ExecuteAsync(req, cancellationToken).ConfigureAwait(false); + } + + // if the response type is oneOf/anyOf, call FromJSON to deserialize the data + if (typeof(Org.OpenAPITools.Models.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + { + response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + } + else if (typeof(T).Name == "Stream") // for binary response + { + response.Data = (T)(object)new MemoryStream(response.RawBytes); + } + + InterceptResponse(req, response); + + var result = ToApiResponse(response); + if (response.ErrorMessage != null) + { + result.ErrorText = response.ErrorMessage; + } + + if (response.Cookies != null && response.Cookies.Count > 0) + { + if (result.Cookies == null) result.Cookies = new List(); + foreach (var restResponseCookie in response.Cookies) + { + var cookie = new Cookie( + restResponseCookie.Name, + restResponseCookie.Value, + restResponseCookie.Path, + restResponseCookie.Domain + ) + { + Comment = restResponseCookie.Comment, + CommentUri = restResponseCookie.CommentUri, + Discard = restResponseCookie.Discard, + Expired = restResponseCookie.Expired, + Expires = restResponseCookie.Expires, + HttpOnly = restResponseCookie.HttpOnly, + Port = restResponseCookie.Port, + Secure = restResponseCookie.Secure, + Version = restResponseCookie.Version + }; + + result.Cookies.Add(cookie); + } + } + return result; + } + + #region IAsynchronousClient + /// + /// Make a HTTP GET request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP POST request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP PUT request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP DELETE request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP HEAD request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP OPTION request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP PATCH request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), config, cancellationToken); + } + #endregion IAsynchronousClient + + #region ISynchronousClient + /// + /// Make a HTTP GET request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Get, path, options, config), config); + } + + /// + /// Make a HTTP POST request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Post, path, options, config), config); + } + + /// + /// Make a HTTP PUT request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Put, path, options, config), config); + } + + /// + /// Make a HTTP DELETE request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Delete, path, options, config), config); + } + + /// + /// Make a HTTP HEAD request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Head, path, options, config), config); + } + + /// + /// Make a HTTP OPTION request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Options, path, options, config), config); + } + + /// + /// Make a HTTP PATCH request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Patch, path, options, config), config); + } + #endregion ISynchronousClient + } +} diff --git a/samples/client/petstore/csharp-netcore-functions/generatedSrc/Client/ApiException.cs b/samples/client/petstore/csharp-netcore-functions/generatedSrc/Client/ApiException.cs new file mode 100644 index 000000000000..dcc378ad208d --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/generatedSrc/Client/ApiException.cs @@ -0,0 +1,68 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// API Exception + /// + public class ApiException : Exception + { + /// + /// Gets or sets the error code (HTTP status code) + /// + /// The error code (HTTP status code). + public int ErrorCode { get; set; } + + /// + /// Gets or sets the error content (body json object) + /// + /// The error content (Http response body). + public object ErrorContent { get; private set; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + public Multimap Headers { get; private set; } + + /// + /// Initializes a new instance of the class. + /// + public ApiException() { } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Error message. + public ApiException(int errorCode, string message) : base(message) + { + this.ErrorCode = errorCode; + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Error message. + /// Error content. + /// HTTP Headers. + public ApiException(int errorCode, string message, object errorContent = null, Multimap headers = null) : base(message) + { + this.ErrorCode = errorCode; + this.ErrorContent = errorContent; + this.Headers = headers; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore-functions/generatedSrc/Client/ApiResponse.cs b/samples/client/petstore/csharp-netcore-functions/generatedSrc/Client/ApiResponse.cs new file mode 100644 index 000000000000..6d91a6f7a47e --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/generatedSrc/Client/ApiResponse.cs @@ -0,0 +1,166 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.Net; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a non-generic contract for the ApiResponse wrapper. + /// + public interface IApiResponse + { + /// + /// The data type of + /// + Type ResponseType { get; } + + /// + /// The content of this response + /// + Object Content { get; } + + /// + /// Gets or sets the status code (HTTP status code) + /// + /// The status code. + HttpStatusCode StatusCode { get; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + Multimap Headers { get; } + + /// + /// Gets or sets any error text defined by the calling client. + /// + string ErrorText { get; set; } + + /// + /// Gets or sets any cookies passed along on the response. + /// + List Cookies { get; set; } + + /// + /// The raw content of this response + /// + string RawContent { get; } + } + + /// + /// API Response + /// + public class ApiResponse : IApiResponse + { + #region Properties + + /// + /// Gets or sets the status code (HTTP status code) + /// + /// The status code. + public HttpStatusCode StatusCode { get; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + public Multimap Headers { get; } + + /// + /// Gets or sets the data (parsed HTTP body) + /// + /// The data. + public T Data { get; } + + /// + /// Gets or sets any error text defined by the calling client. + /// + public string ErrorText { get; set; } + + /// + /// Gets or sets any cookies passed along on the response. + /// + public List Cookies { get; set; } + + /// + /// The content of this response + /// + public Type ResponseType + { + get { return typeof(T); } + } + + /// + /// The data type of + /// + public object Content + { + get { return Data; } + } + + /// + /// The raw content + /// + public string RawContent { get; } + + #endregion Properties + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// HTTP headers. + /// Data (parsed HTTP body) + /// Raw content. + public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data, string rawContent) + { + StatusCode = statusCode; + Headers = headers; + Data = data; + RawContent = rawContent; + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// HTTP headers. + /// Data (parsed HTTP body) + public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data) : this(statusCode, headers, data, null) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Data (parsed HTTP body) + /// Raw content. + public ApiResponse(HttpStatusCode statusCode, T data, string rawContent) : this(statusCode, null, data, rawContent) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Data (parsed HTTP body) + public ApiResponse(HttpStatusCode statusCode, T data) : this(statusCode, data, null) + { + } + + #endregion Constructors + } +} diff --git a/samples/client/petstore/csharp-netcore-functions/generatedSrc/Client/Configuration.cs b/samples/client/petstore/csharp-netcore-functions/generatedSrc/Client/Configuration.cs new file mode 100644 index 000000000000..896bd754ea5f --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/generatedSrc/Client/Configuration.cs @@ -0,0 +1,515 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Security.Cryptography.X509Certificates; +using System.Text; + +namespace Org.OpenAPITools.Client +{ + /// + /// Represents a set of configuration settings + /// + public class Configuration : IReadableConfiguration + { + #region Constants + + /// + /// Version of the package. + /// + /// Version of the package. + public const string Version = "1.0.0"; + + /// + /// Identifier for ISO 8601 DateTime Format + /// + /// See https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 for more information. + // ReSharper disable once InconsistentNaming + public const string ISO8601_DATETIME_FORMAT = "o"; + + #endregion Constants + + #region Static Members + + /// + /// Default creation of exceptions for a given method name and response object + /// + public static readonly ExceptionFactory DefaultExceptionFactory = (methodName, response) => + { + var status = (int)response.StatusCode; + if (status >= 400) + { + return new ApiException(status, + string.Format("Error calling {0}: {1}", methodName, response.RawContent), + response.RawContent, response.Headers); + } + return null; + }; + + #endregion Static Members + + #region Private Members + + /// + /// Defines the base path of the target API server. + /// Example: http://localhost:3000/v1/ + /// + private string _basePath; + + /// + /// Gets or sets the API key based on the authentication name. + /// This is the key and value comprising the "secret" for acessing an API. + /// + /// The API key. + private IDictionary _apiKey; + + /// + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// + /// The prefix of the API key. + private IDictionary _apiKeyPrefix; + + private string _dateTimeFormat = ISO8601_DATETIME_FORMAT; + private string _tempFolderPath = Path.GetTempPath(); + + /// + /// Gets or sets the servers defined in the OpenAPI spec. + /// + /// The servers + private IList> _servers; + #endregion Private Members + + #region Constructors + + /// + /// Initializes a new instance of the class + /// + [System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + public Configuration() + { + Proxy = null; + UserAgent = "OpenAPI-Generator/1.0.0/csharp"; + BasePath = "http://petstore.swagger.io/v2"; + DefaultHeaders = new ConcurrentDictionary(); + ApiKey = new ConcurrentDictionary(); + ApiKeyPrefix = new ConcurrentDictionary(); + Servers = new List>() + { + { + new Dictionary { + {"url", "http://petstore.swagger.io/v2"}, + {"description", "No description provided"}, + } + } + }; + + // Setting Timeout has side effects (forces ApiClient creation). + Timeout = 100000; + } + + /// + /// Initializes a new instance of the class + /// + [System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + public Configuration( + IDictionary defaultHeaders, + IDictionary apiKey, + IDictionary apiKeyPrefix, + string basePath = "http://petstore.swagger.io/v2") : this() + { + if (string.IsNullOrWhiteSpace(basePath)) + throw new ArgumentException("The provided basePath is invalid.", "basePath"); + if (defaultHeaders == null) + throw new ArgumentNullException("defaultHeaders"); + if (apiKey == null) + throw new ArgumentNullException("apiKey"); + if (apiKeyPrefix == null) + throw new ArgumentNullException("apiKeyPrefix"); + + BasePath = basePath; + + foreach (var keyValuePair in defaultHeaders) + { + DefaultHeaders.Add(keyValuePair); + } + + foreach (var keyValuePair in apiKey) + { + ApiKey.Add(keyValuePair); + } + + foreach (var keyValuePair in apiKeyPrefix) + { + ApiKeyPrefix.Add(keyValuePair); + } + } + + #endregion Constructors + + #region Properties + + /// + /// Gets or sets the base path for API access. + /// + public virtual string BasePath { + get { return _basePath; } + set { _basePath = value; } + } + + /// + /// Gets or sets the default header. + /// + [Obsolete("Use DefaultHeaders instead.")] + public virtual IDictionary DefaultHeader + { + get + { + return DefaultHeaders; + } + set + { + DefaultHeaders = value; + } + } + + /// + /// Gets or sets the default headers. + /// + public virtual IDictionary DefaultHeaders { get; set; } + + /// + /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. + /// + public virtual int Timeout { get; set; } + + /// + /// Gets or sets the proxy + /// + /// Proxy. + public virtual WebProxy Proxy { get; set; } + + /// + /// Gets or sets the HTTP user agent. + /// + /// Http user agent. + public virtual string UserAgent { get; set; } + + /// + /// Gets or sets the username (HTTP basic authentication). + /// + /// The username. + public virtual string Username { get; set; } + + /// + /// Gets or sets the password (HTTP basic authentication). + /// + /// The password. + public virtual string Password { get; set; } + + /// + /// Gets the API key with prefix. + /// + /// API key identifier (authentication scheme). + /// API key with prefix. + public string GetApiKeyWithPrefix(string apiKeyIdentifier) + { + string apiKeyValue; + ApiKey.TryGetValue(apiKeyIdentifier, out apiKeyValue); + string apiKeyPrefix; + if (ApiKeyPrefix.TryGetValue(apiKeyIdentifier, out apiKeyPrefix)) + { + return apiKeyPrefix + " " + apiKeyValue; + } + + return apiKeyValue; + } + + /// + /// Gets or sets certificate collection to be sent with requests. + /// + /// X509 Certificate collection. + public X509CertificateCollection ClientCertificates { get; set; } + + /// + /// Gets or sets the access token for OAuth2 authentication. + /// + /// This helper property simplifies code generation. + /// + /// The access token. + public virtual string AccessToken { get; set; } + + /// + /// Gets or sets the temporary folder path to store the files downloaded from the server. + /// + /// Folder path. + public virtual string TempFolderPath + { + get { return _tempFolderPath; } + + set + { + if (string.IsNullOrEmpty(value)) + { + _tempFolderPath = Path.GetTempPath(); + return; + } + + // create the directory if it does not exist + if (!Directory.Exists(value)) + { + Directory.CreateDirectory(value); + } + + // check if the path contains directory separator at the end + if (value[value.Length - 1] == Path.DirectorySeparatorChar) + { + _tempFolderPath = value; + } + else + { + _tempFolderPath = value + Path.DirectorySeparatorChar; + } + } + } + + /// + /// Gets or sets the date time format used when serializing in the ApiClient + /// By default, it's set to ISO 8601 - "o", for others see: + /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx + /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx + /// No validation is done to ensure that the string you're providing is valid + /// + /// The DateTimeFormat string + public virtual string DateTimeFormat + { + get { return _dateTimeFormat; } + set + { + if (string.IsNullOrEmpty(value)) + { + // Never allow a blank or null string, go back to the default + _dateTimeFormat = ISO8601_DATETIME_FORMAT; + return; + } + + // Caution, no validation when you choose date time format other than ISO 8601 + // Take a look at the above links + _dateTimeFormat = value; + } + } + + /// + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// + /// Whatever you set here will be prepended to the value defined in AddApiKey. + /// + /// An example invocation here might be: + /// + /// ApiKeyPrefix["Authorization"] = "Bearer"; + /// + /// … where ApiKey["Authorization"] would then be used to set the value of your bearer token. + /// + /// + /// OAuth2 workflows should set tokens via AccessToken. + /// + /// + /// The prefix of the API key. + public virtual IDictionary ApiKeyPrefix + { + get { return _apiKeyPrefix; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKeyPrefix collection may not be null."); + } + _apiKeyPrefix = value; + } + } + + /// + /// Gets or sets the API key based on the authentication name. + /// + /// The API key. + public virtual IDictionary ApiKey + { + get { return _apiKey; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKey collection may not be null."); + } + _apiKey = value; + } + } + + /// + /// Gets or sets the servers. + /// + /// The servers. + public virtual IList> Servers + { + get { return _servers; } + set + { + if (value == null) + { + throw new InvalidOperationException("Servers may not be null."); + } + _servers = value; + } + } + + /// + /// Returns URL based on server settings without providing values + /// for the variables + /// + /// Array index of the server settings. + /// The server URL. + public string GetServerUrl(int index) + { + return GetServerUrl(index, null); + } + + /// + /// Returns URL based on server settings. + /// + /// Array index of the server settings. + /// Dictionary of the variables and the corresponding values. + /// The server URL. + public string GetServerUrl(int index, Dictionary inputVariables) + { + if (index < 0 || index >= Servers.Count) + { + throw new InvalidOperationException($"Invalid index {index} when selecting the server. Must be less than {Servers.Count}."); + } + + if (inputVariables == null) + { + inputVariables = new Dictionary(); + } + + IReadOnlyDictionary server = Servers[index]; + string url = (string)server["url"]; + + // go through variable and assign a value + foreach (KeyValuePair variable in (IReadOnlyDictionary)server["variables"]) + { + + IReadOnlyDictionary serverVariables = (IReadOnlyDictionary)(variable.Value); + + if (inputVariables.ContainsKey(variable.Key)) + { + if (((List)serverVariables["enum_values"]).Contains(inputVariables[variable.Key])) + { + url = url.Replace("{" + variable.Key + "}", inputVariables[variable.Key]); + } + else + { + throw new InvalidOperationException($"The variable `{variable.Key}` in the server URL has invalid value #{inputVariables[variable.Key]}. Must be {(List)serverVariables["enum_values"]}"); + } + } + else + { + // use defualt value + url = url.Replace("{" + variable.Key + "}", (string)serverVariables["default_value"]); + } + } + + return url; + } + + #endregion Properties + + #region Methods + + /// + /// Returns a string with essential information for debugging. + /// + public static string ToDebugReport() + { + string report = "C# SDK (Org.OpenAPITools) Debug Report:\n"; + report += " OS: " + System.Environment.OSVersion + "\n"; + report += " .NET Framework Version: " + System.Environment.Version + "\n"; + report += " Version of the API: 1.0.0\n"; + report += " SDK Package Version: 1.0.0\n"; + + return report; + } + + /// + /// Add Api Key Header. + /// + /// Api Key name. + /// Api Key value. + /// + public void AddApiKey(string key, string value) + { + ApiKey[key] = value; + } + + /// + /// Sets the API key prefix. + /// + /// Api Key name. + /// Api Key value. + public void AddApiKeyPrefix(string key, string value) + { + ApiKeyPrefix[key] = value; + } + + #endregion Methods + + #region Static Members + /// + /// Merge configurations. + /// + /// First configuration. + /// Second configuration. + /// Merged configuration. + public static IReadableConfiguration MergeConfigurations(IReadableConfiguration first, IReadableConfiguration second) + { + if (second == null) return first ?? GlobalConfiguration.Instance; + + Dictionary apiKey = first.ApiKey.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + Dictionary apiKeyPrefix = first.ApiKeyPrefix.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + Dictionary defaultHeaders = first.DefaultHeaders.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + + foreach (var kvp in second.ApiKey) apiKey[kvp.Key] = kvp.Value; + foreach (var kvp in second.ApiKeyPrefix) apiKeyPrefix[kvp.Key] = kvp.Value; + foreach (var kvp in second.DefaultHeaders) defaultHeaders[kvp.Key] = kvp.Value; + + var config = new Configuration + { + ApiKey = apiKey, + ApiKeyPrefix = apiKeyPrefix, + DefaultHeaders = defaultHeaders, + BasePath = second.BasePath ?? first.BasePath, + Timeout = second.Timeout, + Proxy = second.Proxy ?? first.Proxy, + UserAgent = second.UserAgent ?? first.UserAgent, + Username = second.Username ?? first.Username, + Password = second.Password ?? first.Password, + AccessToken = second.AccessToken ?? first.AccessToken, + TempFolderPath = second.TempFolderPath ?? first.TempFolderPath, + DateTimeFormat = second.DateTimeFormat ?? first.DateTimeFormat + }; + return config; + } + #endregion Static Members + } +} diff --git a/samples/client/petstore/csharp-netcore-functions/generatedSrc/Client/ExceptionFactory.cs b/samples/client/petstore/csharp-netcore-functions/generatedSrc/Client/ExceptionFactory.cs new file mode 100644 index 000000000000..6ae2a10aae40 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/generatedSrc/Client/ExceptionFactory.cs @@ -0,0 +1,22 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// A delegate to ExceptionFactory method + /// + /// Method name + /// Response + /// Exceptions + public delegate Exception ExceptionFactory(string methodName, IApiResponse response); +} diff --git a/samples/client/petstore/csharp-netcore-functions/generatedSrc/Client/IApiAccessor.cs b/samples/client/petstore/csharp-netcore-functions/generatedSrc/Client/IApiAccessor.cs new file mode 100644 index 000000000000..c8a78e995ce9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/generatedSrc/Client/IApiAccessor.cs @@ -0,0 +1,37 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// Represents configuration aspects required to interact with the API endpoints. + /// + public interface IApiAccessor + { + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + IReadableConfiguration Configuration { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + string GetBasePath(); + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + ExceptionFactory ExceptionFactory { get; set; } + } +} diff --git a/samples/client/petstore/csharp-netcore-functions/generatedSrc/Client/OpenAPIDateConverter.cs b/samples/client/petstore/csharp-netcore-functions/generatedSrc/Client/OpenAPIDateConverter.cs new file mode 100644 index 000000000000..dcc79edd9446 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/generatedSrc/Client/OpenAPIDateConverter.cs @@ -0,0 +1,29 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using Newtonsoft.Json.Converters; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class OpenAPIDateConverter : IsoDateTimeConverter + { + /// + /// Initializes a new instance of the class. + /// + public OpenAPIDateConverter() + { + // full-date = date-fullyear "-" date-month "-" date-mday + DateTimeFormat = "yyyy-MM-dd"; + } + } +} diff --git a/samples/client/petstore/csharp-netcore-functions/generatedSrc/Functions/PetApi.cs b/samples/client/petstore/csharp-netcore-functions/generatedSrc/Functions/PetApi.cs new file mode 100644 index 000000000000..5bed004e613e --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/generatedSrc/Functions/PetApi.cs @@ -0,0 +1,104 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Net; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Azure.WebJobs; +using Microsoft.Azure.WebJobs.Extensions.Http; + +namespace Org.OpenAPITools.Apis +{ + public partial class PetApi + { + [FunctionName("PetApi_AddPet")] + public async Task _AddPet([HttpTrigger(AuthorizationLevel.Anonymous, "POST", Route = "/pet")]HttpRequest req, ExecutionContext context) + { + var method = this.GetType().GetMethod("AddPet"); + + return method != null + ? (await ((Task)method.Invoke(this, new object[] { req, context })).ConfigureAwait(false)) + : new StatusCodeResult((int)HttpStatusCode.NotImplemented); + } + + [FunctionName("PetApi_DeletePet")] + public async Task _DeletePet([HttpTrigger(AuthorizationLevel.Anonymous, "DELETE", Route = "/pet/{petId}")]HttpRequest req, ExecutionContext context, long petId) + { + var method = this.GetType().GetMethod("DeletePet"); + + return method != null + ? (await ((Task)method.Invoke(this, new object[] { req, context, })).ConfigureAwait(false)) + : new StatusCodeResult((int)HttpStatusCode.NotImplemented); + } + + [FunctionName("PetApi_FindPetsByStatus")] + public async Task _FindPetsByStatus([HttpTrigger(AuthorizationLevel.Anonymous, "GET", Route = "/pet/findByStatus")]HttpRequest req, ExecutionContext context) + { + var method = this.GetType().GetMethod("FindPetsByStatus"); + + return method != null + ? (await ((Task)method.Invoke(this, new object[] { req, context })).ConfigureAwait(false)) + : new StatusCodeResult((int)HttpStatusCode.NotImplemented); + } + + [FunctionName("PetApi_FindPetsByTags")] + public async Task _FindPetsByTags([HttpTrigger(AuthorizationLevel.Anonymous, "GET", Route = "/pet/findByTags")]HttpRequest req, ExecutionContext context) + { + var method = this.GetType().GetMethod("FindPetsByTags"); + + return method != null + ? (await ((Task)method.Invoke(this, new object[] { req, context })).ConfigureAwait(false)) + : new StatusCodeResult((int)HttpStatusCode.NotImplemented); + } + + [FunctionName("PetApi_GetPetById")] + public async Task _GetPetById([HttpTrigger(AuthorizationLevel.Anonymous, "GET", Route = "/pet/{petId}")]HttpRequest req, ExecutionContext context, long petId) + { + var method = this.GetType().GetMethod("GetPetById"); + + return method != null + ? (await ((Task)method.Invoke(this, new object[] { req, context, })).ConfigureAwait(false)) + : new StatusCodeResult((int)HttpStatusCode.NotImplemented); + } + + [FunctionName("PetApi_UpdatePet")] + public async Task _UpdatePet([HttpTrigger(AuthorizationLevel.Anonymous, "PUT", Route = "/pet")]HttpRequest req, ExecutionContext context) + { + var method = this.GetType().GetMethod("UpdatePet"); + + return method != null + ? (await ((Task)method.Invoke(this, new object[] { req, context })).ConfigureAwait(false)) + : new StatusCodeResult((int)HttpStatusCode.NotImplemented); + } + + [FunctionName("PetApi_UpdatePetWithForm")] + public async Task _UpdatePetWithForm([HttpTrigger(AuthorizationLevel.Anonymous, "POST", Route = "/pet/{petId}")]HttpRequest req, ExecutionContext context, long petId) + { + var method = this.GetType().GetMethod("UpdatePetWithForm"); + + return method != null + ? (await ((Task)method.Invoke(this, new object[] { req, context, })).ConfigureAwait(false)) + : new StatusCodeResult((int)HttpStatusCode.NotImplemented); + } + + [FunctionName("PetApi_UploadFile")] + public async Task _UploadFile([HttpTrigger(AuthorizationLevel.Anonymous, "POST", Route = "/pet/{petId}/uploadImage")]HttpRequest req, ExecutionContext context, long petId) + { + var method = this.GetType().GetMethod("UploadFile"); + + return method != null + ? (await ((Task)method.Invoke(this, new object[] { req, context, })).ConfigureAwait(false)) + : new StatusCodeResult((int)HttpStatusCode.NotImplemented); + } + } +} + diff --git a/samples/client/petstore/csharp-netcore-functions/generatedSrc/Functions/StoreApi.cs b/samples/client/petstore/csharp-netcore-functions/generatedSrc/Functions/StoreApi.cs new file mode 100644 index 000000000000..a41afaa34ab1 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/generatedSrc/Functions/StoreApi.cs @@ -0,0 +1,64 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Net; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Azure.WebJobs; +using Microsoft.Azure.WebJobs.Extensions.Http; + +namespace Org.OpenAPITools.Apis +{ + public partial class StoreApi + { + [FunctionName("StoreApi_DeleteOrder")] + public async Task _DeleteOrder([HttpTrigger(AuthorizationLevel.Anonymous, "DELETE", Route = "/store/order/{orderId}")]HttpRequest req, ExecutionContext context, string orderId) + { + var method = this.GetType().GetMethod("DeleteOrder"); + + return method != null + ? (await ((Task)method.Invoke(this, new object[] { req, context, })).ConfigureAwait(false)) + : new StatusCodeResult((int)HttpStatusCode.NotImplemented); + } + + [FunctionName("StoreApi_GetInventory")] + public async Task _GetInventory([HttpTrigger(AuthorizationLevel.Anonymous, "GET", Route = "/store/inventory")]HttpRequest req, ExecutionContext context) + { + var method = this.GetType().GetMethod("GetInventory"); + + return method != null + ? (await ((Task)method.Invoke(this, new object[] { req, context })).ConfigureAwait(false)) + : new StatusCodeResult((int)HttpStatusCode.NotImplemented); + } + + [FunctionName("StoreApi_GetOrderById")] + public async Task _GetOrderById([HttpTrigger(AuthorizationLevel.Anonymous, "GET", Route = "/store/order/{orderId}")]HttpRequest req, ExecutionContext context, [Range(1, 5)]long orderId) + { + var method = this.GetType().GetMethod("GetOrderById"); + + return method != null + ? (await ((Task)method.Invoke(this, new object[] { req, context, })).ConfigureAwait(false)) + : new StatusCodeResult((int)HttpStatusCode.NotImplemented); + } + + [FunctionName("StoreApi_PlaceOrder")] + public async Task _PlaceOrder([HttpTrigger(AuthorizationLevel.Anonymous, "POST", Route = "/store/order")]HttpRequest req, ExecutionContext context) + { + var method = this.GetType().GetMethod("PlaceOrder"); + + return method != null + ? (await ((Task)method.Invoke(this, new object[] { req, context })).ConfigureAwait(false)) + : new StatusCodeResult((int)HttpStatusCode.NotImplemented); + } + } +} + diff --git a/samples/client/petstore/csharp-netcore-functions/generatedSrc/Functions/UserApi.cs b/samples/client/petstore/csharp-netcore-functions/generatedSrc/Functions/UserApi.cs new file mode 100644 index 000000000000..9ff559bce6cd --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/generatedSrc/Functions/UserApi.cs @@ -0,0 +1,104 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Net; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Azure.WebJobs; +using Microsoft.Azure.WebJobs.Extensions.Http; + +namespace Org.OpenAPITools.Apis +{ + public partial class UserApi + { + [FunctionName("UserApi_CreateUser")] + public async Task _CreateUser([HttpTrigger(AuthorizationLevel.Anonymous, "POST", Route = "/user")]HttpRequest req, ExecutionContext context) + { + var method = this.GetType().GetMethod("CreateUser"); + + return method != null + ? (await ((Task)method.Invoke(this, new object[] { req, context })).ConfigureAwait(false)) + : new StatusCodeResult((int)HttpStatusCode.NotImplemented); + } + + [FunctionName("UserApi_CreateUsersWithArrayInput")] + public async Task _CreateUsersWithArrayInput([HttpTrigger(AuthorizationLevel.Anonymous, "POST", Route = "/user/createWithArray")]HttpRequest req, ExecutionContext context) + { + var method = this.GetType().GetMethod("CreateUsersWithArrayInput"); + + return method != null + ? (await ((Task)method.Invoke(this, new object[] { req, context })).ConfigureAwait(false)) + : new StatusCodeResult((int)HttpStatusCode.NotImplemented); + } + + [FunctionName("UserApi_CreateUsersWithListInput")] + public async Task _CreateUsersWithListInput([HttpTrigger(AuthorizationLevel.Anonymous, "POST", Route = "/user/createWithList")]HttpRequest req, ExecutionContext context) + { + var method = this.GetType().GetMethod("CreateUsersWithListInput"); + + return method != null + ? (await ((Task)method.Invoke(this, new object[] { req, context })).ConfigureAwait(false)) + : new StatusCodeResult((int)HttpStatusCode.NotImplemented); + } + + [FunctionName("UserApi_DeleteUser")] + public async Task _DeleteUser([HttpTrigger(AuthorizationLevel.Anonymous, "DELETE", Route = "/user/{username}")]HttpRequest req, ExecutionContext context, string username) + { + var method = this.GetType().GetMethod("DeleteUser"); + + return method != null + ? (await ((Task)method.Invoke(this, new object[] { req, context, })).ConfigureAwait(false)) + : new StatusCodeResult((int)HttpStatusCode.NotImplemented); + } + + [FunctionName("UserApi_GetUserByName")] + public async Task _GetUserByName([HttpTrigger(AuthorizationLevel.Anonymous, "GET", Route = "/user/{username}")]HttpRequest req, ExecutionContext context, string username) + { + var method = this.GetType().GetMethod("GetUserByName"); + + return method != null + ? (await ((Task)method.Invoke(this, new object[] { req, context, })).ConfigureAwait(false)) + : new StatusCodeResult((int)HttpStatusCode.NotImplemented); + } + + [FunctionName("UserApi_LoginUser")] + public async Task _LoginUser([HttpTrigger(AuthorizationLevel.Anonymous, "GET", Route = "/user/login")]HttpRequest req, ExecutionContext context) + { + var method = this.GetType().GetMethod("LoginUser"); + + return method != null + ? (await ((Task)method.Invoke(this, new object[] { req, context })).ConfigureAwait(false)) + : new StatusCodeResult((int)HttpStatusCode.NotImplemented); + } + + [FunctionName("UserApi_LogoutUser")] + public async Task _LogoutUser([HttpTrigger(AuthorizationLevel.Anonymous, "GET", Route = "/user/logout")]HttpRequest req, ExecutionContext context) + { + var method = this.GetType().GetMethod("LogoutUser"); + + return method != null + ? (await ((Task)method.Invoke(this, new object[] { req, context })).ConfigureAwait(false)) + : new StatusCodeResult((int)HttpStatusCode.NotImplemented); + } + + [FunctionName("UserApi_UpdateUser")] + public async Task _UpdateUser([HttpTrigger(AuthorizationLevel.Anonymous, "PUT", Route = "/user/{username}")]HttpRequest req, ExecutionContext context, string username) + { + var method = this.GetType().GetMethod("UpdateUser"); + + return method != null + ? (await ((Task)method.Invoke(this, new object[] { req, context, })).ConfigureAwait(false)) + : new StatusCodeResult((int)HttpStatusCode.NotImplemented); + } + } +} + diff --git a/samples/client/petstore/csharp-netcore-functions/generatedSrc/Models/ApiResponse.cs b/samples/client/petstore/csharp-netcore-functions/generatedSrc/Models/ApiResponse.cs new file mode 100644 index 000000000000..031f72fa3307 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/generatedSrc/Models/ApiResponse.cs @@ -0,0 +1,155 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Models +{ + /// + /// Describes the result of uploading an image resource + /// + [DataContract(Name = "ApiResponse")] + public partial class ApiResponse : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// code. + /// type. + /// message. + public ApiResponse(int code = default(int), string type = default(string), string message = default(string)) + { + this.Code = code; + this.Type = type; + this.Message = message; + } + + /// + /// Gets or Sets Code + /// + [DataMember(Name = "code", EmitDefaultValue = false)] + public int Code { get; set; } + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { get; set; } + + /// + /// Gets or Sets Message + /// + [DataMember(Name = "message", EmitDefaultValue = false)] + public string Message { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ApiResponse {\n"); + sb.Append(" Code: ").Append(Code).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as ApiResponse); + } + + /// + /// Returns true if ApiResponse instances are equal + /// + /// Instance of ApiResponse to be compared + /// Boolean + public bool Equals(ApiResponse input) + { + if (input == null) + return false; + + return + ( + this.Code == input.Code || + this.Code.Equals(input.Code) + ) && + ( + this.Type == input.Type || + (this.Type != null && + this.Type.Equals(input.Type)) + ) && + ( + this.Message == input.Message || + (this.Message != null && + this.Message.Equals(input.Message)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = hashCode * 59 + this.Code.GetHashCode(); + if (this.Type != null) + hashCode = hashCode * 59 + this.Type.GetHashCode(); + if (this.Message != null) + hashCode = hashCode * 59 + this.Message.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore-functions/generatedSrc/Models/Category.cs b/samples/client/petstore/csharp-netcore-functions/generatedSrc/Models/Category.cs new file mode 100644 index 000000000000..ff645b073b90 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/generatedSrc/Models/Category.cs @@ -0,0 +1,146 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Models +{ + /// + /// A category for a pet + /// + [DataContract(Name = "Category")] + public partial class Category : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id. + /// name. + public Category(long id = default(long), string name = default(string)) + { + this.Id = id; + this.Name = name; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Category {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Category); + } + + /// + /// Returns true if Category instances are equal + /// + /// Instance of Category to be compared + /// Boolean + public bool Equals(Category input) + { + if (input == null) + return false; + + return + ( + this.Id == input.Id || + this.Id.Equals(input.Id) + ) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = hashCode * 59 + this.Id.GetHashCode(); + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Name (string) pattern + Regex regexName = new Regex(@"^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$", RegexOptions.CultureInvariant); + if (false == regexName.Match(this.Name).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Name, must match a pattern of " + regexName, new [] { "Name" }); + } + + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore-functions/generatedSrc/Models/Order.cs b/samples/client/petstore/csharp-netcore-functions/generatedSrc/Models/Order.cs new file mode 100644 index 000000000000..11bc4ed67bee --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/generatedSrc/Models/Order.cs @@ -0,0 +1,223 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Models +{ + /// + /// An order for a pets from the pet store + /// + [DataContract(Name = "Order")] + public partial class Order : IEquatable, IValidatableObject + { + /// + /// Order Status + /// + /// Order Status + [JsonConverter(typeof(StringEnumConverter))] + public enum StatusEnum + { + /// + /// Enum Placed for value: placed + /// + [EnumMember(Value = "placed")] + Placed = 1, + + /// + /// Enum Approved for value: approved + /// + [EnumMember(Value = "approved")] + Approved = 2, + + /// + /// Enum Delivered for value: delivered + /// + [EnumMember(Value = "delivered")] + Delivered = 3 + + } + + + /// + /// Order Status + /// + /// Order Status + [DataMember(Name = "status", EmitDefaultValue = false)] + public StatusEnum? Status { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// id. + /// petId. + /// quantity. + /// shipDate. + /// Order Status. + /// complete (default to false). + public Order(long id = default(long), long petId = default(long), int quantity = default(int), DateTime shipDate = default(DateTime), StatusEnum? status = default(StatusEnum?), bool complete = false) + { + this.Id = id; + this.PetId = petId; + this.Quantity = quantity; + this.ShipDate = shipDate; + this.Status = status; + this.Complete = complete; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long Id { get; set; } + + /// + /// Gets or Sets PetId + /// + [DataMember(Name = "petId", EmitDefaultValue = false)] + public long PetId { get; set; } + + /// + /// Gets or Sets Quantity + /// + [DataMember(Name = "quantity", EmitDefaultValue = false)] + public int Quantity { get; set; } + + /// + /// Gets or Sets ShipDate + /// + [DataMember(Name = "shipDate", EmitDefaultValue = false)] + public DateTime ShipDate { get; set; } + + /// + /// Gets or Sets Complete + /// + [DataMember(Name = "complete", EmitDefaultValue = true)] + public bool Complete { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Order {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" PetId: ").Append(PetId).Append("\n"); + sb.Append(" Quantity: ").Append(Quantity).Append("\n"); + sb.Append(" ShipDate: ").Append(ShipDate).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" Complete: ").Append(Complete).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Order); + } + + /// + /// Returns true if Order instances are equal + /// + /// Instance of Order to be compared + /// Boolean + public bool Equals(Order input) + { + if (input == null) + return false; + + return + ( + this.Id == input.Id || + this.Id.Equals(input.Id) + ) && + ( + this.PetId == input.PetId || + this.PetId.Equals(input.PetId) + ) && + ( + this.Quantity == input.Quantity || + this.Quantity.Equals(input.Quantity) + ) && + ( + this.ShipDate == input.ShipDate || + (this.ShipDate != null && + this.ShipDate.Equals(input.ShipDate)) + ) && + ( + this.Status == input.Status || + this.Status.Equals(input.Status) + ) && + ( + this.Complete == input.Complete || + this.Complete.Equals(input.Complete) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = hashCode * 59 + this.Id.GetHashCode(); + hashCode = hashCode * 59 + this.PetId.GetHashCode(); + hashCode = hashCode * 59 + this.Quantity.GetHashCode(); + if (this.ShipDate != null) + hashCode = hashCode * 59 + this.ShipDate.GetHashCode(); + hashCode = hashCode * 59 + this.Status.GetHashCode(); + hashCode = hashCode * 59 + this.Complete.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore-functions/generatedSrc/Models/Pet.cs b/samples/client/petstore/csharp-netcore-functions/generatedSrc/Models/Pet.cs new file mode 100644 index 000000000000..6c4889298fa4 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/generatedSrc/Models/Pet.cs @@ -0,0 +1,238 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Models +{ + /// + /// A pet for sale in the pet store + /// + [DataContract(Name = "Pet")] + public partial class Pet : IEquatable, IValidatableObject + { + /// + /// pet status in the store + /// + /// pet status in the store + [JsonConverter(typeof(StringEnumConverter))] + public enum StatusEnum + { + /// + /// Enum Available for value: available + /// + [EnumMember(Value = "available")] + Available = 1, + + /// + /// Enum Pending for value: pending + /// + [EnumMember(Value = "pending")] + Pending = 2, + + /// + /// Enum Sold for value: sold + /// + [EnumMember(Value = "sold")] + Sold = 3 + + } + + + /// + /// pet status in the store + /// + /// pet status in the store + [DataMember(Name = "status", EmitDefaultValue = false)] + public StatusEnum? Status { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Pet() { } + /// + /// Initializes a new instance of the class. + /// + /// id. + /// category. + /// name (required). + /// photoUrls (required). + /// tags. + /// pet status in the store. + public Pet(long id = default(long), Category category = default(Category), string name = default(string), List photoUrls = default(List), List tags = default(List), StatusEnum? status = default(StatusEnum?)) + { + // to ensure "name" is required (not null) + this.Name = name ?? throw new ArgumentNullException("name is a required property for Pet and cannot be null"); + // to ensure "photoUrls" is required (not null) + this.PhotoUrls = photoUrls ?? throw new ArgumentNullException("photoUrls is a required property for Pet and cannot be null"); + this.Id = id; + this.Category = category; + this.Tags = tags; + this.Status = status; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long Id { get; set; } + + /// + /// Gets or Sets Category + /// + [DataMember(Name = "category", EmitDefaultValue = false)] + public Category Category { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Gets or Sets PhotoUrls + /// + [DataMember(Name = "photoUrls", IsRequired = true, EmitDefaultValue = false)] + public List PhotoUrls { get; set; } + + /// + /// Gets or Sets Tags + /// + [DataMember(Name = "tags", EmitDefaultValue = false)] + public List Tags { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Pet {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Category: ").Append(Category).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); + sb.Append(" Tags: ").Append(Tags).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Pet); + } + + /// + /// Returns true if Pet instances are equal + /// + /// Instance of Pet to be compared + /// Boolean + public bool Equals(Pet input) + { + if (input == null) + return false; + + return + ( + this.Id == input.Id || + this.Id.Equals(input.Id) + ) && + ( + this.Category == input.Category || + (this.Category != null && + this.Category.Equals(input.Category)) + ) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ) && + ( + this.PhotoUrls == input.PhotoUrls || + this.PhotoUrls != null && + input.PhotoUrls != null && + this.PhotoUrls.SequenceEqual(input.PhotoUrls) + ) && + ( + this.Tags == input.Tags || + this.Tags != null && + input.Tags != null && + this.Tags.SequenceEqual(input.Tags) + ) && + ( + this.Status == input.Status || + this.Status.Equals(input.Status) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = hashCode * 59 + this.Id.GetHashCode(); + if (this.Category != null) + hashCode = hashCode * 59 + this.Category.GetHashCode(); + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + if (this.PhotoUrls != null) + hashCode = hashCode * 59 + this.PhotoUrls.GetHashCode(); + if (this.Tags != null) + hashCode = hashCode * 59 + this.Tags.GetHashCode(); + hashCode = hashCode * 59 + this.Status.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore-functions/generatedSrc/Models/Tag.cs b/samples/client/petstore/csharp-netcore-functions/generatedSrc/Models/Tag.cs new file mode 100644 index 000000000000..f9fd7f6942e3 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/generatedSrc/Models/Tag.cs @@ -0,0 +1,139 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Models +{ + /// + /// A tag for a pet + /// + [DataContract(Name = "Tag")] + public partial class Tag : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id. + /// name. + public Tag(long id = default(long), string name = default(string)) + { + this.Id = id; + this.Name = name; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Tag {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Tag); + } + + /// + /// Returns true if Tag instances are equal + /// + /// Instance of Tag to be compared + /// Boolean + public bool Equals(Tag input) + { + if (input == null) + return false; + + return + ( + this.Id == input.Id || + this.Id.Equals(input.Id) + ) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = hashCode * 59 + this.Id.GetHashCode(); + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore-functions/generatedSrc/Models/User.cs b/samples/client/petstore/csharp-netcore-functions/generatedSrc/Models/User.cs new file mode 100644 index 000000000000..45aa7bd2144c --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/generatedSrc/Models/User.cs @@ -0,0 +1,234 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Models +{ + /// + /// A User who is purchasing from the pet store + /// + [DataContract(Name = "User")] + public partial class User : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// id. + /// username. + /// firstName. + /// lastName. + /// email. + /// password. + /// phone. + /// User Status. + public User(long id = default(long), string username = default(string), string firstName = default(string), string lastName = default(string), string email = default(string), string password = default(string), string phone = default(string), int userStatus = default(int)) + { + this.Id = id; + this.Username = username; + this.FirstName = firstName; + this.LastName = lastName; + this.Email = email; + this.Password = password; + this.Phone = phone; + this.UserStatus = userStatus; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public long Id { get; set; } + + /// + /// Gets or Sets Username + /// + [DataMember(Name = "username", EmitDefaultValue = false)] + public string Username { get; set; } + + /// + /// Gets or Sets FirstName + /// + [DataMember(Name = "firstName", EmitDefaultValue = false)] + public string FirstName { get; set; } + + /// + /// Gets or Sets LastName + /// + [DataMember(Name = "lastName", EmitDefaultValue = false)] + public string LastName { get; set; } + + /// + /// Gets or Sets Email + /// + [DataMember(Name = "email", EmitDefaultValue = false)] + public string Email { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name = "password", EmitDefaultValue = false)] + public string Password { get; set; } + + /// + /// Gets or Sets Phone + /// + [DataMember(Name = "phone", EmitDefaultValue = false)] + public string Phone { get; set; } + + /// + /// User Status + /// + /// User Status + [DataMember(Name = "userStatus", EmitDefaultValue = false)] + public int UserStatus { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class User {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Username: ").Append(Username).Append("\n"); + sb.Append(" FirstName: ").Append(FirstName).Append("\n"); + sb.Append(" LastName: ").Append(LastName).Append("\n"); + sb.Append(" Email: ").Append(Email).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" Phone: ").Append(Phone).Append("\n"); + sb.Append(" UserStatus: ").Append(UserStatus).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as User); + } + + /// + /// Returns true if User instances are equal + /// + /// Instance of User to be compared + /// Boolean + public bool Equals(User input) + { + if (input == null) + return false; + + return + ( + this.Id == input.Id || + this.Id.Equals(input.Id) + ) && + ( + this.Username == input.Username || + (this.Username != null && + this.Username.Equals(input.Username)) + ) && + ( + this.FirstName == input.FirstName || + (this.FirstName != null && + this.FirstName.Equals(input.FirstName)) + ) && + ( + this.LastName == input.LastName || + (this.LastName != null && + this.LastName.Equals(input.LastName)) + ) && + ( + this.Email == input.Email || + (this.Email != null && + this.Email.Equals(input.Email)) + ) && + ( + this.Password == input.Password || + (this.Password != null && + this.Password.Equals(input.Password)) + ) && + ( + this.Phone == input.Phone || + (this.Phone != null && + this.Phone.Equals(input.Phone)) + ) && + ( + this.UserStatus == input.UserStatus || + this.UserStatus.Equals(input.UserStatus) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = hashCode * 59 + this.Id.GetHashCode(); + if (this.Username != null) + hashCode = hashCode * 59 + this.Username.GetHashCode(); + if (this.FirstName != null) + hashCode = hashCode * 59 + this.FirstName.GetHashCode(); + if (this.LastName != null) + hashCode = hashCode * 59 + this.LastName.GetHashCode(); + if (this.Email != null) + hashCode = hashCode * 59 + this.Email.GetHashCode(); + if (this.Password != null) + hashCode = hashCode * 59 + this.Password.GetHashCode(); + if (this.Phone != null) + hashCode = hashCode * 59 + this.Phone.GetHashCode(); + hashCode = hashCode * 59 + this.UserStatus.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore-functions/generatedSrc/README.md b/samples/client/petstore/csharp-netcore-functions/generatedSrc/README.md new file mode 100644 index 000000000000..a531ad1e6029 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/generatedSrc/README.md @@ -0,0 +1,159 @@ +# Org.OpenAPITools - the C# library for the OpenAPI Petstore + +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 1.0.0 +- SDK version: 1.0.0 +- Build package: org.openapitools.codegen.languages.CsharpNetcoreFunctionsServerCodegen + + +## Frameworks supported +- .NET Core >=1.0 +- .NET Framework >=4.6 +- Mono/Xamarin >=vNext + + +## Dependencies + +- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.11.7 or later +- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 12.0.3 or later +- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.8.0 or later +- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 5.0.0 or later + +The DLLs included in the package may not be the latest version. We recommend using [NuGet](https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: +``` +Install-Package RestSharp +Install-Package Newtonsoft.Json +Install-Package JsonSubTypes +Install-Package System.ComponentModel.Annotations +``` + +NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See [RestSharp#742](https://github.com/restsharp/RestSharp/issues/742). +NOTE: RestSharp for .Net Core creates a new socket for each api call, which can lead to a socket exhaustion problem. See [RestSharp#1406](https://github.com/restsharp/RestSharp/issues/1406). + + +## Installation +Generate the DLL using your preferred tool (e.g. `dotnet build`) + +Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces: +```csharp +using Org.OpenAPITools.Apis; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Models; +``` + +## Usage + +To use the API client with a HTTP proxy, setup a `System.Net.WebProxy` +```csharp +Configuration c = new Configuration(); +System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/"); +webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials; +c.Proxy = webProxy; +``` + + +## Getting Started + +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Apis; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Models; + +namespace Example +{ + public class Example + { + public static void Main() + { + + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + config.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(config); + var pet = new Pet(); // Pet | Pet object that needs to be added to the store + + try + { + // Add a new pet to the store + Pet result = apiInstance.AddPet(pet); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.AddPet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + + } + } +} +``` + + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**FindPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**FindPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**GetPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**CreateUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**DeleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**GetUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**LoginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**LogoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**UpdateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + + +## Documentation for Models + + - [Models.ApiResponse](docs/ApiResponse.md) + - [Models.Category](docs/Category.md) + - [Models.Order](docs/Order.md) + - [Models.Pet](docs/Pet.md) + - [Models.Tag](docs/Tag.md) + - [Models.User](docs/User.md) + + + +## Documentation for Authorization + + +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + + +### petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - write:pets: modify pets in your account + - read:pets: read your pets + diff --git a/samples/client/petstore/csharp-netcore-functions/generatedSrc/project.json b/samples/client/petstore/csharp-netcore-functions/generatedSrc/project.json new file mode 100644 index 000000000000..d5d3017c2162 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/generatedSrc/project.json @@ -0,0 +1,12 @@ +{ + "supports": {}, + "dependencies": { + "FubarCoder.RestSharp.Portable.Core": "4.0.7", + "FubarCoder.RestSharp.Portable.HttpClient": "4.0.7", + "Newtonsoft.Json": "10.0.3", + "JsonSubTypes": "1.2.0" + }, + "frameworks": { + "netstandard1.3": {} + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore-functions/git_push.sh b/samples/client/petstore/csharp-netcore-functions/git_push.sh new file mode 100644 index 000000000000..ced3be2b0c7b --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/git_push.sh @@ -0,0 +1,58 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools.Test/Models/ApiResponseTests.cs b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools.Test/Models/ApiResponseTests.cs new file mode 100644 index 000000000000..8a290fd090cb --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools.Test/Models/ApiResponseTests.cs @@ -0,0 +1,86 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Apis; +using Org.OpenAPITools.Models; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing ApiResponse + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class ApiResponseTests : IDisposable + { + // TODO uncomment below to declare an instance variable for ApiResponse + //private ApiResponse instance; + + public ApiResponseTests() + { + // TODO uncomment below to create an instance of ApiResponse + //instance = new ApiResponse(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of ApiResponse + /// + [Fact] + public void ApiResponseInstanceTest() + { + // TODO uncomment below to test "IsType" ApiResponse + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Code' + /// + [Fact] + public void CodeTest() + { + // TODO unit test for the property 'Code' + } + /// + /// Test the property 'Type' + /// + [Fact] + public void TypeTest() + { + // TODO unit test for the property 'Type' + } + /// + /// Test the property 'Message' + /// + [Fact] + public void MessageTest() + { + // TODO unit test for the property 'Message' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools.Test/Models/CategoryTests.cs b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools.Test/Models/CategoryTests.cs new file mode 100644 index 000000000000..dd395f7d6741 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools.Test/Models/CategoryTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Apis; +using Org.OpenAPITools.Models; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Category + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class CategoryTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Category + //private Category instance; + + public CategoryTests() + { + // TODO uncomment below to create an instance of Category + //instance = new Category(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Category + /// + [Fact] + public void CategoryInstanceTest() + { + // TODO uncomment below to test "IsType" Category + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools.Test/Models/OrderTests.cs b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools.Test/Models/OrderTests.cs new file mode 100644 index 000000000000..d78afb0066d6 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools.Test/Models/OrderTests.cs @@ -0,0 +1,110 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Apis; +using Org.OpenAPITools.Models; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Order + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class OrderTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Order + //private Order instance; + + public OrderTests() + { + // TODO uncomment below to create an instance of Order + //instance = new Order(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Order + /// + [Fact] + public void OrderInstanceTest() + { + // TODO uncomment below to test "IsType" Order + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'PetId' + /// + [Fact] + public void PetIdTest() + { + // TODO unit test for the property 'PetId' + } + /// + /// Test the property 'Quantity' + /// + [Fact] + public void QuantityTest() + { + // TODO unit test for the property 'Quantity' + } + /// + /// Test the property 'ShipDate' + /// + [Fact] + public void ShipDateTest() + { + // TODO unit test for the property 'ShipDate' + } + /// + /// Test the property 'Status' + /// + [Fact] + public void StatusTest() + { + // TODO unit test for the property 'Status' + } + /// + /// Test the property 'Complete' + /// + [Fact] + public void CompleteTest() + { + // TODO unit test for the property 'Complete' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools.Test/Models/PetTests.cs b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools.Test/Models/PetTests.cs new file mode 100644 index 000000000000..b444a6448fc8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools.Test/Models/PetTests.cs @@ -0,0 +1,110 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Apis; +using Org.OpenAPITools.Models; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Pet + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class PetTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Pet + //private Pet instance; + + public PetTests() + { + // TODO uncomment below to create an instance of Pet + //instance = new Pet(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Pet + /// + [Fact] + public void PetInstanceTest() + { + // TODO uncomment below to test "IsType" Pet + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'Category' + /// + [Fact] + public void CategoryTest() + { + // TODO unit test for the property 'Category' + } + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + /// + /// Test the property 'PhotoUrls' + /// + [Fact] + public void PhotoUrlsTest() + { + // TODO unit test for the property 'PhotoUrls' + } + /// + /// Test the property 'Tags' + /// + [Fact] + public void TagsTest() + { + // TODO unit test for the property 'Tags' + } + /// + /// Test the property 'Status' + /// + [Fact] + public void StatusTest() + { + // TODO unit test for the property 'Status' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools.Test/Models/TagTests.cs b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools.Test/Models/TagTests.cs new file mode 100644 index 000000000000..141398d03808 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools.Test/Models/TagTests.cs @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Apis; +using Org.OpenAPITools.Models; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing Tag + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class TagTests : IDisposable + { + // TODO uncomment below to declare an instance variable for Tag + //private Tag instance; + + public TagTests() + { + // TODO uncomment below to create an instance of Tag + //instance = new Tag(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of Tag + /// + [Fact] + public void TagInstanceTest() + { + // TODO uncomment below to test "IsType" Tag + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools.Test/Models/UserTests.cs b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools.Test/Models/UserTests.cs new file mode 100644 index 000000000000..3f0d780b9664 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools.Test/Models/UserTests.cs @@ -0,0 +1,126 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Apis; +using Org.OpenAPITools.Models; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing User + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class UserTests : IDisposable + { + // TODO uncomment below to declare an instance variable for User + //private User instance; + + public UserTests() + { + // TODO uncomment below to create an instance of User + //instance = new User(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of User + /// + [Fact] + public void UserInstanceTest() + { + // TODO uncomment below to test "IsType" User + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'Username' + /// + [Fact] + public void UsernameTest() + { + // TODO unit test for the property 'Username' + } + /// + /// Test the property 'FirstName' + /// + [Fact] + public void FirstNameTest() + { + // TODO unit test for the property 'FirstName' + } + /// + /// Test the property 'LastName' + /// + [Fact] + public void LastNameTest() + { + // TODO unit test for the property 'LastName' + } + /// + /// Test the property 'Email' + /// + [Fact] + public void EmailTest() + { + // TODO unit test for the property 'Email' + } + /// + /// Test the property 'Password' + /// + [Fact] + public void PasswordTest() + { + // TODO unit test for the property 'Password' + } + /// + /// Test the property 'Phone' + /// + [Fact] + public void PhoneTest() + { + // TODO unit test for the property 'Phone' + } + /// + /// Test the property 'UserStatus' + /// + [Fact] + public void UserStatusTest() + { + // TODO unit test for the property 'UserStatus' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/ApiClient.cs new file mode 100644 index 000000000000..4f68a59871e7 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/ApiClient.cs @@ -0,0 +1,860 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Formatters; +using System.Text; +using System.Threading; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs; +using RestSharp; +using RestSharp.Deserializers; +using RestSharpMethod = RestSharp.Method; +using Polly; + +namespace Org.OpenAPITools.Client +{ + /// + /// Allows RestSharp to Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON. + /// + internal class CustomJsonCodec : RestSharp.Serializers.ISerializer, RestSharp.Deserializers.IDeserializer + { + private readonly IReadableConfiguration _configuration; + private static readonly string _contentType = "application/json"; + private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + public CustomJsonCodec(IReadableConfiguration configuration) + { + _configuration = configuration; + } + + public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) + { + _serializerSettings = serializerSettings; + _configuration = configuration; + } + + /// + /// Serialize the object into a JSON string. + /// + /// Object to be serialized. + /// A JSON string. + public string Serialize(object obj) + { + if (obj != null && obj is Org.OpenAPITools.Models.AbstractOpenAPISchema) + { + // the object to be serialized is an oneOf/anyOf schema + return ((Org.OpenAPITools.Models.AbstractOpenAPISchema)obj).ToJson(); + } + else + { + return JsonConvert.SerializeObject(obj, _serializerSettings); + } + } + + public T Deserialize(IRestResponse response) + { + var result = (T)Deserialize(response, typeof(T)); + return result; + } + + /// + /// Deserialize the JSON string into a proper object. + /// + /// The HTTP response. + /// Object type. + /// Object representation of the JSON string. + internal object Deserialize(IRestResponse response, Type type) + { + if (type == typeof(byte[])) // return byte array + { + return response.RawBytes; + } + + // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) + if (type == typeof(Stream)) + { + var bytes = response.RawBytes; + if (response.Headers != null) + { + var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) + ? Path.GetTempPath() + : _configuration.TempFolderPath; + var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); + foreach (var header in response.Headers) + { + var match = regex.Match(header.ToString()); + if (match.Success) + { + string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); + File.WriteAllBytes(fileName, bytes); + return new FileStream(fileName, FileMode.Open); + } + } + } + var stream = new MemoryStream(bytes); + return stream; + } + + if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object + { + return DateTime.Parse(response.Content, null, System.Globalization.DateTimeStyles.RoundtripKind); + } + + if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type + { + return Convert.ChangeType(response.Content, type); + } + + // at this point, it must be a model (json) + try + { + return JsonConvert.DeserializeObject(response.Content, type, _serializerSettings); + } + catch (Exception e) + { + throw new ApiException(500, e.Message); + } + } + + public string RootElement { get; set; } + public string Namespace { get; set; } + public string DateFormat { get; set; } + + public string ContentType + { + get { return _contentType; } + set { throw new InvalidOperationException("Not allowed to set content type."); } + } + } + /// + /// Provides a default implementation of an Api client (both synchronous and asynchronous implementatios), + /// encapsulating general REST accessor use cases. + /// + public partial class ApiClient : ISynchronousClient, IAsynchronousClient + { + private readonly string _baseUrl; + + /// + /// Specifies the settings on a object. + /// These settings can be adjusted to accomodate custom serialization rules. + /// + public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Allows for extending request processing for generated code. + /// + /// The RestSharp request object + partial void InterceptRequest(IRestRequest request); + + /// + /// Allows for extending response processing for generated code. + /// + /// The RestSharp request object + /// The RestSharp response object + partial void InterceptResponse(IRestRequest request, IRestResponse response); + + /// + /// Initializes a new instance of the , defaulting to the global configurations' base url. + /// + public ApiClient() + { + _baseUrl = Org.OpenAPITools.Client.GlobalConfiguration.Instance.BasePath; + } + + /// + /// Initializes a new instance of the + /// + /// The target service's base path in URL format. + /// + public ApiClient(string basePath) + { + if (string.IsNullOrEmpty(basePath)) + throw new ArgumentException("basePath cannot be empty"); + + _baseUrl = basePath; + } + + /// + /// Constructs the RestSharp version of an http method + /// + /// Swagger Client Custom HttpMethod + /// RestSharp's HttpMethod instance. + /// + private RestSharpMethod Method(HttpMethod method) + { + RestSharpMethod other; + switch (method) + { + case HttpMethod.Get: + other = RestSharpMethod.GET; + break; + case HttpMethod.Post: + other = RestSharpMethod.POST; + break; + case HttpMethod.Put: + other = RestSharpMethod.PUT; + break; + case HttpMethod.Delete: + other = RestSharpMethod.DELETE; + break; + case HttpMethod.Head: + other = RestSharpMethod.HEAD; + break; + case HttpMethod.Options: + other = RestSharpMethod.OPTIONS; + break; + case HttpMethod.Patch: + other = RestSharpMethod.PATCH; + break; + default: + throw new ArgumentOutOfRangeException("method", method, null); + } + + return other; + } + + /// + /// Provides all logic for constructing a new RestSharp . + /// At this point, all information for querying the service is known. Here, it is simply + /// mapped into the RestSharp request. + /// + /// The http verb. + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// [private] A new RestRequest instance. + /// + private RestRequest NewRequest( + HttpMethod method, + string path, + RequestOptions options, + IReadableConfiguration configuration) + { + if (path == null) throw new ArgumentNullException("path"); + if (options == null) throw new ArgumentNullException("options"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + RestRequest request = new RestRequest(Method(method)) + { + Resource = path, + JsonSerializer = new CustomJsonCodec(SerializerSettings, configuration) + }; + + if (options.PathParameters != null) + { + foreach (var pathParam in options.PathParameters) + { + request.AddParameter(pathParam.Key, pathParam.Value, ParameterType.UrlSegment); + } + } + + if (options.QueryParameters != null) + { + foreach (var queryParam in options.QueryParameters) + { + foreach (var value in queryParam.Value) + { + request.AddQueryParameter(queryParam.Key, value); + } + } + } + + if (configuration.DefaultHeaders != null) + { + foreach (var headerParam in configuration.DefaultHeaders) + { + request.AddHeader(headerParam.Key, headerParam.Value); + } + } + + if (options.HeaderParameters != null) + { + foreach (var headerParam in options.HeaderParameters) + { + foreach (var value in headerParam.Value) + { + request.AddHeader(headerParam.Key, value); + } + } + } + + if (options.FormParameters != null) + { + foreach (var formParam in options.FormParameters) + { + request.AddParameter(formParam.Key, formParam.Value); + } + } + + if (options.Data != null) + { + if (options.Data is Stream stream) + { + var contentType = "application/octet-stream"; + if (options.HeaderParameters != null) + { + var contentTypes = options.HeaderParameters["Content-Type"]; + contentType = contentTypes[0]; + } + + var bytes = ClientUtils.ReadAsBytes(stream); + request.AddParameter(contentType, bytes, ParameterType.RequestBody); + } + else + { + if (options.HeaderParameters != null) + { + var contentTypes = options.HeaderParameters["Content-Type"]; + if (contentTypes == null || contentTypes.Any(header => header.Contains("application/json"))) + { + request.RequestFormat = DataFormat.Json; + } + else + { + // TODO: Generated client user should add additional handlers. RestSharp only supports XML and JSON, with XML as default. + } + } + else + { + // Here, we'll assume JSON APIs are more common. XML can be forced by adding produces/consumes to openapi spec explicitly. + request.RequestFormat = DataFormat.Json; + } + + request.AddJsonBody(options.Data); + } + } + + if (options.FileParameters != null) + { + foreach (var fileParam in options.FileParameters) + { + var bytes = ClientUtils.ReadAsBytes(fileParam.Value); + var fileStream = fileParam.Value as FileStream; + if (fileStream != null) + request.Files.Add(FileParameter.Create(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name))); + else + request.Files.Add(FileParameter.Create(fileParam.Key, bytes, "no_file_name_provided")); + } + } + + if (options.Cookies != null && options.Cookies.Count > 0) + { + foreach (var cookie in options.Cookies) + { + request.AddCookie(cookie.Name, cookie.Value); + } + } + + return request; + } + + private ApiResponse ToApiResponse(IRestResponse response) + { + T result = response.Data; + string rawContent = response.Content; + + var transformed = new ApiResponse(response.StatusCode, new Multimap(), result, rawContent) + { + ErrorText = response.ErrorMessage, + Cookies = new List() + }; + + if (response.Headers != null) + { + foreach (var responseHeader in response.Headers) + { + transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value)); + } + } + + if (response.Cookies != null) + { + foreach (var responseCookies in response.Cookies) + { + transformed.Cookies.Add( + new Cookie( + responseCookies.Name, + responseCookies.Value, + responseCookies.Path, + responseCookies.Domain) + ); + } + } + + return transformed; + } + + private ApiResponse Exec(RestRequest req, IReadableConfiguration configuration) + { + RestClient client = new RestClient(_baseUrl); + + client.ClearHandlers(); + var existingDeserializer = req.JsonSerializer as IDeserializer; + if (existingDeserializer != null) + { + client.AddHandler("application/json", () => existingDeserializer); + client.AddHandler("text/json", () => existingDeserializer); + client.AddHandler("text/x-json", () => existingDeserializer); + client.AddHandler("text/javascript", () => existingDeserializer); + client.AddHandler("*+json", () => existingDeserializer); + } + else + { + var customDeserializer = new CustomJsonCodec(SerializerSettings, configuration); + client.AddHandler("application/json", () => customDeserializer); + client.AddHandler("text/json", () => customDeserializer); + client.AddHandler("text/x-json", () => customDeserializer); + client.AddHandler("text/javascript", () => customDeserializer); + client.AddHandler("*+json", () => customDeserializer); + } + + var xmlDeserializer = new XmlDeserializer(); + client.AddHandler("application/xml", () => xmlDeserializer); + client.AddHandler("text/xml", () => xmlDeserializer); + client.AddHandler("*+xml", () => xmlDeserializer); + client.AddHandler("*", () => xmlDeserializer); + + client.Timeout = configuration.Timeout; + + if (configuration.Proxy != null) + { + client.Proxy = configuration.Proxy; + } + + if (configuration.UserAgent != null) + { + client.UserAgent = configuration.UserAgent; + } + + if (configuration.ClientCertificates != null) + { + client.ClientCertificates = configuration.ClientCertificates; + } + + InterceptRequest(req); + + IRestResponse response; + if (RetryConfiguration.RetryPolicy != null) + { + var policy = RetryConfiguration.RetryPolicy; + var policyResult = policy.ExecuteAndCapture(() => client.Execute(req)); + response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse + { + Request = req, + ErrorException = policyResult.FinalException + }; + } + else + { + response = client.Execute(req); + } + + // if the response type is oneOf/anyOf, call FromJSON to deserialize the data + if (typeof(Org.OpenAPITools.Models.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + { + response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + } + else if (typeof(T).Name == "Stream") // for binary response + { + response.Data = (T)(object)new MemoryStream(response.RawBytes); + } + + InterceptResponse(req, response); + + var result = ToApiResponse(response); + if (response.ErrorMessage != null) + { + result.ErrorText = response.ErrorMessage; + } + + if (response.Cookies != null && response.Cookies.Count > 0) + { + if (result.Cookies == null) result.Cookies = new List(); + foreach (var restResponseCookie in response.Cookies) + { + var cookie = new Cookie( + restResponseCookie.Name, + restResponseCookie.Value, + restResponseCookie.Path, + restResponseCookie.Domain + ) + { + Comment = restResponseCookie.Comment, + CommentUri = restResponseCookie.CommentUri, + Discard = restResponseCookie.Discard, + Expired = restResponseCookie.Expired, + Expires = restResponseCookie.Expires, + HttpOnly = restResponseCookie.HttpOnly, + Port = restResponseCookie.Port, + Secure = restResponseCookie.Secure, + Version = restResponseCookie.Version + }; + + result.Cookies.Add(cookie); + } + } + return result; + } + + private async Task> ExecAsync(RestRequest req, IReadableConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + RestClient client = new RestClient(_baseUrl); + + client.ClearHandlers(); + var existingDeserializer = req.JsonSerializer as IDeserializer; + if (existingDeserializer != null) + { + client.AddHandler("application/json", () => existingDeserializer); + client.AddHandler("text/json", () => existingDeserializer); + client.AddHandler("text/x-json", () => existingDeserializer); + client.AddHandler("text/javascript", () => existingDeserializer); + client.AddHandler("*+json", () => existingDeserializer); + } + else + { + var customDeserializer = new CustomJsonCodec(SerializerSettings, configuration); + client.AddHandler("application/json", () => customDeserializer); + client.AddHandler("text/json", () => customDeserializer); + client.AddHandler("text/x-json", () => customDeserializer); + client.AddHandler("text/javascript", () => customDeserializer); + client.AddHandler("*+json", () => customDeserializer); + } + + var xmlDeserializer = new XmlDeserializer(); + client.AddHandler("application/xml", () => xmlDeserializer); + client.AddHandler("text/xml", () => xmlDeserializer); + client.AddHandler("*+xml", () => xmlDeserializer); + client.AddHandler("*", () => xmlDeserializer); + + client.Timeout = configuration.Timeout; + + if (configuration.Proxy != null) + { + client.Proxy = configuration.Proxy; + } + + if (configuration.UserAgent != null) + { + client.UserAgent = configuration.UserAgent; + } + + if (configuration.ClientCertificates != null) + { + client.ClientCertificates = configuration.ClientCertificates; + } + + InterceptRequest(req); + + IRestResponse response; + if (RetryConfiguration.AsyncRetryPolicy != null) + { + var policy = RetryConfiguration.AsyncRetryPolicy; + var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(req, ct), cancellationToken).ConfigureAwait(false); + response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse + { + Request = req, + ErrorException = policyResult.FinalException + }; + } + else + { + response = await client.ExecuteAsync(req, cancellationToken).ConfigureAwait(false); + } + + // if the response type is oneOf/anyOf, call FromJSON to deserialize the data + if (typeof(Org.OpenAPITools.Models.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + { + response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + } + else if (typeof(T).Name == "Stream") // for binary response + { + response.Data = (T)(object)new MemoryStream(response.RawBytes); + } + + InterceptResponse(req, response); + + var result = ToApiResponse(response); + if (response.ErrorMessage != null) + { + result.ErrorText = response.ErrorMessage; + } + + if (response.Cookies != null && response.Cookies.Count > 0) + { + if (result.Cookies == null) result.Cookies = new List(); + foreach (var restResponseCookie in response.Cookies) + { + var cookie = new Cookie( + restResponseCookie.Name, + restResponseCookie.Value, + restResponseCookie.Path, + restResponseCookie.Domain + ) + { + Comment = restResponseCookie.Comment, + CommentUri = restResponseCookie.CommentUri, + Discard = restResponseCookie.Discard, + Expired = restResponseCookie.Expired, + Expires = restResponseCookie.Expires, + HttpOnly = restResponseCookie.HttpOnly, + Port = restResponseCookie.Port, + Secure = restResponseCookie.Secure, + Version = restResponseCookie.Version + }; + + result.Cookies.Add(cookie); + } + } + return result; + } + + #region IAsynchronousClient + /// + /// Make a HTTP GET request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP POST request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP PUT request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP DELETE request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP HEAD request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP OPTION request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), config, cancellationToken); + } + + /// + /// Make a HTTP PATCH request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), config, cancellationToken); + } + #endregion IAsynchronousClient + + #region ISynchronousClient + /// + /// Make a HTTP GET request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Get, path, options, config), config); + } + + /// + /// Make a HTTP POST request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Post, path, options, config), config); + } + + /// + /// Make a HTTP PUT request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Put, path, options, config), config); + } + + /// + /// Make a HTTP DELETE request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Delete, path, options, config), config); + } + + /// + /// Make a HTTP HEAD request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Head, path, options, config), config); + } + + /// + /// Make a HTTP OPTION request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Options, path, options, config), config); + } + + /// + /// Make a HTTP PATCH request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Patch, path, options, config), config); + } + #endregion ISynchronousClient + } +} diff --git a/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/ApiException.cs b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/ApiException.cs new file mode 100644 index 000000000000..dcc378ad208d --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/ApiException.cs @@ -0,0 +1,68 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// API Exception + /// + public class ApiException : Exception + { + /// + /// Gets or sets the error code (HTTP status code) + /// + /// The error code (HTTP status code). + public int ErrorCode { get; set; } + + /// + /// Gets or sets the error content (body json object) + /// + /// The error content (Http response body). + public object ErrorContent { get; private set; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + public Multimap Headers { get; private set; } + + /// + /// Initializes a new instance of the class. + /// + public ApiException() { } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Error message. + public ApiException(int errorCode, string message) : base(message) + { + this.ErrorCode = errorCode; + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Error message. + /// Error content. + /// HTTP Headers. + public ApiException(int errorCode, string message, object errorContent = null, Multimap headers = null) : base(message) + { + this.ErrorCode = errorCode; + this.ErrorContent = errorContent; + this.Headers = headers; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/ApiResponse.cs b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/ApiResponse.cs new file mode 100644 index 000000000000..6d91a6f7a47e --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/ApiResponse.cs @@ -0,0 +1,166 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.Net; + +namespace Org.OpenAPITools.Client +{ + /// + /// Provides a non-generic contract for the ApiResponse wrapper. + /// + public interface IApiResponse + { + /// + /// The data type of + /// + Type ResponseType { get; } + + /// + /// The content of this response + /// + Object Content { get; } + + /// + /// Gets or sets the status code (HTTP status code) + /// + /// The status code. + HttpStatusCode StatusCode { get; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + Multimap Headers { get; } + + /// + /// Gets or sets any error text defined by the calling client. + /// + string ErrorText { get; set; } + + /// + /// Gets or sets any cookies passed along on the response. + /// + List Cookies { get; set; } + + /// + /// The raw content of this response + /// + string RawContent { get; } + } + + /// + /// API Response + /// + public class ApiResponse : IApiResponse + { + #region Properties + + /// + /// Gets or sets the status code (HTTP status code) + /// + /// The status code. + public HttpStatusCode StatusCode { get; } + + /// + /// Gets or sets the HTTP headers + /// + /// HTTP headers + public Multimap Headers { get; } + + /// + /// Gets or sets the data (parsed HTTP body) + /// + /// The data. + public T Data { get; } + + /// + /// Gets or sets any error text defined by the calling client. + /// + public string ErrorText { get; set; } + + /// + /// Gets or sets any cookies passed along on the response. + /// + public List Cookies { get; set; } + + /// + /// The content of this response + /// + public Type ResponseType + { + get { return typeof(T); } + } + + /// + /// The data type of + /// + public object Content + { + get { return Data; } + } + + /// + /// The raw content + /// + public string RawContent { get; } + + #endregion Properties + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// HTTP headers. + /// Data (parsed HTTP body) + /// Raw content. + public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data, string rawContent) + { + StatusCode = statusCode; + Headers = headers; + Data = data; + RawContent = rawContent; + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// HTTP headers. + /// Data (parsed HTTP body) + public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data) : this(statusCode, headers, data, null) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Data (parsed HTTP body) + /// Raw content. + public ApiResponse(HttpStatusCode statusCode, T data, string rawContent) : this(statusCode, null, data, rawContent) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// HTTP status code. + /// Data (parsed HTTP body) + public ApiResponse(HttpStatusCode statusCode, T data) : this(statusCode, data, null) + { + } + + #endregion Constructors + } +} diff --git a/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/ClientUtils.cs new file mode 100644 index 000000000000..e23537db3c2b --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -0,0 +1,229 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; + +namespace Org.OpenAPITools.Client +{ + /// + /// Utility functions providing some benefit to API client consumers. + /// + public static class ClientUtils + { + /// + /// Sanitize filename by removing the path + /// + /// Filename + /// Filename + public static string SanitizeFilename(string filename) + { + Match match = Regex.Match(filename, @".*[/\\](.*)$"); + return match.Success ? match.Groups[1].Value : filename; + } + + /// + /// Convert params to key/value pairs. + /// Use collectionFormat to properly format lists and collections. + /// + /// The swagger-supported collection format, one of: csv, tsv, ssv, pipes, multi + /// Key name. + /// Value object. + /// A multimap of keys with 1..n associated values. + public static Multimap ParameterToMultiMap(string collectionFormat, string name, object value) + { + var parameters = new Multimap(); + + if (value is ICollection collection && collectionFormat == "multi") + { + foreach (var item in collection) + { + parameters.Add(name, ParameterToString(item)); + } + } + else if (value is IDictionary dictionary) + { + if(collectionFormat == "deepObject") { + foreach (DictionaryEntry entry in dictionary) + { + parameters.Add(name + "[" + entry.Key + "]", ParameterToString(entry.Value)); + } + } + else { + foreach (DictionaryEntry entry in dictionary) + { + parameters.Add(entry.Key.ToString(), ParameterToString(entry.Value)); + } + } + } + else + { + parameters.Add(name, ParameterToString(value)); + } + + return parameters; + } + + /// + /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + /// If parameter is a list, join the list with ",". + /// Otherwise just return the string. + /// + /// The parameter (header, path, query, form). + /// An optional configuration instance, providing formatting options used in processing. + /// Formatted string. + public static string ParameterToString(object obj, IReadableConfiguration configuration = null) + { + if (obj is DateTime dateTime) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTime.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); + if (obj is DateTimeOffset dateTimeOffset) + // Return a formatted date string - Can be customized with Configuration.DateTimeFormat + // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + // For example: 2009-06-15T13:45:30.0000000 + return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); + if (obj is bool boolean) + return boolean ? "true" : "false"; + if (obj is ICollection collection) + return string.Join(",", collection.Cast()); + + return Convert.ToString(obj, CultureInfo.InvariantCulture); + } + + /// + /// URL encode a string + /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 + /// + /// string to be URL encoded + /// Byte array + public static string UrlEncode(string input) + { + const int maxLength = 32766; + + if (input == null) + { + throw new ArgumentNullException("input"); + } + + if (input.Length <= maxLength) + { + return Uri.EscapeDataString(input); + } + + StringBuilder sb = new StringBuilder(input.Length * 2); + int index = 0; + + while (index < input.Length) + { + int length = Math.Min(input.Length - index, maxLength); + string subString = input.Substring(index, length); + + sb.Append(Uri.EscapeDataString(subString)); + index += subString.Length; + } + + return sb.ToString(); + } + + /// + /// Encode string in base64 format. + /// + /// string to be encoded. + /// Encoded string. + public static string Base64Encode(string text) + { + return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + } + + /// + /// Convert stream to byte array + /// + /// Input stream to be converted + /// Byte array + public static byte[] ReadAsBytes(Stream inputStream) + { + using (var ms = new MemoryStream()) + { + inputStream.CopyTo(ms); + return ms.ToArray(); + } + } + + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON type exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public static string SelectHeaderContentType(string[] contentTypes) + { + if (contentTypes.Length == 0) + return null; + + foreach (var contentType in contentTypes) + { + if (IsJsonMime(contentType)) + return contentType; + } + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + + /// + /// Select the Accept header's value from the given accepts array: + /// if JSON exists in the given array, use it; + /// otherwise use all of them (joining into a string) + /// + /// The accepts array to select from. + /// The Accept header to use. + public static string SelectHeaderAccept(string[] accepts) + { + if (accepts.Length == 0) + return null; + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return string.Join(",", accepts); + } + + /// + /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. + /// + public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + /// + /// Check if the given MIME is a JSON MIME. + /// JSON MIME examples: + /// application/json + /// application/json; charset=UTF8 + /// APPLICATION/JSON + /// application/vnd.company+json + /// + /// MIME + /// Returns True if MIME type is json. + public static bool IsJsonMime(string mime) + { + if (string.IsNullOrWhiteSpace(mime)) return false; + + return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json"); + } + } +} diff --git a/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/Configuration.cs b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/Configuration.cs new file mode 100644 index 000000000000..896bd754ea5f --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/Configuration.cs @@ -0,0 +1,515 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Security.Cryptography.X509Certificates; +using System.Text; + +namespace Org.OpenAPITools.Client +{ + /// + /// Represents a set of configuration settings + /// + public class Configuration : IReadableConfiguration + { + #region Constants + + /// + /// Version of the package. + /// + /// Version of the package. + public const string Version = "1.0.0"; + + /// + /// Identifier for ISO 8601 DateTime Format + /// + /// See https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 for more information. + // ReSharper disable once InconsistentNaming + public const string ISO8601_DATETIME_FORMAT = "o"; + + #endregion Constants + + #region Static Members + + /// + /// Default creation of exceptions for a given method name and response object + /// + public static readonly ExceptionFactory DefaultExceptionFactory = (methodName, response) => + { + var status = (int)response.StatusCode; + if (status >= 400) + { + return new ApiException(status, + string.Format("Error calling {0}: {1}", methodName, response.RawContent), + response.RawContent, response.Headers); + } + return null; + }; + + #endregion Static Members + + #region Private Members + + /// + /// Defines the base path of the target API server. + /// Example: http://localhost:3000/v1/ + /// + private string _basePath; + + /// + /// Gets or sets the API key based on the authentication name. + /// This is the key and value comprising the "secret" for acessing an API. + /// + /// The API key. + private IDictionary _apiKey; + + /// + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// + /// The prefix of the API key. + private IDictionary _apiKeyPrefix; + + private string _dateTimeFormat = ISO8601_DATETIME_FORMAT; + private string _tempFolderPath = Path.GetTempPath(); + + /// + /// Gets or sets the servers defined in the OpenAPI spec. + /// + /// The servers + private IList> _servers; + #endregion Private Members + + #region Constructors + + /// + /// Initializes a new instance of the class + /// + [System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + public Configuration() + { + Proxy = null; + UserAgent = "OpenAPI-Generator/1.0.0/csharp"; + BasePath = "http://petstore.swagger.io/v2"; + DefaultHeaders = new ConcurrentDictionary(); + ApiKey = new ConcurrentDictionary(); + ApiKeyPrefix = new ConcurrentDictionary(); + Servers = new List>() + { + { + new Dictionary { + {"url", "http://petstore.swagger.io/v2"}, + {"description", "No description provided"}, + } + } + }; + + // Setting Timeout has side effects (forces ApiClient creation). + Timeout = 100000; + } + + /// + /// Initializes a new instance of the class + /// + [System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + public Configuration( + IDictionary defaultHeaders, + IDictionary apiKey, + IDictionary apiKeyPrefix, + string basePath = "http://petstore.swagger.io/v2") : this() + { + if (string.IsNullOrWhiteSpace(basePath)) + throw new ArgumentException("The provided basePath is invalid.", "basePath"); + if (defaultHeaders == null) + throw new ArgumentNullException("defaultHeaders"); + if (apiKey == null) + throw new ArgumentNullException("apiKey"); + if (apiKeyPrefix == null) + throw new ArgumentNullException("apiKeyPrefix"); + + BasePath = basePath; + + foreach (var keyValuePair in defaultHeaders) + { + DefaultHeaders.Add(keyValuePair); + } + + foreach (var keyValuePair in apiKey) + { + ApiKey.Add(keyValuePair); + } + + foreach (var keyValuePair in apiKeyPrefix) + { + ApiKeyPrefix.Add(keyValuePair); + } + } + + #endregion Constructors + + #region Properties + + /// + /// Gets or sets the base path for API access. + /// + public virtual string BasePath { + get { return _basePath; } + set { _basePath = value; } + } + + /// + /// Gets or sets the default header. + /// + [Obsolete("Use DefaultHeaders instead.")] + public virtual IDictionary DefaultHeader + { + get + { + return DefaultHeaders; + } + set + { + DefaultHeaders = value; + } + } + + /// + /// Gets or sets the default headers. + /// + public virtual IDictionary DefaultHeaders { get; set; } + + /// + /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. + /// + public virtual int Timeout { get; set; } + + /// + /// Gets or sets the proxy + /// + /// Proxy. + public virtual WebProxy Proxy { get; set; } + + /// + /// Gets or sets the HTTP user agent. + /// + /// Http user agent. + public virtual string UserAgent { get; set; } + + /// + /// Gets or sets the username (HTTP basic authentication). + /// + /// The username. + public virtual string Username { get; set; } + + /// + /// Gets or sets the password (HTTP basic authentication). + /// + /// The password. + public virtual string Password { get; set; } + + /// + /// Gets the API key with prefix. + /// + /// API key identifier (authentication scheme). + /// API key with prefix. + public string GetApiKeyWithPrefix(string apiKeyIdentifier) + { + string apiKeyValue; + ApiKey.TryGetValue(apiKeyIdentifier, out apiKeyValue); + string apiKeyPrefix; + if (ApiKeyPrefix.TryGetValue(apiKeyIdentifier, out apiKeyPrefix)) + { + return apiKeyPrefix + " " + apiKeyValue; + } + + return apiKeyValue; + } + + /// + /// Gets or sets certificate collection to be sent with requests. + /// + /// X509 Certificate collection. + public X509CertificateCollection ClientCertificates { get; set; } + + /// + /// Gets or sets the access token for OAuth2 authentication. + /// + /// This helper property simplifies code generation. + /// + /// The access token. + public virtual string AccessToken { get; set; } + + /// + /// Gets or sets the temporary folder path to store the files downloaded from the server. + /// + /// Folder path. + public virtual string TempFolderPath + { + get { return _tempFolderPath; } + + set + { + if (string.IsNullOrEmpty(value)) + { + _tempFolderPath = Path.GetTempPath(); + return; + } + + // create the directory if it does not exist + if (!Directory.Exists(value)) + { + Directory.CreateDirectory(value); + } + + // check if the path contains directory separator at the end + if (value[value.Length - 1] == Path.DirectorySeparatorChar) + { + _tempFolderPath = value; + } + else + { + _tempFolderPath = value + Path.DirectorySeparatorChar; + } + } + } + + /// + /// Gets or sets the date time format used when serializing in the ApiClient + /// By default, it's set to ISO 8601 - "o", for others see: + /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx + /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx + /// No validation is done to ensure that the string you're providing is valid + /// + /// The DateTimeFormat string + public virtual string DateTimeFormat + { + get { return _dateTimeFormat; } + set + { + if (string.IsNullOrEmpty(value)) + { + // Never allow a blank or null string, go back to the default + _dateTimeFormat = ISO8601_DATETIME_FORMAT; + return; + } + + // Caution, no validation when you choose date time format other than ISO 8601 + // Take a look at the above links + _dateTimeFormat = value; + } + } + + /// + /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + /// + /// Whatever you set here will be prepended to the value defined in AddApiKey. + /// + /// An example invocation here might be: + /// + /// ApiKeyPrefix["Authorization"] = "Bearer"; + /// + /// … where ApiKey["Authorization"] would then be used to set the value of your bearer token. + /// + /// + /// OAuth2 workflows should set tokens via AccessToken. + /// + /// + /// The prefix of the API key. + public virtual IDictionary ApiKeyPrefix + { + get { return _apiKeyPrefix; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKeyPrefix collection may not be null."); + } + _apiKeyPrefix = value; + } + } + + /// + /// Gets or sets the API key based on the authentication name. + /// + /// The API key. + public virtual IDictionary ApiKey + { + get { return _apiKey; } + set + { + if (value == null) + { + throw new InvalidOperationException("ApiKey collection may not be null."); + } + _apiKey = value; + } + } + + /// + /// Gets or sets the servers. + /// + /// The servers. + public virtual IList> Servers + { + get { return _servers; } + set + { + if (value == null) + { + throw new InvalidOperationException("Servers may not be null."); + } + _servers = value; + } + } + + /// + /// Returns URL based on server settings without providing values + /// for the variables + /// + /// Array index of the server settings. + /// The server URL. + public string GetServerUrl(int index) + { + return GetServerUrl(index, null); + } + + /// + /// Returns URL based on server settings. + /// + /// Array index of the server settings. + /// Dictionary of the variables and the corresponding values. + /// The server URL. + public string GetServerUrl(int index, Dictionary inputVariables) + { + if (index < 0 || index >= Servers.Count) + { + throw new InvalidOperationException($"Invalid index {index} when selecting the server. Must be less than {Servers.Count}."); + } + + if (inputVariables == null) + { + inputVariables = new Dictionary(); + } + + IReadOnlyDictionary server = Servers[index]; + string url = (string)server["url"]; + + // go through variable and assign a value + foreach (KeyValuePair variable in (IReadOnlyDictionary)server["variables"]) + { + + IReadOnlyDictionary serverVariables = (IReadOnlyDictionary)(variable.Value); + + if (inputVariables.ContainsKey(variable.Key)) + { + if (((List)serverVariables["enum_values"]).Contains(inputVariables[variable.Key])) + { + url = url.Replace("{" + variable.Key + "}", inputVariables[variable.Key]); + } + else + { + throw new InvalidOperationException($"The variable `{variable.Key}` in the server URL has invalid value #{inputVariables[variable.Key]}. Must be {(List)serverVariables["enum_values"]}"); + } + } + else + { + // use defualt value + url = url.Replace("{" + variable.Key + "}", (string)serverVariables["default_value"]); + } + } + + return url; + } + + #endregion Properties + + #region Methods + + /// + /// Returns a string with essential information for debugging. + /// + public static string ToDebugReport() + { + string report = "C# SDK (Org.OpenAPITools) Debug Report:\n"; + report += " OS: " + System.Environment.OSVersion + "\n"; + report += " .NET Framework Version: " + System.Environment.Version + "\n"; + report += " Version of the API: 1.0.0\n"; + report += " SDK Package Version: 1.0.0\n"; + + return report; + } + + /// + /// Add Api Key Header. + /// + /// Api Key name. + /// Api Key value. + /// + public void AddApiKey(string key, string value) + { + ApiKey[key] = value; + } + + /// + /// Sets the API key prefix. + /// + /// Api Key name. + /// Api Key value. + public void AddApiKeyPrefix(string key, string value) + { + ApiKeyPrefix[key] = value; + } + + #endregion Methods + + #region Static Members + /// + /// Merge configurations. + /// + /// First configuration. + /// Second configuration. + /// Merged configuration. + public static IReadableConfiguration MergeConfigurations(IReadableConfiguration first, IReadableConfiguration second) + { + if (second == null) return first ?? GlobalConfiguration.Instance; + + Dictionary apiKey = first.ApiKey.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + Dictionary apiKeyPrefix = first.ApiKeyPrefix.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + Dictionary defaultHeaders = first.DefaultHeaders.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + + foreach (var kvp in second.ApiKey) apiKey[kvp.Key] = kvp.Value; + foreach (var kvp in second.ApiKeyPrefix) apiKeyPrefix[kvp.Key] = kvp.Value; + foreach (var kvp in second.DefaultHeaders) defaultHeaders[kvp.Key] = kvp.Value; + + var config = new Configuration + { + ApiKey = apiKey, + ApiKeyPrefix = apiKeyPrefix, + DefaultHeaders = defaultHeaders, + BasePath = second.BasePath ?? first.BasePath, + Timeout = second.Timeout, + Proxy = second.Proxy ?? first.Proxy, + UserAgent = second.UserAgent ?? first.UserAgent, + Username = second.Username ?? first.Username, + Password = second.Password ?? first.Password, + AccessToken = second.AccessToken ?? first.AccessToken, + TempFolderPath = second.TempFolderPath ?? first.TempFolderPath, + DateTimeFormat = second.DateTimeFormat ?? first.DateTimeFormat + }; + return config; + } + #endregion Static Members + } +} diff --git a/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/ExceptionFactory.cs b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/ExceptionFactory.cs new file mode 100644 index 000000000000..6ae2a10aae40 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/ExceptionFactory.cs @@ -0,0 +1,22 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// A delegate to ExceptionFactory method + /// + /// Method name + /// Response + /// Exceptions + public delegate Exception ExceptionFactory(string methodName, IApiResponse response); +} diff --git a/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/GlobalConfiguration.cs b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/GlobalConfiguration.cs new file mode 100644 index 000000000000..e1c00c89a03f --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/GlobalConfiguration.cs @@ -0,0 +1,67 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// provides a compile-time extension point for globally configuring + /// API Clients. + /// + /// + /// A customized implementation via partial class may reside in another file and may + /// be excluded from automatic generation via a .openapi-generator-ignore file. + /// + public partial class GlobalConfiguration : Configuration + { + #region Private Members + + private static readonly object GlobalConfigSync = new { }; + private static IReadableConfiguration _globalConfiguration; + + #endregion Private Members + + #region Constructors + + /// + private GlobalConfiguration() + { + } + + /// + public GlobalConfiguration(IDictionary defaultHeader, IDictionary apiKey, IDictionary apiKeyPrefix, string basePath = "http://localhost:3000/api") : base(defaultHeader, apiKey, apiKeyPrefix, basePath) + { + } + + static GlobalConfiguration() + { + Instance = new GlobalConfiguration(); + } + + #endregion Constructors + + /// + /// Gets or sets the default Configuration. + /// + /// Configuration. + public static IReadableConfiguration Instance + { + get { return _globalConfiguration; } + set + { + lock (GlobalConfigSync) + { + _globalConfiguration = value; + } + } + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/HttpMethod.cs b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/HttpMethod.cs new file mode 100644 index 000000000000..1dd692d8cfb2 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/HttpMethod.cs @@ -0,0 +1,33 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +namespace Org.OpenAPITools.Client +{ + /// + /// Http methods supported by swagger + /// + public enum HttpMethod + { + /// HTTP GET request. + Get, + /// HTTP POST request. + Post, + /// HTTP PUT request. + Put, + /// HTTP DELETE request. + Delete, + /// HTTP HEAD request. + Head, + /// HTTP OPTIONS request. + Options, + /// HTTP PATCH request. + Patch + } +} diff --git a/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/IApiAccessor.cs b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/IApiAccessor.cs new file mode 100644 index 000000000000..c8a78e995ce9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/IApiAccessor.cs @@ -0,0 +1,37 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; + +namespace Org.OpenAPITools.Client +{ + /// + /// Represents configuration aspects required to interact with the API endpoints. + /// + public interface IApiAccessor + { + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + IReadableConfiguration Configuration { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + string GetBasePath(); + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + ExceptionFactory ExceptionFactory { get; set; } + } +} diff --git a/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/IAsynchronousClient.cs b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/IAsynchronousClient.cs new file mode 100644 index 000000000000..066d9b39482a --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/IAsynchronousClient.cs @@ -0,0 +1,100 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Threading.Tasks; + +namespace Org.OpenAPITools.Client +{ + /// + /// Contract for Asynchronous RESTful API interactions. + /// + /// This interface allows consumers to provide a custom API accessor client. + /// + public interface IAsynchronousClient + { + /// + /// Executes a non-blocking call to some using the GET http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the POST http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the PUT http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the DELETE http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the HEAD http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the OPTIONS http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Executes a non-blocking call to some using the PATCH http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// Cancellation Token to cancel the request. + /// The return type. + /// A task eventually representing the response data, decorated with + Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } +} diff --git a/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/IReadableConfiguration.cs b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/IReadableConfiguration.cs new file mode 100644 index 000000000000..00bedba8ee28 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/IReadableConfiguration.cs @@ -0,0 +1,115 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.Net; +using System.Security.Cryptography.X509Certificates; + +namespace Org.OpenAPITools.Client +{ + /// + /// Represents a readable-only configuration contract. + /// + public interface IReadableConfiguration + { + /// + /// Gets the access token. + /// + /// Access token. + string AccessToken { get; } + + /// + /// Gets the API key. + /// + /// API key. + IDictionary ApiKey { get; } + + /// + /// Gets the API key prefix. + /// + /// API key prefix. + IDictionary ApiKeyPrefix { get; } + + /// + /// Gets the base path. + /// + /// Base path. + string BasePath { get; } + + /// + /// Gets the date time format. + /// + /// Date time foramt. + string DateTimeFormat { get; } + + /// + /// Gets the default header. + /// + /// Default header. + [Obsolete("Use DefaultHeaders instead.")] + IDictionary DefaultHeader { get; } + + /// + /// Gets the default headers. + /// + /// Default headers. + IDictionary DefaultHeaders { get; } + + /// + /// Gets the temp folder path. + /// + /// Temp folder path. + string TempFolderPath { get; } + + /// + /// Gets the HTTP connection timeout (in milliseconds) + /// + /// HTTP connection timeout. + int Timeout { get; } + + /// + /// Gets the proxy. + /// + /// Proxy. + WebProxy Proxy { get; } + + /// + /// Gets the user agent. + /// + /// User agent. + string UserAgent { get; } + + /// + /// Gets the username. + /// + /// Username. + string Username { get; } + + /// + /// Gets the password. + /// + /// Password. + string Password { get; } + + /// + /// Gets the API key with prefix. + /// + /// API key identifier (authentication scheme). + /// API key with prefix. + string GetApiKeyWithPrefix(string apiKeyIdentifier); + + /// + /// Gets certificate collection to be sent with requests. + /// + /// X509 Certificate collection. + X509CertificateCollection ClientCertificates { get; } + } +} diff --git a/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/ISynchronousClient.cs b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/ISynchronousClient.cs new file mode 100644 index 000000000000..3910f6d68ce1 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/ISynchronousClient.cs @@ -0,0 +1,93 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.IO; + +namespace Org.OpenAPITools.Client +{ + /// + /// Contract for Synchronous RESTful API interactions. + /// + /// This interface allows consumers to provide a custom API accessor client. + /// + public interface ISynchronousClient + { + /// + /// Executes a blocking call to some using the GET http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the POST http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the PUT http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the DELETE http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the HEAD http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the OPTIONS http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null); + + /// + /// Executes a blocking call to some using the PATCH http verb. + /// + /// The relative path to invoke. + /// The request parameters to pass along to the client. + /// Per-request configurable settings. + /// The return type. + /// The response data, decorated with + ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null); + } +} diff --git a/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/Multimap.cs b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/Multimap.cs new file mode 100644 index 000000000000..966d634a50b8 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/Multimap.cs @@ -0,0 +1,295 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Org.OpenAPITools.Client +{ + /// + /// A dictionary in which one key has many associated values. + /// + /// The type of the key + /// The type of the value associated with the key. + public class Multimap : IDictionary> + { + #region Private Fields + + private readonly Dictionary> _dictionary; + + #endregion Private Fields + + #region Constructors + + /// + /// Empty Constructor. + /// + public Multimap() + { + _dictionary = new Dictionary>(); + } + + /// + /// Constructor with comparer. + /// + /// + public Multimap(IEqualityComparer comparer) + { + _dictionary = new Dictionary>(comparer); + } + + #endregion Constructors + + #region Enumerators + + /// + /// To get the enumerator. + /// + /// Enumerator + public IEnumerator>> GetEnumerator() + { + return _dictionary.GetEnumerator(); + } + + /// + /// To get the enumerator. + /// + /// Enumerator + IEnumerator IEnumerable.GetEnumerator() + { + return _dictionary.GetEnumerator(); + } + + #endregion Enumerators + + #region Public Members + /// + /// Add values to Multimap + /// + /// Key value pair + public void Add(KeyValuePair> item) + { + if (!TryAdd(item.Key, item.Value)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + + /// + /// Add Multimap to Multimap + /// + /// Multimap + public void Add(Multimap multimap) + { + foreach (var item in multimap) + { + if (!TryAdd(item.Key, item.Value)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + } + + /// + /// Clear Multimap + /// + public void Clear() + { + _dictionary.Clear(); + } + + /// + /// Determines whether Multimap contains the specified item. + /// + /// Key value pair + /// Method needs to be implemented + /// true if the Multimap contains the item; otherwise, false. + public bool Contains(KeyValuePair> item) + { + throw new NotImplementedException(); + } + + /// + /// Copy items of the Multimap to an array, + /// starting at a particular array index. + /// + /// The array that is the destination of the items copied + /// from Multimap. The array must have zero-based indexing. + /// The zero-based index in array at which copying begins. + /// Method needs to be implemented + public void CopyTo(KeyValuePair>[] array, int arrayIndex) + { + throw new NotImplementedException(); + } + + /// + /// Removes the specified item from the Multimap. + /// + /// Key value pair + /// true if the item is successfully removed; otherwise, false. + /// Method needs to be implemented + public bool Remove(KeyValuePair> item) + { + throw new NotImplementedException(); + } + + /// + /// Gets the number of items contained in the Multimap. + /// + public int Count => _dictionary.Count; + + /// + /// Gets a value indicating whether the Multimap is read-only. + /// + public bool IsReadOnly => false; + + /// + /// Adds an item with the provided key and value to the Multimap. + /// + /// The object to use as the key of the item to add. + /// The object to use as the value of the item to add. + /// Thrown when couldn't add the value to Multimap. + public void Add(TKey key, IList value) + { + if (value != null && value.Count > 0) + { + if (_dictionary.TryGetValue(key, out var list)) + { + foreach (var k in value) list.Add(k); + } + else + { + list = new List(value); + if (!TryAdd(key, list)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + } + } + + /// + /// Determines whether the Multimap contains an item with the specified key. + /// + /// The key to locate in the Multimap. + /// true if the Multimap contains an item with + /// the key; otherwise, false. + public bool ContainsKey(TKey key) + { + return _dictionary.ContainsKey(key); + } + + /// + /// Removes item with the specified key from the Multimap. + /// + /// The key to locate in the Multimap. + /// true if the item is successfully removed; otherwise, false. + public bool Remove(TKey key) + { + return TryRemove(key, out var _); + } + + /// + /// Gets the value associated with the specified key. + /// + /// The key whose value to get. + /// When this method returns, the value associated with the specified key, if the + /// key is found; otherwise, the default value for the type of the value parameter. + /// This parameter is passed uninitialized. + /// true if the object that implements Multimap contains + /// an item with the specified key; otherwise, false. + public bool TryGetValue(TKey key, out IList value) + { + return _dictionary.TryGetValue(key, out value); + } + + /// + /// Gets or sets the item with the specified key. + /// + /// The key of the item to get or set. + /// The value of the specified key. + public IList this[TKey key] + { + get => _dictionary[key]; + set => _dictionary[key] = value; + } + + /// + /// Gets a System.Collections.Generic.ICollection containing the keys of the Multimap. + /// + public ICollection Keys => _dictionary.Keys; + + /// + /// Gets a System.Collections.Generic.ICollection containing the values of the Multimap. + /// + public ICollection> Values => _dictionary.Values; + + /// + /// Copy the items of the Multimap to an System.Array, + /// starting at a particular System.Array index. + /// + /// The one-dimensional System.Array that is the destination of the items copied + /// from Multimap. The System.Array must have zero-based indexing. + /// The zero-based index in array at which copying begins. + public void CopyTo(Array array, int index) + { + ((ICollection)_dictionary).CopyTo(array, index); + } + + /// + /// Adds an item with the provided key and value to the Multimap. + /// + /// The object to use as the key of the item to add. + /// The object to use as the value of the item to add. + /// Thrown when couldn't add value to Multimap. + public void Add(TKey key, TValue value) + { + if (value != null) + { + if (_dictionary.TryGetValue(key, out var list)) + { + list.Add(value); + } + else + { + list = new List { value }; + if (!TryAdd(key, list)) + throw new InvalidOperationException("Could not add value to Multimap."); + } + } + } + + #endregion Public Members + + #region Private Members + + /** + * Helper method to encapsulate generator differences between dictionary types. + */ + private bool TryRemove(TKey key, out IList value) + { + _dictionary.TryGetValue(key, out value); + return _dictionary.Remove(key); + } + + /** + * Helper method to encapsulate generator differences between dictionary types. + */ + private bool TryAdd(TKey key, IList value) + { + try + { + _dictionary.Add(key, value); + } + catch (ArgumentException) + { + return false; + } + + return true; + } + #endregion Private Members + } +} diff --git a/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs new file mode 100644 index 000000000000..dcc79edd9446 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs @@ -0,0 +1,29 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using Newtonsoft.Json.Converters; + +namespace Org.OpenAPITools.Client +{ + /// + /// Formatter for 'date' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + public class OpenAPIDateConverter : IsoDateTimeConverter + { + /// + /// Initializes a new instance of the class. + /// + public OpenAPIDateConverter() + { + // full-date = date-fullyear "-" date-month "-" date-mday + DateTimeFormat = "yyyy-MM-dd"; + } + } +} diff --git a/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/RequestOptions.cs b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/RequestOptions.cs new file mode 100644 index 000000000000..c6b3ccc38f22 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/RequestOptions.cs @@ -0,0 +1,74 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; + +namespace Org.OpenAPITools.Client +{ + /// + /// A container for generalized request inputs. This type allows consumers to extend the request functionality + /// by abstracting away from the default (built-in) request framework (e.g. RestSharp). + /// + public class RequestOptions + { + /// + /// Parameters to be bound to path parts of the Request's URL + /// + public Dictionary PathParameters { get; set; } + + /// + /// Query parameters to be applied to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap QueryParameters { get; set; } + + /// + /// Header parameters to be applied to to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap HeaderParameters { get; set; } + + /// + /// Form parameters to be sent along with the request. + /// + public Dictionary FormParameters { get; set; } + + /// + /// File parameters to be sent along with the request. + /// + public Dictionary FileParameters { get; set; } + + /// + /// Cookies to be sent along with the request. + /// + public List Cookies { get; set; } + + /// + /// Any data associated with a request body. + /// + public Object Data { get; set; } + + /// + /// Constructs a new instance of + /// + public RequestOptions() + { + PathParameters = new Dictionary(); + QueryParameters = new Multimap(); + HeaderParameters = new Multimap(); + FormParameters = new Dictionary(); + FileParameters = new Dictionary(); + Cookies = new List(); + } + } +} diff --git a/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/RetryConfiguration.cs b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/RetryConfiguration.cs new file mode 100644 index 000000000000..c93633a36d93 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Client/RetryConfiguration.cs @@ -0,0 +1,21 @@ +using Polly; +using RestSharp; + +namespace Org.OpenAPITools.Client +{ + /// + /// Configuration class to set the polly retry policies to be applied to the requests. + /// + public class RetryConfiguration + { + /// + /// Retry policy + /// + public static Policy RetryPolicy { get; set; } + + /// + /// Async retry policy + /// + public static AsyncPolicy AsyncRetryPolicy { get; set; } + } +} diff --git a/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Models/AbstractOpenAPISchema.cs b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Models/AbstractOpenAPISchema.cs new file mode 100644 index 000000000000..38e023162dd9 --- /dev/null +++ b/samples/client/petstore/csharp-netcore-functions/src/Org.OpenAPITools/Models/AbstractOpenAPISchema.cs @@ -0,0 +1,76 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; + +namespace Org.OpenAPITools.Models +{ + /// + /// Abstract base class for oneOf, anyOf schemas in the OpenAPI specification + /// + public abstract partial class AbstractOpenAPISchema + { + /// + /// Custom JSON serializer + /// + static public readonly JsonSerializerSettings SerializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + MissingMemberHandling = MissingMemberHandling.Error, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Custom JSON serializer for objects with additional properties + /// + static public readonly JsonSerializerSettings AdditionalPropertiesSerializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + MissingMemberHandling = MissingMemberHandling.Ignore, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Gets or Sets the actual instance + /// + public abstract Object ActualInstance { get; set; } + + /// + /// Gets or Sets IsNullable to indicate whether the instance is nullable + /// + public bool IsNullable { get; protected set; } + + /// + /// Gets or Sets the schema type, which can be either `oneOf` or `anyOf` + /// + public string SchemaType { get; protected set; } + + /// + /// Converts the instance into JSON string. + /// + public abstract string ToJson(); + } +} From 676da0e77831bb55d637324769976bff8e0da17a Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 7 Dec 2021 00:11:40 +0800 Subject: [PATCH 071/117] update samples --- .../java/okhttp-gson-nextgen/.openapi-generator/VERSION | 2 +- .../petstore/swift5/frozenEnums/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/VERSION b/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/VERSION +++ b/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/frozenEnums/.openapi-generator/VERSION b/samples/client/petstore/swift5/frozenEnums/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/swift5/frozenEnums/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/frozenEnums/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 4077803655c0..0984c4c1ad21 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file From 000a18d3b98e26ccfc6d74148d3276e1a6d641da Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 7 Dec 2021 15:11:06 +0800 Subject: [PATCH 072/117] [java][okhttp-gson-nextgen] Better null handling in oneOf, anyOf model (#11056) * better null handling in oneOf model * update anyof with better null handling * add null test --- .../libraries/okhttp-gson-nextgen/anyof_model.mustache | 5 +++++ .../libraries/okhttp-gson-nextgen/oneof_model.mustache | 5 +++++ .../src/main/java/org/openapitools/client/model/Fruit.java | 5 +++++ .../main/java/org/openapitools/client/model/FruitReq.java | 5 +++++ .../main/java/org/openapitools/client/model/GmFruit.java | 5 +++++ .../main/java/org/openapitools/client/model/Mammal.java | 5 +++++ .../java/org/openapitools/client/model/NullableShape.java | 5 +++++ .../src/main/java/org/openapitools/client/model/Pig.java | 5 +++++ .../java/org/openapitools/client/model/Quadrilateral.java | 5 +++++ .../src/main/java/org/openapitools/client/model/Shape.java | 5 +++++ .../java/org/openapitools/client/model/ShapeOrNull.java | 5 +++++ .../main/java/org/openapitools/client/model/Triangle.java | 5 +++++ .../src/test/java/org/openapitools/client/JSONTest.java | 7 +++++++ 13 files changed, 67 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache index a4c5c86ca2de..04f8a08934c0 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache @@ -50,6 +50,11 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im return (TypeAdapter) new TypeAdapter<{{classname}}>() { @Override public void write(JsonWriter out, {{classname}} value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + {{#anyOf}} // check if the actual instance is of the type `{{.}}` if (value.getActualInstance() instanceof {{.}}) { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache index 0b7c8b6369e1..84c4846dc503 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache @@ -50,6 +50,11 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im return (TypeAdapter) new TypeAdapter<{{classname}}>() { @Override public void write(JsonWriter out, {{classname}} value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + {{#oneOf}} // check if the actual instance is of the type `{{.}}` if (value.getActualInstance() instanceof {{.}}) { diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java index 6f907a92f0ae..4b162d79aec8 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java @@ -78,6 +78,11 @@ public TypeAdapter create(Gson gson, TypeToken type) { return (TypeAdapter) new TypeAdapter() { @Override public void write(JsonWriter out, Fruit value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + // check if the actual instance is of the type `Apple` if (value.getActualInstance() instanceof Apple) { JsonObject obj = adapterApple.toJsonTree((Apple)value.getActualInstance()).getAsJsonObject(); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java index 303049b6007b..13436b1d6e32 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java @@ -78,6 +78,11 @@ public TypeAdapter create(Gson gson, TypeToken type) { return (TypeAdapter) new TypeAdapter() { @Override public void write(JsonWriter out, FruitReq value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + // check if the actual instance is of the type `AppleReq` if (value.getActualInstance() instanceof AppleReq) { JsonObject obj = adapterAppleReq.toJsonTree((AppleReq)value.getActualInstance()).getAsJsonObject(); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java index 441f0330de61..1d07fdfd6ba7 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java @@ -78,6 +78,11 @@ public TypeAdapter create(Gson gson, TypeToken type) { return (TypeAdapter) new TypeAdapter() { @Override public void write(JsonWriter out, GmFruit value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + // check if the actual instance is of the type `Apple` if (value.getActualInstance() instanceof Apple) { JsonObject obj = adapterApple.toJsonTree((Apple)value.getActualInstance()).getAsJsonObject(); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java index 466644f4b7c8..fcd1935126bf 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java @@ -79,6 +79,11 @@ public TypeAdapter create(Gson gson, TypeToken type) { return (TypeAdapter) new TypeAdapter() { @Override public void write(JsonWriter out, Mammal value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + // check if the actual instance is of the type `Pig` if (value.getActualInstance() instanceof Pig) { JsonObject obj = adapterPig.toJsonTree((Pig)value.getActualInstance()).getAsJsonObject(); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java index 67b42a305722..bb11f4eb0e99 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java @@ -77,6 +77,11 @@ public TypeAdapter create(Gson gson, TypeToken type) { return (TypeAdapter) new TypeAdapter() { @Override public void write(JsonWriter out, NullableShape value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + // check if the actual instance is of the type `Quadrilateral` if (value.getActualInstance() instanceof Quadrilateral) { JsonObject obj = adapterQuadrilateral.toJsonTree((Quadrilateral)value.getActualInstance()).getAsJsonObject(); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java index ea0b58cbf909..9e2015ba6727 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java @@ -77,6 +77,11 @@ public TypeAdapter create(Gson gson, TypeToken type) { return (TypeAdapter) new TypeAdapter() { @Override public void write(JsonWriter out, Pig value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + // check if the actual instance is of the type `BasquePig` if (value.getActualInstance() instanceof BasquePig) { JsonObject obj = adapterBasquePig.toJsonTree((BasquePig)value.getActualInstance()).getAsJsonObject(); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java index b91dda2eece6..04a317679bd8 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java @@ -77,6 +77,11 @@ public TypeAdapter create(Gson gson, TypeToken type) { return (TypeAdapter) new TypeAdapter() { @Override public void write(JsonWriter out, Quadrilateral value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + // check if the actual instance is of the type `ComplexQuadrilateral` if (value.getActualInstance() instanceof ComplexQuadrilateral) { JsonObject obj = adapterComplexQuadrilateral.toJsonTree((ComplexQuadrilateral)value.getActualInstance()).getAsJsonObject(); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java index df7274029b25..babaf6be36fb 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java @@ -77,6 +77,11 @@ public TypeAdapter create(Gson gson, TypeToken type) { return (TypeAdapter) new TypeAdapter() { @Override public void write(JsonWriter out, Shape value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + // check if the actual instance is of the type `Quadrilateral` if (value.getActualInstance() instanceof Quadrilateral) { JsonObject obj = adapterQuadrilateral.toJsonTree((Quadrilateral)value.getActualInstance()).getAsJsonObject(); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java index 7c6f090482a4..6b413bce9a38 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java @@ -77,6 +77,11 @@ public TypeAdapter create(Gson gson, TypeToken type) { return (TypeAdapter) new TypeAdapter() { @Override public void write(JsonWriter out, ShapeOrNull value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + // check if the actual instance is of the type `Quadrilateral` if (value.getActualInstance() instanceof Quadrilateral) { JsonObject obj = adapterQuadrilateral.toJsonTree((Quadrilateral)value.getActualInstance()).getAsJsonObject(); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java index e9e70e6be716..f9a3276d9b1a 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java @@ -79,6 +79,11 @@ public TypeAdapter create(Gson gson, TypeToken type) { return (TypeAdapter) new TypeAdapter() { @Override public void write(JsonWriter out, Triangle value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + // check if the actual instance is of the type `EquilateralTriangle` if (value.getActualInstance() instanceof EquilateralTriangle) { JsonObject obj = adapterEquilateralTriangle.toJsonTree((EquilateralTriangle)value.getActualInstance()).getAsJsonObject(); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java index c6b3c2345dd8..4c3fbb12ec57 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java @@ -314,6 +314,13 @@ public void testOneOfSchemaWithoutDiscriminator() throws Exception { assertEquals(inst2.getMealy(), false); assertEquals(json.getGson().toJson(inst2), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); } + { + // test to ensure the oneOf object can be serialized to "null" correctly + FruitReq o = new FruitReq(); + assertEquals(o.getActualInstance(), null); + assertEquals(json.getGson().toJson(o), "null"); + assertEquals(json.getGson().toJson(null), "null"); + } { // Same test, but this time with additional (undeclared) properties. // Since FruitReq has additionalProperties: false, deserialization should fail. From 192126be6b90f58f512cda583aa830fec8d07be9 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 7 Dec 2021 16:22:46 +0800 Subject: [PATCH 073/117] [java][okhttp-gson-next-gen] fix serialization, add tests (#11057) * fix serialization, add tests * add new files --- .../okhttp-gson-nextgen/anyof_model.mustache | 1 + .../okhttp-gson-nextgen/oneof_model.mustache | 1 + ...sting-with-http-signature-okhttp-gson.yaml | 6 + .../.openapi-generator/FILES | 2 + .../java/okhttp-gson-nextgen/README.md | 1 + .../java/okhttp-gson-nextgen/api/openapi.yaml | 6 + .../java/okhttp-gson-nextgen/docs/GmFruit.md | 2 +- .../okhttp-gson-nextgen/docs/Pineapple.md | 13 ++ .../java/org/openapitools/client/JSON.java | 1 + .../org/openapitools/client/model/Fruit.java | 2 + .../openapitools/client/model/FruitReq.java | 2 + .../openapitools/client/model/GmFruit.java | 56 +++++- .../org/openapitools/client/model/Mammal.java | 3 + .../client/model/NullableShape.java | 2 + .../org/openapitools/client/model/Pig.java | 2 + .../openapitools/client/model/Pineapple.java | 162 ++++++++++++++++++ .../client/model/Quadrilateral.java | 2 + .../org/openapitools/client/model/Shape.java | 2 + .../client/model/ShapeOrNull.java | 2 + .../openapitools/client/model/Triangle.java | 3 + .../org/openapitools/client/JSONTest.java | 31 ++++ .../client/model/PineappleTest.java | 51 ++++++ 22 files changed, 347 insertions(+), 6 deletions(-) create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Pineapple.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pineapple.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/PineappleTest.java diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache index 04f8a08934c0..e1727ddc047e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache @@ -60,6 +60,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im if (value.getActualInstance() instanceof {{.}}) { JsonObject obj = adapter{{.}}.toJsonTree(({{.}})value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } {{/anyOf}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache index 84c4846dc503..48da5e472c3e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache @@ -60,6 +60,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im if (value.getActualInstance() instanceof {{.}}) { JsonObject obj = adapter{{.}}.toJsonTree(({{.}})value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } {{/oneOf}} diff --git a/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml b/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml index 92b32a47679d..bf85279739ee 100644 --- a/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml @@ -1888,6 +1888,11 @@ components: type: string pattern: /^[A-Z\s]*$/i nullable: true + pineapple: + type: object + properties: + origin: + type: string banana: type: object properties: @@ -1950,6 +1955,7 @@ components: color: type: string anyOf: + - $ref: '#/components/schemas/pineapple' - $ref: '#/components/schemas/apple' - $ref: '#/components/schemas/banana' additionalProperties: false diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/FILES b/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/FILES index 39148a7980a7..29da59bcd3e4 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/FILES +++ b/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/FILES @@ -66,6 +66,7 @@ docs/ParentPet.md docs/Pet.md docs/PetApi.md docs/Pig.md +docs/Pineapple.md docs/Quadrilateral.md docs/QuadrilateralInterface.md docs/ReadOnlyFirst.md @@ -178,6 +179,7 @@ src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java src/main/java/org/openapitools/client/model/ParentPet.java src/main/java/org/openapitools/client/model/Pet.java src/main/java/org/openapitools/client/model/Pig.java +src/main/java/org/openapitools/client/model/Pineapple.java src/main/java/org/openapitools/client/model/Quadrilateral.java src/main/java/org/openapitools/client/model/QuadrilateralInterface.java src/main/java/org/openapitools/client/model/ReadOnlyFirst.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/README.md b/samples/client/petstore/java/okhttp-gson-nextgen/README.md index 6110aea0fa04..3a81849aa6fc 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/README.md +++ b/samples/client/petstore/java/okhttp-gson-nextgen/README.md @@ -213,6 +213,7 @@ Class | Method | HTTP request | Description - [ParentPet](docs/ParentPet.md) - [Pet](docs/Pet.md) - [Pig](docs/Pig.md) + - [Pineapple](docs/Pineapple.md) - [Quadrilateral](docs/Quadrilateral.md) - [QuadrilateralInterface](docs/QuadrilateralInterface.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml b/samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml index 8e64d05d5f2f..e2ecf87a054d 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml +++ b/samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml @@ -2053,6 +2053,11 @@ components: pattern: /^[A-Z\s]*$/i type: string type: object + pineapple: + properties: + origin: + type: string + type: object banana: properties: lengthCm: @@ -2113,6 +2118,7 @@ components: gmFruit: additionalProperties: false anyOf: + - $ref: '#/components/schemas/pineapple' - $ref: '#/components/schemas/apple' - $ref: '#/components/schemas/banana' properties: diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/GmFruit.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/GmFruit.md index 1536d689689e..d91eec57f89b 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/GmFruit.md +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/GmFruit.md @@ -8,8 +8,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **color** | **String** | | [optional] -**cultivar** | **String** | | [optional] **origin** | **String** | | [optional] +**cultivar** | **String** | | [optional] **lengthCm** | **BigDecimal** | | [optional] diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Pineapple.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Pineapple.md new file mode 100644 index 000000000000..b7980a3b9526 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Pineapple.md @@ -0,0 +1,13 @@ + + +# Pineapple + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**origin** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java index 40146a3e6f5f..33e8ed752ef8 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java @@ -270,6 +270,7 @@ public JSON() { .registerTypeAdapterFactory(new org.openapitools.client.model.ParentPet.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.Pet.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.Pig.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Pineapple.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.Quadrilateral.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.QuadrilateralInterface.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.ReadOnlyFirst.CustomTypeAdapterFactory()) diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java index 4b162d79aec8..03436bd35b27 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java @@ -87,12 +87,14 @@ public void write(JsonWriter out, Fruit value) throws IOException { if (value.getActualInstance() instanceof Apple) { JsonObject obj = adapterApple.toJsonTree((Apple)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } // check if the actual instance is of the type `Banana` if (value.getActualInstance() instanceof Banana) { JsonObject obj = adapterBanana.toJsonTree((Banana)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: Apple, Banana"); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java index 13436b1d6e32..6a6ea0c82f60 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java @@ -87,12 +87,14 @@ public void write(JsonWriter out, FruitReq value) throws IOException { if (value.getActualInstance() instanceof AppleReq) { JsonObject obj = adapterAppleReq.toJsonTree((AppleReq)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } // check if the actual instance is of the type `BananaReq` if (value.getActualInstance() instanceof BananaReq) { JsonObject obj = adapterBananaReq.toJsonTree((BananaReq)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: AppleReq, BananaReq"); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java index 1d07fdfd6ba7..4085fd34c10d 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java @@ -26,6 +26,7 @@ import java.math.BigDecimal; import org.openapitools.client.model.Apple; import org.openapitools.client.model.Banana; +import org.openapitools.client.model.Pineapple; import javax.ws.rs.core.GenericType; @@ -74,6 +75,7 @@ public TypeAdapter create(Gson gson, TypeToken type) { final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter adapterApple = gson.getDelegateAdapter(this, TypeToken.get(Apple.class)); final TypeAdapter adapterBanana = gson.getDelegateAdapter(this, TypeToken.get(Banana.class)); + final TypeAdapter adapterPineapple = gson.getDelegateAdapter(this, TypeToken.get(Pineapple.class)); return (TypeAdapter) new TypeAdapter() { @Override @@ -87,15 +89,24 @@ public void write(JsonWriter out, GmFruit value) throws IOException { if (value.getActualInstance() instanceof Apple) { JsonObject obj = adapterApple.toJsonTree((Apple)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } // check if the actual instance is of the type `Banana` if (value.getActualInstance() instanceof Banana) { JsonObject obj = adapterBanana.toJsonTree((Banana)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `Pineapple` + if (value.getActualInstance() instanceof Pineapple) { + JsonObject obj = adapterPineapple.toJsonTree((Pineapple)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; } - throw new IOException("Failed to deserialize as the type doesn't match anyOf schemas: Apple, Banana"); + throw new IOException("Failed to deserialize as the type doesn't match anyOf schemas: Apple, Banana, Pineapple"); } @Override @@ -126,6 +137,18 @@ public GmFruit read(JsonReader in) throws IOException { log.log(Level.FINER, "Input data does not match schema 'Banana'", e); } + // deserialize Pineapple + try { + deserialized = gson.fromJson(in, Pineapple.class); + log.log(Level.FINER, "Input data matches schema 'Pineapple'"); + GmFruit ret = new GmFruit(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Pineapple'", e); + } + throw new IOException("Failed deserialization for GmFruit: no match found."); } }.nullSafe(); @@ -149,11 +172,18 @@ public GmFruit(Banana o) { setActualInstance(o); } + public GmFruit(Pineapple o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + static { schemas.put("Apple", new GenericType() { }); schemas.put("Banana", new GenericType() { }); + schemas.put("Pineapple", new GenericType() { + }); } @Override @@ -164,7 +194,7 @@ public Map getSchemas() { /** * Set the instance that matches the anyOf child schema, check * the instance parameter is valid against the anyOf child schemas: - * Apple, Banana + * Apple, Banana, Pineapple * * It could be an instance of the 'anyOf' schemas. * The anyOf child schemas may themselves be a composed schema (allOf, anyOf, anyOf). @@ -181,14 +211,19 @@ public void setActualInstance(Object instance) { return; } - throw new RuntimeException("Invalid instance type. Must be Apple, Banana"); + if (instance instanceof Pineapple) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Apple, Banana, Pineapple"); } /** * Get the actual instance, which can be the following: - * Apple, Banana + * Apple, Banana, Pineapple * - * @return The actual instance (Apple, Banana) + * @return The actual instance (Apple, Banana, Pineapple) */ @Override public Object getActualInstance() { @@ -217,5 +252,16 @@ public Banana getBanana() throws ClassCastException { return (Banana)super.getActualInstance(); } + /** + * Get the actual instance of `Pineapple`. If the actual instance is not `Pineapple`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Pineapple` + * @throws ClassCastException if the instance is not `Pineapple` + */ + public Pineapple getPineapple() throws ClassCastException { + return (Pineapple)super.getActualInstance(); + } + } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java index fcd1935126bf..1298c95a72c1 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java @@ -88,18 +88,21 @@ public void write(JsonWriter out, Mammal value) throws IOException { if (value.getActualInstance() instanceof Pig) { JsonObject obj = adapterPig.toJsonTree((Pig)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } // check if the actual instance is of the type `Whale` if (value.getActualInstance() instanceof Whale) { JsonObject obj = adapterWhale.toJsonTree((Whale)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } // check if the actual instance is of the type `Zebra` if (value.getActualInstance() instanceof Zebra) { JsonObject obj = adapterZebra.toJsonTree((Zebra)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: Pig, Whale, Zebra"); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java index bb11f4eb0e99..9da8d1671bf6 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java @@ -86,12 +86,14 @@ public void write(JsonWriter out, NullableShape value) throws IOException { if (value.getActualInstance() instanceof Quadrilateral) { JsonObject obj = adapterQuadrilateral.toJsonTree((Quadrilateral)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } // check if the actual instance is of the type `Triangle` if (value.getActualInstance() instanceof Triangle) { JsonObject obj = adapterTriangle.toJsonTree((Triangle)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: Quadrilateral, Triangle"); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java index 9e2015ba6727..5271006630cd 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java @@ -86,12 +86,14 @@ public void write(JsonWriter out, Pig value) throws IOException { if (value.getActualInstance() instanceof BasquePig) { JsonObject obj = adapterBasquePig.toJsonTree((BasquePig)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } // check if the actual instance is of the type `DanishPig` if (value.getActualInstance() instanceof DanishPig) { JsonObject obj = adapterDanishPig.toJsonTree((DanishPig)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: BasquePig, DanishPig"); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pineapple.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pineapple.java new file mode 100644 index 000000000000..284058b93a8d --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pineapple.java @@ -0,0 +1,162 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * Pineapple + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Pineapple { + public static final String SERIALIZED_NAME_ORIGIN = "origin"; + @SerializedName(SERIALIZED_NAME_ORIGIN) + private String origin; + + public Pineapple() { + } + + public Pineapple origin(String origin) { + + this.origin = origin; + return this; + } + + /** + * Get origin + * @return origin + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getOrigin() { + return origin; + } + + + public void setOrigin(String origin) { + this.origin = origin; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pineapple pineapple = (Pineapple) o; + return Objects.equals(this.origin, pineapple.origin); + } + + @Override + public int hashCode() { + return Objects.hash(origin); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pineapple {\n"); + sb.append(" origin: ").append(toIndentedString(origin)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("origin"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Pineapple.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Pineapple' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Pineapple.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Pineapple value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Pineapple read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!Pineapple.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Pineapple` properties"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java index 04a317679bd8..40785f69a73e 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java @@ -86,12 +86,14 @@ public void write(JsonWriter out, Quadrilateral value) throws IOException { if (value.getActualInstance() instanceof ComplexQuadrilateral) { JsonObject obj = adapterComplexQuadrilateral.toJsonTree((ComplexQuadrilateral)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } // check if the actual instance is of the type `SimpleQuadrilateral` if (value.getActualInstance() instanceof SimpleQuadrilateral) { JsonObject obj = adapterSimpleQuadrilateral.toJsonTree((SimpleQuadrilateral)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: ComplexQuadrilateral, SimpleQuadrilateral"); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java index babaf6be36fb..c6ebebc4a3fe 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java @@ -86,12 +86,14 @@ public void write(JsonWriter out, Shape value) throws IOException { if (value.getActualInstance() instanceof Quadrilateral) { JsonObject obj = adapterQuadrilateral.toJsonTree((Quadrilateral)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } // check if the actual instance is of the type `Triangle` if (value.getActualInstance() instanceof Triangle) { JsonObject obj = adapterTriangle.toJsonTree((Triangle)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: Quadrilateral, Triangle"); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java index 6b413bce9a38..ddb66a3ec635 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java @@ -86,12 +86,14 @@ public void write(JsonWriter out, ShapeOrNull value) throws IOException { if (value.getActualInstance() instanceof Quadrilateral) { JsonObject obj = adapterQuadrilateral.toJsonTree((Quadrilateral)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } // check if the actual instance is of the type `Triangle` if (value.getActualInstance() instanceof Triangle) { JsonObject obj = adapterTriangle.toJsonTree((Triangle)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: Quadrilateral, Triangle"); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java index f9a3276d9b1a..a0f2a5847f90 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java @@ -88,18 +88,21 @@ public void write(JsonWriter out, Triangle value) throws IOException { if (value.getActualInstance() instanceof EquilateralTriangle) { JsonObject obj = adapterEquilateralTriangle.toJsonTree((EquilateralTriangle)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } // check if the actual instance is of the type `IsoscelesTriangle` if (value.getActualInstance() instanceof IsoscelesTriangle) { JsonObject obj = adapterIsoscelesTriangle.toJsonTree((IsoscelesTriangle)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } // check if the actual instance is of the type `ScaleneTriangle` if (value.getActualInstance() instanceof ScaleneTriangle) { JsonObject obj = adapterScaleneTriangle.toJsonTree((ScaleneTriangle)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle"); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java index 4c3fbb12ec57..aab71f4c4623 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java @@ -286,6 +286,36 @@ public static String getCurrentTimezoneOffset() { return offset; } + /** + * Validate an anyOf schema can be deserialized into the expected class. + * The anyOf schema does not have a discriminator. + */ + @Test + public void testAnyOfSchemaWithoutDiscriminator() throws Exception { + { + String str = "{ \"cultivar\": \"golden delicious\", \"origin\": \"japan\" }"; + String str2 = "{ \"origin_typo\": \"japan\" }"; + + // make sure deserialization works for pojo object + Apple a = json.getGson().fromJson(str, Apple.class); + assertEquals(a.getCultivar(), "golden delicious"); + assertEquals(a.getOrigin(), "japan"); + + GmFruit o = json.getGson().fromJson(str, GmFruit.class); + assertTrue(o.getActualInstance() instanceof Apple); + Apple inst = (Apple) o.getActualInstance(); + assertEquals(inst.getCultivar(), "golden delicious"); + assertEquals(inst.getOrigin(), "japan"); + assertEquals(json.getGson().toJson(inst), "{\"cultivar\":\"golden delicious\",\"origin\":\"japan\"}"); + assertEquals(json.getGson().toJson(o), "{\"cultivar\":\"golden delicious\",\"origin\":\"japan\"}"); + + // no match + Exception exception = assertThrows(com.google.gson.JsonSyntaxException.class, () -> { + GmFruit o2 = json.getGson().fromJson(str2, GmFruit.class); + }); + } + } + /** * Validate a oneOf schema can be deserialized into the expected class. * The oneOf schema does not have a discriminator. @@ -308,6 +338,7 @@ public void testOneOfSchemaWithoutDiscriminator() throws Exception { assertEquals(inst.getCultivar(), "golden delicious"); assertEquals(inst.getMealy(), false); assertEquals(json.getGson().toJson(inst), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); + assertEquals(json.getGson().toJson(o), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); AppleReq inst2 = o.getAppleReq(); assertEquals(inst2.getCultivar(), "golden delicious"); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/PineappleTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/PineappleTest.java new file mode 100644 index 000000000000..33c1e27f36e5 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/PineappleTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Pineapple + */ +public class PineappleTest { + private final Pineapple model = new Pineapple(); + + /** + * Model tests for Pineapple + */ + @Test + public void testPineapple() { + // TODO: test Pineapple + } + + /** + * Test the property 'origin' + */ + @Test + public void originTest() { + // TODO: test origin + } + +} From a489a2e828acc8e21c7d4e761ee197b3c7fb4d2a Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 7 Dec 2021 21:38:54 +0800 Subject: [PATCH 074/117] [java][okhttp-gson-next-gen] better error message in oneOf/anyOf (#11059) * better error message * update tests --- .../okhttp-gson-nextgen/anyof_model.mustache | 10 +-- .../okhttp-gson-nextgen/oneof_model.mustache | 6 +- ...sting-with-http-signature-okhttp-gson.yaml | 6 -- .../.openapi-generator/FILES | 2 - .../java/okhttp-gson-nextgen/README.md | 1 - .../java/okhttp-gson-nextgen/api/openapi.yaml | 6 -- .../java/okhttp-gson-nextgen/docs/GmFruit.md | 2 +- .../java/org/openapitools/client/JSON.java | 1 - .../org/openapitools/client/model/Fruit.java | 4 +- .../openapitools/client/model/FruitReq.java | 4 +- .../openapitools/client/model/GmFruit.java | 62 +++---------------- .../org/openapitools/client/model/Mammal.java | 4 +- .../client/model/NullableShape.java | 4 +- .../org/openapitools/client/model/Pig.java | 4 +- .../client/model/Quadrilateral.java | 4 +- .../org/openapitools/client/model/Shape.java | 4 +- .../client/model/ShapeOrNull.java | 4 +- .../openapitools/client/model/Triangle.java | 4 +- .../org/openapitools/client/JSONTest.java | 16 ++++- 19 files changed, 51 insertions(+), 97 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache index e1727ddc047e..2b41e44940ae 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache @@ -64,12 +64,14 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } {{/anyOf}} - throw new IOException("Failed to deserialize as the type doesn't match anyOf schemas: {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}"); + throw new IOException("Failed to serialize as the type doesn't match anyOf schemas: {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}"); } @Override public {{classname}} read(JsonReader in) throws IOException { Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + {{#useOneOfDiscriminatorLookup}} {{#discriminator}} // use discriminator value for faster anyOf lookup @@ -78,7 +80,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im switch (discriminatorValue) { {{#mappedModels}} case "{{{mappingName}}}": - deserialized = gson.fromJson(in, {{{modelName}}}.class); + deserialized = adapter{{modelName}}.fromJsonTree(jsonObject); new{{classname}}.setActualInstance(deserialized); return new{{classname}}; {{/mappedModels}} @@ -92,7 +94,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{#anyOf}} // deserialize {{{.}}} try { - deserialized = gson.fromJson(in, {{.}}.class); + deserialized = adapter{{.}}.fromJsonTree(jsonObject); log.log(Level.FINER, "Input data matches schema '{{{.}}}'"); {{classname}} ret = new {{classname}}(); ret.setActualInstance(deserialized); @@ -103,7 +105,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } {{/anyOf}} - throw new IOException("Failed deserialization for {{classname}}: no match found."); + throw new IOException(String.format("Failed deserialization for {{classname}} as data doesn't match anyOf schmeas: {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}. JSON: %s", jsonObject.toString())); } }.nullSafe(); } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache index 48da5e472c3e..a9300854dead 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache @@ -64,7 +64,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } {{/oneOf}} - throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}"); + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}"); } @Override @@ -80,7 +80,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im switch (discriminatorValue) { {{#mappedModels}} case "{{{mappingName}}}": - deserialized = adapter{{.}}.fromJsonTree(jsonObject); + deserialized = adapter{{modelName}}.fromJsonTree(jsonObject); new{{classname}}.setActualInstance(deserialized); return new{{classname}}; {{/mappedModels}} @@ -110,7 +110,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im return ret; } - throw new IOException(String.format("Failed deserialization for {{classname}}: %d classes match result, expected 1", match)); + throw new IOException(String.format("Failed deserialization for {{classname}}: %d classes match result, expected 1. JSON: %s", match, jsonObject.toString())); } }.nullSafe(); } diff --git a/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml b/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml index bf85279739ee..92b32a47679d 100644 --- a/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml @@ -1888,11 +1888,6 @@ components: type: string pattern: /^[A-Z\s]*$/i nullable: true - pineapple: - type: object - properties: - origin: - type: string banana: type: object properties: @@ -1955,7 +1950,6 @@ components: color: type: string anyOf: - - $ref: '#/components/schemas/pineapple' - $ref: '#/components/schemas/apple' - $ref: '#/components/schemas/banana' additionalProperties: false diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/FILES b/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/FILES index 29da59bcd3e4..39148a7980a7 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/FILES +++ b/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/FILES @@ -66,7 +66,6 @@ docs/ParentPet.md docs/Pet.md docs/PetApi.md docs/Pig.md -docs/Pineapple.md docs/Quadrilateral.md docs/QuadrilateralInterface.md docs/ReadOnlyFirst.md @@ -179,7 +178,6 @@ src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java src/main/java/org/openapitools/client/model/ParentPet.java src/main/java/org/openapitools/client/model/Pet.java src/main/java/org/openapitools/client/model/Pig.java -src/main/java/org/openapitools/client/model/Pineapple.java src/main/java/org/openapitools/client/model/Quadrilateral.java src/main/java/org/openapitools/client/model/QuadrilateralInterface.java src/main/java/org/openapitools/client/model/ReadOnlyFirst.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/README.md b/samples/client/petstore/java/okhttp-gson-nextgen/README.md index 3a81849aa6fc..6110aea0fa04 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/README.md +++ b/samples/client/petstore/java/okhttp-gson-nextgen/README.md @@ -213,7 +213,6 @@ Class | Method | HTTP request | Description - [ParentPet](docs/ParentPet.md) - [Pet](docs/Pet.md) - [Pig](docs/Pig.md) - - [Pineapple](docs/Pineapple.md) - [Quadrilateral](docs/Quadrilateral.md) - [QuadrilateralInterface](docs/QuadrilateralInterface.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml b/samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml index e2ecf87a054d..8e64d05d5f2f 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml +++ b/samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml @@ -2053,11 +2053,6 @@ components: pattern: /^[A-Z\s]*$/i type: string type: object - pineapple: - properties: - origin: - type: string - type: object banana: properties: lengthCm: @@ -2118,7 +2113,6 @@ components: gmFruit: additionalProperties: false anyOf: - - $ref: '#/components/schemas/pineapple' - $ref: '#/components/schemas/apple' - $ref: '#/components/schemas/banana' properties: diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/GmFruit.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/GmFruit.md index d91eec57f89b..1536d689689e 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/GmFruit.md +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/GmFruit.md @@ -8,8 +8,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **color** | **String** | | [optional] -**origin** | **String** | | [optional] **cultivar** | **String** | | [optional] +**origin** | **String** | | [optional] **lengthCm** | **BigDecimal** | | [optional] diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java index 33e8ed752ef8..40146a3e6f5f 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java @@ -270,7 +270,6 @@ public JSON() { .registerTypeAdapterFactory(new org.openapitools.client.model.ParentPet.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.Pet.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.Pig.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.Pineapple.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.Quadrilateral.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.QuadrilateralInterface.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.ReadOnlyFirst.CustomTypeAdapterFactory()) diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java index 03436bd35b27..7ed501ad6df0 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java @@ -97,7 +97,7 @@ public void write(JsonWriter out, Fruit value) throws IOException { return; } - throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: Apple, Banana"); + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Apple, Banana"); } @Override @@ -133,7 +133,7 @@ public Fruit read(JsonReader in) throws IOException { return ret; } - throw new IOException(String.format("Failed deserialization for Fruit: %d classes match result, expected 1", match)); + throw new IOException(String.format("Failed deserialization for Fruit: %d classes match result, expected 1. JSON: %s", match, jsonObject.toString())); } }.nullSafe(); } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java index 6a6ea0c82f60..5c886b122bcb 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java @@ -97,7 +97,7 @@ public void write(JsonWriter out, FruitReq value) throws IOException { return; } - throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: AppleReq, BananaReq"); + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: AppleReq, BananaReq"); } @Override @@ -133,7 +133,7 @@ public FruitReq read(JsonReader in) throws IOException { return ret; } - throw new IOException(String.format("Failed deserialization for FruitReq: %d classes match result, expected 1", match)); + throw new IOException(String.format("Failed deserialization for FruitReq: %d classes match result, expected 1. JSON: %s", match, jsonObject.toString())); } }.nullSafe(); } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java index 4085fd34c10d..36a4bd8b2489 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java @@ -26,7 +26,6 @@ import java.math.BigDecimal; import org.openapitools.client.model.Apple; import org.openapitools.client.model.Banana; -import org.openapitools.client.model.Pineapple; import javax.ws.rs.core.GenericType; @@ -75,7 +74,6 @@ public TypeAdapter create(Gson gson, TypeToken type) { final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter adapterApple = gson.getDelegateAdapter(this, TypeToken.get(Apple.class)); final TypeAdapter adapterBanana = gson.getDelegateAdapter(this, TypeToken.get(Banana.class)); - final TypeAdapter adapterPineapple = gson.getDelegateAdapter(this, TypeToken.get(Pineapple.class)); return (TypeAdapter) new TypeAdapter() { @Override @@ -99,23 +97,18 @@ public void write(JsonWriter out, GmFruit value) throws IOException { return; } - // check if the actual instance is of the type `Pineapple` - if (value.getActualInstance() instanceof Pineapple) { - JsonObject obj = adapterPineapple.toJsonTree((Pineapple)value.getActualInstance()).getAsJsonObject(); - elementAdapter.write(out, obj); - return; - } - - throw new IOException("Failed to deserialize as the type doesn't match anyOf schemas: Apple, Banana, Pineapple"); + throw new IOException("Failed to serialize as the type doesn't match anyOf schemas: Apple, Banana"); } @Override public GmFruit read(JsonReader in) throws IOException { Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + // deserialize Apple try { - deserialized = gson.fromJson(in, Apple.class); + deserialized = adapterApple.fromJsonTree(jsonObject); log.log(Level.FINER, "Input data matches schema 'Apple'"); GmFruit ret = new GmFruit(); ret.setActualInstance(deserialized); @@ -127,7 +120,7 @@ public GmFruit read(JsonReader in) throws IOException { // deserialize Banana try { - deserialized = gson.fromJson(in, Banana.class); + deserialized = adapterBanana.fromJsonTree(jsonObject); log.log(Level.FINER, "Input data matches schema 'Banana'"); GmFruit ret = new GmFruit(); ret.setActualInstance(deserialized); @@ -137,19 +130,7 @@ public GmFruit read(JsonReader in) throws IOException { log.log(Level.FINER, "Input data does not match schema 'Banana'", e); } - // deserialize Pineapple - try { - deserialized = gson.fromJson(in, Pineapple.class); - log.log(Level.FINER, "Input data matches schema 'Pineapple'"); - GmFruit ret = new GmFruit(); - ret.setActualInstance(deserialized); - return ret; - } catch (Exception e) { - // deserialization failed, continue - log.log(Level.FINER, "Input data does not match schema 'Pineapple'", e); - } - - throw new IOException("Failed deserialization for GmFruit: no match found."); + throw new IOException(String.format("Failed deserialization for GmFruit as data doesn't match anyOf schmeas: Apple, Banana. JSON: %s", jsonObject.toString())); } }.nullSafe(); } @@ -172,18 +153,11 @@ public GmFruit(Banana o) { setActualInstance(o); } - public GmFruit(Pineapple o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); - } - static { schemas.put("Apple", new GenericType() { }); schemas.put("Banana", new GenericType() { }); - schemas.put("Pineapple", new GenericType() { - }); } @Override @@ -194,7 +168,7 @@ public Map getSchemas() { /** * Set the instance that matches the anyOf child schema, check * the instance parameter is valid against the anyOf child schemas: - * Apple, Banana, Pineapple + * Apple, Banana * * It could be an instance of the 'anyOf' schemas. * The anyOf child schemas may themselves be a composed schema (allOf, anyOf, anyOf). @@ -211,19 +185,14 @@ public void setActualInstance(Object instance) { return; } - if (instance instanceof Pineapple) { - super.setActualInstance(instance); - return; - } - - throw new RuntimeException("Invalid instance type. Must be Apple, Banana, Pineapple"); + throw new RuntimeException("Invalid instance type. Must be Apple, Banana"); } /** * Get the actual instance, which can be the following: - * Apple, Banana, Pineapple + * Apple, Banana * - * @return The actual instance (Apple, Banana, Pineapple) + * @return The actual instance (Apple, Banana) */ @Override public Object getActualInstance() { @@ -252,16 +221,5 @@ public Banana getBanana() throws ClassCastException { return (Banana)super.getActualInstance(); } - /** - * Get the actual instance of `Pineapple`. If the actual instance is not `Pineapple`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `Pineapple` - * @throws ClassCastException if the instance is not `Pineapple` - */ - public Pineapple getPineapple() throws ClassCastException { - return (Pineapple)super.getActualInstance(); - } - } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java index 1298c95a72c1..21834a0903b4 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java @@ -105,7 +105,7 @@ public void write(JsonWriter out, Mammal value) throws IOException { return; } - throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: Pig, Whale, Zebra"); + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Pig, Whale, Zebra"); } @Override @@ -151,7 +151,7 @@ public Mammal read(JsonReader in) throws IOException { return ret; } - throw new IOException(String.format("Failed deserialization for Mammal: %d classes match result, expected 1", match)); + throw new IOException(String.format("Failed deserialization for Mammal: %d classes match result, expected 1. JSON: %s", match, jsonObject.toString())); } }.nullSafe(); } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java index 9da8d1671bf6..f2946ec60ecf 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java @@ -96,7 +96,7 @@ public void write(JsonWriter out, NullableShape value) throws IOException { return; } - throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: Quadrilateral, Triangle"); + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Quadrilateral, Triangle"); } @Override @@ -132,7 +132,7 @@ public NullableShape read(JsonReader in) throws IOException { return ret; } - throw new IOException(String.format("Failed deserialization for NullableShape: %d classes match result, expected 1", match)); + throw new IOException(String.format("Failed deserialization for NullableShape: %d classes match result, expected 1. JSON: %s", match, jsonObject.toString())); } }.nullSafe(); } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java index 5271006630cd..54982ba3f8ef 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java @@ -96,7 +96,7 @@ public void write(JsonWriter out, Pig value) throws IOException { return; } - throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: BasquePig, DanishPig"); + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: BasquePig, DanishPig"); } @Override @@ -132,7 +132,7 @@ public Pig read(JsonReader in) throws IOException { return ret; } - throw new IOException(String.format("Failed deserialization for Pig: %d classes match result, expected 1", match)); + throw new IOException(String.format("Failed deserialization for Pig: %d classes match result, expected 1. JSON: %s", match, jsonObject.toString())); } }.nullSafe(); } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java index 40785f69a73e..aad102d30574 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java @@ -96,7 +96,7 @@ public void write(JsonWriter out, Quadrilateral value) throws IOException { return; } - throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: ComplexQuadrilateral, SimpleQuadrilateral"); + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: ComplexQuadrilateral, SimpleQuadrilateral"); } @Override @@ -132,7 +132,7 @@ public Quadrilateral read(JsonReader in) throws IOException { return ret; } - throw new IOException(String.format("Failed deserialization for Quadrilateral: %d classes match result, expected 1", match)); + throw new IOException(String.format("Failed deserialization for Quadrilateral: %d classes match result, expected 1. JSON: %s", match, jsonObject.toString())); } }.nullSafe(); } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java index c6ebebc4a3fe..23b4c43b002c 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java @@ -96,7 +96,7 @@ public void write(JsonWriter out, Shape value) throws IOException { return; } - throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: Quadrilateral, Triangle"); + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Quadrilateral, Triangle"); } @Override @@ -132,7 +132,7 @@ public Shape read(JsonReader in) throws IOException { return ret; } - throw new IOException(String.format("Failed deserialization for Shape: %d classes match result, expected 1", match)); + throw new IOException(String.format("Failed deserialization for Shape: %d classes match result, expected 1. JSON: %s", match, jsonObject.toString())); } }.nullSafe(); } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java index ddb66a3ec635..871b88812982 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java @@ -96,7 +96,7 @@ public void write(JsonWriter out, ShapeOrNull value) throws IOException { return; } - throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: Quadrilateral, Triangle"); + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Quadrilateral, Triangle"); } @Override @@ -132,7 +132,7 @@ public ShapeOrNull read(JsonReader in) throws IOException { return ret; } - throw new IOException(String.format("Failed deserialization for ShapeOrNull: %d classes match result, expected 1", match)); + throw new IOException(String.format("Failed deserialization for ShapeOrNull: %d classes match result, expected 1. JSON: %s", match, jsonObject.toString())); } }.nullSafe(); } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java index a0f2a5847f90..9311228bf044 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java @@ -105,7 +105,7 @@ public void write(JsonWriter out, Triangle value) throws IOException { return; } - throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle"); + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle"); } @Override @@ -151,7 +151,7 @@ public Triangle read(JsonReader in) throws IOException { return ret; } - throw new IOException(String.format("Failed deserialization for Triangle: %d classes match result, expected 1", match)); + throw new IOException(String.format("Failed deserialization for Triangle: %d classes match result, expected 1. JSON: %s", match, jsonObject.toString())); } }.nullSafe(); } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java index aab71f4c4623..e7d783574f98 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java @@ -294,7 +294,6 @@ public static String getCurrentTimezoneOffset() { public void testAnyOfSchemaWithoutDiscriminator() throws Exception { { String str = "{ \"cultivar\": \"golden delicious\", \"origin\": \"japan\" }"; - String str2 = "{ \"origin_typo\": \"japan\" }"; // make sure deserialization works for pojo object Apple a = json.getGson().fromJson(str, Apple.class); @@ -309,8 +308,19 @@ public void testAnyOfSchemaWithoutDiscriminator() throws Exception { assertEquals(json.getGson().toJson(inst), "{\"cultivar\":\"golden delicious\",\"origin\":\"japan\"}"); assertEquals(json.getGson().toJson(o), "{\"cultivar\":\"golden delicious\",\"origin\":\"japan\"}"); + String str2 = "{ \"origin_typo\": \"japan\" }"; // no match - Exception exception = assertThrows(com.google.gson.JsonSyntaxException.class, () -> { + Exception exception = assertThrows(java.lang.IllegalArgumentException.class, () -> { + Apple o3 = json.getGson().fromJson(str2, Apple.class); + }); + + // no match + Exception exception3 = assertThrows(java.lang.IllegalArgumentException.class, () -> { + Banana o2 = json.getGson().fromJson(str2, Banana.class); + }); + + // no match + Exception exception4 = assertThrows(com.google.gson.JsonSyntaxException.class, () -> { GmFruit o2 = json.getGson().fromJson(str2, GmFruit.class); }); } @@ -359,7 +369,7 @@ public void testOneOfSchemaWithoutDiscriminator() throws Exception { Exception exception = assertThrows(com.google.gson.JsonSyntaxException.class, () -> { FruitReq o = json.getGson().fromJson(str, FruitReq.class); }); - assertTrue(exception.getMessage().contains("Failed deserialization for FruitReq: 0 classes match result")); + assertTrue(exception.getMessage().contains("Failed deserialization for FruitReq: 0 classes match result, expected 1. JSON: {\"cultivar\":\"golden delicious\",\"mealy\":false,\"garbage_prop\":\"abc\"}")); } { String str = "{ \"lengthCm\": 17 }"; From 2ff6f833e2f9dc6885f73375e0adc9e17d504a0f Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 8 Dec 2021 09:39:42 +0800 Subject: [PATCH 075/117] add more tests for oneOf (#11068) --- .../src/test/java/org/openapitools/client/JSONTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java index e7d783574f98..6b631a5a9805 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java @@ -382,6 +382,8 @@ public void testOneOfSchemaWithoutDiscriminator() throws Exception { assertTrue(o.getActualInstance() instanceof BananaReq); BananaReq inst = (BananaReq) o.getActualInstance(); assertEquals(inst.getLengthCm(), new java.math.BigDecimal(17)); + assertEquals(json.getGson().toJson(o), "{\"lengthCm\":17}"); + assertEquals(json.getGson().toJson(inst), "{\"lengthCm\":17}"); } { // Try to deserialize empty object. This should fail 'oneOf' because none will match From c9410447019068af88971143b979d4ec02b8ac17 Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@users.noreply.github.com> Date: Wed, 8 Dec 2021 17:07:49 +0000 Subject: [PATCH 076/117] [swift5][client] allow request cancellation and authentication flow to work together (#11019) * [swift5][client] allow request cancellation and authentication flow to work together * [swift5][client] allow request cancellation and authentication flow to work together * [swift5][client] rename OpenAPIRequestCancellable to RequestTask * [swift5][client] rename OpenAPIRequestCancellable to RequestTask --- .../src/main/resources/swift5/APIs.mustache | 5 +- .../src/main/resources/swift5/Models.mustache | 30 +++++- .../src/main/resources/swift5/api.mustache | 22 ++--- .../AlamofireImplementations.mustache | 8 +- .../URLSessionImplementations.mustache | 8 +- .../Classes/OpenAPIs/APIs.swift | 5 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 24 ++--- .../APIs/FakeClassnameTags123API.swift | 2 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 18 ++-- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 8 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 16 ++-- .../OpenAPIs/AlamofireImplementations.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 14 +++ .../SwaggerClientTests/PetAPITests.swift | 2 +- .../SwaggerClientTests/run_xcodebuild.sh | 4 +- .../Classes/OpenAPIs/APIs.swift | 5 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 8 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 96 +++++++++---------- .../APIs/FakeClassnameTags123API.swift | 8 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 72 +++++++------- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 32 +++---- .../Classes/OpenAPIs/APIs/UserAPI.swift | 64 ++++++------- .../Classes/OpenAPIs/Models.swift | 13 +++ .../OpenAPIs/URLSessionImplementations.swift | 8 +- .../Classes/OpenAPIs/APIs.swift | 5 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 6 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 72 +++++++------- .../APIs/FakeClassnameTags123API.swift | 6 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 54 +++++------ .../Classes/OpenAPIs/APIs/StoreAPI.swift | 24 ++--- .../Classes/OpenAPIs/APIs/UserAPI.swift | 48 +++++----- .../Classes/OpenAPIs/Models.swift | 13 +++ .../OpenAPIs/URLSessionImplementations.swift | 8 +- .../xcshareddata/swiftpm/Package.resolved | 4 +- .../SwaggerClientTests/PetAPITests.swift | 2 +- .../SwaggerClientTests/run_xcodebuild.sh | 4 +- .../Classes/OpenAPIs/APIs.swift | 5 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 28 +++--- .../APIs/FakeClassnameTags123API.swift | 2 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 18 ++-- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 8 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 16 ++-- .../Classes/OpenAPIs/Models.swift | 13 +++ .../OpenAPIs/URLSessionImplementations.swift | 8 +- .../xcshareddata/swiftpm/Package.resolved | 4 +- .../SwaggerClientTests/PetAPITests.swift | 2 +- .../SwaggerClientTests/run_xcodebuild.sh | 4 +- .../Classes/OpenAPIs/APIs.swift | 5 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 16 ++-- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 8 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 16 ++-- .../Classes/OpenAPIs/Models.swift | 13 +++ .../OpenAPIs/URLSessionImplementations.swift | 8 +- .../Classes/OpenAPIs/APIs.swift | 5 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 24 ++--- .../APIs/FakeClassnameTags123API.swift | 2 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 18 ++-- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 8 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 16 ++-- .../Classes/OpenAPIs/Models.swift | 13 +++ .../OpenAPIs/URLSessionImplementations.swift | 8 +- .../Classes/OpenAPIs/APIs.swift | 5 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 24 ++--- .../APIs/FakeClassnameTags123API.swift | 2 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 18 ++-- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 8 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 16 ++-- .../Classes/OpenAPIs/Models.swift | 13 +++ .../OpenAPIs/URLSessionImplementations.swift | 8 +- .../Classes/OpenAPIs/APIs.swift | 5 +- .../Classes/OpenAPIs/APIs/DefaultAPI.swift | 2 +- .../Classes/OpenAPIs/Models.swift | 13 +++ .../OpenAPIs/URLSessionImplementations.swift | 8 +- .../Classes/OpenAPIs/APIs.swift | 5 +- .../Classes/OpenAPIs/Models.swift | 13 +++ .../OpenAPIs/URLSessionImplementations.swift | 8 +- .../xcshareddata/swiftpm/Package.resolved | 6 +- .../SwaggerClientTests/PetAPITests.swift | 2 +- .../SwaggerClientTests/run_xcodebuild.sh | 4 +- .../Classes/OpenAPIs/APIs.swift | 5 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 24 ++--- .../APIs/FakeClassnameTags123API.swift | 2 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 18 ++-- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 8 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 16 ++-- .../Classes/OpenAPIs/Models.swift | 13 +++ .../OpenAPIs/URLSessionImplementations.swift | 8 +- .../Classes/OpenAPIs/APIs.swift | 5 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 24 ++--- .../APIs/FakeClassnameTags123API.swift | 2 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 18 ++-- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 8 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 16 ++-- .../Classes/OpenAPIs/Models.swift | 13 +++ .../OpenAPIs/URLSessionImplementations.swift | 8 +- .../Classes/OpenAPIs/APIs.swift | 5 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 4 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 48 +++++----- .../APIs/FakeClassnameTags123API.swift | 4 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 36 +++---- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 16 ++-- .../Classes/OpenAPIs/APIs/UserAPI.swift | 32 +++---- .../Classes/OpenAPIs/Models.swift | 13 +++ .../OpenAPIs/URLSessionImplementations.swift | 8 +- .../xcshareddata/swiftpm/Package.resolved | 6 +- .../SwaggerClientTests/PetAPITests.swift | 2 +- .../SwaggerClientTests/run_xcodebuild.sh | 4 +- .../client/petstore/swift5/swift5_test_all.sh | 13 ++- .../Sources/PetstoreClient/APIs.swift | 5 +- .../PetstoreClient/APIs/AnotherFakeAPI.swift | 2 +- .../Sources/PetstoreClient/APIs/FakeAPI.swift | 24 ++--- .../APIs/FakeClassnameTags123API.swift | 2 +- .../Sources/PetstoreClient/APIs/PetAPI.swift | 18 ++-- .../PetstoreClient/APIs/StoreAPI.swift | 8 +- .../Sources/PetstoreClient/APIs/UserAPI.swift | 16 ++-- .../Sources/PetstoreClient/Models.swift | 13 +++ .../URLSessionImplementations.swift | 8 +- .../xcshareddata/swiftpm/Package.resolved | 4 +- .../BearerDecodableRequestBuilder.swift | 12 ++- .../SwaggerClientTests/PetAPITests.swift | 14 +-- .../SwaggerClientTests/StoreAPITests.swift | 12 +-- .../SwaggerClientTests/UserAPITests.swift | 6 +- .../SwaggerClientTests/run_xcodebuild.sh | 4 +- .../Classes/OpenAPIs/APIs.swift | 5 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 24 ++--- .../APIs/FakeClassnameTags123API.swift | 2 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 18 ++-- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 8 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 16 ++-- .../Classes/OpenAPIs/Models.swift | 13 +++ .../OpenAPIs/URLSessionImplementations.swift | 8 +- 138 files changed, 1005 insertions(+), 784 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/swift5/APIs.mustache b/modules/openapi-generator/src/main/resources/swift5/APIs.mustache index dcca24f56d3f..847e9be55954 100644 --- a/modules/openapi-generator/src/main/resources/swift5/APIs.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/APIs.mustache @@ -36,6 +36,7 @@ import Vapor {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} let parameters: [String: Any]? {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} let method: String {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} let URLString: String + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} let requestTask: RequestTask = RequestTask() /// Optional block to obtain a reference to the request's progress instance when available.{{#useURLSession}} /// 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. @@ -58,8 +59,8 @@ import Vapor } @discardableResult - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func execute(_ apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { - return nil + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func execute(_ apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return requestTask } {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} func addHeader(name: String, value: String) -> Self { diff --git a/modules/openapi-generator/src/main/resources/swift5/Models.mustache b/modules/openapi-generator/src/main/resources/swift5/Models.mustache index 1195d5ea9c42..28d9935dd532 100644 --- a/modules/openapi-generator/src/main/resources/swift5/Models.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/Models.mustache @@ -4,7 +4,8 @@ // https://openapi-generator.tech // -import Foundation +import Foundation{{#useAlamofire}} +import Alamofire{{/useAlamofire}} protocol JSONEncodable { func encodeToJSON() -> Any @@ -78,3 +79,30 @@ extension CaseIterableDefaultsLast { self.init(statusCode: response.statusCode, header: header, body: body) } } + +{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} final class RequestTask { +{{#useAlamofire}} + private var request: Request? + + internal func set(request: Request) { + self.request = request + } + + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} func cancel() { + request?.cancel() + request = nil + } +{{/useAlamofire}} +{{^useAlamofire}} + private var task: URLSessionTask? + + internal func set(task: URLSessionTask) { + self.task = task + } + + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} func cancel() { + task?.cancel() + task = nil + } +{{/useAlamofire}} +} diff --git a/modules/openapi-generator/src/main/resources/swift5/api.mustache b/modules/openapi-generator/src/main/resources/swift5/api.mustache index 42b44955aadd..5ae1f5513d2c 100644 --- a/modules/openapi-generator/src/main/resources/swift5/api.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/api.mustache @@ -57,7 +57,7 @@ extension {{projectName}}API { @available(*, deprecated, message: "This operation is deprecated.") {{/isDeprecated}} @discardableResult - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, completion: @escaping ((_ data: {{{returnType}}}{{^returnType}}Void{{/returnType}}?, _ error: Error?) -> Void)) -> URLSessionTask? { + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, completion: @escaping ((_ data: {{{returnType}}}{{^returnType}}Void{{/returnType}}?, _ error: Error?) -> Void)) -> RequestTask { return {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute(apiResponseQueue) { result in switch result { {{#returnType}} @@ -124,7 +124,7 @@ extension {{projectName}}API { {{/isDeprecated}} {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue) -> Observable<{{{returnType}}}{{^returnType}}Void{{/returnType}}> { return Observable.create { observer -> Disposable in - let task = {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute(apiResponseQueue) { result in + let requestTask = {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute(apiResponseQueue) { result in switch result { {{#returnType}} case let .success(response): @@ -141,7 +141,7 @@ extension {{projectName}}API { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -161,9 +161,9 @@ extension {{projectName}}API { {{/isDeprecated}} @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue) -> AnyPublisher<{{{returnType}}}{{^returnType}}Void{{/returnType}}, Error> { - var task: URLSessionTask? + var requestTask: RequestTask? return Future<{{{returnType}}}{{^returnType}}Void{{/returnType}}, Error> { promise in - task = {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute(apiResponseQueue) { result in + requestTask = {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute(apiResponseQueue) { result in switch result { {{#returnType}} case let .success(response): @@ -179,7 +179,7 @@ extension {{projectName}}API { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -199,7 +199,7 @@ extension {{projectName}}API { {{/isDeprecated}} @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue) async throws{{#returnType}} -> {{{returnType}}}{{/returnType}} { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -208,7 +208,7 @@ extension {{projectName}}API { return } - task = {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute(apiResponseQueue) { result in + requestTask = {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute(apiResponseQueue) { result in switch result { {{#returnType}} case let .success(response): @@ -223,8 +223,8 @@ extension {{projectName}}API { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } {{/useAsyncAwait}} @@ -241,7 +241,7 @@ extension {{projectName}}API { @available(*, deprecated, message: "This operation is deprecated.") {{/isDeprecated}} @discardableResult - open class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<{{{returnType}}}{{^returnType}}Void{{/returnType}}, ErrorResponse>) -> Void)) -> URLSessionTask? { + open class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<{{{returnType}}}{{^returnType}}Void{{/returnType}}, ErrorResponse>) -> Void)) -> RequestTask { return {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute(apiResponseQueue) { result in switch result { {{#returnType}} diff --git a/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache b/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache index 48105ef58d95..5ec281b054e3 100644 --- a/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache @@ -79,7 +79,7 @@ private var managerStore = SynchronizedDictionary() } @discardableResult - override {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func execute(_ apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + override {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func execute(_ apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { let managerId = UUID().uuidString // Create a new manager for each request to customize its request header let manager = createAlamofireSession() @@ -125,6 +125,8 @@ private var managerStore = SynchronizedDictionary() } } + requestTask.set(request: upload) + self.processRequest(request: upload, managerId, apiResponseQueue, completion) } else if contentType == "application/x-www-form-urlencoded" { encoding = URLEncoding(destination: .httpBody) @@ -142,10 +144,10 @@ private var managerStore = SynchronizedDictionary() onProgressReady(request.uploadProgress) } processRequest(request: request, managerId, apiResponseQueue, completion) - return request.task + requestTask.set(request: request) } - return nil + return requestTask } fileprivate func processRequest(request: DataRequest, _ managerId: String, _ apiResponseQueue: DispatchQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { diff --git a/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache b/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache index 707577e0da31..eeae3c98aef9 100644 --- a/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache @@ -100,7 +100,7 @@ private var credentialStore = SynchronizedDictionary() } @discardableResult - override {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func execute(_ apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + override {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func execute(_ apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { let urlSession = createURLSession() guard let xMethod = HTTPMethod(rawValue: method) else { @@ -172,14 +172,14 @@ private var credentialStore = SynchronizedDictionary() dataTask.resume() - return dataTask + requestTask.set(task: dataTask) } catch { apiResponseQueue.async { completion(.failure(ErrorResponse.error(415, nil, nil, error))) } - - return nil } + + return requestTask } fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { 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 9ffe15ebc9aa..4222b4cbaee7 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -27,6 +27,7 @@ open class RequestBuilder { public let parameters: [String: Any]? public let method: String public let URLString: String + public let requestTask: RequestTask = RequestTask() /// Optional block to obtain a reference to the request's progress instance when available. public var onProgressReady: ((Progress) -> Void)? @@ -47,8 +48,8 @@ open class RequestBuilder { } @discardableResult - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { - return nil + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return requestTask } public func addHeader(name: String, value: String) -> Self { 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 ac45c1f454b7..5e179af64e25 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 @@ -20,7 +20,7 @@ open class AnotherFakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result 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 a5165719f100..d980142c6ab2 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 @@ -19,7 +19,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -61,7 +61,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -103,7 +103,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -145,7 +145,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -187,7 +187,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -230,7 +230,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -276,7 +276,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -333,7 +333,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - 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)) -> URLSessionTask? { + 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)) -> RequestTask { return 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 in switch result { case .success: @@ -485,7 +485,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: @@ -555,7 +555,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - 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)) -> URLSessionTask? { + 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)) -> RequestTask { return testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in switch result { case .success: @@ -611,7 +611,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in switch result { case .success: @@ -655,7 +655,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in switch result { case .success: 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 ac274a7c550a..34e8c9c7f233 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 @@ -20,7 +20,7 @@ open class FakeClassnameTags123API { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result 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 bd5c091925bf..254930e7779f 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 @@ -20,7 +20,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -67,7 +67,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in switch result { case .success: @@ -126,7 +126,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -177,7 +177,7 @@ open class PetAPI { */ @available(*, deprecated, message: "This operation is deprecated.") @discardableResult - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -228,7 +228,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> RequestTask { return getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -278,7 +278,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -326,7 +326,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: @@ -385,7 +385,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> RequestTask { return uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -444,7 +444,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> RequestTask { return uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in switch result { case let .success(response): 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 f25392268665..c111e8301304 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 @@ -20,7 +20,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: @@ -66,7 +66,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> RequestTask { return getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -112,7 +112,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -159,7 +159,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result 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 3fc59f9ef4fc..5e01a4a7c346 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 @@ -20,7 +20,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -64,7 +64,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -107,7 +107,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -150,7 +150,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: @@ -197,7 +197,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> RequestTask { return getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -244,7 +244,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> RequestTask { return loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -292,7 +292,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: @@ -335,7 +335,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result 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 c8f1b663434c..577abc9a6ad0 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -79,7 +79,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } @discardableResult - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { let managerId = UUID().uuidString // Create a new manager for each request to customize its request header let manager = createAlamofireSession() @@ -125,6 +125,8 @@ open class AlamofireRequestBuilder: RequestBuilder { } } + requestTask.set(request: upload) + self.processRequest(request: upload, managerId, apiResponseQueue, completion) } else if contentType == "application/x-www-form-urlencoded" { encoding = URLEncoding(destination: .httpBody) @@ -142,10 +144,10 @@ open class AlamofireRequestBuilder: RequestBuilder { onProgressReady(request.uploadProgress) } processRequest(request: request, managerId, apiResponseQueue, completion) - return request.task + requestTask.set(request: request) } - return nil + return requestTask } fileprivate func processRequest(request: DataRequest, _ managerId: String, _ apiResponseQueue: DispatchQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { 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 7787127c40d8..fc69bffcc11b 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -5,6 +5,7 @@ // import Foundation +import Alamofire protocol JSONEncodable { func encodeToJSON() -> Any @@ -78,3 +79,16 @@ open class Response { self.init(statusCode: response.statusCode, header: header, body: body) } } + +public final class RequestTask { + private var request: Request? + + internal func set(request: Request) { + self.request = request + } + + public func cancel() { + request?.cancel() + request = nil + } +} diff --git a/samples/client/petstore/swift5/alamofireLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/samples/client/petstore/swift5/alamofireLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift index 31f90f6acfab..9dfbc9aa465d 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift @@ -26,7 +26,7 @@ class PetAPITests: XCTestCase { func test1CreatePet() { let expectation = self.expectation(description: "testCreatePet") - let category = PetstoreClient.Category(id: 1234, name: "eyeColor") + let category = Category(id: 1234, name: "eyeColor") let tags = [Tag(id: 1234, name: "New York"), Tag(id: 124321, name: "Jose")] let newPet = Pet(id: 1000, category: category, name: "Fluffy", photoUrls: ["https://petstore.com/sample/photo1.jpg", "https://petstore.com/sample/photo2.jpg"], tags: tags, status: .available) diff --git a/samples/client/petstore/swift5/alamofireLibrary/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift5/alamofireLibrary/SwaggerClientTests/run_xcodebuild.sh index 19e1e06dad60..719b9c841811 100755 --- a/samples/client/petstore/swift5/alamofireLibrary/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift5/alamofireLibrary/SwaggerClientTests/run_xcodebuild.sh @@ -1,5 +1,3 @@ #!/bin/sh -pod install - -xcodebuild clean build build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index a7933c418ad4..485585212d42 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -27,6 +27,7 @@ open class RequestBuilder { public let parameters: [String: Any]? public let method: String public let URLString: String + public let requestTask: RequestTask = RequestTask() /// 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. @@ -49,8 +50,8 @@ open class RequestBuilder { } @discardableResult - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { - return nil + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return requestTask } public func addHeader(name: String, value: String) -> Self { diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 4877906db165..bd8044516fed 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -21,7 +21,7 @@ open class AnotherFakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Client { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -30,7 +30,7 @@ open class AnotherFakeAPI { return } - task = call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): continuation.resume(returning: response.body) @@ -39,8 +39,8 @@ open class AnotherFakeAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 8e449d22dc7c..1b105b037f66 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -20,7 +20,7 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Bool { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -29,7 +29,7 @@ open class FakeAPI { return } - task = fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): continuation.resume(returning: response.body) @@ -38,8 +38,8 @@ open class FakeAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -75,7 +75,7 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> OuterComposite { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -84,7 +84,7 @@ open class FakeAPI { return } - task = fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): continuation.resume(returning: response.body) @@ -93,8 +93,8 @@ open class FakeAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -130,7 +130,7 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Double { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -139,7 +139,7 @@ open class FakeAPI { return } - task = fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): continuation.resume(returning: response.body) @@ -148,8 +148,8 @@ open class FakeAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -185,7 +185,7 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> String { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -194,7 +194,7 @@ open class FakeAPI { return } - task = fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): continuation.resume(returning: response.body) @@ -203,8 +203,8 @@ open class FakeAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -240,7 +240,7 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -249,7 +249,7 @@ open class FakeAPI { return } - task = testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: continuation.resume(returning: ()) @@ -258,8 +258,8 @@ open class FakeAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -296,7 +296,7 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -305,7 +305,7 @@ open class FakeAPI { return } - task = testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in + requestTask = testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in switch result { case .success: continuation.resume(returning: ()) @@ -314,8 +314,8 @@ open class FakeAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -355,7 +355,7 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Client { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -364,7 +364,7 @@ open class FakeAPI { return } - task = testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): continuation.resume(returning: response.body) @@ -373,8 +373,8 @@ open class FakeAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -425,7 +425,7 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -434,7 +434,7 @@ open class FakeAPI { return } - task = 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 in + requestTask = 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 in switch result { case .success: continuation.resume(returning: ()) @@ -443,8 +443,8 @@ open class FakeAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -590,7 +590,7 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -599,7 +599,7 @@ open class FakeAPI { return } - task = testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in + requestTask = testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: continuation.resume(returning: ()) @@ -608,8 +608,8 @@ open class FakeAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -673,7 +673,7 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -682,7 +682,7 @@ open class FakeAPI { return } - task = testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in + requestTask = testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in switch result { case .success: continuation.resume(returning: ()) @@ -691,8 +691,8 @@ open class FakeAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -742,7 +742,7 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -751,7 +751,7 @@ open class FakeAPI { return } - task = testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in + requestTask = testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in switch result { case .success: continuation.resume(returning: ()) @@ -760,8 +760,8 @@ open class FakeAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -799,7 +799,7 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -808,7 +808,7 @@ open class FakeAPI { return } - task = testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in + requestTask = testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in switch result { case .success: continuation.resume(returning: ()) @@ -817,8 +817,8 @@ open class FakeAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 66d801132d26..6313692d6d48 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -21,7 +21,7 @@ open class FakeClassnameTags123API { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Client { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -30,7 +30,7 @@ open class FakeClassnameTags123API { return } - task = testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): continuation.resume(returning: response.body) @@ -39,8 +39,8 @@ open class FakeClassnameTags123API { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index f169ed382da2..d541b28938d5 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -21,7 +21,7 @@ open class PetAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -30,7 +30,7 @@ open class PetAPI { return } - task = addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: continuation.resume(returning: ()) @@ -39,8 +39,8 @@ open class PetAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -81,7 +81,7 @@ open class PetAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -90,7 +90,7 @@ open class PetAPI { return } - task = deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in + requestTask = deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in switch result { case .success: continuation.resume(returning: ()) @@ -99,8 +99,8 @@ open class PetAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -153,7 +153,7 @@ open class PetAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> [Pet] { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -162,7 +162,7 @@ open class PetAPI { return } - task = findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in + requestTask = findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): continuation.resume(returning: response.body) @@ -171,8 +171,8 @@ open class PetAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -217,7 +217,7 @@ open class PetAPI { @available(*, deprecated, message: "This operation is deprecated.") @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> [Pet] { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -226,7 +226,7 @@ open class PetAPI { return } - task = findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in + requestTask = findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): continuation.resume(returning: response.body) @@ -235,8 +235,8 @@ open class PetAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -281,7 +281,7 @@ open class PetAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Pet { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -290,7 +290,7 @@ open class PetAPI { return } - task = getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in + requestTask = getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): continuation.resume(returning: response.body) @@ -299,8 +299,8 @@ open class PetAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -344,7 +344,7 @@ open class PetAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -353,7 +353,7 @@ open class PetAPI { return } - task = updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: continuation.resume(returning: ()) @@ -362,8 +362,8 @@ open class PetAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -405,7 +405,7 @@ open class PetAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -414,7 +414,7 @@ open class PetAPI { return } - task = updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in + requestTask = updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: continuation.resume(returning: ()) @@ -423,8 +423,8 @@ open class PetAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -477,7 +477,7 @@ open class PetAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> ApiResponse { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -486,7 +486,7 @@ open class PetAPI { return } - task = uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in + requestTask = uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): continuation.resume(returning: response.body) @@ -495,8 +495,8 @@ open class PetAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -549,7 +549,7 @@ open class PetAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> ApiResponse { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -558,7 +558,7 @@ open class PetAPI { return } - task = uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in + requestTask = uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in switch result { case let .success(response): continuation.resume(returning: response.body) @@ -567,8 +567,8 @@ open class PetAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 41d3a6047dc2..510311783b9e 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -21,7 +21,7 @@ open class StoreAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -30,7 +30,7 @@ open class StoreAPI { return } - task = deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + requestTask = deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: continuation.resume(returning: ()) @@ -39,8 +39,8 @@ open class StoreAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -80,7 +80,7 @@ open class StoreAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> [String: Int] { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -89,7 +89,7 @@ open class StoreAPI { return } - task = getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in + requestTask = getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): continuation.resume(returning: response.body) @@ -98,8 +98,8 @@ open class StoreAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -139,7 +139,7 @@ open class StoreAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Order { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -148,7 +148,7 @@ open class StoreAPI { return } - task = getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + requestTask = getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): continuation.resume(returning: response.body) @@ -157,8 +157,8 @@ open class StoreAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -199,7 +199,7 @@ open class StoreAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Order { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -208,7 +208,7 @@ open class StoreAPI { return } - task = placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): continuation.resume(returning: response.body) @@ -217,8 +217,8 @@ open class StoreAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index f0e57f333cdf..7cc9a77f01b9 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -21,7 +21,7 @@ open class UserAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -30,7 +30,7 @@ open class UserAPI { return } - task = createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: continuation.resume(returning: ()) @@ -39,8 +39,8 @@ open class UserAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -78,7 +78,7 @@ open class UserAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -87,7 +87,7 @@ open class UserAPI { return } - task = createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: continuation.resume(returning: ()) @@ -96,8 +96,8 @@ open class UserAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -134,7 +134,7 @@ open class UserAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -143,7 +143,7 @@ open class UserAPI { return } - task = createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: continuation.resume(returning: ()) @@ -152,8 +152,8 @@ open class UserAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -190,7 +190,7 @@ open class UserAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -199,7 +199,7 @@ open class UserAPI { return } - task = deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + requestTask = deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: continuation.resume(returning: ()) @@ -208,8 +208,8 @@ open class UserAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -250,7 +250,7 @@ open class UserAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> User { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -259,7 +259,7 @@ open class UserAPI { return } - task = getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + requestTask = getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): continuation.resume(returning: response.body) @@ -268,8 +268,8 @@ open class UserAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -310,7 +310,7 @@ open class UserAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> String { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -319,7 +319,7 @@ open class UserAPI { return } - task = loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in + requestTask = loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): continuation.resume(returning: response.body) @@ -328,8 +328,8 @@ open class UserAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -371,7 +371,7 @@ open class UserAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -380,7 +380,7 @@ open class UserAPI { return } - task = logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in + requestTask = logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: continuation.resume(returning: ()) @@ -389,8 +389,8 @@ open class UserAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -427,7 +427,7 @@ open class UserAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -436,7 +436,7 @@ open class UserAPI { return } - task = updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in + requestTask = updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in switch result { case .success: continuation.resume(returning: ()) @@ -445,8 +445,8 @@ open class UserAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 7787127c40d8..7cb4e06d16cc 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -78,3 +78,16 @@ open class Response { self.init(statusCode: response.statusCode, header: header, body: body) } } + +public final class RequestTask { + private var task: URLSessionTask? + + internal func set(task: URLSessionTask) { + self.task = task + } + + public func cancel() { + task?.cancel() + task = nil + } +} diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index fe7fb6683bcf..23df908ca326 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -100,7 +100,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } @discardableResult - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { let urlSession = createURLSession() guard let xMethod = HTTPMethod(rawValue: method) else { @@ -172,14 +172,14 @@ open class URLSessionRequestBuilder: RequestBuilder { dataTask.resume() - return dataTask + requestTask.set(task: dataTask) } catch { apiResponseQueue.async { completion(.failure(ErrorResponse.error(415, nil, nil, error))) } - - return nil } + + return requestTask } fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { 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 a7933c418ad4..485585212d42 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -27,6 +27,7 @@ open class RequestBuilder { public let parameters: [String: Any]? public let method: String public let URLString: String + public let requestTask: RequestTask = RequestTask() /// 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. @@ -49,8 +50,8 @@ open class RequestBuilder { } @discardableResult - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { - return nil + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return requestTask } public func addHeader(name: String, value: String) -> Self { 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 724845424e6f..e0457cb53cfd 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 @@ -25,9 +25,9 @@ open class AnotherFakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body)) @@ -37,7 +37,7 @@ open class AnotherFakeAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } 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 27b455e59fff..565fb17c666b 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 @@ -24,9 +24,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body)) @@ -36,7 +36,7 @@ open class FakeAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -75,9 +75,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body)) @@ -87,7 +87,7 @@ open class FakeAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -126,9 +126,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body)) @@ -138,7 +138,7 @@ open class FakeAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -177,9 +177,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body)) @@ -189,7 +189,7 @@ open class FakeAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -228,9 +228,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -240,7 +240,7 @@ open class FakeAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -280,9 +280,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in + requestTask = testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -292,7 +292,7 @@ open class FakeAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -335,9 +335,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body)) @@ -347,7 +347,7 @@ open class FakeAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -401,9 +401,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = 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 in + requestTask = 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 in switch result { case .success: promise(.success(())) @@ -413,7 +413,7 @@ open class FakeAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -562,9 +562,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in + requestTask = testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -574,7 +574,7 @@ open class FakeAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -641,9 +641,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in + requestTask = testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -653,7 +653,7 @@ open class FakeAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -706,9 +706,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in + requestTask = testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -718,7 +718,7 @@ open class FakeAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -759,9 +759,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in + requestTask = testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -771,7 +771,7 @@ open class FakeAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } 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 f95386104723..a8ad34b07b63 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 @@ -25,9 +25,9 @@ open class FakeClassnameTags123API { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body)) @@ -37,7 +37,7 @@ open class FakeClassnameTags123API { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } 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 71225a5b53d9..3f9674b43fd8 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 @@ -25,9 +25,9 @@ open class PetAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -37,7 +37,7 @@ open class PetAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -81,9 +81,9 @@ open class PetAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in + requestTask = deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -93,7 +93,7 @@ open class PetAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -149,9 +149,9 @@ open class PetAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher<[Pet], Error> { - var task: URLSessionTask? + var requestTask: RequestTask? return Future<[Pet], Error> { promise in - task = findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in + requestTask = findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body)) @@ -161,7 +161,7 @@ open class PetAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -209,9 +209,9 @@ open class PetAPI { @available(*, deprecated, message: "This operation is deprecated.") @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher<[Pet], Error> { - var task: URLSessionTask? + var requestTask: RequestTask? return Future<[Pet], Error> { promise in - task = findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in + requestTask = findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body)) @@ -221,7 +221,7 @@ open class PetAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -269,9 +269,9 @@ open class PetAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in + requestTask = getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body)) @@ -281,7 +281,7 @@ open class PetAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -328,9 +328,9 @@ open class PetAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -340,7 +340,7 @@ open class PetAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -385,9 +385,9 @@ open class PetAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in + requestTask = updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -397,7 +397,7 @@ open class PetAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -453,9 +453,9 @@ open class PetAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in + requestTask = uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body)) @@ -465,7 +465,7 @@ open class PetAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -521,9 +521,9 @@ open class PetAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in + requestTask = uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body)) @@ -533,7 +533,7 @@ open class PetAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } 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 ec3368c105af..623d072590e9 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 @@ -25,9 +25,9 @@ open class StoreAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + requestTask = deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -37,7 +37,7 @@ open class StoreAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -80,9 +80,9 @@ open class StoreAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher<[String: Int], Error> { - var task: URLSessionTask? + var requestTask: RequestTask? return Future<[String: Int], Error> { promise in - task = getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in + requestTask = getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body)) @@ -92,7 +92,7 @@ open class StoreAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -135,9 +135,9 @@ open class StoreAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + requestTask = getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body)) @@ -147,7 +147,7 @@ open class StoreAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -191,9 +191,9 @@ open class StoreAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body)) @@ -203,7 +203,7 @@ open class StoreAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } 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 5ec63243c521..28231e9be5ba 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 @@ -25,9 +25,9 @@ open class UserAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -37,7 +37,7 @@ open class UserAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -78,9 +78,9 @@ open class UserAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -90,7 +90,7 @@ open class UserAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -130,9 +130,9 @@ open class UserAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -142,7 +142,7 @@ open class UserAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -182,9 +182,9 @@ open class UserAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + requestTask = deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -194,7 +194,7 @@ open class UserAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -238,9 +238,9 @@ open class UserAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + requestTask = getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body)) @@ -250,7 +250,7 @@ open class UserAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -294,9 +294,9 @@ open class UserAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in + requestTask = loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body)) @@ -306,7 +306,7 @@ open class UserAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -351,9 +351,9 @@ open class UserAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in + requestTask = logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -363,7 +363,7 @@ open class UserAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -403,9 +403,9 @@ open class UserAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in + requestTask = updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -415,7 +415,7 @@ open class UserAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } 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 7787127c40d8..7cb4e06d16cc 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -78,3 +78,16 @@ open class Response { self.init(statusCode: response.statusCode, header: header, body: body) } } + +public final class RequestTask { + private var task: URLSessionTask? + + internal func set(task: URLSessionTask) { + self.task = task + } + + public func cancel() { + task?.cancel() + task = nil + } +} 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 fe7fb6683bcf..23df908ca326 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -100,7 +100,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } @discardableResult - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { let urlSession = createURLSession() guard let xMethod = HTTPMethod(rawValue: method) else { @@ -172,14 +172,14 @@ open class URLSessionRequestBuilder: RequestBuilder { dataTask.resume() - return dataTask + requestTask.set(task: dataTask) } catch { apiResponseQueue.async { completion(.failure(ErrorResponse.error(415, nil, nil, error))) } - - return nil } + + return requestTask } fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { diff --git a/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved b/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved index d384b276b4bc..730957420e19 100644 --- a/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -6,8 +6,8 @@ "repositoryURL": "https://github.com/Flight-School/AnyCodable", "state": { "branch": null, - "revision": "876d162385e9862ae8b3c8d65dc301312b040005", - "version": "0.6.0" + "revision": "b1a7a8a6186f2fcb28f7bda67cfc545de48b3c80", + "version": "0.6.2" } } ] diff --git a/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift index 6136098ee576..29c50819e27d 100644 --- a/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift +++ b/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift @@ -30,7 +30,7 @@ class PetAPITests: XCTestCase { func test1CreatePet() { let expectation = self.expectation(description: "testCreatePet") - let category = PetstoreClient.Category(id: 1234, name: "eyeColor") + let category = Category(id: 1234, name: "eyeColor") let tags = [Tag(id: 1234, name: "New York"), Tag(id: 124321, name: "Jose")] let newPet = Pet(id: 1000, category: category, name: "Fluffy", photoUrls: ["https://petstore.com/sample/photo1.jpg", "https://petstore.com/sample/photo2.jpg"], tags: tags, status: .available) diff --git a/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/run_xcodebuild.sh index 79520c7fc38c..719b9c841811 100755 --- a/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/run_xcodebuild.sh @@ -1,5 +1,3 @@ #!/bin/sh -pod install - -xcodebuild -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" test -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} 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 a7933c418ad4..485585212d42 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -27,6 +27,7 @@ open class RequestBuilder { public let parameters: [String: Any]? public let method: String public let URLString: String + public let requestTask: RequestTask = RequestTask() /// 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. @@ -49,8 +50,8 @@ open class RequestBuilder { } @discardableResult - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { - return nil + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return requestTask } public func addHeader(name: String, value: String) -> Self { 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 ac45c1f454b7..5e179af64e25 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 @@ -20,7 +20,7 @@ open class AnotherFakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result 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 bf154f2e1db3..78c64f76f117 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 @@ -20,7 +20,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createXmlItem(xmlItem: XmlItem, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createXmlItem(xmlItem: XmlItem, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createXmlItemWithRequestBuilder(xmlItem: xmlItem).execute(apiResponseQueue) { result in switch result { case .success: @@ -63,7 +63,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -105,7 +105,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -147,7 +147,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -189,7 +189,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -231,7 +231,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -274,7 +274,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -320,7 +320,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -377,7 +377,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - 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)) -> URLSessionTask? { + 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)) -> RequestTask { return 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 in switch result { case .success: @@ -529,7 +529,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: @@ -599,7 +599,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - 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)) -> URLSessionTask? { + 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)) -> RequestTask { return testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in switch result { case .success: @@ -655,7 +655,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in switch result { case .success: @@ -699,7 +699,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in switch result { case .success: @@ -752,7 +752,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testQueryParameterCollectionFormat(pipe: [String], ioutil: [String], http: [String], url: [String], context: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testQueryParameterCollectionFormat(pipe: [String], ioutil: [String], http: [String], url: [String], context: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testQueryParameterCollectionFormatWithRequestBuilder(pipe: pipe, ioutil: ioutil, http: http, url: url, context: context).execute(apiResponseQueue) { result in switch result { case .success: 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 ac274a7c550a..34e8c9c7f233 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 @@ -20,7 +20,7 @@ open class FakeClassnameTags123API { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result 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 655b2358c526..6d37af7299fc 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 @@ -20,7 +20,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -67,7 +67,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in switch result { case .success: @@ -126,7 +126,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -177,7 +177,7 @@ open class PetAPI { */ @available(*, deprecated, message: "This operation is deprecated.") @discardableResult - open class func findPetsByTags(tags: Set, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Set?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByTags(tags: Set, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Set?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -228,7 +228,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> RequestTask { return getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -278,7 +278,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -326,7 +326,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: @@ -385,7 +385,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> RequestTask { return uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -444,7 +444,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> RequestTask { return uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in switch result { case let .success(response): 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 f25392268665..c111e8301304 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 @@ -20,7 +20,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: @@ -66,7 +66,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> RequestTask { return getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -112,7 +112,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -159,7 +159,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result 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 3fc59f9ef4fc..5e01a4a7c346 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 @@ -20,7 +20,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -64,7 +64,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -107,7 +107,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -150,7 +150,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: @@ -197,7 +197,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> RequestTask { return getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -244,7 +244,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> RequestTask { return loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -292,7 +292,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: @@ -335,7 +335,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in switch result { case .success: 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 7787127c40d8..7cb4e06d16cc 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -78,3 +78,16 @@ open class Response { self.init(statusCode: response.statusCode, header: header, body: body) } } + +public final class RequestTask { + private var task: URLSessionTask? + + internal func set(task: URLSessionTask) { + self.task = task + } + + public func cancel() { + task?.cancel() + task = nil + } +} 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 fe7fb6683bcf..23df908ca326 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -100,7 +100,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } @discardableResult - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { let urlSession = createURLSession() guard let xMethod = HTTPMethod(rawValue: method) else { @@ -172,14 +172,14 @@ open class URLSessionRequestBuilder: RequestBuilder { dataTask.resume() - return dataTask + requestTask.set(task: dataTask) } catch { apiResponseQueue.async { completion(.failure(ErrorResponse.error(415, nil, nil, error))) } - - return nil } + + return requestTask } fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { diff --git a/samples/client/petstore/swift5/default/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved b/samples/client/petstore/swift5/default/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved index d384b276b4bc..730957420e19 100644 --- a/samples/client/petstore/swift5/default/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/samples/client/petstore/swift5/default/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -6,8 +6,8 @@ "repositoryURL": "https://github.com/Flight-School/AnyCodable", "state": { "branch": null, - "revision": "876d162385e9862ae8b3c8d65dc301312b040005", - "version": "0.6.0" + "revision": "b1a7a8a6186f2fcb28f7bda67cfc545de48b3c80", + "version": "0.6.2" } } ] diff --git a/samples/client/petstore/swift5/default/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/samples/client/petstore/swift5/default/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift index 31f90f6acfab..9dfbc9aa465d 100644 --- a/samples/client/petstore/swift5/default/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift +++ b/samples/client/petstore/swift5/default/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift @@ -26,7 +26,7 @@ class PetAPITests: XCTestCase { func test1CreatePet() { let expectation = self.expectation(description: "testCreatePet") - let category = PetstoreClient.Category(id: 1234, name: "eyeColor") + let category = Category(id: 1234, name: "eyeColor") let tags = [Tag(id: 1234, name: "New York"), Tag(id: 124321, name: "Jose")] let newPet = Pet(id: 1000, category: category, name: "Fluffy", photoUrls: ["https://petstore.com/sample/photo1.jpg", "https://petstore.com/sample/photo2.jpg"], tags: tags, status: .available) diff --git a/samples/client/petstore/swift5/default/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift5/default/SwaggerClientTests/run_xcodebuild.sh index 19e1e06dad60..719b9c841811 100755 --- a/samples/client/petstore/swift5/default/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift5/default/SwaggerClientTests/run_xcodebuild.sh @@ -1,5 +1,3 @@ #!/bin/sh -pod install - -xcodebuild clean build build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs.swift index b40334cece0a..79ef8ff207b2 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -27,6 +27,7 @@ open class RequestBuilder { public let parameters: [String: Any]? public let method: String public let URLString: String + public let requestTask: RequestTask = RequestTask() /// 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. @@ -49,8 +50,8 @@ open class RequestBuilder { } @discardableResult - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { - return nil + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return requestTask } public func addHeader(name: String, value: String) -> Self { diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 59a82575aa13..ed7c4d5c1f88 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -20,7 +20,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func addPet(pet: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func addPet(pet: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return addPetWithRequestBuilder(pet: pet).execute(apiResponseQueue) { result in switch result { case .success: @@ -67,7 +67,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in switch result { case .success: @@ -126,7 +126,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -177,7 +177,7 @@ open class PetAPI { */ @available(*, deprecated, message: "This operation is deprecated.") @discardableResult - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -228,7 +228,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> RequestTask { return getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -278,7 +278,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updatePet(pet: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updatePet(pet: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithRequestBuilder(pet: pet).execute(apiResponseQueue) { result in switch result { case .success: @@ -326,7 +326,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: @@ -385,7 +385,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> RequestTask { return uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 0f5624f3e1ff..b09bede07879 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -20,7 +20,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: @@ -66,7 +66,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> RequestTask { return getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -112,7 +112,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -159,7 +159,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func placeOrder(order: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func placeOrder(order: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return placeOrderWithRequestBuilder(order: order).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 26c12a61e64f..c68667274c12 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -20,7 +20,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUser(user: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUser(user: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUserWithRequestBuilder(user: user).execute(apiResponseQueue) { result in switch result { case .success: @@ -67,7 +67,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUsersWithArrayInput(user: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUsersWithArrayInput(user: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithArrayInputWithRequestBuilder(user: user).execute(apiResponseQueue) { result in switch result { case .success: @@ -113,7 +113,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUsersWithListInput(user: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUsersWithListInput(user: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithListInputWithRequestBuilder(user: user).execute(apiResponseQueue) { result in switch result { case .success: @@ -159,7 +159,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: @@ -209,7 +209,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> RequestTask { return getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -256,7 +256,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> RequestTask { return loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -304,7 +304,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: @@ -350,7 +350,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updateUser(username: String, user: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updateUser(username: String, user: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updateUserWithRequestBuilder(username: username, user: user).execute(apiResponseQueue) { result in switch result { case .success: diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift index 7787127c40d8..7cb4e06d16cc 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -78,3 +78,16 @@ open class Response { self.init(statusCode: response.statusCode, header: header, body: body) } } + +public final class RequestTask { + private var task: URLSessionTask? + + internal func set(task: URLSessionTask) { + self.task = task + } + + public func cancel() { + task?.cancel() + task = nil + } +} diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index fe7fb6683bcf..23df908ca326 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -100,7 +100,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } @discardableResult - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { let urlSession = createURLSession() guard let xMethod = HTTPMethod(rawValue: method) else { @@ -172,14 +172,14 @@ open class URLSessionRequestBuilder: RequestBuilder { dataTask.resume() - return dataTask + requestTask.set(task: dataTask) } catch { apiResponseQueue.async { completion(.failure(ErrorResponse.error(415, nil, nil, error))) } - - return nil } + + return requestTask } fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { 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 571d0564cef5..2dc59ba173f7 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -27,6 +27,7 @@ internal class RequestBuilder { internal let parameters: [String: Any]? internal let method: String internal let URLString: String + internal let requestTask: RequestTask = RequestTask() /// 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. @@ -49,8 +50,8 @@ internal class RequestBuilder { } @discardableResult - internal func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { - return nil + internal func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return requestTask } internal func addHeader(name: String, value: String) -> Self { 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 f5d2ab74a2f4..fee5f2b8cc28 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 @@ -20,7 +20,7 @@ internal class AnotherFakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result 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 31c875915aca..344309b20bce 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 @@ -19,7 +19,7 @@ internal class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -61,7 +61,7 @@ internal class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -103,7 +103,7 @@ internal class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -145,7 +145,7 @@ internal class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -187,7 +187,7 @@ internal class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -230,7 +230,7 @@ internal class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -276,7 +276,7 @@ internal class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -333,7 +333,7 @@ internal class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - 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)) -> URLSessionTask? { + 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)) -> RequestTask { return 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 in switch result { case .success: @@ -485,7 +485,7 @@ internal class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: @@ -555,7 +555,7 @@ internal class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - 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)) -> URLSessionTask? { + 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)) -> RequestTask { return testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in switch result { case .success: @@ -611,7 +611,7 @@ internal class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in switch result { case .success: @@ -655,7 +655,7 @@ internal class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in switch result { case .success: 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 e6f46831cf9e..ff9d932c5a00 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 @@ -20,7 +20,7 @@ internal class FakeClassnameTags123API { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result 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 74aa56a14e69..84428b2b76be 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 @@ -20,7 +20,7 @@ internal class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -67,7 +67,7 @@ internal class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func deletePet(apiKey: String? = nil, petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func deletePet(apiKey: String? = nil, petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deletePetWithRequestBuilder(apiKey: apiKey, petId: petId).execute(apiResponseQueue) { result in switch result { case .success: @@ -126,7 +126,7 @@ internal class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -177,7 +177,7 @@ internal class PetAPI { */ @available(*, deprecated, message: "This operation is deprecated.") @discardableResult - internal class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -228,7 +228,7 @@ internal class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> RequestTask { return getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -278,7 +278,7 @@ internal class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -326,7 +326,7 @@ internal class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: @@ -385,7 +385,7 @@ internal class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> RequestTask { return uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -444,7 +444,7 @@ internal class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func uploadFileWithRequiredFile(petId: Int64, additionalMetadata: String? = nil, requiredFile: URL, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func uploadFileWithRequiredFile(petId: Int64, additionalMetadata: String? = nil, requiredFile: URL, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> RequestTask { return uploadFileWithRequiredFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, requiredFile: requiredFile).execute(apiResponseQueue) { result in switch result { case let .success(response): 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 111ce53225f7..226802df83a3 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 @@ -20,7 +20,7 @@ internal class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: @@ -66,7 +66,7 @@ internal class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> RequestTask { return getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -112,7 +112,7 @@ internal class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -159,7 +159,7 @@ internal class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result 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 f8a4404579bb..352cb794c303 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 @@ -20,7 +20,7 @@ internal class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -64,7 +64,7 @@ internal class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -107,7 +107,7 @@ internal class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -150,7 +150,7 @@ internal class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: @@ -197,7 +197,7 @@ internal class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> RequestTask { return getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -244,7 +244,7 @@ internal class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> RequestTask { return loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -292,7 +292,7 @@ internal class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: @@ -335,7 +335,7 @@ internal class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in switch result { case .success: 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 60869f63ef61..7fcbd1ee511b 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -78,3 +78,16 @@ internal class Response { self.init(statusCode: response.statusCode, header: header, body: body) } } + +internal final class RequestTask { + private var task: URLSessionTask? + + internal func set(task: URLSessionTask) { + self.task = task + } + + internal func cancel() { + task?.cancel() + task = nil + } +} 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 0d4c11bc1ac5..929cbc5f04f9 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -100,7 +100,7 @@ internal class URLSessionRequestBuilder: RequestBuilder { } @discardableResult - override internal func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + override internal func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { let urlSession = createURLSession() guard let xMethod = HTTPMethod(rawValue: method) else { @@ -172,14 +172,14 @@ internal class URLSessionRequestBuilder: RequestBuilder { dataTask.resume() - return dataTask + requestTask.set(task: dataTask) } catch { apiResponseQueue.async { completion(.failure(ErrorResponse.error(415, nil, nil, error))) } - - return nil } + + return requestTask } fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { 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 a7933c418ad4..485585212d42 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -27,6 +27,7 @@ open class RequestBuilder { public let parameters: [String: Any]? public let method: String public let URLString: String + public let requestTask: RequestTask = RequestTask() /// 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. @@ -49,8 +50,8 @@ open class RequestBuilder { } @discardableResult - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { - return nil + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return requestTask } public func addHeader(name: String, value: String) -> Self { 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 d84e62c007e9..c8199c163564 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 @@ -20,7 +20,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result 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 5396fe8dd325..3211e37fe6d6 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 @@ -19,7 +19,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -61,7 +61,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -103,7 +103,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -145,7 +145,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -187,7 +187,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -230,7 +230,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -276,7 +276,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -333,7 +333,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - 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)) -> URLSessionTask? { + 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)) -> RequestTask { return 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 in switch result { case .success: @@ -485,7 +485,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: @@ -555,7 +555,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - 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)) -> URLSessionTask? { + 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)) -> RequestTask { return testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in switch result { case .success: @@ -611,7 +611,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in switch result { case .success: @@ -655,7 +655,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in switch result { case .success: 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 153aaa15d8f3..897771399d5a 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 @@ -20,7 +20,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result 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 58fbeae4d633..851cba507158 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 @@ -20,7 +20,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -67,7 +67,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in switch result { case .success: @@ -126,7 +126,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -177,7 +177,7 @@ import AnyCodable */ @available(*, deprecated, message: "This operation is deprecated.") @discardableResult - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -228,7 +228,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> RequestTask { return getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -278,7 +278,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -326,7 +326,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: @@ -385,7 +385,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> RequestTask { return uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -444,7 +444,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> RequestTask { return uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in switch result { case let .success(response): 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 c4c37878af96..333059bb1004 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 @@ -20,7 +20,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: @@ -66,7 +66,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> RequestTask { return getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -112,7 +112,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -159,7 +159,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result 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 fc6c823089ae..6a9da2b760ee 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 @@ -20,7 +20,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -64,7 +64,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -107,7 +107,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -150,7 +150,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: @@ -197,7 +197,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> RequestTask { return getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -244,7 +244,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> RequestTask { return loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -292,7 +292,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: @@ -335,7 +335,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in switch result { case .success: 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 7787127c40d8..7cb4e06d16cc 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -78,3 +78,16 @@ open class Response { self.init(statusCode: response.statusCode, header: header, body: body) } } + +public final class RequestTask { + private var task: URLSessionTask? + + internal func set(task: URLSessionTask) { + self.task = task + } + + public func cancel() { + task?.cancel() + task = nil + } +} 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 fe7fb6683bcf..23df908ca326 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -100,7 +100,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } @discardableResult - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { let urlSession = createURLSession() guard let xMethod = HTTPMethod(rawValue: method) else { @@ -172,14 +172,14 @@ open class URLSessionRequestBuilder: RequestBuilder { dataTask.resume() - return dataTask + requestTask.set(task: dataTask) } catch { apiResponseQueue.async { completion(.failure(ErrorResponse.error(415, nil, nil, error))) } - - return nil } + + return requestTask } fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIs.swift index 312ef272770c..96e432a19d0a 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -27,6 +27,7 @@ open class RequestBuilder { public let parameters: [String: Any]? public let method: String public let URLString: String + public let requestTask: RequestTask = RequestTask() /// 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. @@ -49,8 +50,8 @@ open class RequestBuilder { } @discardableResult - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { - return nil + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return requestTask } public func addHeader(name: String, value: String) -> Self { diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIs/DefaultAPI.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIs/DefaultAPI.swift index 0fabebe64100..f17b96cd1f94 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIs/DefaultAPI.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIs/DefaultAPI.swift @@ -18,7 +18,7 @@ open class DefaultAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func rootGet(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Fruit?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func rootGet(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Fruit?, _ error: Error?) -> Void)) -> RequestTask { return rootGetWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models.swift index 7787127c40d8..7cb4e06d16cc 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -78,3 +78,16 @@ open class Response { self.init(statusCode: response.statusCode, header: header, body: body) } } + +public final class RequestTask { + private var task: URLSessionTask? + + internal func set(task: URLSessionTask) { + self.task = task + } + + public func cancel() { + task?.cancel() + task = nil + } +} diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index fe7fb6683bcf..23df908ca326 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -100,7 +100,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } @discardableResult - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { let urlSession = createURLSession() guard let xMethod = HTTPMethod(rawValue: method) else { @@ -172,14 +172,14 @@ open class URLSessionRequestBuilder: RequestBuilder { dataTask.resume() - return dataTask + requestTask.set(task: dataTask) } catch { apiResponseQueue.async { completion(.failure(ErrorResponse.error(415, nil, nil, error))) } - - return nil } + + return requestTask } fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { 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 a7933c418ad4..485585212d42 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -27,6 +27,7 @@ open class RequestBuilder { public let parameters: [String: Any]? public let method: String public let URLString: String + public let requestTask: RequestTask = RequestTask() /// 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. @@ -49,8 +50,8 @@ open class RequestBuilder { } @discardableResult - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { - return nil + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return requestTask } public func addHeader(name: String, value: String) -> Self { 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 7787127c40d8..7cb4e06d16cc 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -78,3 +78,16 @@ open class Response { self.init(statusCode: response.statusCode, header: header, body: body) } } + +public final class RequestTask { + private var task: URLSessionTask? + + internal func set(task: URLSessionTask) { + self.task = task + } + + public func cancel() { + task?.cancel() + task = nil + } +} 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 fe7fb6683bcf..23df908ca326 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -100,7 +100,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } @discardableResult - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { let urlSession = createURLSession() guard let xMethod = HTTPMethod(rawValue: method) else { @@ -172,14 +172,14 @@ open class URLSessionRequestBuilder: RequestBuilder { dataTask.resume() - return dataTask + requestTask.set(task: dataTask) } catch { apiResponseQueue.async { completion(.failure(ErrorResponse.error(415, nil, nil, error))) } - - return nil } + + return requestTask } fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { diff --git a/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved b/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved index 63ce26f05eba..b1a805eecf89 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -6,13 +6,13 @@ "repositoryURL": "https://github.com/Flight-School/AnyCodable", "state": { "branch": null, - "revision": "876d162385e9862ae8b3c8d65dc301312b040005", - "version": "0.6.0" + "revision": "b1a7a8a6186f2fcb28f7bda67cfc545de48b3c80", + "version": "0.6.2" } }, { "package": "PromiseKit", - "repositoryURL": "https://github.com/mxcl/PromiseKit.git", + "repositoryURL": "https://github.com/mxcl/PromiseKit", "state": { "branch": null, "revision": "d2f7ba14bcdc45e18f4f60ad9df883fb9055f081", diff --git a/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift index b29dfa48ec63..ff6de167c8ef 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift @@ -27,7 +27,7 @@ class PetAPITests: XCTestCase { func test1CreatePet() { let expectation = self.expectation(description: "testCreatePet") - let category = PetstoreClient.Category(id: 1234, name: "eyeColor") + let category = Category(id: 1234, name: "eyeColor") let tags = [Tag(id: 1234, name: "New York"), Tag(id: 124321, name: "Jose")] let newPet = Pet(id: 1000, category: category, name: "Fluffy", photoUrls: ["https://petstore.com/sample/photo1.jpg", "https://petstore.com/sample/photo2.jpg"], tags: tags, status: .available) diff --git a/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/run_xcodebuild.sh index 79520c7fc38c..719b9c841811 100755 --- a/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/run_xcodebuild.sh @@ -1,5 +1,3 @@ #!/bin/sh -pod install - -xcodebuild -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" test -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs.swift index a7933c418ad4..485585212d42 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -27,6 +27,7 @@ open class RequestBuilder { public let parameters: [String: Any]? public let method: String public let URLString: String + public let requestTask: RequestTask = RequestTask() /// 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. @@ -49,8 +50,8 @@ open class RequestBuilder { } @discardableResult - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { - return nil + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return requestTask } public func addHeader(name: String, value: String) -> Self { diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index ac45c1f454b7..5e179af64e25 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -20,7 +20,7 @@ open class AnotherFakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index a5165719f100..d980142c6ab2 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -19,7 +19,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -61,7 +61,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -103,7 +103,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -145,7 +145,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -187,7 +187,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -230,7 +230,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -276,7 +276,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -333,7 +333,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - 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)) -> URLSessionTask? { + 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)) -> RequestTask { return 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 in switch result { case .success: @@ -485,7 +485,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: @@ -555,7 +555,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - 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)) -> URLSessionTask? { + 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)) -> RequestTask { return testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in switch result { case .success: @@ -611,7 +611,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in switch result { case .success: @@ -655,7 +655,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in switch result { case .success: diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index ac274a7c550a..34e8c9c7f233 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -20,7 +20,7 @@ open class FakeClassnameTags123API { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index bd5c091925bf..254930e7779f 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -20,7 +20,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -67,7 +67,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in switch result { case .success: @@ -126,7 +126,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -177,7 +177,7 @@ open class PetAPI { */ @available(*, deprecated, message: "This operation is deprecated.") @discardableResult - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -228,7 +228,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> RequestTask { return getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -278,7 +278,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -326,7 +326,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: @@ -385,7 +385,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> RequestTask { return uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -444,7 +444,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> RequestTask { return uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index f25392268665..c111e8301304 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -20,7 +20,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: @@ -66,7 +66,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> RequestTask { return getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -112,7 +112,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -159,7 +159,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 3fc59f9ef4fc..5e01a4a7c346 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -20,7 +20,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -64,7 +64,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -107,7 +107,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -150,7 +150,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: @@ -197,7 +197,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> RequestTask { return getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -244,7 +244,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> RequestTask { return loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -292,7 +292,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: @@ -335,7 +335,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in switch result { case .success: diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift index 7787127c40d8..7cb4e06d16cc 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -78,3 +78,16 @@ open class Response { self.init(statusCode: response.statusCode, header: header, body: body) } } + +public final class RequestTask { + private var task: URLSessionTask? + + internal func set(task: URLSessionTask) { + self.task = task + } + + public func cancel() { + task?.cancel() + task = nil + } +} diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index fe7fb6683bcf..23df908ca326 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -100,7 +100,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } @discardableResult - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { let urlSession = createURLSession() guard let xMethod = HTTPMethod(rawValue: method) else { @@ -172,14 +172,14 @@ open class URLSessionRequestBuilder: RequestBuilder { dataTask.resume() - return dataTask + requestTask.set(task: dataTask) } catch { apiResponseQueue.async { completion(.failure(ErrorResponse.error(415, nil, nil, error))) } - - return nil } + + return requestTask } fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { 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 c097bc87b6e0..c684ae4fad1e 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -19,6 +19,7 @@ open class RequestBuilder { public let parameters: [String: Any]? public let method: String public let URLString: String + public let requestTask: RequestTask = RequestTask() /// 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. @@ -41,8 +42,8 @@ open class RequestBuilder { } @discardableResult - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { - return nil + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return requestTask } public func addHeader(name: String, value: String) -> Self { 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 03e84c9a2e39..2c9646087005 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 @@ -20,7 +20,7 @@ open class AnotherFakeAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): 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 db0c4cb351cb..e34744063884 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 @@ -19,7 +19,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -61,7 +61,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -103,7 +103,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -145,7 +145,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -187,7 +187,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -230,7 +230,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -276,7 +276,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -333,7 +333,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ @discardableResult - 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 ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + 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 ((_ result: Swift.Result) -> Void)) -> RequestTask { return 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 in switch result { case .success: @@ -485,7 +485,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: @@ -555,7 +555,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ @discardableResult - 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 ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + 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 ((_ result: Swift.Result) -> Void)) -> RequestTask { return testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in switch result { case .success: @@ -611,7 +611,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in switch result { case .success: @@ -655,7 +655,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in switch result { case .success: 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 0749c5c9dc71..bc8e16a86dd0 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 @@ -20,7 +20,7 @@ open class FakeClassnameTags123API { - parameter completion: completion handler to receive the result */ @discardableResult - open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): 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 33bc3ed33a9a..d88ad67da751 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 @@ -20,7 +20,7 @@ open class PetAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -67,7 +67,7 @@ open class PetAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in switch result { case .success: @@ -126,7 +126,7 @@ open class PetAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<[Pet], ErrorResponse>) -> Void)) -> URLSessionTask? { + open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<[Pet], ErrorResponse>) -> Void)) -> RequestTask { return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -177,7 +177,7 @@ open class PetAPI { */ @available(*, deprecated, message: "This operation is deprecated.") @discardableResult - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<[Pet], ErrorResponse>) -> Void)) -> URLSessionTask? { + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<[Pet], ErrorResponse>) -> Void)) -> RequestTask { return findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -228,7 +228,7 @@ open class PetAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -278,7 +278,7 @@ open class PetAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -326,7 +326,7 @@ open class PetAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: @@ -385,7 +385,7 @@ open class PetAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -444,7 +444,7 @@ open class PetAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in switch result { case let .success(response): 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 6ce5440ab905..766f89065fee 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 @@ -20,7 +20,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: @@ -66,7 +66,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<[String: Int], ErrorResponse>) -> Void)) -> URLSessionTask? { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<[String: Int], ErrorResponse>) -> Void)) -> RequestTask { return getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -112,7 +112,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -159,7 +159,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): 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 bca3f08fe834..0a40144f75a8 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 @@ -20,7 +20,7 @@ open class UserAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -64,7 +64,7 @@ open class UserAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -107,7 +107,7 @@ open class UserAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -150,7 +150,7 @@ open class UserAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: @@ -197,7 +197,7 @@ open class UserAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -244,7 +244,7 @@ open class UserAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -292,7 +292,7 @@ open class UserAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: @@ -335,7 +335,7 @@ open class UserAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in switch result { case .success: 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 7787127c40d8..7cb4e06d16cc 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -78,3 +78,16 @@ open class Response { self.init(statusCode: response.statusCode, header: header, body: body) } } + +public final class RequestTask { + private var task: URLSessionTask? + + internal func set(task: URLSessionTask) { + self.task = task + } + + public func cancel() { + task?.cancel() + task = nil + } +} 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 fe7fb6683bcf..23df908ca326 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -100,7 +100,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } @discardableResult - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { let urlSession = createURLSession() guard let xMethod = HTTPMethod(rawValue: method) else { @@ -172,14 +172,14 @@ open class URLSessionRequestBuilder: RequestBuilder { dataTask.resume() - return dataTask + requestTask.set(task: dataTask) } catch { apiResponseQueue.async { completion(.failure(ErrorResponse.error(415, nil, nil, error))) } - - return nil } + + return requestTask } fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { 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 a7933c418ad4..485585212d42 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -27,6 +27,7 @@ open class RequestBuilder { public let parameters: [String: Any]? public let method: String public let URLString: String + public let requestTask: RequestTask = RequestTask() /// 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. @@ -49,8 +50,8 @@ open class RequestBuilder { } @discardableResult - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { - return nil + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return requestTask } public func addHeader(name: String, value: String) -> Self { 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 34db22eeb118..336e8a19e364 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 @@ -22,7 +22,7 @@ open class AnotherFakeAPI { */ open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let requestTask = call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body) @@ -33,7 +33,7 @@ open class AnotherFakeAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } 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 4d998a532176..e27e0b6c2db3 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 @@ -21,7 +21,7 @@ open class FakeAPI { */ open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let requestTask = fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body) @@ -32,7 +32,7 @@ open class FakeAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -69,7 +69,7 @@ open class FakeAPI { */ open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let requestTask = fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body) @@ -80,7 +80,7 @@ open class FakeAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -117,7 +117,7 @@ open class FakeAPI { */ open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let requestTask = fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body) @@ -128,7 +128,7 @@ open class FakeAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -165,7 +165,7 @@ open class FakeAPI { */ open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let requestTask = fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body) @@ -176,7 +176,7 @@ open class FakeAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -213,7 +213,7 @@ open class FakeAPI { */ open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let requestTask = testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -224,7 +224,7 @@ open class FakeAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -262,7 +262,7 @@ open class FakeAPI { */ open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in + let requestTask = testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -273,7 +273,7 @@ open class FakeAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -314,7 +314,7 @@ open class FakeAPI { */ open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let requestTask = testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body) @@ -325,7 +325,7 @@ open class FakeAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -377,7 +377,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, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = 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 in + let requestTask = 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 in switch result { case .success: observer.onNext(()) @@ -388,7 +388,7 @@ open class FakeAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -535,7 +535,7 @@ open class FakeAPI { */ open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in + let requestTask = testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -546,7 +546,7 @@ open class FakeAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -611,7 +611,7 @@ open class FakeAPI { */ open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in + let requestTask = testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -622,7 +622,7 @@ open class FakeAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -673,7 +673,7 @@ open class FakeAPI { */ open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in + let requestTask = testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -684,7 +684,7 @@ open class FakeAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -723,7 +723,7 @@ open class FakeAPI { */ open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in + let requestTask = testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -734,7 +734,7 @@ open class FakeAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } 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 a19dd70dd44b..bd7da53d6071 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 @@ -22,7 +22,7 @@ open class FakeClassnameTags123API { */ open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let requestTask = testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body) @@ -33,7 +33,7 @@ open class FakeClassnameTags123API { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } 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 73e4a43c655e..a1fa17f78bed 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 @@ -22,7 +22,7 @@ open class PetAPI { */ open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let requestTask = addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -33,7 +33,7 @@ open class PetAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -75,7 +75,7 @@ open class PetAPI { */ open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in + let requestTask = deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -86,7 +86,7 @@ open class PetAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -140,7 +140,7 @@ open class PetAPI { */ open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable<[Pet]> { return Observable.create { observer -> Disposable in - let task = findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in + let requestTask = findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body) @@ -151,7 +151,7 @@ open class PetAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -197,7 +197,7 @@ open class PetAPI { @available(*, deprecated, message: "This operation is deprecated.") open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable<[Pet]> { return Observable.create { observer -> Disposable in - let task = findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in + let requestTask = findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body) @@ -208,7 +208,7 @@ open class PetAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -254,7 +254,7 @@ open class PetAPI { */ open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in + let requestTask = getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body) @@ -265,7 +265,7 @@ open class PetAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -310,7 +310,7 @@ open class PetAPI { */ open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let requestTask = updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -321,7 +321,7 @@ open class PetAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -364,7 +364,7 @@ open class PetAPI { */ open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in + let requestTask = updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -375,7 +375,7 @@ open class PetAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -429,7 +429,7 @@ open class PetAPI { */ open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in + let requestTask = uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body) @@ -440,7 +440,7 @@ open class PetAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -494,7 +494,7 @@ open class PetAPI { */ open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in + let requestTask = uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body) @@ -505,7 +505,7 @@ open class PetAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } 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 09ef36156209..283b7332c551 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 @@ -22,7 +22,7 @@ open class StoreAPI { */ open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + let requestTask = deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -33,7 +33,7 @@ open class StoreAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -74,7 +74,7 @@ open class StoreAPI { */ open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable<[String: Int]> { return Observable.create { observer -> Disposable in - let task = getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in + let requestTask = getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body) @@ -85,7 +85,7 @@ open class StoreAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -126,7 +126,7 @@ open class StoreAPI { */ open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + let requestTask = getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body) @@ -137,7 +137,7 @@ open class StoreAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -179,7 +179,7 @@ open class StoreAPI { */ open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let requestTask = placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body) @@ -190,7 +190,7 @@ open class StoreAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } 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 be932ce5e321..c0be612ac9ee 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 @@ -22,7 +22,7 @@ open class UserAPI { */ open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let requestTask = createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -33,7 +33,7 @@ open class UserAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -72,7 +72,7 @@ open class UserAPI { */ open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let requestTask = createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -83,7 +83,7 @@ open class UserAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -121,7 +121,7 @@ open class UserAPI { */ open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let requestTask = createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -132,7 +132,7 @@ open class UserAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -170,7 +170,7 @@ open class UserAPI { */ open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + let requestTask = deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -181,7 +181,7 @@ open class UserAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -223,7 +223,7 @@ open class UserAPI { */ open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + let requestTask = getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body) @@ -234,7 +234,7 @@ open class UserAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -276,7 +276,7 @@ open class UserAPI { */ open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in + let requestTask = loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body) @@ -287,7 +287,7 @@ open class UserAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -330,7 +330,7 @@ open class UserAPI { */ open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in + let requestTask = logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -341,7 +341,7 @@ open class UserAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -379,7 +379,7 @@ open class UserAPI { */ open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in + let requestTask = updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -390,7 +390,7 @@ open class UserAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } 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 7787127c40d8..7cb4e06d16cc 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -78,3 +78,16 @@ open class Response { self.init(statusCode: response.statusCode, header: header, body: body) } } + +public final class RequestTask { + private var task: URLSessionTask? + + internal func set(task: URLSessionTask) { + self.task = task + } + + public func cancel() { + task?.cancel() + task = nil + } +} 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 fe7fb6683bcf..23df908ca326 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -100,7 +100,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } @discardableResult - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { let urlSession = createURLSession() guard let xMethod = HTTPMethod(rawValue: method) else { @@ -172,14 +172,14 @@ open class URLSessionRequestBuilder: RequestBuilder { dataTask.resume() - return dataTask + requestTask.set(task: dataTask) } catch { apiResponseQueue.async { completion(.failure(ErrorResponse.error(415, nil, nil, error))) } - - return nil } + + return requestTask } fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { diff --git a/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved b/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved index 231d85369677..dde8565ecf67 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -6,13 +6,13 @@ "repositoryURL": "https://github.com/Flight-School/AnyCodable", "state": { "branch": null, - "revision": "876d162385e9862ae8b3c8d65dc301312b040005", - "version": "0.6.0" + "revision": "b1a7a8a6186f2fcb28f7bda67cfc545de48b3c80", + "version": "0.6.2" } }, { "package": "RxSwift", - "repositoryURL": "https://github.com/ReactiveX/RxSwift.git", + "repositoryURL": "https://github.com/ReactiveX/RxSwift", "state": { "branch": null, "revision": "7c17a6ccca06b5c107cfa4284e634562ddaf5951", diff --git a/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift index db7609caf07d..d5da81a1203e 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift @@ -28,7 +28,7 @@ class PetAPITests: XCTestCase { func test1CreatePet() { let expectation = self.expectation(description: "testCreatePet") - let category = PetstoreClient.Category(id: 1234, name: "eyeColor") + let category = Category(id: 1234, name: "eyeColor") let tags = [Tag(id: 1234, name: "New York"), Tag(id: 124321, name: "Jose")] let newPet = Pet(id: 1000, category: category, name: "Fluffy", photoUrls: ["https://petstore.com/sample/photo1.jpg", "https://petstore.com/sample/photo2.jpg"], tags: tags, status: .available) diff --git a/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/run_xcodebuild.sh index 79520c7fc38c..719b9c841811 100755 --- a/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/run_xcodebuild.sh @@ -1,5 +1,3 @@ #!/bin/sh -pod install - -xcodebuild -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" test -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift5/swift5_test_all.sh b/samples/client/petstore/swift5/swift5_test_all.sh index faeb4ca6aa14..5fdedca3282b 100755 --- a/samples/client/petstore/swift5/swift5_test_all.sh +++ b/samples/client/petstore/swift5/swift5_test_all.sh @@ -5,13 +5,12 @@ set -e DIRECTORY=`dirname $0` # example project with unit tests -# temporarily commment them because they are flaky -# mvn -f $DIRECTORY/alamofireLibrary/SwaggerClientTests/pom.xml integration-test -# mvn -f $DIRECTORY/combineLibrary/SwaggerClientTests/pom.xml integration-test -# mvn -f $DIRECTORY/default/SwaggerClientTests/pom.xml integration-test -# mvn -f $DIRECTORY/promisekitLibrary/SwaggerClientTests/pom.xml integration-test -# mvn -f $DIRECTORY/rxswiftLibrary/SwaggerClientTests/pom.xml integration-test -# mvn -f $DIRECTORY/urlsessionLibrary/SwaggerClientTests/pom.xml integration-test +mvn -f $DIRECTORY/alamofireLibrary/SwaggerClientTests/pom.xml integration-test +mvn -f $DIRECTORY/combineLibrary/SwaggerClientTests/pom.xml integration-test +mvn -f $DIRECTORY/default/SwaggerClientTests/pom.xml integration-test +mvn -f $DIRECTORY/promisekitLibrary/SwaggerClientTests/pom.xml integration-test +mvn -f $DIRECTORY/rxswiftLibrary/SwaggerClientTests/pom.xml integration-test +mvn -f $DIRECTORY/urlsessionLibrary/SwaggerClientTests/pom.xml integration-test # spm build mvn -f $DIRECTORY/alamofireLibrary/pom.xml integration-test diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs.swift index a7933c418ad4..485585212d42 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs.swift @@ -27,6 +27,7 @@ open class RequestBuilder { public let parameters: [String: Any]? public let method: String public let URLString: String + public let requestTask: RequestTask = RequestTask() /// 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. @@ -49,8 +50,8 @@ open class RequestBuilder { } @discardableResult - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { - return nil + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return requestTask } public func addHeader(name: String, value: String) -> Self { diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift index 7759248e5377..20dfa6d14c47 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift @@ -23,7 +23,7 @@ open class AnotherFakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift index 80d050c6d3e3..f336d4b552c0 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift @@ -22,7 +22,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -64,7 +64,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -106,7 +106,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -148,7 +148,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -190,7 +190,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -233,7 +233,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -279,7 +279,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -336,7 +336,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - 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)) -> URLSessionTask? { + 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)) -> RequestTask { return 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 in switch result { case .success: @@ -488,7 +488,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: @@ -558,7 +558,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - 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)) -> URLSessionTask? { + 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)) -> RequestTask { return testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in switch result { case .success: @@ -614,7 +614,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in switch result { case .success: @@ -658,7 +658,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in switch result { case .success: diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift index f79685883677..e1608abb4098 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift @@ -23,7 +23,7 @@ open class FakeClassnameTags123API { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/PetAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/PetAPI.swift index ffcf8725e94f..551edaf0db4c 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/PetAPI.swift @@ -23,7 +23,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -70,7 +70,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in switch result { case .success: @@ -129,7 +129,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -180,7 +180,7 @@ open class PetAPI { */ @available(*, deprecated, message: "This operation is deprecated.") @discardableResult - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -231,7 +231,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> RequestTask { return getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -281,7 +281,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -329,7 +329,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: @@ -388,7 +388,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> RequestTask { return uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -447,7 +447,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> RequestTask { return uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift index 8c57ab94977b..052761d676e7 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift @@ -23,7 +23,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: @@ -69,7 +69,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> RequestTask { return getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -115,7 +115,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -162,7 +162,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/UserAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/UserAPI.swift index 90bc5143fa7b..242239a1a9ed 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/UserAPI.swift @@ -23,7 +23,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -67,7 +67,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -110,7 +110,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -153,7 +153,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: @@ -200,7 +200,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> RequestTask { return getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -247,7 +247,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> RequestTask { return loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -295,7 +295,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: @@ -338,7 +338,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in switch result { case .success: diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models.swift index 7787127c40d8..7cb4e06d16cc 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models.swift @@ -78,3 +78,16 @@ open class Response { self.init(statusCode: response.statusCode, header: header, body: body) } } + +public final class RequestTask { + private var task: URLSessionTask? + + internal func set(task: URLSessionTask) { + self.task = task + } + + public func cancel() { + task?.cancel() + task = nil + } +} diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift index fe7fb6683bcf..23df908ca326 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift @@ -100,7 +100,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } @discardableResult - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { let urlSession = createURLSession() guard let xMethod = HTTPMethod(rawValue: method) else { @@ -172,14 +172,14 @@ open class URLSessionRequestBuilder: RequestBuilder { dataTask.resume() - return dataTask + requestTask.set(task: dataTask) } catch { apiResponseQueue.async { completion(.failure(ErrorResponse.error(415, nil, nil, error))) } - - return nil } + + return requestTask } fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { diff --git a/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved b/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved index d384b276b4bc..730957420e19 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -6,8 +6,8 @@ "repositoryURL": "https://github.com/Flight-School/AnyCodable", "state": { "branch": null, - "revision": "876d162385e9862ae8b3c8d65dc301312b040005", - "version": "0.6.0" + "revision": "b1a7a8a6186f2fcb28f7bda67cfc545de48b3c80", + "version": "0.6.2" } } ] diff --git a/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClient/BearerDecodableRequestBuilder.swift b/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClient/BearerDecodableRequestBuilder.swift index a28a4c90c0e9..b1f37b4ea80f 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClient/BearerDecodableRequestBuilder.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClient/BearerDecodableRequestBuilder.swift @@ -20,8 +20,8 @@ class BearerRequestBuilderFactory: RequestBuilderFactory { } class BearerRequestBuilder: URLSessionRequestBuilder { - override func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (Result, Error>) -> Void) { - + @discardableResult + override func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (Result, ErrorResponse>) -> Void) -> RequestTask { // Before making the request, we can validate if we have a bearer token to be able to make a request BearerTokenHandler.refreshTokenIfDoesntExist { @@ -61,12 +61,14 @@ class BearerRequestBuilder: URLSessionRequestBuilder { } } } + + return requestTask } } class BearerDecodableRequestBuilder: URLSessionDecodableRequestBuilder { - override func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (Result, Error>) -> Void) { - + @discardableResult + override func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (Result, ErrorResponse>) -> Void) -> RequestTask { // Before making the request, we can validate if we have a bearer token to be able to make a request BearerTokenHandler.refreshTokenIfDoesntExist { @@ -106,6 +108,8 @@ class BearerDecodableRequestBuilder: URLSessionDecodableRequestBui } } } + + return requestTask } } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift index 31f90f6acfab..f1a26cdd41b8 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift @@ -26,11 +26,11 @@ class PetAPITests: XCTestCase { func test1CreatePet() { let expectation = self.expectation(description: "testCreatePet") - let category = PetstoreClient.Category(id: 1234, name: "eyeColor") - let tags = [Tag(id: 1234, name: "New York"), Tag(id: 124321, name: "Jose")] - let newPet = Pet(id: 1000, category: category, name: "Fluffy", photoUrls: ["https://petstore.com/sample/photo1.jpg", "https://petstore.com/sample/photo2.jpg"], tags: tags, status: .available) + let category = PetstoreClientAPI.Category(id: 1234, name: "eyeColor") + let tags = [PetstoreClientAPI.Tag(id: 1234, name: "New York"), PetstoreClientAPI.Tag(id: 124321, name: "Jose")] + let newPet = PetstoreClientAPI.Pet(id: 1000, category: category, name: "Fluffy", photoUrls: ["https://petstore.com/sample/photo1.jpg", "https://petstore.com/sample/photo2.jpg"], tags: tags, status: .available) - PetAPI.addPet(body: newPet) { (_, error) in + PetstoreClientAPI.PetAPI.addPet(body: newPet) { (_, error) in guard error == nil else { XCTFail("error creating pet") return @@ -45,7 +45,7 @@ class PetAPITests: XCTestCase { func test2GetPet() { let expectation = self.expectation(description: "testGetPet") - PetAPI.getPetById(petId: 1000) { (pet, error) in + PetstoreClientAPI.PetAPI.getPetById(petId: 1000) { (pet, error) in guard error == nil else { XCTFail("error retrieving pet") return @@ -74,7 +74,7 @@ class PetAPITests: XCTestCase { fatalError() } - PetAPI.uploadFile(petId: 1000, additionalMetadata: "additionalMetadata", file: imageURL) { (_, error) in + PetstoreClientAPI.PetAPI.uploadFile(petId: 1000, additionalMetadata: "additionalMetadata", file: imageURL) { (_, error) in guard error == nil else { FileUtils.deleteFile(fileURL: imageURL) XCTFail("error uploading file") @@ -91,7 +91,7 @@ class PetAPITests: XCTestCase { func test4DeletePet() { let expectation = self.expectation(description: "testDeletePet") - PetAPI.deletePet(petId: 1000) { (_, error) in + PetstoreClientAPI.PetAPI.deletePet(petId: 1000) { (_, error) in guard error == nil else { XCTFail("error deleting pet") return diff --git a/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift b/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift index 94cb489e5f25..697526423874 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift @@ -19,10 +19,10 @@ class StoreAPITests: XCTestCase { func test1PlaceOrder() { // use explicit naming to reference the enum so that we test we don't regress on enum naming let shipDate = Date() - let order = Order(id: 1000, petId: 1000, quantity: 10, shipDate: shipDate, status: .placed, complete: true) + let order = PetstoreClientAPI.Order(id: 1000, petId: 1000, quantity: 10, shipDate: shipDate, status: .placed, complete: true) let expectation = self.expectation(description: "testPlaceOrder") - StoreAPI.placeOrder(body: order) { (order, error) in + PetstoreClientAPI.StoreAPI.placeOrder(body: order) { (order, error) in guard error == nil else { XCTFail("error placing order: \(error.debugDescription)") return @@ -45,7 +45,7 @@ class StoreAPITests: XCTestCase { func test2GetOrder() { let expectation = self.expectation(description: "testGetOrder") - StoreAPI.getOrderById(orderId: 1000) { (order, error) in + PetstoreClientAPI.StoreAPI.getOrderById(orderId: 1000) { (order, error) in guard error == nil else { XCTFail("error retrieving order: \(error.debugDescription)") return @@ -59,14 +59,14 @@ class StoreAPITests: XCTestCase { expectation.fulfill() } } - + self.waitForExpectations(timeout: testTimeout, handler: nil) } func test3DeleteOrder() { let expectation = self.expectation(description: "testDeleteOrder") - StoreAPI.deleteOrder(orderId: "1000") { (response, error) in + PetstoreClientAPI.StoreAPI.deleteOrder(orderId: "1000") { (response, error) in guard error == nil else { XCTFail("error deleting order") return @@ -86,7 +86,7 @@ class StoreAPITests: XCTestCase { func testDownloadProgress() { let responseExpectation = self.expectation(description: "obtain response") let progressExpectation = self.expectation(description: "obtain progress") - let requestBuilder = StoreAPI.getOrderByIdWithRequestBuilder(orderId: 1000) + let requestBuilder = PetstoreClientAPI.StoreAPI.getOrderByIdWithRequestBuilder(orderId: 1000) requestBuilder.onProgressReady = { (_) in progressExpectation.fulfill() diff --git a/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift b/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift index 0a1ca3902eb6..2041d1208e7e 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift @@ -27,7 +27,7 @@ class UserAPITests: XCTestCase { func testLogin() { let expectation = self.expectation(description: "testLogin") - UserAPI.loginUser(username: "swiftTester", password: "swift") { (_, error) in + PetstoreClientAPI.UserAPI.loginUser(username: "swiftTester", password: "swift") { (_, error) in guard error == nil else { XCTFail("error logging in") return @@ -42,7 +42,7 @@ class UserAPITests: XCTestCase { func testLogout() { let expectation = self.expectation(description: "testLogout") - UserAPI.logoutUser { (_, error) in + PetstoreClientAPI.UserAPI.logoutUser { (_, error) in guard error == nil else { XCTFail("error logging out") return @@ -58,7 +58,7 @@ class UserAPITests: XCTestCase { // The path for this operation is /user/{userId}. In order to make a usable path, // then we must make sure that {userId} is percent-escaped when it is substituted // into the path. So we intentionally introduce a path with spaces. - let userRequestBuilder = UserAPI.getUserByNameWithRequestBuilder(username: "User Name With Spaces") + let userRequestBuilder = PetstoreClientAPI.UserAPI.getUserByNameWithRequestBuilder(username: "User Name With Spaces") let urlContainsSpace = userRequestBuilder.URLString.contains(" ") XCTAssert(!urlContainsSpace, "Expected URL to be escaped, but it was not.") diff --git a/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/run_xcodebuild.sh index 19e1e06dad60..719b9c841811 100755 --- a/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/run_xcodebuild.sh @@ -1,5 +1,3 @@ #!/bin/sh -pod install - -xcodebuild clean build build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs.swift index a7933c418ad4..485585212d42 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -27,6 +27,7 @@ open class RequestBuilder { public let parameters: [String: Any]? public let method: String public let URLString: String + public let requestTask: RequestTask = RequestTask() /// 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. @@ -49,8 +50,8 @@ open class RequestBuilder { } @discardableResult - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { - return nil + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return requestTask } public func addHeader(name: String, value: String) -> Self { diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index ac45c1f454b7..5e179af64e25 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -20,7 +20,7 @@ open class AnotherFakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index a5165719f100..d980142c6ab2 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -19,7 +19,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -61,7 +61,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -103,7 +103,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -145,7 +145,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -187,7 +187,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -230,7 +230,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -276,7 +276,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -333,7 +333,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - 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)) -> URLSessionTask? { + 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)) -> RequestTask { return 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 in switch result { case .success: @@ -485,7 +485,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: @@ -555,7 +555,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - 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)) -> URLSessionTask? { + 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)) -> RequestTask { return testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in switch result { case .success: @@ -611,7 +611,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in switch result { case .success: @@ -655,7 +655,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in switch result { case .success: diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index ac274a7c550a..34e8c9c7f233 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -20,7 +20,7 @@ open class FakeClassnameTags123API { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index bd5c091925bf..254930e7779f 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -20,7 +20,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -67,7 +67,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in switch result { case .success: @@ -126,7 +126,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -177,7 +177,7 @@ open class PetAPI { */ @available(*, deprecated, message: "This operation is deprecated.") @discardableResult - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -228,7 +228,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> RequestTask { return getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -278,7 +278,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -326,7 +326,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: @@ -385,7 +385,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> RequestTask { return uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -444,7 +444,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> RequestTask { return uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index f25392268665..c111e8301304 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -20,7 +20,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: @@ -66,7 +66,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> RequestTask { return getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -112,7 +112,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -159,7 +159,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 3fc59f9ef4fc..5e01a4a7c346 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -20,7 +20,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -64,7 +64,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -107,7 +107,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -150,7 +150,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: @@ -197,7 +197,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> RequestTask { return getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -244,7 +244,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> RequestTask { return loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -292,7 +292,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: @@ -335,7 +335,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in switch result { case .success: diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models.swift index 7787127c40d8..7cb4e06d16cc 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -78,3 +78,16 @@ open class Response { self.init(statusCode: response.statusCode, header: header, body: body) } } + +public final class RequestTask { + private var task: URLSessionTask? + + internal func set(task: URLSessionTask) { + self.task = task + } + + public func cancel() { + task?.cancel() + task = nil + } +} diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index fe7fb6683bcf..23df908ca326 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -100,7 +100,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } @discardableResult - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { let urlSession = createURLSession() guard let xMethod = HTTPMethod(rawValue: method) else { @@ -172,14 +172,14 @@ open class URLSessionRequestBuilder: RequestBuilder { dataTask.resume() - return dataTask + requestTask.set(task: dataTask) } catch { apiResponseQueue.async { completion(.failure(ErrorResponse.error(415, nil, nil, error))) } - - return nil } + + return requestTask } fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { From 347b75a024452d8fbdfc3864084d2f613004d7ca Mon Sep 17 00:00:00 2001 From: Justin Black Date: Wed, 8 Dec 2021 13:03:08 -0800 Subject: [PATCH 077/117] Fixes paramName and dataType for request body anyType parameters (#11075) * Adds request body of any type * Fixes param dataType, paramName, and baseName * Uses updateRequestBodyForPrimitiveType as the else case for anyType request bodies like the code used to do * Samples updated * Samples regenerated --- .../openapitools/codegen/DefaultCodegen.java | 2 + .../resources/3_0/oneOfArrayMapImport.yaml | 10 ++++ .../Classes/OpenAPIs/APIs.swift | 5 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 24 ++++----- .../APIs/FakeClassnameTags123API.swift | 2 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 18 +++---- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 8 +-- .../Classes/OpenAPIs/APIs/UserAPI.swift | 16 +++--- .../Classes/OpenAPIs/Models.swift | 13 +++++ .../OpenAPIs/URLSessionImplementations.swift | 8 +-- .../builds/default/api/default.service.ts | 51 +++++++++++++++++++ 12 files changed, 118 insertions(+), 41 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 e97a6caf557e..e76b78d6e5a8 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 @@ -6721,6 +6721,8 @@ public CodegenParameter fromRequestBody(RequestBody body, Set imports, S } else if (ModelUtils.isObjectSchema(schema)) { // object type schema OR (AnyType schema with properties defined) this.addBodyModelSchema(codegenParameter, name, schema, imports, bodyParameterName, false); + } else { + updateRequestBodyForPrimitiveType(codegenParameter, schema, bodyParameterName, imports); } addVarsRequiredVarsAdditionalProps(schema, codegenParameter); } else { diff --git a/modules/openapi-generator/src/test/resources/3_0/oneOfArrayMapImport.yaml b/modules/openapi-generator/src/test/resources/3_0/oneOfArrayMapImport.yaml index 9fb06fc38f03..ed2a9f02e3f5 100644 --- a/modules/openapi-generator/src/test/resources/3_0/oneOfArrayMapImport.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/oneOfArrayMapImport.yaml @@ -12,6 +12,16 @@ paths: application/json: schema: $ref: '#/components/schemas/fruit' + put: + operationId: test + parameters: [] + requestBody: + content: + application/json: + schema: {} + responses: + '204': + description: Success components: schemas: fruit: diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs.swift index a7933c418ad4..485585212d42 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -27,6 +27,7 @@ open class RequestBuilder { public let parameters: [String: Any]? public let method: String public let URLString: String + public let requestTask: RequestTask = RequestTask() /// 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. @@ -49,8 +50,8 @@ open class RequestBuilder { } @discardableResult - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { - return nil + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return requestTask } public func addHeader(name: String, value: String) -> Self { diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index ac45c1f454b7..5e179af64e25 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -20,7 +20,7 @@ open class AnotherFakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 9f5c7a495e18..eac6aeb1a3ce 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -19,7 +19,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -61,7 +61,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -103,7 +103,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -145,7 +145,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -187,7 +187,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -230,7 +230,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -276,7 +276,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -333,7 +333,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open 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)) -> URLSessionTask? { + open 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)) -> RequestTask { return 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 in switch result { case .success: @@ -485,7 +485,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: @@ -555,7 +555,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - 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)) -> URLSessionTask? { + 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)) -> RequestTask { return testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in switch result { case .success: @@ -611,7 +611,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in switch result { case .success: @@ -655,7 +655,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in switch result { case .success: diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index ac274a7c550a..34e8c9c7f233 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -20,7 +20,7 @@ open class FakeClassnameTags123API { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 2baca7e644ac..1fc238359a00 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -20,7 +20,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -67,7 +67,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deletePet(apiKey: String? = nil, petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deletePet(apiKey: String? = nil, petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deletePetWithRequestBuilder(apiKey: apiKey, petId: petId).execute(apiResponseQueue) { result in switch result { case .success: @@ -126,7 +126,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -177,7 +177,7 @@ open class PetAPI { */ @available(*, deprecated, message: "This operation is deprecated.") @discardableResult - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -228,7 +228,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> RequestTask { return getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -278,7 +278,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -326,7 +326,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: @@ -385,7 +385,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> RequestTask { return uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -444,7 +444,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func uploadFileWithRequiredFile(petId: Int64, additionalMetadata: String? = nil, requiredFile: URL, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func uploadFileWithRequiredFile(petId: Int64, additionalMetadata: String? = nil, requiredFile: URL, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> RequestTask { return uploadFileWithRequiredFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, requiredFile: requiredFile).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index f25392268665..c111e8301304 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -20,7 +20,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: @@ -66,7 +66,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> RequestTask { return getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -112,7 +112,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -159,7 +159,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 3fc59f9ef4fc..5e01a4a7c346 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -20,7 +20,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -64,7 +64,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -107,7 +107,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -150,7 +150,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: @@ -197,7 +197,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> RequestTask { return getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -244,7 +244,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> RequestTask { return loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -292,7 +292,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: @@ -335,7 +335,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in switch result { case .success: diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models.swift index 7787127c40d8..7cb4e06d16cc 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -78,3 +78,16 @@ open class Response { self.init(statusCode: response.statusCode, header: header, body: body) } } + +public final class RequestTask { + private var task: URLSessionTask? + + internal func set(task: URLSessionTask) { + self.task = task + } + + public func cancel() { + task?.cancel() + task = nil + } +} diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index fe7fb6683bcf..23df908ca326 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -100,7 +100,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } @discardableResult - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { let urlSession = createURLSession() guard let xMethod = HTTPMethod(rawValue: method) else { @@ -172,14 +172,14 @@ open class URLSessionRequestBuilder: RequestBuilder { dataTask.resume() - return dataTask + requestTask.set(task: dataTask) } catch { apiResponseQueue.async { completion(.failure(ErrorResponse.error(415, nil, nil, error))) } - - return nil } + + return requestTask } fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { diff --git a/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/api/default.service.ts b/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/api/default.service.ts index 6a74ef3266ba..7363f44f9462 100644 --- a/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/api/default.service.ts +++ b/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/api/default.service.ts @@ -128,4 +128,55 @@ export class DefaultService { ); } + /** + * @param body + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public test(body?: any, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public test(body?: any, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public test(body?: any, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public test(body?: any, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.put(`${this.configuration.basePath}/`, + body, + { + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + } From b755ae288afe9b4d23de14e72ff6dc7735686690 Mon Sep 17 00:00:00 2001 From: Tomasz Prus Date: Wed, 8 Dec 2021 22:15:26 +0100 Subject: [PATCH 078/117] [Python] Add option to select/detect content-type. (#10978) * [Python] Add option to select/detect content-type. * Regenerate samples after rebase. * Update samples. * test: fix assertion --- .../src/main/resources/python/api.mustache | 5 + .../main/resources/python/api_client.mustache | 34 +++-- .../petstore_api/api/another_fake_api.py | 5 + .../python/petstore_api/api/fake_api.py | 80 ++++++++++ .../api/fake_classname_tags_123_api.py | 5 + .../python/petstore_api/api/pet_api.py | 45 ++++++ .../python/petstore_api/api/store_api.py | 20 +++ .../python/petstore_api/api/user_api.py | 40 +++++ .../python/petstore_api/api_client.py | 34 +++-- .../petstore/python/test/test_fake_api.py | 1 + .../petstore/python/tests/test_api_client.py | 10 ++ .../petstore/python/tests/test_pet_api.py | 25 +++- .../petstore_api/api/another_fake_api.py | 5 + .../petstore_api/api/fake_api.py | 80 ++++++++++ .../api/fake_classname_tags_123_api.py | 5 + .../petstore_api/api/pet_api.py | 45 ++++++ .../petstore_api/api/store_api.py | 20 +++ .../petstore_api/api/user_api.py | 40 +++++ .../petstore_api/api_client.py | 34 +++-- .../test/test_fake_api.py | 1 + .../python/x_auth_id_alias/api/usage_api.py | 20 +++ .../python/x_auth_id_alias/api_client.py | 34 +++-- .../python/dynamic_servers/api/usage_api.py | 10 ++ .../python/dynamic_servers/api_client.py | 34 +++-- .../petstore_api/api/another_fake_api.py | 5 + .../python/petstore_api/api/default_api.py | 5 + .../python/petstore_api/api/fake_api.py | 140 ++++++++++++++++++ .../api/fake_classname_tags_123_api.py | 5 + .../python/petstore_api/api/pet_api.py | 35 +++++ .../python/petstore_api/api/store_api.py | 20 +++ .../python/petstore_api/api/user_api.py | 40 +++++ .../python/petstore_api/api_client.py | 34 +++-- 32 files changed, 855 insertions(+), 61 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/api.mustache b/modules/openapi-generator/src/main/resources/python/api.mustache index 841ac8bb8557..bba20b6210b2 100644 --- a/modules/openapi-generator/src/main/resources/python/api.mustache +++ b/modules/openapi-generator/src/main/resources/python/api.mustache @@ -270,6 +270,9 @@ class {{classname}}(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -298,6 +301,8 @@ class {{classname}}(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') {{#requiredParams}} kwargs['{{paramName}}'] = \ diff --git a/modules/openapi-generator/src/main/resources/python/api_client.mustache b/modules/openapi-generator/src/main/resources/python/api_client.mustache index 91591e10cc51..b083d401dd4e 100644 --- a/modules/openapi-generator/src/main/resources/python/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache @@ -129,7 +129,8 @@ class ApiClient(object): _preload_content: bool = True, _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None + _check_type: typing.Optional[bool] = None, + _content_type: typing.Optional[str] = None ): config = self.configuration @@ -584,10 +585,12 @@ class ApiClient(object): else: return ', '.join(accepts) - def select_header_content_type(self, content_types): + def select_header_content_type(self, content_types, method=None, body=None): """Returns `Content-Type` based on an array of content_types provided. :param content_types: List of content-types. + :param method: http method (e.g. POST, PATCH). + :param body: http body to send. :return: Content-Type (e.g. application/json). """ if not content_types: @@ -595,6 +598,11 @@ class ApiClient(object): content_types = [x.lower() for x in content_types] + if (method == 'PATCH' and + 'application/json-patch+json' in content_types and + isinstance(body, list)): + return 'application/json-patch+json' + if 'application/json' in content_types or '*/*' in content_types: return 'application/json' else: @@ -685,7 +693,8 @@ class Endpoint(object): '_request_timeout', '_return_http_data_only', '_check_input_type', - '_check_return_type' + '_check_return_type', + '_content_type' ]) self.params_map['nullable'].extend(['_request_timeout']) self.validations = root_map['validations'] @@ -698,7 +707,8 @@ class Endpoint(object): '_request_timeout': (none_type, float, (float,), [float], int, (int,), [int]), '_return_http_data_only': (bool,), '_check_input_type': (bool,), - '_check_return_type': (bool,) + '_check_return_type': (bool,), + '_content_type': (none_type, str) } self.openapi_types.update(extra_types) self.attribute_map = root_map['attribute_map'] @@ -845,12 +855,16 @@ class Endpoint(object): params['header']['Accept'] = self.api_client.select_header_accept( accept_headers_list) - content_type_headers_list = self.headers_map['content_type'] - if content_type_headers_list: - if params['body'] != "": - header_list = self.api_client.select_header_content_type( - content_type_headers_list) - params['header']['Content-Type'] = header_list + if kwargs.get('_content_type'): + params['header']['Content-Type'] = kwargs['_content_type'] + else: + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + if params['body'] != "": + header_list = self.api_client.select_header_content_type( + content_type_headers_list, self.settings['http_method'], + params['body']) + params['header']['Content-Type'] = header_list return self.api_client.call_api( self.settings['endpoint_path'], self.settings['http_method'], diff --git a/samples/client/petstore/python/petstore_api/api/another_fake_api.py b/samples/client/petstore/python/petstore_api/api/another_fake_api.py index 2ae65760a36e..1411f08cbc18 100644 --- a/samples/client/petstore/python/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python/petstore_api/api/another_fake_api.py @@ -119,6 +119,9 @@ def call_123_test_special_tags( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -147,6 +150,8 @@ def call_123_test_special_tags( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body 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 4afa17e3cb2b..a21d5838f41f 100644 --- a/samples/client/petstore/python/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python/petstore_api/api/fake_api.py @@ -1132,6 +1132,9 @@ def array_model( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1160,6 +1163,8 @@ def array_model( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.array_model_endpoint.call_with_http_info(**kwargs) @@ -1194,6 +1199,9 @@ def boolean( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1222,6 +1230,8 @@ def boolean( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.boolean_endpoint.call_with_http_info(**kwargs) @@ -1258,6 +1268,9 @@ def create_xml_item( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1286,6 +1299,8 @@ def create_xml_item( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['xml_item'] = \ xml_item @@ -1322,6 +1337,9 @@ def number_with_validations( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1350,6 +1368,8 @@ def number_with_validations( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.number_with_validations_endpoint.call_with_http_info(**kwargs) @@ -1384,6 +1404,9 @@ def object_model_with_ref_props( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1412,6 +1435,8 @@ def object_model_with_ref_props( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.object_model_with_ref_props_endpoint.call_with_http_info(**kwargs) @@ -1446,6 +1471,9 @@ def string( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1474,6 +1502,8 @@ def string( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.string_endpoint.call_with_http_info(**kwargs) @@ -1508,6 +1538,9 @@ def string_enum( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1536,6 +1569,8 @@ def string_enum( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.string_enum_endpoint.call_with_http_info(**kwargs) @@ -1572,6 +1607,9 @@ def test_body_with_file_schema( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1600,6 +1638,8 @@ def test_body_with_file_schema( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body @@ -1639,6 +1679,9 @@ def test_body_with_query_params( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1667,6 +1710,8 @@ def test_body_with_query_params( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['query'] = \ query @@ -1707,6 +1752,9 @@ def test_client_model( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1735,6 +1783,8 @@ def test_client_model( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body @@ -1781,6 +1831,9 @@ def test_endpoint_enums_length_one( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1809,6 +1862,8 @@ def test_endpoint_enums_length_one( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['query_integer'] = \ query_integer @@ -1871,6 +1926,9 @@ def test_endpoint_parameters( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1899,6 +1957,8 @@ def test_endpoint_parameters( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['number'] = \ number @@ -1948,6 +2008,9 @@ def test_enum_parameters( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1976,6 +2039,8 @@ def test_enum_parameters( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.test_enum_parameters_endpoint.call_with_http_info(**kwargs) @@ -2019,6 +2084,9 @@ def test_group_parameters( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2047,6 +2115,8 @@ def test_group_parameters( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['required_string_group'] = \ required_string_group @@ -2088,6 +2158,9 @@ def test_inline_additional_properties( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2116,6 +2189,8 @@ def test_inline_additional_properties( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['param'] = \ param @@ -2155,6 +2230,9 @@ def test_json_form_data( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2183,6 +2261,8 @@ def test_json_form_data( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['param'] = \ param diff --git a/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py index 54fdf7f892a9..76e35824fbe1 100644 --- a/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py @@ -121,6 +121,9 @@ def test_classname( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -149,6 +152,8 @@ def test_classname( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body diff --git a/samples/client/petstore/python/petstore_api/api/pet_api.py b/samples/client/petstore/python/petstore_api/api/pet_api.py index 1a8a4c51fde9..13fb1d981f43 100644 --- a/samples/client/petstore/python/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python/petstore_api/api/pet_api.py @@ -584,6 +584,9 @@ def add_pet( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -612,6 +615,8 @@ def add_pet( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body @@ -650,6 +655,9 @@ def delete_pet( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -678,6 +686,8 @@ def delete_pet( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['pet_id'] = \ pet_id @@ -716,6 +726,9 @@ def find_pets_by_status( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -744,6 +757,8 @@ def find_pets_by_status( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['status'] = \ status @@ -782,6 +797,9 @@ def find_pets_by_tags( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -810,6 +828,8 @@ def find_pets_by_tags( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['tags'] = \ tags @@ -848,6 +868,9 @@ def get_pet_by_id( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -876,6 +899,8 @@ def get_pet_by_id( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['pet_id'] = \ pet_id @@ -913,6 +938,9 @@ def update_pet( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -941,6 +969,8 @@ def update_pet( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body @@ -980,6 +1010,9 @@ def update_pet_with_form( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1008,6 +1041,8 @@ def update_pet_with_form( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['pet_id'] = \ pet_id @@ -1048,6 +1083,9 @@ def upload_file( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1076,6 +1114,8 @@ def upload_file( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['pet_id'] = \ pet_id @@ -1116,6 +1156,9 @@ def upload_file_with_required_file( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1144,6 +1187,8 @@ def upload_file_with_required_file( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['pet_id'] = \ pet_id diff --git a/samples/client/petstore/python/petstore_api/api/store_api.py b/samples/client/petstore/python/petstore_api/api/store_api.py index cd573a911215..934c55259995 100644 --- a/samples/client/petstore/python/petstore_api/api/store_api.py +++ b/samples/client/petstore/python/petstore_api/api/store_api.py @@ -265,6 +265,9 @@ def delete_order( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -293,6 +296,8 @@ def delete_order( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['order_id'] = \ order_id @@ -328,6 +333,9 @@ def get_inventory( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -356,6 +364,8 @@ def get_inventory( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.get_inventory_endpoint.call_with_http_info(**kwargs) @@ -392,6 +402,9 @@ def get_order_by_id( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -420,6 +433,8 @@ def get_order_by_id( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['order_id'] = \ order_id @@ -457,6 +472,9 @@ def place_order( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -485,6 +503,8 @@ def place_order( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body diff --git a/samples/client/petstore/python/petstore_api/api/user_api.py b/samples/client/petstore/python/petstore_api/api/user_api.py index 3088eb159f1d..78cc2f4a8b6b 100644 --- a/samples/client/petstore/python/petstore_api/api/user_api.py +++ b/samples/client/petstore/python/petstore_api/api/user_api.py @@ -452,6 +452,9 @@ def create_user( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -480,6 +483,8 @@ def create_user( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body @@ -517,6 +522,9 @@ def create_users_with_array_input( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -545,6 +553,8 @@ def create_users_with_array_input( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body @@ -582,6 +592,9 @@ def create_users_with_list_input( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -610,6 +623,8 @@ def create_users_with_list_input( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body @@ -648,6 +663,9 @@ def delete_user( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -676,6 +694,8 @@ def delete_user( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['username'] = \ username @@ -713,6 +733,9 @@ def get_user_by_name( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -741,6 +764,8 @@ def get_user_by_name( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['username'] = \ username @@ -780,6 +805,9 @@ def login_user( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -808,6 +836,8 @@ def login_user( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['username'] = \ username @@ -844,6 +874,9 @@ def logout_user( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -872,6 +905,8 @@ def logout_user( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.logout_user_endpoint.call_with_http_info(**kwargs) @@ -910,6 +945,9 @@ def update_user( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -938,6 +976,8 @@ def update_user( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['username'] = \ username diff --git a/samples/client/petstore/python/petstore_api/api_client.py b/samples/client/petstore/python/petstore_api/api_client.py index 9e6f1523497d..7b4eea830ea8 100644 --- a/samples/client/petstore/python/petstore_api/api_client.py +++ b/samples/client/petstore/python/petstore_api/api_client.py @@ -131,7 +131,8 @@ def __call_api( _preload_content: bool = True, _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None + _check_type: typing.Optional[bool] = None, + _content_type: typing.Optional[str] = None ): config = self.configuration @@ -572,10 +573,12 @@ def select_header_accept(self, accepts): else: return ', '.join(accepts) - def select_header_content_type(self, content_types): + def select_header_content_type(self, content_types, method=None, body=None): """Returns `Content-Type` based on an array of content_types provided. :param content_types: List of content-types. + :param method: http method (e.g. POST, PATCH). + :param body: http body to send. :return: Content-Type (e.g. application/json). """ if not content_types: @@ -583,6 +586,11 @@ def select_header_content_type(self, content_types): content_types = [x.lower() for x in content_types] + if (method == 'PATCH' and + 'application/json-patch+json' in content_types and + isinstance(body, list)): + return 'application/json-patch+json' + if 'application/json' in content_types or '*/*' in content_types: return 'application/json' else: @@ -664,7 +672,8 @@ def __init__(self, settings=None, params_map=None, root_map=None, '_request_timeout', '_return_http_data_only', '_check_input_type', - '_check_return_type' + '_check_return_type', + '_content_type' ]) self.params_map['nullable'].extend(['_request_timeout']) self.validations = root_map['validations'] @@ -677,7 +686,8 @@ def __init__(self, settings=None, params_map=None, root_map=None, '_request_timeout': (none_type, float, (float,), [float], int, (int,), [int]), '_return_http_data_only': (bool,), '_check_input_type': (bool,), - '_check_return_type': (bool,) + '_check_return_type': (bool,), + '_content_type': (none_type, str) } self.openapi_types.update(extra_types) self.attribute_map = root_map['attribute_map'] @@ -824,12 +834,16 @@ def call_with_http_info(self, **kwargs): params['header']['Accept'] = self.api_client.select_header_accept( accept_headers_list) - content_type_headers_list = self.headers_map['content_type'] - if content_type_headers_list: - if params['body'] != "": - header_list = self.api_client.select_header_content_type( - content_type_headers_list) - params['header']['Content-Type'] = header_list + if kwargs.get('_content_type'): + params['header']['Content-Type'] = kwargs['_content_type'] + else: + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + if params['body'] != "": + header_list = self.api_client.select_header_content_type( + content_type_headers_list, self.settings['http_method'], + params['body']) + params['header']['Content-Type'] = header_list return self.api_client.call_api( self.settings['endpoint_path'], self.settings['http_method'], diff --git a/samples/client/petstore/python/test/test_fake_api.py b/samples/client/petstore/python/test/test_fake_api.py index 9275f2047c42..c8345a8760ab 100644 --- a/samples/client/petstore/python/test/test_fake_api.py +++ b/samples/client/petstore/python/test/test_fake_api.py @@ -121,6 +121,7 @@ def test_test_endpoint_enums_length_one(self): call_with_http_info.assert_called_with( _check_input_type=True, _check_return_type=True, + _content_type=None, _host_index=None, _preload_content=True, _request_timeout=None, diff --git a/samples/client/petstore/python/tests/test_api_client.py b/samples/client/petstore/python/tests/test_api_client.py index c249bf1fc5e8..35747c842173 100644 --- a/samples/client/petstore/python/tests/test_api_client.py +++ b/samples/client/petstore/python/tests/test_api_client.py @@ -122,6 +122,16 @@ def test_select_header_content_type(self): content_type = self.api_client.select_header_content_type(content_types) self.assertEqual(content_type, 'application/json') + content_types = ['application/json-patch+json', 'application/json'] + content_type = self.api_client.select_header_content_type(content_types, + 'PATCH', [{ "op": "add", "path": "/myPath", "value": ["myValue"]}]) + self.assertEqual(content_type, 'application/json-patch+json') + + content_types = ['application/json-patch+json', 'application/json'] + content_type = self.api_client.select_header_content_type(content_types, + 'PATCH', {"value": ["myValue"]}) + self.assertEqual(content_type, 'application/json') + def test_sanitize_for_serialization(self): # None data = None diff --git a/samples/client/petstore/python/tests/test_pet_api.py b/samples/client/petstore/python/tests/test_pet_api.py index 38d7a1cc0b82..0753f64b238d 100644 --- a/samples/client/petstore/python/tests/test_pet_api.py +++ b/samples/client/petstore/python/tests/test_pet_api.py @@ -391,7 +391,6 @@ def get_header(name, default=None): file.close() self.pet_api.upload_file(pet_id=self.pet.id, file=file) - def test_delete_pet(self): self.pet_api.add_pet(self.pet) self.pet_api.delete_pet(pet_id=self.pet.id, api_key="special-key") @@ -402,5 +401,29 @@ def test_delete_pet(self): except ApiException as e: self.assertEqual(404, e.status) + @patch.object(petstore_api.ApiClient, 'call_api') + @patch.object(petstore_api.ApiClient, 'select_header_content_type') + def test_call_select_header_content_type(self, mock_select_ct, mock_call_api): + mock_select_ct.return_value = 'application/json' + self.pet_api.add_pet(self.pet) + # check if all arguments are passed to select_header_content_type + mock_select_ct.assert_called_once_with( + ['application/json', 'application/xml'], + 'POST', + self.pet) + mock_call_api.assert_called_once() + self.assertEqual(mock_call_api.mock_calls[0][1][4], + {'Content-Type': 'application/json'}) + + @patch.object(petstore_api.ApiClient, 'call_api') + def test_call_with_forced_content_type(self, mock_call_api): + # force content-type + self.pet_api.add_pet(self.pet, _content_type='application/xml') + mock_call_api.assert_called_once() + # check if content-type is used + self.assertEqual(mock_call_api.mock_calls[0][1][4], + {'Content-Type': 'application/xml'}) + + if __name__ == '__main__': unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py index 2ae65760a36e..1411f08cbc18 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py @@ -119,6 +119,9 @@ def call_123_test_special_tags( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -147,6 +150,8 @@ def call_123_test_special_tags( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py index 4afa17e3cb2b..a21d5838f41f 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py @@ -1132,6 +1132,9 @@ def array_model( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1160,6 +1163,8 @@ def array_model( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.array_model_endpoint.call_with_http_info(**kwargs) @@ -1194,6 +1199,9 @@ def boolean( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1222,6 +1230,8 @@ def boolean( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.boolean_endpoint.call_with_http_info(**kwargs) @@ -1258,6 +1268,9 @@ def create_xml_item( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1286,6 +1299,8 @@ def create_xml_item( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['xml_item'] = \ xml_item @@ -1322,6 +1337,9 @@ def number_with_validations( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1350,6 +1368,8 @@ def number_with_validations( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.number_with_validations_endpoint.call_with_http_info(**kwargs) @@ -1384,6 +1404,9 @@ def object_model_with_ref_props( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1412,6 +1435,8 @@ def object_model_with_ref_props( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.object_model_with_ref_props_endpoint.call_with_http_info(**kwargs) @@ -1446,6 +1471,9 @@ def string( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1474,6 +1502,8 @@ def string( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.string_endpoint.call_with_http_info(**kwargs) @@ -1508,6 +1538,9 @@ def string_enum( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1536,6 +1569,8 @@ def string_enum( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.string_enum_endpoint.call_with_http_info(**kwargs) @@ -1572,6 +1607,9 @@ def test_body_with_file_schema( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1600,6 +1638,8 @@ def test_body_with_file_schema( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body @@ -1639,6 +1679,9 @@ def test_body_with_query_params( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1667,6 +1710,8 @@ def test_body_with_query_params( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['query'] = \ query @@ -1707,6 +1752,9 @@ def test_client_model( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1735,6 +1783,8 @@ def test_client_model( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body @@ -1781,6 +1831,9 @@ def test_endpoint_enums_length_one( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1809,6 +1862,8 @@ def test_endpoint_enums_length_one( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['query_integer'] = \ query_integer @@ -1871,6 +1926,9 @@ def test_endpoint_parameters( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1899,6 +1957,8 @@ def test_endpoint_parameters( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['number'] = \ number @@ -1948,6 +2008,9 @@ def test_enum_parameters( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1976,6 +2039,8 @@ def test_enum_parameters( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.test_enum_parameters_endpoint.call_with_http_info(**kwargs) @@ -2019,6 +2084,9 @@ def test_group_parameters( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2047,6 +2115,8 @@ def test_group_parameters( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['required_string_group'] = \ required_string_group @@ -2088,6 +2158,9 @@ def test_inline_additional_properties( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2116,6 +2189,8 @@ def test_inline_additional_properties( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['param'] = \ param @@ -2155,6 +2230,9 @@ def test_json_form_data( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2183,6 +2261,8 @@ def test_json_form_data( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['param'] = \ param diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags_123_api.py index 54fdf7f892a9..76e35824fbe1 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags_123_api.py @@ -121,6 +121,9 @@ def test_classname( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -149,6 +152,8 @@ def test_classname( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py index 1a8a4c51fde9..13fb1d981f43 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py @@ -584,6 +584,9 @@ def add_pet( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -612,6 +615,8 @@ def add_pet( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body @@ -650,6 +655,9 @@ def delete_pet( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -678,6 +686,8 @@ def delete_pet( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['pet_id'] = \ pet_id @@ -716,6 +726,9 @@ def find_pets_by_status( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -744,6 +757,8 @@ def find_pets_by_status( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['status'] = \ status @@ -782,6 +797,9 @@ def find_pets_by_tags( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -810,6 +828,8 @@ def find_pets_by_tags( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['tags'] = \ tags @@ -848,6 +868,9 @@ def get_pet_by_id( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -876,6 +899,8 @@ def get_pet_by_id( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['pet_id'] = \ pet_id @@ -913,6 +938,9 @@ def update_pet( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -941,6 +969,8 @@ def update_pet( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body @@ -980,6 +1010,9 @@ def update_pet_with_form( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1008,6 +1041,8 @@ def update_pet_with_form( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['pet_id'] = \ pet_id @@ -1048,6 +1083,9 @@ def upload_file( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1076,6 +1114,8 @@ def upload_file( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['pet_id'] = \ pet_id @@ -1116,6 +1156,9 @@ def upload_file_with_required_file( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1144,6 +1187,8 @@ def upload_file_with_required_file( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['pet_id'] = \ pet_id diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py index cd573a911215..934c55259995 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py @@ -265,6 +265,9 @@ def delete_order( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -293,6 +296,8 @@ def delete_order( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['order_id'] = \ order_id @@ -328,6 +333,9 @@ def get_inventory( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -356,6 +364,8 @@ def get_inventory( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.get_inventory_endpoint.call_with_http_info(**kwargs) @@ -392,6 +402,9 @@ def get_order_by_id( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -420,6 +433,8 @@ def get_order_by_id( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['order_id'] = \ order_id @@ -457,6 +472,9 @@ def place_order( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -485,6 +503,8 @@ def place_order( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py index 3088eb159f1d..78cc2f4a8b6b 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py @@ -452,6 +452,9 @@ def create_user( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -480,6 +483,8 @@ def create_user( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body @@ -517,6 +522,9 @@ def create_users_with_array_input( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -545,6 +553,8 @@ def create_users_with_array_input( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body @@ -582,6 +592,9 @@ def create_users_with_list_input( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -610,6 +623,8 @@ def create_users_with_list_input( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body @@ -648,6 +663,9 @@ def delete_user( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -676,6 +694,8 @@ def delete_user( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['username'] = \ username @@ -713,6 +733,9 @@ def get_user_by_name( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -741,6 +764,8 @@ def get_user_by_name( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['username'] = \ username @@ -780,6 +805,9 @@ def login_user( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -808,6 +836,8 @@ def login_user( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['username'] = \ username @@ -844,6 +874,9 @@ def logout_user( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -872,6 +905,8 @@ def logout_user( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.logout_user_endpoint.call_with_http_info(**kwargs) @@ -910,6 +945,9 @@ def update_user( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -938,6 +976,8 @@ def update_user( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['username'] = \ username diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py index 9e6f1523497d..7b4eea830ea8 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py @@ -131,7 +131,8 @@ def __call_api( _preload_content: bool = True, _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None + _check_type: typing.Optional[bool] = None, + _content_type: typing.Optional[str] = None ): config = self.configuration @@ -572,10 +573,12 @@ def select_header_accept(self, accepts): else: return ', '.join(accepts) - def select_header_content_type(self, content_types): + def select_header_content_type(self, content_types, method=None, body=None): """Returns `Content-Type` based on an array of content_types provided. :param content_types: List of content-types. + :param method: http method (e.g. POST, PATCH). + :param body: http body to send. :return: Content-Type (e.g. application/json). """ if not content_types: @@ -583,6 +586,11 @@ def select_header_content_type(self, content_types): content_types = [x.lower() for x in content_types] + if (method == 'PATCH' and + 'application/json-patch+json' in content_types and + isinstance(body, list)): + return 'application/json-patch+json' + if 'application/json' in content_types or '*/*' in content_types: return 'application/json' else: @@ -664,7 +672,8 @@ def __init__(self, settings=None, params_map=None, root_map=None, '_request_timeout', '_return_http_data_only', '_check_input_type', - '_check_return_type' + '_check_return_type', + '_content_type' ]) self.params_map['nullable'].extend(['_request_timeout']) self.validations = root_map['validations'] @@ -677,7 +686,8 @@ def __init__(self, settings=None, params_map=None, root_map=None, '_request_timeout': (none_type, float, (float,), [float], int, (int,), [int]), '_return_http_data_only': (bool,), '_check_input_type': (bool,), - '_check_return_type': (bool,) + '_check_return_type': (bool,), + '_content_type': (none_type, str) } self.openapi_types.update(extra_types) self.attribute_map = root_map['attribute_map'] @@ -824,12 +834,16 @@ def call_with_http_info(self, **kwargs): params['header']['Accept'] = self.api_client.select_header_accept( accept_headers_list) - content_type_headers_list = self.headers_map['content_type'] - if content_type_headers_list: - if params['body'] != "": - header_list = self.api_client.select_header_content_type( - content_type_headers_list) - params['header']['Content-Type'] = header_list + if kwargs.get('_content_type'): + params['header']['Content-Type'] = kwargs['_content_type'] + else: + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + if params['body'] != "": + header_list = self.api_client.select_header_content_type( + content_type_headers_list, self.settings['http_method'], + params['body']) + params['header']['Content-Type'] = header_list return self.api_client.call_api( self.settings['endpoint_path'], self.settings['http_method'], diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py index 9275f2047c42..c8345a8760ab 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py @@ -121,6 +121,7 @@ def test_test_endpoint_enums_length_one(self): call_with_http_info.assert_called_with( _check_input_type=True, _check_return_type=True, + _content_type=None, _host_index=None, _preload_content=True, _request_timeout=None, diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/usage_api.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/usage_api.py index b9bc47de2b3c..b636697b0c47 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/usage_api.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/usage_api.py @@ -243,6 +243,9 @@ def any_key( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -271,6 +274,8 @@ def any_key( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.any_key_endpoint.call_with_http_info(**kwargs) @@ -304,6 +309,9 @@ def both_keys( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -332,6 +340,8 @@ def both_keys( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.both_keys_endpoint.call_with_http_info(**kwargs) @@ -365,6 +375,9 @@ def key_in_header( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -393,6 +406,8 @@ def key_in_header( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.key_in_header_endpoint.call_with_http_info(**kwargs) @@ -426,6 +441,9 @@ def key_in_query( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -454,6 +472,8 @@ def key_in_query( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.key_in_query_endpoint.call_with_http_info(**kwargs) diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py index a3407d97a846..0da461222793 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py @@ -131,7 +131,8 @@ def __call_api( _preload_content: bool = True, _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None + _check_type: typing.Optional[bool] = None, + _content_type: typing.Optional[str] = None ): config = self.configuration @@ -572,10 +573,12 @@ def select_header_accept(self, accepts): else: return ', '.join(accepts) - def select_header_content_type(self, content_types): + def select_header_content_type(self, content_types, method=None, body=None): """Returns `Content-Type` based on an array of content_types provided. :param content_types: List of content-types. + :param method: http method (e.g. POST, PATCH). + :param body: http body to send. :return: Content-Type (e.g. application/json). """ if not content_types: @@ -583,6 +586,11 @@ def select_header_content_type(self, content_types): content_types = [x.lower() for x in content_types] + if (method == 'PATCH' and + 'application/json-patch+json' in content_types and + isinstance(body, list)): + return 'application/json-patch+json' + if 'application/json' in content_types or '*/*' in content_types: return 'application/json' else: @@ -664,7 +672,8 @@ def __init__(self, settings=None, params_map=None, root_map=None, '_request_timeout', '_return_http_data_only', '_check_input_type', - '_check_return_type' + '_check_return_type', + '_content_type' ]) self.params_map['nullable'].extend(['_request_timeout']) self.validations = root_map['validations'] @@ -677,7 +686,8 @@ def __init__(self, settings=None, params_map=None, root_map=None, '_request_timeout': (none_type, float, (float,), [float], int, (int,), [int]), '_return_http_data_only': (bool,), '_check_input_type': (bool,), - '_check_return_type': (bool,) + '_check_return_type': (bool,), + '_content_type': (none_type, str) } self.openapi_types.update(extra_types) self.attribute_map = root_map['attribute_map'] @@ -824,12 +834,16 @@ def call_with_http_info(self, **kwargs): params['header']['Accept'] = self.api_client.select_header_accept( accept_headers_list) - content_type_headers_list = self.headers_map['content_type'] - if content_type_headers_list: - if params['body'] != "": - header_list = self.api_client.select_header_content_type( - content_type_headers_list) - params['header']['Content-Type'] = header_list + if kwargs.get('_content_type'): + params['header']['Content-Type'] = kwargs['_content_type'] + else: + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + if params['body'] != "": + header_list = self.api_client.select_header_content_type( + content_type_headers_list, self.settings['http_method'], + params['body']) + params['header']['Content-Type'] = header_list return self.api_client.call_api( self.settings['endpoint_path'], self.settings['http_method'], diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api/usage_api.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api/usage_api.py index d9e5929e14c1..ec975f752c6b 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api/usage_api.py +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api/usage_api.py @@ -198,6 +198,9 @@ def custom_server( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -226,6 +229,8 @@ def custom_server( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.custom_server_endpoint.call_with_http_info(**kwargs) @@ -259,6 +264,9 @@ def default_server( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -287,6 +295,8 @@ def default_server( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.default_server_endpoint.call_with_http_info(**kwargs) diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py index a2dce8f7105a..a7d12d3e3c10 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py @@ -131,7 +131,8 @@ def __call_api( _preload_content: bool = True, _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None + _check_type: typing.Optional[bool] = None, + _content_type: typing.Optional[str] = None ): config = self.configuration @@ -572,10 +573,12 @@ def select_header_accept(self, accepts): else: return ', '.join(accepts) - def select_header_content_type(self, content_types): + def select_header_content_type(self, content_types, method=None, body=None): """Returns `Content-Type` based on an array of content_types provided. :param content_types: List of content-types. + :param method: http method (e.g. POST, PATCH). + :param body: http body to send. :return: Content-Type (e.g. application/json). """ if not content_types: @@ -583,6 +586,11 @@ def select_header_content_type(self, content_types): content_types = [x.lower() for x in content_types] + if (method == 'PATCH' and + 'application/json-patch+json' in content_types and + isinstance(body, list)): + return 'application/json-patch+json' + if 'application/json' in content_types or '*/*' in content_types: return 'application/json' else: @@ -664,7 +672,8 @@ def __init__(self, settings=None, params_map=None, root_map=None, '_request_timeout', '_return_http_data_only', '_check_input_type', - '_check_return_type' + '_check_return_type', + '_content_type' ]) self.params_map['nullable'].extend(['_request_timeout']) self.validations = root_map['validations'] @@ -677,7 +686,8 @@ def __init__(self, settings=None, params_map=None, root_map=None, '_request_timeout': (none_type, float, (float,), [float], int, (int,), [int]), '_return_http_data_only': (bool,), '_check_input_type': (bool,), - '_check_return_type': (bool,) + '_check_return_type': (bool,), + '_content_type': (none_type, str) } self.openapi_types.update(extra_types) self.attribute_map = root_map['attribute_map'] @@ -824,12 +834,16 @@ def call_with_http_info(self, **kwargs): params['header']['Accept'] = self.api_client.select_header_accept( accept_headers_list) - content_type_headers_list = self.headers_map['content_type'] - if content_type_headers_list: - if params['body'] != "": - header_list = self.api_client.select_header_content_type( - content_type_headers_list) - params['header']['Content-Type'] = header_list + if kwargs.get('_content_type'): + params['header']['Content-Type'] = kwargs['_content_type'] + else: + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + if params['body'] != "": + header_list = self.api_client.select_header_content_type( + content_type_headers_list, self.settings['http_method'], + params['body']) + params['header']['Content-Type'] = header_list return self.api_client.call_api( self.settings['endpoint_path'], self.settings['http_method'], diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py index c99ba19bce0c..52d1fc410d35 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py @@ -119,6 +119,9 @@ def call_123_test_special_tags( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -147,6 +150,8 @@ def call_123_test_special_tags( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['client'] = \ client diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py index 4d23104e6b07..26a35b8e65fc 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py @@ -107,6 +107,9 @@ def foo_get( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -135,6 +138,8 @@ def foo_get( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.foo_get_endpoint.call_with_http_info(**kwargs) diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py index 0f93d1cfde12..dd2db14c8ad7 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py @@ -1720,6 +1720,9 @@ def additional_properties_with_array_of_enums( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1748,6 +1751,8 @@ def additional_properties_with_array_of_enums( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.additional_properties_with_array_of_enums_endpoint.call_with_http_info(**kwargs) @@ -1782,6 +1787,9 @@ def array_model( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1810,6 +1818,8 @@ def array_model( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.array_model_endpoint.call_with_http_info(**kwargs) @@ -1843,6 +1853,9 @@ def array_of_enums( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1871,6 +1884,8 @@ def array_of_enums( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.array_of_enums_endpoint.call_with_http_info(**kwargs) @@ -1905,6 +1920,9 @@ def boolean( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1933,6 +1951,8 @@ def boolean( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.boolean_endpoint.call_with_http_info(**kwargs) @@ -1967,6 +1987,9 @@ def composed_one_of_number_with_validations( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1995,6 +2018,8 @@ def composed_one_of_number_with_validations( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.composed_one_of_number_with_validations_endpoint.call_with_http_info(**kwargs) @@ -2030,6 +2055,9 @@ def download_attachment( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2058,6 +2086,8 @@ def download_attachment( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['file_name'] = \ file_name @@ -2093,6 +2123,9 @@ def enum_test( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2121,6 +2154,8 @@ def enum_test( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.enum_test_endpoint.call_with_http_info(**kwargs) @@ -2153,6 +2188,9 @@ def fake_health_get( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2181,6 +2219,8 @@ def fake_health_get( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.fake_health_get_endpoint.call_with_http_info(**kwargs) @@ -2217,6 +2257,9 @@ def mammal( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2245,6 +2288,8 @@ def mammal( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['mammal'] = \ mammal @@ -2281,6 +2326,9 @@ def number_with_validations( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2309,6 +2357,8 @@ def number_with_validations( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.number_with_validations_endpoint.call_with_http_info(**kwargs) @@ -2343,6 +2393,9 @@ def object_model_with_ref_props( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2371,6 +2424,8 @@ def object_model_with_ref_props( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.object_model_with_ref_props_endpoint.call_with_http_info(**kwargs) @@ -2404,6 +2459,9 @@ def post_inline_additional_properties_payload( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2432,6 +2490,8 @@ def post_inline_additional_properties_payload( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.post_inline_additional_properties_payload_endpoint.call_with_http_info(**kwargs) @@ -2465,6 +2525,9 @@ def post_inline_additional_properties_ref_payload( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2493,6 +2556,8 @@ def post_inline_additional_properties_ref_payload( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.post_inline_additional_properties_ref_payload_endpoint.call_with_http_info(**kwargs) @@ -2527,6 +2592,9 @@ def string( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2555,6 +2623,8 @@ def string( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.string_endpoint.call_with_http_info(**kwargs) @@ -2589,6 +2659,9 @@ def string_enum( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2617,6 +2690,8 @@ def string_enum( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.string_enum_endpoint.call_with_http_info(**kwargs) @@ -2653,6 +2728,9 @@ def test_body_with_file_schema( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2681,6 +2759,8 @@ def test_body_with_file_schema( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['file_schema_test_class'] = \ file_schema_test_class @@ -2720,6 +2800,9 @@ def test_body_with_query_params( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2748,6 +2831,8 @@ def test_body_with_query_params( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['query'] = \ query @@ -2788,6 +2873,9 @@ def test_client_model( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2816,6 +2904,8 @@ def test_client_model( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['client'] = \ client @@ -2870,6 +2960,9 @@ def test_endpoint_parameters( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2898,6 +2991,8 @@ def test_endpoint_parameters( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['number'] = \ number @@ -2947,6 +3042,9 @@ def test_enum_parameters( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2975,6 +3073,8 @@ def test_enum_parameters( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.test_enum_parameters_endpoint.call_with_http_info(**kwargs) @@ -3018,6 +3118,9 @@ def test_group_parameters( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -3046,6 +3149,8 @@ def test_group_parameters( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['required_string_group'] = \ required_string_group @@ -3087,6 +3192,9 @@ def test_inline_additional_properties( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -3115,6 +3223,8 @@ def test_inline_additional_properties( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['request_body'] = \ request_body @@ -3154,6 +3264,9 @@ def test_json_form_data( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -3182,6 +3295,8 @@ def test_json_form_data( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['param'] = \ param @@ -3230,6 +3345,9 @@ def test_query_parameter_collection_format( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -3258,6 +3376,8 @@ def test_query_parameter_collection_format( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['pipe'] = \ pipe @@ -3301,6 +3421,9 @@ def tx_rx_any_of_model( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -3329,6 +3452,8 @@ def tx_rx_any_of_model( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.tx_rx_any_of_model_endpoint.call_with_http_info(**kwargs) @@ -3364,6 +3489,9 @@ def upload_download_file( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -3392,6 +3520,8 @@ def upload_download_file( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body @@ -3430,6 +3560,9 @@ def upload_file( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -3458,6 +3591,8 @@ def upload_file( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['file'] = \ file @@ -3493,6 +3628,9 @@ def upload_files( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -3521,6 +3659,8 @@ def upload_files( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.upload_files_endpoint.call_with_http_info(**kwargs) diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py index efcf30af12d7..0284c348b363 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py @@ -121,6 +121,9 @@ def test_classname( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -149,6 +152,8 @@ def test_classname( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['client'] = \ client diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py index 1ae658e16d4c..d555b6995ad4 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py @@ -472,6 +472,9 @@ def add_pet( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -500,6 +503,8 @@ def add_pet( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['pet'] = \ pet @@ -538,6 +543,9 @@ def delete_pet( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -566,6 +574,8 @@ def delete_pet( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['pet_id'] = \ pet_id @@ -604,6 +614,9 @@ def find_pets_by_status( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -632,6 +645,8 @@ def find_pets_by_status( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['status'] = \ status @@ -670,6 +685,9 @@ def find_pets_by_tags( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -698,6 +716,8 @@ def find_pets_by_tags( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['tags'] = \ tags @@ -736,6 +756,9 @@ def get_pet_by_id( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -764,6 +787,8 @@ def get_pet_by_id( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['pet_id'] = \ pet_id @@ -801,6 +826,9 @@ def update_pet( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -829,6 +857,8 @@ def update_pet( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['pet'] = \ pet @@ -868,6 +898,9 @@ def update_pet_with_form( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -896,6 +929,8 @@ def update_pet_with_form( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['pet_id'] = \ pet_id diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py index 26a6bfe22200..c1cb69094fe5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py @@ -267,6 +267,9 @@ def delete_order( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -295,6 +298,8 @@ def delete_order( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['order_id'] = \ order_id @@ -330,6 +335,9 @@ def get_inventory( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -358,6 +366,8 @@ def get_inventory( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.get_inventory_endpoint.call_with_http_info(**kwargs) @@ -394,6 +404,9 @@ def get_order_by_id( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -422,6 +435,8 @@ def get_order_by_id( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['order_id'] = \ order_id @@ -459,6 +474,9 @@ def place_order( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -487,6 +505,8 @@ def place_order( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['order'] = \ order diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py index 67b33352ddac..da2217633ffc 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py @@ -460,6 +460,9 @@ def create_user( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -488,6 +491,8 @@ def create_user( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['user'] = \ user @@ -525,6 +530,9 @@ def create_users_with_array_input( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -553,6 +561,8 @@ def create_users_with_array_input( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['user'] = \ user @@ -590,6 +600,9 @@ def create_users_with_list_input( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -618,6 +631,8 @@ def create_users_with_list_input( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['user'] = \ user @@ -656,6 +671,9 @@ def delete_user( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -684,6 +702,8 @@ def delete_user( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['username'] = \ username @@ -721,6 +741,9 @@ def get_user_by_name( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -749,6 +772,8 @@ def get_user_by_name( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['username'] = \ username @@ -788,6 +813,9 @@ def login_user( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -816,6 +844,8 @@ def login_user( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['username'] = \ username @@ -852,6 +882,9 @@ def logout_user( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -880,6 +913,8 @@ def logout_user( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.logout_user_endpoint.call_with_http_info(**kwargs) @@ -918,6 +953,9 @@ def update_user( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -946,6 +984,8 @@ def update_user( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['username'] = \ username diff --git a/samples/openapi3/client/petstore/python/petstore_api/api_client.py b/samples/openapi3/client/petstore/python/petstore_api/api_client.py index 29ae24dd01d7..86cddf1a7b2b 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_client.py @@ -131,7 +131,8 @@ def __call_api( _preload_content: bool = True, _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None + _check_type: typing.Optional[bool] = None, + _content_type: typing.Optional[str] = None ): config = self.configuration @@ -572,10 +573,12 @@ def select_header_accept(self, accepts): else: return ', '.join(accepts) - def select_header_content_type(self, content_types): + def select_header_content_type(self, content_types, method=None, body=None): """Returns `Content-Type` based on an array of content_types provided. :param content_types: List of content-types. + :param method: http method (e.g. POST, PATCH). + :param body: http body to send. :return: Content-Type (e.g. application/json). """ if not content_types: @@ -583,6 +586,11 @@ def select_header_content_type(self, content_types): content_types = [x.lower() for x in content_types] + if (method == 'PATCH' and + 'application/json-patch+json' in content_types and + isinstance(body, list)): + return 'application/json-patch+json' + if 'application/json' in content_types or '*/*' in content_types: return 'application/json' else: @@ -671,7 +679,8 @@ def __init__(self, settings=None, params_map=None, root_map=None, '_request_timeout', '_return_http_data_only', '_check_input_type', - '_check_return_type' + '_check_return_type', + '_content_type' ]) self.params_map['nullable'].extend(['_request_timeout']) self.validations = root_map['validations'] @@ -684,7 +693,8 @@ def __init__(self, settings=None, params_map=None, root_map=None, '_request_timeout': (none_type, float, (float,), [float], int, (int,), [int]), '_return_http_data_only': (bool,), '_check_input_type': (bool,), - '_check_return_type': (bool,) + '_check_return_type': (bool,), + '_content_type': (none_type, str) } self.openapi_types.update(extra_types) self.attribute_map = root_map['attribute_map'] @@ -831,12 +841,16 @@ def call_with_http_info(self, **kwargs): params['header']['Accept'] = self.api_client.select_header_accept( accept_headers_list) - content_type_headers_list = self.headers_map['content_type'] - if content_type_headers_list: - if params['body'] != "": - header_list = self.api_client.select_header_content_type( - content_type_headers_list) - params['header']['Content-Type'] = header_list + if kwargs.get('_content_type'): + params['header']['Content-Type'] = kwargs['_content_type'] + else: + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + if params['body'] != "": + header_list = self.api_client.select_header_content_type( + content_type_headers_list, self.settings['http_method'], + params['body']) + params['header']['Content-Type'] = header_list return self.api_client.call_api( self.settings['endpoint_path'], self.settings['http_method'], From 550c0781dca1505762e8348f7b692d751b28c766 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 10 Dec 2021 02:08:17 +0800 Subject: [PATCH 079/117] [okhttp-gson-next-gen] new option for error object (#10995) * add error body and type to api exception class * add option to specify error object * add option, update api doc with better error handling * update samples * update doc --- docs/generators/java.md | 1 + .../codegen/languages/JavaClientCodegen.java | 23 +++++ .../okhttp-gson-nextgen/api.mustache | 28 +++++- .../okhttp-gson-nextgen/apiException.mustache | 40 +++++++++ .../okhttp-gson-nextgen/api_doc.mustache | 22 +++-- .../docs/AnotherFakeApi.md | 6 +- .../okhttp-gson-nextgen/docs/DefaultApi.md | 6 +- .../java/okhttp-gson-nextgen/docs/FakeApi.md | 90 ++++--------------- .../docs/FakeClassnameTags123Api.md | 6 +- .../java/okhttp-gson-nextgen/docs/PetApi.md | 54 ++--------- .../java/okhttp-gson-nextgen/docs/StoreApi.md | 24 +---- .../java/okhttp-gson-nextgen/docs/UserApi.md | 48 ++-------- .../org/openapitools/client/ApiException.java | 40 +++++++++ .../client/api/AnotherFakeApi.java | 11 ++- .../openapitools/client/api/DefaultApi.java | 11 ++- .../org/openapitools/client/api/FakeApi.java | 71 ++++++++++++--- .../client/api/FakeClassnameTags123Api.java | 11 ++- .../org/openapitools/client/api/PetApi.java | 51 ++++++++--- .../org/openapitools/client/api/StoreApi.java | 31 +++++-- .../org/openapitools/client/api/UserApi.java | 21 ++++- 20 files changed, 351 insertions(+), 244 deletions(-) diff --git a/docs/generators/java.md b/docs/generators/java.md index 1160c36f8b96..4d086325a06f 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -30,6 +30,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |dynamicOperations|Generate operations dynamically at runtime from an OAS| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|errorObjectType|Error Object type. (This option is for okhttp-gson-next-gen only)| |null| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |gradleProperties|Append additional Gradle proeprties to the gradle.properties file| |null| |groupId|groupId in generated pom.xml| |org.openapitools| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java index 965da6dbd770..f675c9a9c3f1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java @@ -66,6 +66,8 @@ public class JavaClientCodegen extends AbstractJavaCodegen public static final String DYNAMIC_OPERATIONS = "dynamicOperations"; public static final String SUPPORT_STREAMING = "supportStreaming"; public static final String GRADLE_PROPERTIES= "gradleProperties"; + public static final String ERROR_OBJECT_TYPE= "errorObjectType"; + public static final String ERROR_OBJECT_SUBTYPE= "errorObjectSubtype"; public static final String PLAY_24 = "play24"; public static final String PLAY_25 = "play25"; @@ -118,6 +120,8 @@ public class JavaClientCodegen extends AbstractJavaCodegen protected boolean dynamicOperations = false; protected boolean supportStreaming = false; protected String gradleProperties; + protected String errorObjectType; + protected List errorObjectSubtype; protected String authFolder; protected String serializationLibrary = null; @@ -163,6 +167,7 @@ public JavaClientCodegen() { cliOptions.add(CliOption.newBoolean(DYNAMIC_OPERATIONS, "Generate operations dynamically at runtime from an OAS", this.dynamicOperations)); cliOptions.add(CliOption.newBoolean(SUPPORT_STREAMING, "Support streaming endpoint (beta)", this.supportStreaming)); cliOptions.add(CliOption.newString(GRADLE_PROPERTIES, "Append additional Gradle proeprties to the gradle.properties file")); + cliOptions.add(CliOption.newString(ERROR_OBJECT_TYPE, "Error Object type. (This option is for okhttp-gson-next-gen only)")); cliOptions.add(CliOption.newString(CONFIG_KEY, "Config key in @RegisterRestClient. Default to none. Only `microprofile` supports this option.")); supportedLibraries.put(JERSEY1, "HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libraries instead."); @@ -343,6 +348,16 @@ public void processOpts() { } additionalProperties.put(GRADLE_PROPERTIES, gradleProperties); + if (additionalProperties.containsKey(ERROR_OBJECT_TYPE)) { + this.setErrorObjectType(additionalProperties.get(ERROR_OBJECT_TYPE).toString()); + } + additionalProperties.put(ERROR_OBJECT_TYPE, errorObjectType); + + if (additionalProperties.containsKey(ERROR_OBJECT_SUBTYPE)) { + this.setErrorObjectSubtype((List)additionalProperties.get(ERROR_OBJECT_SUBTYPE)); + } + additionalProperties.put(ERROR_OBJECT_SUBTYPE, errorObjectSubtype); + final String invokerFolder = (sourceFolder + '/' + invokerPackage).replace(".", "/"); final String apiFolder = (sourceFolder + '/' + apiPackage).replace(".", "/"); final String modelsFolder = (sourceFolder + File.separator + modelPackage().replace('.', File.separatorChar)).replace('/', File.separatorChar); @@ -1030,6 +1045,14 @@ public void setGradleProperties(final String gradleProperties) { this.gradleProperties= gradleProperties; } + public void setErrorObjectType(final String errorObjectType) { + this.errorObjectType= errorObjectType; + } + + public void setErrorObjectSubtype(final List errorObjectSubtype) { + this.errorObjectSubtype= errorObjectSubtype; + } + /** * Serialization library. * diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api.mustache index 525d56fa5d51..2b623d2cf842 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api.mustache @@ -51,6 +51,7 @@ import java.util.Map; import java.io.InputStream; {{/supportStreaming}} {{/fullJavaUtil}} +import javax.ws.rs.core.GenericType; {{#operations}} public class {{classname}} { @@ -294,13 +295,32 @@ public class {{classname}} { {{/isDeprecated}} public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-streaming}} InputStream {{operationId}}WithHttpInfo({{#allParams}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { okhttp3.Call localVarCall = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}null); - {{#returnType}}Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); - return localVarApiClient.executeStream(localVarCall, localVarReturnType);{{/returnType}} + {{#returnType}} + try { + Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); + return localVarApiClient.executeStream(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken<{{{errorObjectType}}}{{^errorObjectType}}{{{returnType}}}{{/errorObjectType}}>(){}.getType())); + e.setErrorObjectType(new GenericType<{{{errorObjectType}}}{{^errorObjectType}}{{{returnType}}}{{/errorObjectType}}>(){}); + throw e; + } + {{/returnType}} } {{/vendorExtensions.x-streaming}}{{^vendorExtensions.x-streaming}} ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { okhttp3.Call localVarCall = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}null); - {{#returnType}}Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType);{{/returnType}}{{^returnType}}return localVarApiClient.execute(localVarCall);{{/returnType}} + {{^returnType}} + return localVarApiClient.execute(localVarCall); + {{/returnType}} + {{#returnType}} + try { + Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken<{{{errorObjectType}}}{{^errorObjectType}}{{{returnType}}}{{/errorObjectType}}>(){}.getType())); + e.setErrorObjectType(new GenericType<{{{errorObjectType}}}{{^errorObjectType}}{{{returnType}}}{{/errorObjectType}}>(){}); + throw e; + } + {{/returnType}} } {{/vendorExtensions.x-streaming}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/apiException.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/apiException.mustache index 4bec51da938e..59da3c51c261 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/apiException.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/apiException.mustache @@ -9,6 +9,8 @@ import java.util.Map.Entry; import java.util.TreeMap; {{/caseInsensitiveResponseHeaders}} +import javax.ws.rs.core.GenericType; + /** *

    ApiException class.

    */ @@ -18,6 +20,8 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us private int code = 0; private Map> responseHeaders = null; private String responseBody = null; + private {{{errorObjectType}}}{{^errorObjectType}}Object{{/errorObjectType}} errorObject = null; + private GenericType errorObjectType = null; /** *

    Constructor for ApiException.

    @@ -156,4 +160,40 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us public String getResponseBody() { return responseBody; } + + /** + * Get the error object type. + * + * @return Error object type + */ + public GenericType getErrorObjectType() { + return errorObjectType; + } + + /** + * Set the error object type. + * + * @param errorObjectType object type + */ + public void setErrorObjectType(GenericType errorObjectType) { + this.errorObjectType = errorObjectType; + } + + /** + * Get the error object. + * + * @return Error object + */ + public {{{errorObjectType}}}{{^errorObjectType}}Object{{/errorObjectType}} getErrorObject() { + return errorObject; + } + + /** + * Get the error object. + * + * @param errorObject Error object + */ + public void setErrorObject({{{errorObjectType}}}{{^errorObjectType}}Object{{/errorObjectType}} errorObject) { + this.errorObject = errorObject; + } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api_doc.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api_doc.mustache index 5a4e3969c93d..616ad65a5aca 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api_doc.mustache @@ -63,11 +63,23 @@ public class Example { .execute();{{/vendorExtensions.x-group-parameters}}{{#returnType}} System.out.println(result);{{/returnType}} } catch (ApiException e) { - System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + {{=< >=}} + <#errorObjectSubtype> + <^-first>} else if (e.getErrorObject() instanceof <&.>) { + // do something here + <#-last> + } else { + // something else happened + System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + + + <={{ }}=> + } } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AnotherFakeApi.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AnotherFakeApi.md index 149488eff9a0..af82f73feb62 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AnotherFakeApi.md @@ -35,11 +35,7 @@ public class Example { Client result = apiInstance.call123testSpecialTags(client); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/DefaultApi.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/DefaultApi.md index 311c4fa6bbc1..c77f189afd06 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/DefaultApi.md +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/DefaultApi.md @@ -32,11 +32,7 @@ public class Example { InlineResponseDefault result = apiInstance.fooGet(); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#fooGet"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeApi.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeApi.md index 3401bb6eeb03..bee53680247b 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeApi.md +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeApi.md @@ -46,11 +46,7 @@ public class Example { HealthCheckResult result = apiInstance.fakeHealthGet(); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#fakeHealthGet"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -105,11 +101,7 @@ public class Example { Boolean result = apiInstance.fakeOuterBooleanSerialize(body); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -167,11 +159,7 @@ public class Example { OuterComposite result = apiInstance.fakeOuterCompositeSerialize(outerComposite); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -229,11 +217,7 @@ public class Example { BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -291,11 +275,7 @@ public class Example { String result = apiInstance.fakeOuterStringSerialize(body); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -350,11 +330,7 @@ public class Example { List result = apiInstance.getArrayOfEnums(); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#getArrayOfEnums"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -408,11 +384,7 @@ public class Example { try { apiInstance.testBodyWithFileSchema(fileSchemaTestClass); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testBodyWithFileSchema"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -468,11 +440,7 @@ public class Example { try { apiInstance.testBodyWithQueryParams(query, user); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -531,11 +499,7 @@ public class Example { Client result = apiInstance.testClientModel(client); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testClientModel"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -611,11 +575,7 @@ public class Example { try { apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testEndpointParameters"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -693,11 +653,7 @@ public class Example { try { apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testEnumParameters"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -776,11 +732,7 @@ public class Example { .int64Group(int64Group) .execute(); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testGroupParameters"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -840,11 +792,7 @@ public class Example { try { apiInstance.testInlineAdditionalProperties(requestBody); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -900,11 +848,7 @@ public class Example { try { apiInstance.testJsonFormData(param, param2); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testJsonFormData"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -966,11 +910,7 @@ public class Example { try { apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeClassnameTags123Api.md index dbd12c37f053..5212d7c77810 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeClassnameTags123Api.md @@ -42,11 +42,7 @@ public class Example { Client result = apiInstance.testClassname(client); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/PetApi.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/PetApi.md index cca26664dea0..8cdb1506fb51 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/PetApi.md +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/PetApi.md @@ -46,11 +46,7 @@ public class Example { try { apiInstance.addPet(pet); } catch (ApiException e) { - System.err.println("Exception when calling PetApi#addPet"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -111,11 +107,7 @@ public class Example { try { apiInstance.deletePet(petId, apiKey); } catch (ApiException e) { - System.err.println("Exception when calling PetApi#deletePet"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -180,11 +172,7 @@ public class Example { List result = apiInstance.findPetsByStatus(status); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling PetApi#findPetsByStatus"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -249,11 +237,7 @@ public class Example { List result = apiInstance.findPetsByTags(tags); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling PetApi#findPetsByTags"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -319,11 +303,7 @@ public class Example { Pet result = apiInstance.getPetById(petId); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling PetApi#getPetById"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -386,11 +366,7 @@ public class Example { try { apiInstance.updatePet(pet); } catch (ApiException e) { - System.err.println("Exception when calling PetApi#updatePet"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -454,11 +430,7 @@ public class Example { try { apiInstance.updatePetWithForm(petId, name, status); } catch (ApiException e) { - System.err.println("Exception when calling PetApi#updatePetWithForm"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -523,11 +495,7 @@ public class Example { ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling PetApi#uploadFile"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -592,11 +560,7 @@ public class Example { ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/StoreApi.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/StoreApi.md index 270388f5e444..8d9dee8e68fc 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/StoreApi.md +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/StoreApi.md @@ -37,11 +37,7 @@ public class Example { try { apiInstance.deleteOrder(orderId); } catch (ApiException e) { - System.err.println("Exception when calling StoreApi#deleteOrder"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -106,11 +102,7 @@ public class Example { Map result = apiInstance.getInventory(); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling StoreApi#getInventory"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -165,11 +157,7 @@ public class Example { Order result = apiInstance.getOrderById(orderId); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling StoreApi#getOrderById"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -227,11 +215,7 @@ public class Example { Order result = apiInstance.placeOrder(order); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling StoreApi#placeOrder"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/UserApi.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/UserApi.md index 26a0642e3235..5c8ee4c6f5eb 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/UserApi.md +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/UserApi.md @@ -41,11 +41,7 @@ public class Example { try { apiInstance.createUser(user); } catch (ApiException e) { - System.err.println("Exception when calling UserApi#createUser"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -100,11 +96,7 @@ public class Example { try { apiInstance.createUsersWithArrayInput(user); } catch (ApiException e) { - System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -159,11 +151,7 @@ public class Example { try { apiInstance.createUsersWithListInput(user); } catch (ApiException e) { - System.err.println("Exception when calling UserApi#createUsersWithListInput"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -220,11 +208,7 @@ public class Example { try { apiInstance.deleteUser(username); } catch (ApiException e) { - System.err.println("Exception when calling UserApi#deleteUser"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -281,11 +265,7 @@ public class Example { User result = apiInstance.getUserByName(username); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling UserApi#getUserByName"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -344,11 +324,7 @@ public class Example { String result = apiInstance.loginUser(username, password); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling UserApi#loginUser"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -404,11 +380,7 @@ public class Example { try { apiInstance.logoutUser(); } catch (ApiException e) { - System.err.println("Exception when calling UserApi#logoutUser"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -463,11 +435,7 @@ public class Example { try { apiInstance.updateUser(username, user); } catch (ApiException e) { - System.err.println("Exception when calling UserApi#updateUser"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiException.java index 5851f0405ade..60e4f9a5e7e6 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiException.java @@ -16,6 +16,8 @@ import java.util.Map; import java.util.List; +import javax.ws.rs.core.GenericType; + /** *

    ApiException class.

    */ @@ -25,6 +27,8 @@ public class ApiException extends Exception { private int code = 0; private Map> responseHeaders = null; private String responseBody = null; + private Object errorObject = null; + private GenericType errorObjectType = null; /** *

    Constructor for ApiException.

    @@ -151,4 +155,40 @@ public Map> getResponseHeaders() { public String getResponseBody() { return responseBody; } + + /** + * Get the error object type. + * + * @return Error object type + */ + public GenericType getErrorObjectType() { + return errorObjectType; + } + + /** + * Set the error object type. + * + * @param errorObjectType object type + */ + public void setErrorObjectType(GenericType errorObjectType) { + this.errorObjectType = errorObjectType; + } + + /** + * Get the error object. + * + * @return Error object + */ + public Object getErrorObject() { + return errorObject; + } + + /** + * Get the error object. + * + * @param errorObject Error object + */ + public void setErrorObject(Object errorObject) { + this.errorObject = errorObject; + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index e258256633e4..b0269aea9fcf 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -34,6 +34,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class AnotherFakeApi { private ApiClient localVarApiClient; @@ -143,8 +144,14 @@ public Client call123testSpecialTags(Client client) throws ApiException { */ public ApiResponse call123testSpecialTagsWithHttpInfo(Client client) throws ApiException { okhttp3.Call localVarCall = call123testSpecialTagsValidateBeforeCall(client, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/DefaultApi.java index c4e26ea2b1cd..1c8e2d248561 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/DefaultApi.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -34,6 +34,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class DefaultApi { private ApiClient localVarApiClient; @@ -135,8 +136,14 @@ public InlineResponseDefault fooGet() throws ApiException { */ public ApiResponse fooGetWithHttpInfo() throws ApiException { okhttp3.Call localVarCall = fooGetValidateBeforeCall(null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeApi.java index 3c5114fef1b4..271df76973e0 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeApi.java @@ -43,6 +43,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class FakeApi { private ApiClient localVarApiClient; @@ -144,8 +145,14 @@ public HealthCheckResult fakeHealthGet() throws ApiException { */ public ApiResponse fakeHealthGetWithHttpInfo() throws ApiException { okhttp3.Call localVarCall = fakeHealthGetValidateBeforeCall(null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -251,8 +258,14 @@ public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException { */ public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(Boolean body) throws ApiException { okhttp3.Call localVarCall = fakeOuterBooleanSerializeValidateBeforeCall(body, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -359,8 +372,14 @@ public OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite) */ public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(OuterComposite outerComposite) throws ApiException { okhttp3.Call localVarCall = fakeOuterCompositeSerializeValidateBeforeCall(outerComposite, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -467,8 +486,14 @@ public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException */ public ApiResponse fakeOuterNumberSerializeWithHttpInfo(BigDecimal body) throws ApiException { okhttp3.Call localVarCall = fakeOuterNumberSerializeValidateBeforeCall(body, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -575,8 +600,14 @@ public String fakeOuterStringSerialize(String body) throws ApiException { */ public ApiResponse fakeOuterStringSerializeWithHttpInfo(String body) throws ApiException { okhttp3.Call localVarCall = fakeOuterStringSerializeValidateBeforeCall(body, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -680,8 +711,14 @@ public List getArrayOfEnums() throws ApiException { */ public ApiResponse> getArrayOfEnumsWithHttpInfo() throws ApiException { okhttp3.Call localVarCall = getArrayOfEnumsValidateBeforeCall(null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken>(){}.getType())); + e.setErrorObjectType(new GenericType>(){}); + throw e; + } } /** @@ -1023,8 +1060,14 @@ public Client testClientModel(Client client) throws ApiException { */ public ApiResponse testClientModelWithHttpInfo(Client client) throws ApiException { okhttp3.Call localVarCall = testClientModelValidateBeforeCall(client, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index f9449ed44204..db7a5f435f4c 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -34,6 +34,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class FakeClassnameTags123Api { private ApiClient localVarApiClient; @@ -143,8 +144,14 @@ public Client testClassname(Client client) throws ApiException { */ public ApiResponse testClassnameWithHttpInfo(Client client) throws ApiException { okhttp3.Call localVarCall = testClassnameValidateBeforeCall(client, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/PetApi.java index d88ee6f9c316..98d73aa76f0b 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/PetApi.java @@ -36,6 +36,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class PetApi { private ApiClient localVarApiClient; @@ -379,8 +380,14 @@ public List findPetsByStatus(List status) throws ApiException { */ public ApiResponse> findPetsByStatusWithHttpInfo(List status) throws ApiException { okhttp3.Call localVarCall = findPetsByStatusValidateBeforeCall(status, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken>(){}.getType())); + e.setErrorObjectType(new GenericType>(){}); + throw e; + } } /** @@ -507,8 +514,14 @@ public List findPetsByTags(List tags) throws ApiException { @Deprecated public ApiResponse> findPetsByTagsWithHttpInfo(List tags) throws ApiException { okhttp3.Call localVarCall = findPetsByTagsValidateBeforeCall(tags, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken>(){}.getType())); + e.setErrorObjectType(new GenericType>(){}); + throw e; + } } /** @@ -630,8 +643,14 @@ public Pet getPetById(Long petId) throws ApiException { */ public ApiResponse getPetByIdWithHttpInfo(Long petId) throws ApiException { okhttp3.Call localVarCall = getPetByIdValidateBeforeCall(petId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -1003,8 +1022,14 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File f */ public ApiResponse uploadFileWithHttpInfo(Long petId, String additionalMetadata, File file) throws ApiException { okhttp3.Call localVarCall = uploadFileValidateBeforeCall(petId, additionalMetadata, file, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -1138,8 +1163,14 @@ public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile */ public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws ApiException { okhttp3.Call localVarCall = uploadFileWithRequiredFileValidateBeforeCall(petId, requiredFile, additionalMetadata, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/StoreApi.java index d9a068df9e9a..ab5718fb99c5 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/StoreApi.java @@ -34,6 +34,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class StoreApi { private ApiClient localVarApiClient; @@ -249,8 +250,14 @@ public Map getInventory() throws ApiException { */ public ApiResponse> getInventoryWithHttpInfo() throws ApiException { okhttp3.Call localVarCall = getInventoryValidateBeforeCall(null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken>(){}.getType())); + e.setErrorObjectType(new GenericType>(){}); + throw e; + } } /** @@ -368,8 +375,14 @@ public Order getOrderById(Long orderId) throws ApiException { */ public ApiResponse getOrderByIdWithHttpInfo(Long orderId) throws ApiException { okhttp3.Call localVarCall = getOrderByIdValidateBeforeCall(orderId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -486,8 +499,14 @@ public Order placeOrder(Order order) throws ApiException { */ public ApiResponse placeOrderWithHttpInfo(Order order) throws ApiException { okhttp3.Call localVarCall = placeOrderValidateBeforeCall(order, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/UserApi.java index 0f4f2d294a48..4bf2dc2b82f3 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/UserApi.java @@ -34,6 +34,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class UserApi { private ApiClient localVarApiClient; @@ -591,8 +592,14 @@ public User getUserByName(String username) throws ApiException { */ public ApiResponse getUserByNameWithHttpInfo(String username) throws ApiException { okhttp3.Call localVarCall = getUserByNameValidateBeforeCall(username, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -725,8 +732,14 @@ public String loginUser(String username, String password) throws ApiException { */ public ApiResponse loginUserWithHttpInfo(String username, String password) throws ApiException { okhttp3.Call localVarCall = loginUserValidateBeforeCall(username, password, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** From c94d2b2331fe851c79d86e2cfae6a036de5f1ce5 Mon Sep 17 00:00:00 2001 From: Deniz Dogan Date: Fri, 10 Dec 2021 07:08:32 +0100 Subject: [PATCH 080/117] [swift5] Fix missing case for FormDataEncoding#encode (#11064) Fixes #11062 --- .../alamofire/AlamofireImplementations.mustache | 2 ++ .../urlsession/URLSessionImplementations.mustache | 9 +++++++++ .../Classes/OpenAPIs/AlamofireImplementations.swift | 2 ++ .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +++++++++ .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +++++++++ .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +++++++++ .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +++++++++ .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +++++++++ .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +++++++++ .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +++++++++ .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +++++++++ .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +++++++++ .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +++++++++ .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +++++++++ .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +++++++++ .../PetstoreClient/URLSessionImplementations.swift | 9 +++++++++ .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +++++++++ 17 files changed, 139 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache b/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache index 5ec281b054e3..b716d254fa2b 100644 --- a/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache @@ -114,6 +114,8 @@ private var managerStore = SynchronizedDictionary() mpForm.append(string.data(using: String.Encoding.utf8)!, withName: k) case let number as NSNumber: mpForm.append(number.stringValue.data(using: String.Encoding.utf8)!, withName: k) + case let data as Data: + mpForm.append(data, withName: k) default: fatalError("Unprocessable value \(v) with key \(k)") } diff --git a/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache b/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache index eeae3c98aef9..e235cd372001 100644 --- a/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache @@ -477,6 +477,15 @@ private class FormDataEncoding: ParameterEncoding { ) } + case let data as Data: + + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + default: fatalError("Unprocessable value \(value) with key \(key)") } 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 577abc9a6ad0..69945cad3fea 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -114,6 +114,8 @@ open class AlamofireRequestBuilder: RequestBuilder { mpForm.append(string.data(using: String.Encoding.utf8)!, withName: k) case let number as NSNumber: mpForm.append(number.stringValue.data(using: String.Encoding.utf8)!, withName: k) + case let data as Data: + mpForm.append(data, withName: k) default: fatalError("Unprocessable value \(v) with key \(k)") } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 23df908ca326..ca22cb7e6e54 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -477,6 +477,15 @@ private class FormDataEncoding: ParameterEncoding { ) } + case let data as Data: + + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + default: fatalError("Unprocessable value \(value) with key \(key)") } 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 23df908ca326..ca22cb7e6e54 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -477,6 +477,15 @@ private class FormDataEncoding: ParameterEncoding { ) } + case let data as Data: + + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + default: fatalError("Unprocessable value \(value) with key \(key)") } 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 23df908ca326..ca22cb7e6e54 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -477,6 +477,15 @@ private class FormDataEncoding: ParameterEncoding { ) } + case let data as Data: + + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + default: fatalError("Unprocessable value \(value) with key \(key)") } diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 23df908ca326..ca22cb7e6e54 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -477,6 +477,15 @@ private class FormDataEncoding: ParameterEncoding { ) } + case let data as Data: + + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + default: fatalError("Unprocessable value \(value) with key \(key)") } diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 23df908ca326..ca22cb7e6e54 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -477,6 +477,15 @@ private class FormDataEncoding: ParameterEncoding { ) } + case let data as Data: + + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + default: fatalError("Unprocessable value \(value) with key \(key)") } 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 929cbc5f04f9..86beadcc71ce 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -477,6 +477,15 @@ private class FormDataEncoding: ParameterEncoding { ) } + case let data as Data: + + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + default: fatalError("Unprocessable value \(value) with key \(key)") } 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 23df908ca326..ca22cb7e6e54 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -477,6 +477,15 @@ private class FormDataEncoding: ParameterEncoding { ) } + case let data as Data: + + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + default: fatalError("Unprocessable value \(value) with key \(key)") } diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 23df908ca326..ca22cb7e6e54 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -477,6 +477,15 @@ private class FormDataEncoding: ParameterEncoding { ) } + case let data as Data: + + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + default: fatalError("Unprocessable value \(value) with key \(key)") } 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 23df908ca326..ca22cb7e6e54 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -477,6 +477,15 @@ private class FormDataEncoding: ParameterEncoding { ) } + case let data as Data: + + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + default: fatalError("Unprocessable value \(value) with key \(key)") } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 23df908ca326..ca22cb7e6e54 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -477,6 +477,15 @@ private class FormDataEncoding: ParameterEncoding { ) } + case let data as Data: + + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + default: fatalError("Unprocessable value \(value) with key \(key)") } 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 23df908ca326..ca22cb7e6e54 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -477,6 +477,15 @@ private class FormDataEncoding: ParameterEncoding { ) } + case let data as Data: + + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + default: fatalError("Unprocessable value \(value) with key \(key)") } 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 23df908ca326..ca22cb7e6e54 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -477,6 +477,15 @@ private class FormDataEncoding: ParameterEncoding { ) } + case let data as Data: + + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + default: fatalError("Unprocessable value \(value) with key \(key)") } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift index 23df908ca326..ca22cb7e6e54 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift @@ -477,6 +477,15 @@ private class FormDataEncoding: ParameterEncoding { ) } + case let data as Data: + + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + default: fatalError("Unprocessable value \(value) with key \(key)") } diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 23df908ca326..ca22cb7e6e54 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -477,6 +477,15 @@ private class FormDataEncoding: ParameterEncoding { ) } + case let data as Data: + + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + default: fatalError("Unprocessable value \(value) with key \(key)") } From cee5f7591241956b946263855caf8c4eb18e6470 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Fri, 10 Dec 2021 13:49:29 -0800 Subject: [PATCH 081/117] Feat adds content and header properties to CodegenResponse (#11046) * Adds responseHeaders to codegenResponse * Sets response headers in codegenResponse * Samples updated * Adds test of response headers * Adds content to CodegenResponse * Sets codegenResponse content * Tests added, test content-data.yaml spec update * Adds mediaTypeSchemaSuffix input to getContent * Tests updated * Updates how response content schema names are set * Adds missing Locale to String.format invocations --- .../openapitools/codegen/CodegenResponse.java | 24 ++- .../openapitools/codegen/DefaultCodegen.java | 66 ++++-- .../codegen/DefaultCodegenTest.java | 188 ++++++++++++------ .../src/test/resources/3_0/content-data.yaml | 34 +++- .../java/org/openapitools/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../openapitools/client/api/UserApiImpl.java | 1 + .../client/api/rxjava/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../openapitools/client/api/UserApiImpl.java | 1 + .../client/api/rxjava/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.scala | 1 + .../openapitools/example/api/UserApi.scala | 1 + .../org/openapitools/client/api/UserApi.scala | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../org/openapitools/api/UserApiService.java | 1 + .../api/impl/UserApiServiceImpl.java | 1 + .../puppies/store/apis/UserApiController.java | 1 + .../store/apis/UserApiControllerImp.java | 1 + .../apis/UserApiControllerImpInterface.java | 1 + .../app/controllers/UserApiController.java | 1 + .../app/controllers/UserApiControllerImp.java | 1 + .../UserApiControllerImpInterface.java | 1 + .../app/controllers/UserApiController.java | 1 + .../app/controllers/UserApiController.java | 1 + .../app/controllers/UserApiControllerImp.java | 1 + .../UserApiControllerImpInterface.java | 1 + .../app/controllers/UserApiController.java | 1 + .../app/controllers/UserApiControllerImp.java | 1 + .../UserApiControllerImpInterface.java | 1 + .../app/controllers/UserApiController.java | 1 + .../app/controllers/UserApiControllerImp.java | 1 + .../UserApiControllerImpInterface.java | 1 + .../app/controllers/UserApiController.java | 1 + .../app/controllers/UserApiControllerImp.java | 1 + .../app/controllers/UserApiController.java | 1 + .../app/controllers/UserApiControllerImp.java | 1 + .../UserApiControllerImpInterface.java | 1 + .../app/controllers/UserApiController.java | 1 + .../app/controllers/UserApiControllerImp.java | 1 + .../UserApiControllerImpInterface.java | 1 + .../app/controllers/UserApiController.java | 1 + .../app/controllers/UserApiControllerImp.java | 1 + .../UserApiControllerImpInterface.java | 1 + .../app/controllers/UserApiController.java | 1 + .../app/controllers/UserApiControllerImp.java | 1 + .../UserApiControllerImpInterface.java | 1 + .../vertxweb/server/api/UserApi.java | 1 + .../vertxweb/server/api/UserApiHandler.java | 1 + .../vertxweb/server/api/UserApiImpl.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../org/openapitools/api/UserApiService.java | 1 + .../api/impl/UserApiServiceImpl.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../org/openapitools/api/UserApiService.java | 1 + .../api/impl/UserApiServiceImpl.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../org/openapitools/api/UserApiService.java | 1 + .../api/impl/UserApiServiceImpl.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../api/impl/UserApiServiceImpl.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../api/impl/UserApiServiceImpl.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../api/impl/UserApiServiceImpl.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../org/openapitools/api/UserApiService.java | 1 + .../api/impl/UserApiServiceImpl.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../org/openapitools/api/UserApiService.java | 1 + .../api/impl/UserApiServiceImpl.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../org/openapitools/api/UserApiService.java | 1 + .../api/impl/UserApiServiceImpl.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../org/openapitools/api/UserApiService.java | 1 + .../api/impl/UserApiServiceImpl.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../org/openapitools/api/UserApiService.java | 1 + .../api/impl/UserApiServiceImpl.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../org/openapitools/api/UserApiService.java | 1 + .../api/impl/UserApiServiceImpl.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../openapitools/api/UserApiController.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../org/openapitools/api/UserApiDelegate.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../org/openapitools/api/UserApiDelegate.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../org/openapitools/api/UserApiDelegate.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../openapitools/api/UserApiController.java | 1 + .../org/openapitools/api/UserApiDelegate.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../org/openapitools/api/UserApiDelegate.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../openapitools/api/UserApiController.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../openapitools/virtualan/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + 143 files changed, 365 insertions(+), 86 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java index b81bda5f583a..7a23b3ab7267 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java @@ -21,6 +21,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties { public final List headers = new ArrayList(); + private List responseHeaders = new ArrayList(); public String code; public boolean is1xx; public boolean is2xx; @@ -87,6 +88,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties { private boolean hasDiscriminatorWithNonEmptyMapping; private CodegenComposedSchemas composedSchemas; private boolean hasMultipleTypes = false; + private LinkedHashMap content; @Override public int hashCode() { @@ -98,7 +100,7 @@ public int hashCode() { getMaxProperties(), getMinProperties(), uniqueItems, getMaxItems(), getMinItems(), getMaxLength(), getMinLength(), exclusiveMinimum, exclusiveMaximum, getMinimum(), getMaximum(), getPattern(), is1xx, is2xx, is3xx, is4xx, is5xx, additionalPropertiesIsAnyType, hasVars, hasRequired, - hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes); + hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes, responseHeaders, content); } @Override @@ -147,6 +149,8 @@ public boolean equals(Object o) { getAdditionalPropertiesIsAnyType() == that.getAdditionalPropertiesIsAnyType() && getHasVars() == that.getHasVars() && getHasRequired() == that.getHasRequired() && + Objects.equals(content, that.getContent()) && + Objects.equals(responseHeaders, that.getResponseHeaders()) && Objects.equals(composedSchemas, that.getComposedSchemas()) && Objects.equals(vars, that.vars) && Objects.equals(requiredVars, that.requiredVars) && @@ -176,6 +180,22 @@ public boolean equals(Object o) { } + public LinkedHashMap getContent() { + return content; + } + + public void setContent(LinkedHashMap content) { + this.content = content; + } + + public List getResponseHeaders() { + return responseHeaders; + } + + public void setResponseHeaders(List responseHeaders) { + this.responseHeaders = responseHeaders; + } + @Override public String getPattern() { return pattern; @@ -488,6 +508,8 @@ public String toString() { sb.append(", getHasDiscriminatorWithNonEmptyMapping=").append(hasDiscriminatorWithNonEmptyMapping); sb.append(", composedSchemas=").append(composedSchemas); sb.append(", hasMultipleTypes=").append(hasMultipleTypes); + sb.append(", responseHeaders=").append(responseHeaders); + sb.append(", content=").append(content); sb.append('}'); return sb.toString(); } 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 e76b78d6e5a8..32947d787069 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 @@ -3959,6 +3959,20 @@ public CodegenOperation fromOperation(String path, ApiResponse response = operationGetResponsesEntry.getValue(); addProducesInfo(response, op); CodegenResponse r = fromResponse(key, response); + Map headers = response.getHeaders(); + if (headers != null) { + List responseHeaders = new ArrayList<>(); + for (Entry entry: headers.entrySet()) { + String headerName = entry.getKey(); + Header header = entry.getValue(); + CodegenParameter responseHeader = heeaderToCodegenParameter(header, headerName, imports, String.format(Locale.ROOT, "%sResponseParameter", r.code)); + responseHeaders.add(responseHeader); + } + r.setResponseHeaders(responseHeaders); + } + String mediaTypeSchemaSuffix = String.format(Locale.ROOT, "%sResponseBody", r.code); + r.setContent(getContent(response.getContent(), imports, mediaTypeSchemaSuffix)); + if (r.baseType != null && !defaultIncludes.contains(r.baseType) && !languageSpecificPrimitives.contains(r.baseType)) { @@ -4065,6 +4079,7 @@ public CodegenOperation fromOperation(String path, param = ModelUtils.getReferencedParameter(this.openAPI, param); CodegenParameter p = fromParameter(param, imports); + p.setContent(getContent(param.getContent(), imports, "RequestParameter" + toModelName(param.getName()))); // ensure unique params if (ensureUniqueParams) { @@ -4502,7 +4517,6 @@ public CodegenParameter fromParameter(Parameter parameter, Set imports) codegenParameter.isDeprecated = parameter.getDeprecated(); } codegenParameter.jsonSchema = Json.pretty(parameter); - codegenParameter.setContent(getContent(parameter.getContent(), imports)); if (GlobalSettings.getProperty("debugParser") != null) { LOGGER.info("working on Parameter {}", parameter.getName()); @@ -6586,11 +6600,36 @@ protected void updateRequestBodyForString(CodegenParameter codegenParameter, Sch codegenParameter.pattern = toRegularExpression(schema.getPattern()); } - protected String toMediaTypeSchemaName(String contentType) { - return toModelName(contentType + "Schema"); + protected String toMediaTypeSchemaName(String contentType, String mediaTypeSchemaSuffix) { + return "SchemaFor" + mediaTypeSchemaSuffix + toModelName(contentType); } - protected LinkedHashMap getContent(Content content, Set imports) { + private CodegenParameter heeaderToCodegenParameter(Header header, String headerName, Set imports, String mediaTypeSchemaSuffix) { + if (header == null) { + return null; + } + Parameter headerParam = new Parameter(); + headerParam.setName(headerName); + headerParam.setIn("header"); + headerParam.setDescription(header.getDescription()); + headerParam.setRequired(header.getRequired()); + headerParam.setDeprecated(header.getDeprecated()); + Header.StyleEnum style = header.getStyle(); + if (style != null) { + headerParam.setStyle(Parameter.StyleEnum.valueOf(style.name())); + } + headerParam.setExplode(header.getExplode()); + headerParam.setSchema(header.getSchema()); + headerParam.setExamples(header.getExamples()); + headerParam.setExample(header.getExample()); + headerParam.setContent(header.getContent()); + headerParam.setExtensions(header.getExtensions()); + CodegenParameter param = fromParameter(headerParam, imports); + param.setContent(getContent(headerParam.getContent(), imports, mediaTypeSchemaSuffix)); + return param; + } + + protected LinkedHashMap getContent(Content content, Set imports, String mediaTypeSchemaSuffix) { if (content == null) { return null; } @@ -6609,20 +6648,7 @@ protected LinkedHashMap getContent(Content content, Se for (Entry headerEntry: encHeaders.entrySet()) { String headerName = headerEntry.getKey(); Header header = ModelUtils.getReferencedHeader(this.openAPI, headerEntry.getValue()); - Parameter headerParam = new Parameter(); - headerParam.setName(headerName); - headerParam.setIn("header"); - headerParam.setDescription(header.getDescription()); - headerParam.setRequired(header.getRequired()); - headerParam.setDeprecated(header.getDeprecated()); - headerParam.setStyle(Parameter.StyleEnum.valueOf(header.getStyle().name())); - headerParam.setExplode(header.getExplode()); - headerParam.setSchema(header.getSchema()); - headerParam.setExamples(header.getExamples()); - headerParam.setExample(header.getExample()); - headerParam.setContent(header.getContent()); - headerParam.setExtensions(header.getExtensions()); - CodegenParameter param = fromParameter(headerParam, imports); + CodegenParameter param = heeaderToCodegenParameter(header, headerName, imports, mediaTypeSchemaSuffix); headers.add(param); } } @@ -6638,7 +6664,7 @@ protected LinkedHashMap getContent(Content content, Se } } String contentType = contentEntry.getKey(); - CodegenProperty schemaProp = fromProperty(toMediaTypeSchemaName(contentType), mt.getSchema()); + CodegenProperty schemaProp = fromProperty(toMediaTypeSchemaName(contentType, mediaTypeSchemaSuffix), mt.getSchema()); CodegenMediaType codegenMt = new CodegenMediaType(schemaProp, ceMap); cmtContent.put(contentType, codegenMt); } @@ -6666,7 +6692,7 @@ public CodegenParameter fromRequestBody(RequestBody body, Set imports, S if (schema == null) { throw new RuntimeException("Request body cannot be null. Possible cause: missing schema in body parameter (OAS v2): " + body); } - codegenParameter.setContent(getContent(body.getContent(), imports)); + codegenParameter.setContent(getContent(body.getContent(), imports, "RequestBody")); if (StringUtils.isNotBlank(schema.get$ref())) { name = ModelUtils.getSimpleRef(schema.get$ref()); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java index 949bc1a9243b..54a2b0d20530 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java @@ -1673,12 +1673,12 @@ public void testLeadingSlashIsAddedIfMissing() { public void testDefaultResponseShouldBeLast() { OpenAPI openAPI = TestUtils.createOpenAPI(); Operation myOperation = new Operation().operationId("myOperation").responses( - new ApiResponses() - .addApiResponse( - "default", new ApiResponse().description("Default")) - .addApiResponse( - "422", new ApiResponse().description("Error")) - ); + new ApiResponses() + .addApiResponse( + "default", new ApiResponse().description("Default")) + .addApiResponse( + "422", new ApiResponse().description("Error")) + ); openAPI.path("/here", new PathItem().get(myOperation)); final DefaultCodegen codegen = new DefaultCodegen(); codegen.setOpenAPI(openAPI); @@ -2353,49 +2353,49 @@ public void testUseOneOfInterfaces() { @Test public void testFormComposedSchema() { OpenAPI openAPI = TestUtils.parseContent("openapi: 3.0.1\n" + - "info:\n" + - " version: '1.0.0'\n" + - " title: the title\n" + - "\n" + - "paths:\n" + - " '/users/me':\n" + - " post:\n" + - " description: Change user password.\n" + - " operationId: changeCurrentUserPassword\n" + - " requestBody:\n" + - " required: true\n" + - " content:\n" + - " multipart/form-data:\n" + - " schema:\n" + - " $ref: '#/components/schemas/ChangePasswordRequest'\n" + - " responses:\n" + - " '200':\n" + - " description: Successful operation\n" + - " content: {}\n" + - "\n" + - "components:\n" + - " schemas:\n" + - " CommonPasswordRequest:\n" + - " type: object\n" + - " required: [ password, passwordConfirmation ]\n" + - " properties:\n" + - " password:\n" + - " type: string\n" + - " format: password\n" + - " passwordConfirmation:\n" + - " type: string\n" + - " format: password\n" + - "\n" + - " ChangePasswordRequest:\n" + - " type: object\n" + - " allOf:\n" + - " - $ref: '#/components/schemas/CommonPasswordRequest'\n" + - " - type: object\n" + - " required: [ oldPassword ]\n" + - " properties:\n" + - " oldPassword:\n" + - " type: string\n" + - " format: password\n"); + "info:\n" + + " version: '1.0.0'\n" + + " title: the title\n" + + "\n" + + "paths:\n" + + " '/users/me':\n" + + " post:\n" + + " description: Change user password.\n" + + " operationId: changeCurrentUserPassword\n" + + " requestBody:\n" + + " required: true\n" + + " content:\n" + + " multipart/form-data:\n" + + " schema:\n" + + " $ref: '#/components/schemas/ChangePasswordRequest'\n" + + " responses:\n" + + " '200':\n" + + " description: Successful operation\n" + + " content: {}\n" + + "\n" + + "components:\n" + + " schemas:\n" + + " CommonPasswordRequest:\n" + + " type: object\n" + + " required: [ password, passwordConfirmation ]\n" + + " properties:\n" + + " password:\n" + + " type: string\n" + + " format: password\n" + + " passwordConfirmation:\n" + + " type: string\n" + + " format: password\n" + + "\n" + + " ChangePasswordRequest:\n" + + " type: object\n" + + " allOf:\n" + + " - $ref: '#/components/schemas/CommonPasswordRequest'\n" + + " - type: object\n" + + " required: [ oldPassword ]\n" + + " properties:\n" + + " oldPassword:\n" + + " type: string\n" + + " format: password\n"); final DefaultCodegen cg = new DefaultCodegen(); cg.setOpenAPI(openAPI); @@ -2404,16 +2404,16 @@ public void testFormComposedSchema() { final PathItem path = openAPI.getPaths().get("/users/me"); final CodegenOperation operation = cg.fromOperation( - "/users/me", - "post", - path.getPost(), - path.getServers()); + "/users/me", + "post", + path.getPost(), + path.getServers()); assertEquals(operation.formParams.size(), 3, - "The list of parameters should include inherited type"); + "The list of parameters should include inherited type"); final List names = operation.formParams.stream() - .map(param -> param.paramName) - .collect(Collectors.toList()); + .map(param -> param.paramName) + .collect(Collectors.toList()); assertTrue(names.contains("password")); assertTrue(names.contains("passwordConfirmation")); assertTrue(names.contains("oldPassword")); @@ -3347,7 +3347,7 @@ public void testHasRequiredInProperties() { assertTrue(hasRequired); } else { // All variables must be in the above sets - fail(); + fail(); } } } @@ -3930,7 +3930,8 @@ public void testResponses() { assertFalse(cr.primitiveType); } - public void testParameterContent() { + @Test + public void testRequestParameterContent() { DefaultCodegen codegen = new DefaultCodegen(); final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/content-data.yaml"); codegen.setOpenAPI(openAPI); @@ -3948,6 +3949,7 @@ public void testParameterContent() { CodegenProperty cp = mt.getSchema(); assertTrue(cp.isMap); assertEquals(cp.complexType, "object"); + assertEquals(cp.baseName, "SchemaForRequestParameterCoordinatesInlineSchemaApplicationJson"); CodegenParameter coordinatesReferencedSchema = co.queryParams.get(1); content = coordinatesReferencedSchema.getContent(); @@ -3956,6 +3958,7 @@ public void testParameterContent() { cp = mt.getSchema(); assertFalse(cp.isMap); // because it is a referenced schema assertEquals(cp.complexType, "coordinates"); + assertEquals(cp.baseName, "SchemaForRequestParameterCoordinatesReferencedSchemaApplicationJson"); } @Test @@ -3975,13 +3978,13 @@ public void testRequestBodyContent() { CodegenMediaType mt = content.get("application/json"); assertNull(mt.getEncoding()); CodegenProperty cp = mt.getSchema(); - assertEquals(cp.baseName, "ApplicationJsonSchema"); + assertEquals(cp.baseName, "SchemaForRequestBodyApplicationJson"); assertNotNull(cp); mt = content.get("text/plain"); assertNull(mt.getEncoding()); cp = mt.getSchema(); - assertEquals(cp.baseName, "TextPlainSchema"); + assertEquals(cp.baseName, "SchemaForRequestBodyTextPlain"); assertNotNull(cp); // Note: the inline model resolver has a bug for this use case; it extracts an inline request body into a component // but the schema it references is not string type @@ -3995,13 +3998,72 @@ public void testRequestBodyContent() { mt = content.get("application/json"); assertNull(mt.getEncoding()); cp = mt.getSchema(); - assertEquals(cp.baseName, "ApplicationJsonSchema"); + assertEquals(cp.baseName, "SchemaForRequestBodyApplicationJson"); + assertEquals(cp.complexType, "coordinates"); + + mt = content.get("text/plain"); + assertNull(mt.getEncoding()); + cp = mt.getSchema(); + assertEquals(cp.baseName, "SchemaForRequestBodyTextPlain"); + assertTrue(cp.isString); + } + + @Test + public void testResponseContentAndHeader() { + DefaultCodegen codegen = new DefaultCodegen(); + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/content-data.yaml"); + codegen.setOpenAPI(openAPI); + String path; + CodegenOperation co; + + path = "/jsonQueryParams"; + co = codegen.fromOperation(path, "GET", openAPI.getPaths().get(path).getGet(), null); + CodegenParameter coordinatesInlineSchema = co.queryParams.get(0); + LinkedHashMap content = coordinatesInlineSchema.getContent(); + assertNotNull(content); + assertEquals(content.keySet(), new HashSet<>(Arrays.asList("application/json"))); + + CodegenParameter schemaParam = co.queryParams.get(2); + assertEquals(schemaParam.getSchema().baseName, "stringWithMinLength"); + + + CodegenResponse cr = co.responses.get(0); + List responseHeaders = cr.getResponseHeaders(); + assertEquals(1, responseHeaders.size()); + CodegenParameter header = responseHeaders.get(0); + assertEquals("X-Rate-Limit", header.baseName); + assertTrue(header.isUnboundedInteger); + assertEquals(header.getSchema().baseName, "X-Rate-Limit"); + + content = cr.getContent(); + assertEquals(content.keySet(), new HashSet<>(Arrays.asList("application/json", "text/plain"))); + CodegenMediaType mt = content.get("application/json"); + assertNull(mt.getEncoding()); + CodegenProperty cp = mt.getSchema(); + assertFalse(cp.isMap); // because it is a referenced schema + assertEquals(cp.complexType, "coordinates"); + assertEquals(cp.baseName, "SchemaFor200ResponseBodyApplicationJson"); + + mt = content.get("text/plain"); + assertNull(mt.getEncoding()); + cp = mt.getSchema(); + assertEquals(cp.baseName, "SchemaFor200ResponseBodyTextPlain"); + assertTrue(cp.isString); + + cr = co.responses.get(1); + content = cr.getContent(); + assertEquals(content.keySet(), new HashSet<>(Arrays.asList("application/json", "text/plain"))); + mt = content.get("application/json"); + assertNull(mt.getEncoding()); + cp = mt.getSchema(); + assertFalse(cp.isMap); // because it is a referenced schema assertEquals(cp.complexType, "coordinates"); + assertEquals(cp.baseName, "SchemaFor201ResponseBodyApplicationJson"); mt = content.get("text/plain"); assertNull(mt.getEncoding()); cp = mt.getSchema(); - assertEquals(cp.baseName, "TextPlainSchema"); + assertEquals(cp.baseName, "SchemaFor201ResponseBodyTextPlain"); assertTrue(cp.isString); } -} +} \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/content-data.yaml b/modules/openapi-generator/src/test/resources/3_0/content-data.yaml index 56228cd30543..6296747be8a2 100644 --- a/modules/openapi-generator/src/test/resources/3_0/content-data.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/content-data.yaml @@ -26,9 +26,39 @@ paths: application/json: schema: $ref: '#/components/schemas/coordinates' + - name: stringWithMinLength + in: query + schema: + $ref: '#/components/schemas/stringWithMinLength' responses: - '201': + '200': description: 'OK' + headers: + X-Rate-Limit: + description: "The number of allowed requests in the current period" + schema: + type: integer + content: + application/json: + schema: + $ref: '#/components/schemas/coordinates' + text/plain: + schema: + $ref: '#/components/schemas/stringWithMinLength' + '201': + description: 'Created OK' + headers: + X-Rate-Limit-Limit: + description: "The number of allowed requests in the current period" + schema: + type: integer + content: + application/json: + schema: + $ref: '#/components/schemas/coordinates' + text/plain: + schema: + $ref: '#/components/schemas/stringWithMinLength' /inlineRequestBodySchemasDifferingByContentType: post: requestBody: @@ -80,4 +110,4 @@ components: lat: type: number long: - type: number + type: number \ No newline at end of file diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/UserApi.java index e29a340990c3..6e608808a733 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/UserApi.java @@ -18,6 +18,7 @@ import org.openapitools.query.QueryParam; import io.micronaut.core.convert.format.Format; import reactor.core.publisher.Mono; +import java.time.LocalDateTime; import org.openapitools.model.User; import javax.annotation.Generated; import java.util.ArrayList; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/UserApi.java index f2bc445ff228..948722b28de0 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/UserApi.java @@ -20,6 +20,7 @@ import org.openapitools.client.model.*; import org.openapitools.client.Pair; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/api/UserApi.java index d97f8235c4d4..b71073a1acc9 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/api/UserApi.java @@ -4,6 +4,7 @@ import org.openapitools.client.EncodingUtils; import org.openapitools.client.model.ApiResponse; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import java.util.ArrayList; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/UserApi.java index c6a74a80c00e..55adb67061eb 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/UserApi.java @@ -4,6 +4,7 @@ import org.openapitools.client.EncodingUtils; import org.openapitools.client.model.ApiResponse; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import java.util.ArrayList; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/UserApi.java index eaf587737db9..b3ef67b61ca6 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/UserApi.java @@ -2,6 +2,7 @@ import org.openapitools.client.ApiClient; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import com.fasterxml.jackson.core.type.TypeReference; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/UserApi.java index 1c6ce952c316..c0862cb96675 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/UserApi.java @@ -20,6 +20,7 @@ import org.openapitools.client.model.*; import org.openapitools.client.Pair; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/UserApi.java index c016f258f898..a2b14e76422a 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/UserApi.java @@ -8,6 +8,7 @@ import javax.ws.rs.core.GenericType; +import java.time.LocalDateTime; import org.openapitools.client.model.User; import java.util.ArrayList; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java index c016f258f898..2a59daac578e 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java @@ -8,6 +8,7 @@ import javax.ws.rs.core.GenericType; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import java.util.ArrayList; diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/UserApi.java index b9fd9ed12a0f..400bcc6a8ef8 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/UserApi.java @@ -12,6 +12,7 @@ package org.openapitools.client.api; +import java.util.Date; import org.openapitools.client.model.User; import java.io.InputStream; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/UserApi.java index 87d2be2c3f4f..209d289e08e4 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/UserApi.java @@ -17,6 +17,7 @@ import org.openapitools.client.ApiResponse; import org.openapitools.client.Pair; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import com.fasterxml.jackson.core.type.TypeReference; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/UserApi.java index d4f06af3fd58..2ce486c6491f 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/UserApi.java @@ -17,6 +17,7 @@ import org.openapitools.client.ApiResponse; import org.openapitools.client.Pair; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import com.fasterxml.jackson.core.type.TypeReference; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/UserApi.java index b6ab5b1bd532..706ac5239f7a 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/UserApi.java @@ -30,6 +30,7 @@ import java.io.IOException; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import java.lang.reflect.Type; diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/UserApi.java index 4bf2dc2b82f3..df1e507d1e43 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/UserApi.java @@ -27,6 +27,7 @@ import java.io.IOException; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import java.lang.reflect.Type; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java index 7e6577a7b11d..f47c499de125 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java @@ -27,6 +27,7 @@ import java.io.IOException; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import java.lang.reflect.Type; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java index 7e6577a7b11d..f47c499de125 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java @@ -27,6 +27,7 @@ import java.io.IOException; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import java.lang.reflect.Type; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/UserApi.java index 4caf52a8d5f8..cfabc572135d 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/UserApi.java @@ -13,6 +13,7 @@ package org.openapitools.client.api; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import java.util.ArrayList; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/UserApi.java index 4b2ee75cb922..c50c5ecb2a24 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/UserApi.java @@ -14,6 +14,7 @@ package org.openapitools.client.api; import com.google.gson.reflect.TypeToken; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import java.util.ArrayList; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/UserApi.java index 96c7210bf240..6c9ab56a94c2 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/UserApi.java @@ -7,6 +7,7 @@ import javax.ws.rs.core.GenericType; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import java.util.ArrayList; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/UserApi.java index 3561cd6e6db5..217e995d4a94 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/UserApi.java @@ -2,6 +2,7 @@ import org.openapitools.client.ApiClient; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import java.util.Collections; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/UserApi.java index 3561cd6e6db5..217e995d4a94 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/UserApi.java @@ -2,6 +2,7 @@ import org.openapitools.client.ApiClient; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import java.util.Collections; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/UserApi.java index 3208b159ade7..c568e477b92d 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/UserApi.java @@ -11,6 +11,7 @@ import okhttp3.ResponseBody; import okhttp3.MultipartBody; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import java.util.ArrayList; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/UserApi.java index be6071fd7d0e..55b998e696c7 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/UserApi.java @@ -9,6 +9,7 @@ import okhttp3.ResponseBody; import okhttp3.MultipartBody; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import java.util.ArrayList; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/UserApi.java index 134d9ea66f5d..f0f9bfc01f5f 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/UserApi.java @@ -10,6 +10,7 @@ import okhttp3.ResponseBody; import okhttp3.MultipartBody; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import java.util.ArrayList; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/UserApi.java index 7be5be28df39..00839a720e47 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/UserApi.java @@ -10,6 +10,7 @@ import okhttp3.ResponseBody; import okhttp3.MultipartBody; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import java.util.ArrayList; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/UserApi.java index e5c33d583abf..5d55c6aa266d 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/UserApi.java @@ -1,6 +1,7 @@ package org.openapitools.client.api; import org.openapitools.client.ApiClient; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/UserApiImpl.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/UserApiImpl.java index 7c2885ba3bc1..3e39564dd286 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/UserApiImpl.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/UserApiImpl.java @@ -1,5 +1,6 @@ package org.openapitools.client.api; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import io.vertx.core.AsyncResult; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/rxjava/UserApi.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/rxjava/UserApi.java index 51280eef3804..466c016abc08 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/rxjava/UserApi.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/rxjava/UserApi.java @@ -1,5 +1,6 @@ package org.openapitools.client.api.rxjava; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import org.openapitools.client.ApiClient; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/UserApi.java index e5c33d583abf..b7922264c5c4 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/UserApi.java @@ -1,6 +1,7 @@ package org.openapitools.client.api; import org.openapitools.client.ApiClient; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/UserApiImpl.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/UserApiImpl.java index 7c2885ba3bc1..592748032b6f 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/UserApiImpl.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/UserApiImpl.java @@ -1,5 +1,6 @@ package org.openapitools.client.api; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import io.vertx.core.AsyncResult; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/UserApi.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/UserApi.java index 51280eef3804..6ed5725ec837 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/UserApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/UserApi.java @@ -1,5 +1,6 @@ package org.openapitools.client.api.rxjava; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import org.openapitools.client.ApiClient; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/UserApi.java index 6920c4cd2009..70fd7a644cdf 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/UserApi.java @@ -2,6 +2,7 @@ import org.openapitools.client.ApiClient; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import java.util.HashMap; diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/UserApi.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/UserApi.scala index 880c084c64c1..112105938ad3 100644 --- a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/UserApi.scala +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/UserApi.scala @@ -11,6 +11,7 @@ */ package org.openapitools.client.api +import java.time.OffsetDateTime import org.openapitools.client.model.User import org.openapitools.client.core._ import org.openapitools.client.core.CollectionFormats._ diff --git a/samples/client/petstore/scala-httpclient-deprecated/src/main/scala/org/openapitools/example/api/UserApi.scala b/samples/client/petstore/scala-httpclient-deprecated/src/main/scala/org/openapitools/example/api/UserApi.scala index d39a90e57415..e194afed5a36 100644 --- a/samples/client/petstore/scala-httpclient-deprecated/src/main/scala/org/openapitools/example/api/UserApi.scala +++ b/samples/client/petstore/scala-httpclient-deprecated/src/main/scala/org/openapitools/example/api/UserApi.scala @@ -14,6 +14,7 @@ package org.openapitools.example.api import java.text.SimpleDateFormat +import java.util.Date import org.openapitools.client.model.User import org.openapitools.example.invoker.{ApiInvoker, ApiException} diff --git a/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/UserApi.scala b/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/UserApi.scala index 68e147b3d0fa..5cc17ea09c19 100644 --- a/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/UserApi.scala +++ b/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/UserApi.scala @@ -11,6 +11,7 @@ */ package org.openapitools.client.api +import java.time.OffsetDateTime import org.openapitools.client.model.User import org.openapitools.client.core.JsonSupport._ import sttp.client._ diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java index 0f9c95ed0401..f02a6902a51c 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index 483b0873d51e..ec264eb0d0b7 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java index 4fabd81f3b34..5fa9e20f90dd 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java index 27ab4c67aab3..006c4fd5ef43 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java index ab1c5d462d73..769693bc7e48 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java @@ -8,6 +8,7 @@ import javax.ws.rs.core.GenericType; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import java.util.ArrayList; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/UserApi.java index 836abbd19f76..a54f5e2a3ee4 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/UserApi.java @@ -7,6 +7,7 @@ import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/UserApiService.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/UserApiService.java index 14f88b4c31f7..905aab2c1b61 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/UserApiService.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/UserApiService.java @@ -6,6 +6,7 @@ import org.wso2.msf4j.formparam.FormDataParam; import org.wso2.msf4j.formparam.FileInfo; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/java-msf4j/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/java-msf4j/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index 9110ccdf44d0..092f5f3a5819 100644 --- a/samples/server/petstore/java-msf4j/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/java-msf4j/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -3,6 +3,7 @@ import org.openapitools.api.*; import org.openapitools.model.*; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiController.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiController.java index 40e025ed4450..e6e8c6097d4d 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiController.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiController.java @@ -1,6 +1,7 @@ package com.puppies.store.apis; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.typesafe.config.Config; diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImp.java index a5c27c44caf9..3ff0eb26e4cd 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImp.java @@ -1,6 +1,7 @@ package com.puppies.store.apis; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import play.mvc.Http; diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImpInterface.java index 0837531ed7aa..adae1c272395 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImpInterface.java @@ -1,6 +1,7 @@ package com.puppies.store.apis; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiController.java index 3a89de0cd115..2d6685b18a42 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiController.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.typesafe.config.Config; diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImp.java index 417765d035b5..b4c38db7da4d 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImp.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import play.mvc.Http; diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImpInterface.java index 39a8a9f8960a..2a1a3322b197 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImpInterface.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework-controller-only/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-controller-only/app/controllers/UserApiController.java index 1a1e62be27c5..d3c05dfa2033 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/controllers/UserApiController.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.typesafe.config.Config; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java index 7c2ee85e2e15..6169c1620105 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.typesafe.config.Config; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImp.java index f866d4e9853c..341f50171817 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImp.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import play.mvc.Http; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImpInterface.java index bd254922d03a..39d422cc1ea4 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImpInterface.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiController.java index 879700e98c70..e0572c7f33cb 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiController.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.typesafe.config.Config; diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImp.java index 3be679120b6a..02a82befbec7 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImp.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import play.mvc.Http; diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImpInterface.java index 8aea513ad764..722d76055f70 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImpInterface.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiController.java index 29a5aaf90817..f4218359b688 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiController.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.typesafe.config.Config; diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImp.java index 1fc6f076ca65..75b2af297974 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImp.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import play.mvc.Http; diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImpInterface.java index 9f00bfc1fc16..4a83cce61987 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImpInterface.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiController.java index f9a5ff9af682..e8c0a2f4123e 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiController.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.typesafe.config.Config; diff --git a/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiControllerImp.java index 551cff753e3c..5d2342bdf201 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiControllerImp.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import play.mvc.Http; diff --git a/samples/server/petstore/java-play-framework-no-nullable/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-nullable/app/controllers/UserApiController.java index 7c2ee85e2e15..6169c1620105 100644 --- a/samples/server/petstore/java-play-framework-no-nullable/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-nullable/app/controllers/UserApiController.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.typesafe.config.Config; diff --git a/samples/server/petstore/java-play-framework-no-nullable/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-no-nullable/app/controllers/UserApiControllerImp.java index f866d4e9853c..341f50171817 100644 --- a/samples/server/petstore/java-play-framework-no-nullable/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-nullable/app/controllers/UserApiControllerImp.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import play.mvc.Http; diff --git a/samples/server/petstore/java-play-framework-no-nullable/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-nullable/app/controllers/UserApiControllerImpInterface.java index bd254922d03a..39d422cc1ea4 100644 --- a/samples/server/petstore/java-play-framework-no-nullable/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-nullable/app/controllers/UserApiControllerImpInterface.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiController.java index 7c2ee85e2e15..6169c1620105 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiController.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.typesafe.config.Config; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImp.java index f866d4e9853c..341f50171817 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImp.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import play.mvc.Http; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImpInterface.java index bd254922d03a..39d422cc1ea4 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImpInterface.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiController.java index 916e3d26033e..582c691a51b1 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiController.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.typesafe.config.Config; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImp.java index f866d4e9853c..341f50171817 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImp.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import play.mvc.Http; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImpInterface.java index bd254922d03a..39d422cc1ea4 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImpInterface.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java index 7c2ee85e2e15..6169c1620105 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.typesafe.config.Config; diff --git a/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImp.java index f866d4e9853c..341f50171817 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImp.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import play.mvc.Http; diff --git a/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImpInterface.java index bd254922d03a..39d422cc1ea4 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImpInterface.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApi.java b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApi.java index 51a910d032f1..a68768f7179e 100644 --- a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApi.java +++ b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApi.java @@ -1,5 +1,6 @@ package org.openapitools.vertxweb.server.api; +import java.time.OffsetDateTime; import org.openapitools.vertxweb.server.model.User; import org.openapitools.vertxweb.server.ApiResponse; diff --git a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiHandler.java b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiHandler.java index 85beafc942d8..f32f94a006f9 100644 --- a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiHandler.java +++ b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiHandler.java @@ -1,5 +1,6 @@ package org.openapitools.vertxweb.server.api; +import java.time.OffsetDateTime; import org.openapitools.vertxweb.server.model.User; import com.fasterxml.jackson.core.type.TypeReference; diff --git a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiImpl.java b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiImpl.java index 13b9457de8e8..b2097db1dec0 100644 --- a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiImpl.java +++ b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiImpl.java @@ -1,5 +1,6 @@ package org.openapitools.vertxweb.server.api; +import java.time.OffsetDateTime; import org.openapitools.vertxweb.server.model.User; import org.openapitools.vertxweb.server.ApiResponse; diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/org/openapitools/api/UserApi.java index a621c7a62291..f615b43fc0d9 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/org/openapitools/api/UserApi.java @@ -1,5 +1,6 @@ package org.openapitools.api; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/org/openapitools/api/UserApi.java index 280ad5696667..6a0c280728d0 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/org/openapitools/api/UserApi.java @@ -1,5 +1,6 @@ package org.openapitools.api; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/UserApi.java index 40ad9d927032..1d2df9950e4d 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/UserApi.java @@ -1,5 +1,6 @@ package org.openapitools.api; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/UserApi.java index 05b3b1e61cce..ac1d5d79c93a 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/UserApi.java @@ -8,6 +8,7 @@ import io.swagger.jaxrs.*; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import java.util.Map; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/UserApiService.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/UserApiService.java index 15e4486bc6c5..0398450b90e1 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/UserApiService.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/UserApiService.java @@ -6,6 +6,7 @@ import org.glassfish.jersey.media.multipart.FormDataBodyPart; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import java.util.List; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index 1e5df1742f13..2777fd418e30 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -4,6 +4,7 @@ import org.openapitools.model.*; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import java.util.List; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApi.java index 6d96f196c9e5..a21940cf1307 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApi.java @@ -7,6 +7,7 @@ import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApiService.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApiService.java index 1464a5adacbc..a97a94b96304 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApiService.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApiService.java @@ -5,6 +5,7 @@ import org.glassfish.jersey.media.multipart.FormDataBodyPart; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index 2d7b2e001a41..f52f29ff610d 100644 --- a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -3,6 +3,7 @@ import org.openapitools.api.*; import org.openapitools.model.*; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/api/UserApi.java index d9780d5234b6..a86e19f4e7b9 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/api/UserApiService.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/api/UserApiService.java index 35d72d421127..9c8711a4c33a 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/api/UserApiService.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/api/UserApiService.java @@ -4,6 +4,7 @@ import org.openapitools.model.*; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/default/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index 40d14d0be55b..3922ee89e621 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -4,6 +4,7 @@ import org.openapitools.model.*; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/org/openapitools/api/UserApi.java index 22506d0ee4da..18245bceec16 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ import io.swagger.jaxrs.*; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import java.util.List; diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index a63f0db78fe7..5b04e2fe7c5b 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -5,6 +5,7 @@ import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import java.util.List; diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/org/openapitools/api/UserApi.java index 22506d0ee4da..4ff199c24041 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/org/openapitools/api/UserApi.java @@ -5,6 +5,7 @@ import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; +import org.joda.time.DateTime; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index a63f0db78fe7..6f7c52daa96a 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -4,6 +4,7 @@ import org.openapitools.model.*; +import org.joda.time.DateTime; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/org/openapitools/api/UserApi.java index 22506d0ee4da..9085d6360ea1 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/org/openapitools/api/UserApi.java @@ -5,6 +5,7 @@ import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index a63f0db78fe7..1df5c3e26f10 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -4,6 +4,7 @@ import org.openapitools.model.*; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/api/UserApi.java index d9780d5234b6..6c9a757e1982 100644 --- a/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/api/UserApi.java @@ -7,6 +7,7 @@ import io.swagger.jaxrs.*; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import java.util.Map; diff --git a/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/api/UserApiService.java b/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/api/UserApiService.java index 35d72d421127..a5042f3ed871 100644 --- a/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/api/UserApiService.java +++ b/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/api/UserApiService.java @@ -5,6 +5,7 @@ import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import java.util.List; diff --git a/samples/server/petstore/jaxrs-resteasy/java8/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/java8/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index 40d14d0be55b..c71a0ed4e5ef 100644 --- a/samples/server/petstore/jaxrs-resteasy/java8/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-resteasy/java8/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -5,6 +5,7 @@ import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import java.util.List; diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/api/UserApi.java index d9780d5234b6..571e51a33456 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; +import org.joda.time.DateTime; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/api/UserApiService.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/api/UserApiService.java index 35d72d421127..8560f101ffb8 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/api/UserApiService.java +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/api/UserApiService.java @@ -4,6 +4,7 @@ import org.openapitools.model.*; +import org.joda.time.DateTime; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/joda/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index 40d14d0be55b..6c64a9bc5d3c 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -4,6 +4,7 @@ import org.openapitools.model.*; +import org.joda.time.DateTime; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/UserApi.java index a1fb4ed1b0f5..f07a6ceb7d02 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/UserApi.java @@ -1,5 +1,6 @@ package org.openapitools.api; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/UserApi.java index a72c9431305b..2657167dce12 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/UserApi.java @@ -1,5 +1,6 @@ package org.openapitools.api; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/UserApi.java index 9d44284fa0fc..2808b3bc0906 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/UserApi.java @@ -7,6 +7,7 @@ import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/UserApiService.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/UserApiService.java index 79b52a8a5ec9..da302c73c1e2 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/UserApiService.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/UserApiService.java @@ -5,6 +5,7 @@ import com.sun.jersey.multipart.FormDataParam; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index 5df04a4d533b..be039a8631c6 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -5,6 +5,7 @@ import com.sun.jersey.multipart.FormDataParam; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/UserApi.java index aa5b7ec2d6ff..d3ac6451018c 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/UserApi.java @@ -7,6 +7,7 @@ import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/UserApiService.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/UserApiService.java index 79b52a8a5ec9..da302c73c1e2 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/UserApiService.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/UserApiService.java @@ -5,6 +5,7 @@ import com.sun.jersey.multipart.FormDataParam; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index 5df04a4d533b..be039a8631c6 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -5,6 +5,7 @@ import com.sun.jersey.multipart.FormDataParam; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/UserApi.java index 2d90f2523525..ba9ff14767b3 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/UserApi.java @@ -7,6 +7,7 @@ import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/UserApiService.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/UserApiService.java index 15e4486bc6c5..493a47591e58 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/UserApiService.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/UserApiService.java @@ -5,6 +5,7 @@ import org.glassfish.jersey.media.multipart.FormDataBodyPart; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index 1e5df1742f13..f4bd2bfef429 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -3,6 +3,7 @@ import org.openapitools.api.*; import org.openapitools.model.*; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/UserApi.java index 05b3b1e61cce..083280808341 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/UserApi.java @@ -7,6 +7,7 @@ import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/UserApiService.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/UserApiService.java index 15e4486bc6c5..493a47591e58 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/UserApiService.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/UserApiService.java @@ -5,6 +5,7 @@ import org.glassfish.jersey.media.multipart.FormDataBodyPart; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index 1e5df1742f13..f4bd2bfef429 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -3,6 +3,7 @@ import org.openapitools.api.*; import org.openapitools.model.*; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java index 941fffd38328..ce495a26f875 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java index 27f6a346d300..0a1551959741 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.LocalDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java index 27f6a346d300..fabb81f5f1a8 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index 27f6a346d300..fabb81f5f1a8 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java index 27f6a346d300..fabb81f5f1a8 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java index f96ae9134403..517f2743d2aa 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import org.threeten.bp.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java index a749387b89f1..a5441a06b657 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java @@ -1,6 +1,7 @@ package org.openapitools.api; import java.util.List; +import org.threeten.bp.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java index 27f6a346d300..fabb81f5f1a8 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java index c6a6fa866994..7fce7995a83d 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiDelegate.java index 78da7c8510bc..b63fa7a1c28a 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -1,6 +1,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java index c6a6fa866994..7fce7995a83d 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java index 78da7c8510bc..b63fa7a1c28a 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -1,6 +1,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java index cb97dfa0de6f..2e0fbbbffc94 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java index 505c317d5f45..9487e29ee1a1 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java index 7241a736ea1b..563d11fa041e 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -1,6 +1,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java index f96ae9134403..517f2743d2aa 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import org.threeten.bp.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java index da136ce2f801..927da273215f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java @@ -1,6 +1,7 @@ package org.openapitools.api; import java.util.List; +import org.threeten.bp.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiDelegate.java index 81c3ecc25887..00d156773a2e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -1,6 +1,7 @@ package org.openapitools.api; import java.util.List; +import org.threeten.bp.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java index c6a6fa866994..7fce7995a83d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiDelegate.java index 78da7c8510bc..b63fa7a1c28a 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -1,6 +1,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java index f96ae9134403..517f2743d2aa 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import org.threeten.bp.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java index a749387b89f1..a5441a06b657 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java @@ -1,6 +1,7 @@ package org.openapitools.api; import java.util.List; +import org.threeten.bp.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index 27f6a346d300..fabb81f5f1a8 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java index 27f6a346d300..fabb81f5f1a8 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java index f97eeb8e4071..a3766015580e 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.virtualan.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.virtualan.model.User; import io.swagger.annotations.*; import io.virtualan.annotation.ApiVirtual; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java index 27f6a346d300..fabb81f5f1a8 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; From 0236f84c1156c4aa03027c861221cf6389c35479 Mon Sep 17 00:00:00 2001 From: Guus Bloemsma Date: Sat, 11 Dec 2021 14:48:00 +0100 Subject: [PATCH 082/117] [kotlin-client] Allowing vendor types for json (#10758) * Using the first serializable 'consumes' mediaType Using all deserializable 'produces' mediaTypes Matching json vendor types as json * updating the generated samples --- .../languages/KotlinClientCodegen.java | 63 ++++++++++++++++--- .../libraries/jvm-okhttp/api.mustache | 3 + .../infrastructure/ApiClient.kt.mustache | 14 ++--- .../openapitools/client/apis/DefaultApi.kt | 1 + .../client/infrastructure/ApiClient.kt | 12 ++-- .../petstore/kotlin-gson/docs/PetApi.md | 10 +-- .../petstore/kotlin-gson/docs/StoreApi.md | 4 +- .../petstore/kotlin-gson/docs/UserApi.md | 4 +- .../org/openapitools/client/apis/PetApi.kt | 14 +++-- .../org/openapitools/client/apis/StoreApi.kt | 5 +- .../org/openapitools/client/apis/UserApi.kt | 14 +++-- .../client/infrastructure/ApiClient.kt | 12 ++-- .../petstore/kotlin-jackson/docs/PetApi.md | 10 +-- .../petstore/kotlin-jackson/docs/StoreApi.md | 4 +- .../petstore/kotlin-jackson/docs/UserApi.md | 4 +- .../org/openapitools/client/apis/PetApi.kt | 14 +++-- .../org/openapitools/client/apis/StoreApi.kt | 5 +- .../org/openapitools/client/apis/UserApi.kt | 14 +++-- .../client/infrastructure/ApiClient.kt | 12 ++-- .../kotlin-json-request-string/docs/PetApi.md | 10 +-- .../docs/StoreApi.md | 4 +- .../docs/UserApi.md | 4 +- .../org/openapitools/client/apis/PetApi.kt | 14 +++-- .../org/openapitools/client/apis/StoreApi.kt | 5 +- .../org/openapitools/client/apis/UserApi.kt | 14 +++-- .../client/infrastructure/ApiClient.kt | 12 ++-- .../docs/PetApi.md | 10 +-- .../docs/StoreApi.md | 4 +- .../docs/UserApi.md | 4 +- .../org/openapitools/client/apis/PetApi.kt | 14 +++-- .../org/openapitools/client/apis/StoreApi.kt | 5 +- .../org/openapitools/client/apis/UserApi.kt | 14 +++-- .../client/infrastructure/ApiClient.kt | 12 ++-- .../kotlin-moshi-codegen/docs/PetApi.md | 10 +-- .../kotlin-moshi-codegen/docs/StoreApi.md | 4 +- .../kotlin-moshi-codegen/docs/UserApi.md | 4 +- .../org/openapitools/client/apis/PetApi.kt | 14 +++-- .../org/openapitools/client/apis/StoreApi.kt | 5 +- .../org/openapitools/client/apis/UserApi.kt | 14 +++-- .../client/infrastructure/ApiClient.kt | 12 ++-- .../petstore/kotlin-nonpublic/docs/PetApi.md | 10 +-- .../kotlin-nonpublic/docs/StoreApi.md | 4 +- .../petstore/kotlin-nonpublic/docs/UserApi.md | 4 +- .../org/openapitools/client/apis/PetApi.kt | 14 +++-- .../org/openapitools/client/apis/StoreApi.kt | 5 +- .../org/openapitools/client/apis/UserApi.kt | 14 +++-- .../client/infrastructure/ApiClient.kt | 12 ++-- .../petstore/kotlin-nullable/docs/PetApi.md | 10 +-- .../petstore/kotlin-nullable/docs/StoreApi.md | 4 +- .../petstore/kotlin-nullable/docs/UserApi.md | 4 +- .../org/openapitools/client/apis/PetApi.kt | 14 +++-- .../org/openapitools/client/apis/StoreApi.kt | 5 +- .../org/openapitools/client/apis/UserApi.kt | 14 +++-- .../client/infrastructure/ApiClient.kt | 12 ++-- .../petstore/kotlin-okhttp3/docs/PetApi.md | 10 +-- .../petstore/kotlin-okhttp3/docs/StoreApi.md | 4 +- .../petstore/kotlin-okhttp3/docs/UserApi.md | 4 +- .../org/openapitools/client/apis/PetApi.kt | 14 +++-- .../org/openapitools/client/apis/StoreApi.kt | 5 +- .../org/openapitools/client/apis/UserApi.kt | 14 +++-- .../client/infrastructure/ApiClient.kt | 12 ++-- .../petstore/kotlin-string/docs/PetApi.md | 10 +-- .../petstore/kotlin-string/docs/StoreApi.md | 4 +- .../petstore/kotlin-string/docs/UserApi.md | 4 +- .../org/openapitools/client/apis/PetApi.kt | 14 +++-- .../org/openapitools/client/apis/StoreApi.kt | 5 +- .../org/openapitools/client/apis/UserApi.kt | 14 +++-- .../client/infrastructure/ApiClient.kt | 12 ++-- .../petstore/kotlin-threetenbp/docs/PetApi.md | 10 +-- .../kotlin-threetenbp/docs/StoreApi.md | 4 +- .../kotlin-threetenbp/docs/UserApi.md | 4 +- .../org/openapitools/client/apis/PetApi.kt | 14 +++-- .../org/openapitools/client/apis/StoreApi.kt | 5 +- .../org/openapitools/client/apis/UserApi.kt | 14 +++-- .../client/infrastructure/ApiClient.kt | 12 ++-- .../org/openapitools/client/apis/EnumApi.kt | 1 + .../client/infrastructure/ApiClient.kt | 12 ++-- samples/client/petstore/kotlin/docs/PetApi.md | 10 +-- .../client/petstore/kotlin/docs/StoreApi.md | 4 +- .../client/petstore/kotlin/docs/UserApi.md | 4 +- .../org/openapitools/client/apis/PetApi.kt | 14 +++-- .../org/openapitools/client/apis/StoreApi.kt | 5 +- .../org/openapitools/client/apis/UserApi.kt | 14 +++-- .../client/infrastructure/ApiClient.kt | 12 ++-- 84 files changed, 483 insertions(+), 316 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java index 28a3853332dd..80b54000dd81 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java @@ -18,8 +18,21 @@ package org.openapitools.codegen.languages; import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.*; -import org.openapitools.codegen.meta.features.*; +import org.openapitools.codegen.CliOption; +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.CodegenModel; +import org.openapitools.codegen.CodegenOperation; +import org.openapitools.codegen.CodegenParameter; +import org.openapitools.codegen.CodegenProperty; +import org.openapitools.codegen.CodegenType; +import org.openapitools.codegen.SupportingFile; +import org.openapitools.codegen.meta.features.ClientModificationFeature; +import org.openapitools.codegen.meta.features.DocumentationFeature; +import org.openapitools.codegen.meta.features.GlobalFeature; +import org.openapitools.codegen.meta.features.ParameterFeature; +import org.openapitools.codegen.meta.features.SchemaSupportFeature; +import org.openapitools.codegen.meta.features.SecurityFeature; +import org.openapitools.codegen.meta.features.WireFormatFeature; import org.openapitools.codegen.utils.ProcessUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -28,6 +41,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.function.Predicate; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -617,14 +631,14 @@ public Map postProcessModels(Map objs) { // escape the variable base name for use as a string literal List vars = Stream.of( - cm.vars, - cm.allVars, - cm.optionalVars, - cm.requiredVars, - cm.readOnlyVars, - cm.readWriteVars, - cm.parentVars - ) + cm.vars, + cm.allVars, + cm.optionalVars, + cm.requiredVars, + cm.readOnlyVars, + cm.readWriteVars, + cm.parentVars + ) .flatMap(List::stream) .collect(Collectors.toList()); @@ -653,6 +667,35 @@ public Map postProcessOperationsWithModels(Map o operation.path = operation.path.substring(1); } + if (JVM_OKHTTP.equals(getLibrary()) || JVM_OKHTTP3.equals(getLibrary()) || JVM_OKHTTP4.equals(getLibrary())) { + // Ideally we would do content negotiation to choose the best mediatype, but that would be a next step. + // For now we take the first mediatype we can parse and send that. + Predicate> isSerializable = typeMapping -> { + String mediaTypeValue = typeMapping.get("mediaType"); + if (mediaTypeValue == null) + return false; + // match on first part in mediaTypes like 'application/json; charset=utf-8' + int endIndex = mediaTypeValue.indexOf(';'); + String mediaType = (endIndex == -1 + ? mediaTypeValue + : mediaTypeValue.substring(0, endIndex) + ).trim(); + return "multipart/form-data".equals(mediaType) + || "application/x-www-form-urlencoded".equals(mediaType) + || (mediaType.startsWith("application/") && mediaType.endsWith("json")); + }; + operation.consumes = operation.consumes == null ? null : operation.consumes.stream() + .filter(isSerializable) + .limit(1) + .collect(Collectors.toList()); + operation.hasConsumes = operation.consumes != null && !operation.consumes.isEmpty(); + + operation.produces = operation.produces == null ? null : operation.produces.stream() + .filter(isSerializable) + .collect(Collectors.toList()); + operation.hasProduces = operation.produces != null && !operation.produces.isEmpty(); + } + // set multipart against all relevant operations if (operation.hasConsumes == Boolean.TRUE) { if (isMultipartType(operation.consumes)) { diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache index 71d19cb2ecaf..8059b5ffa797 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache @@ -130,6 +130,9 @@ import {{packageName}}.infrastructure.toMultiValue {{#headerParams}} {{{paramName}}}{{^required}}?{{/required}}.apply { localVariableHeaders["{{baseName}}"] = {{#isContainer}}this.joinToString(separator = collectionDelimiter("{{collectionFormat}}")){{/isContainer}}{{^isContainer}}this.toString(){{/isContainer}} } {{/headerParams}} + {{^hasFormParams}}{{#hasConsumes}}{{#consumes}}localVariableHeaders["Content-Type"] = "{{{mediaType}}}" + {{/consumes}}{{/hasConsumes}}{{/hasFormParams}}{{#hasProduces}}localVariableHeaders["Accept"] = "{{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}" +{{/hasProduces}} return RequestConfig( method = RequestMethod.{{httpMethod}}, diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache index 57bd33d35bfc..8f30c1808e2c 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache @@ -167,8 +167,8 @@ import com.squareup.moshi.adapter } }.build() } + mediaType.startsWith("application/") && mediaType.endsWith("json") -> {{#jvm-okhttp3}} - mediaType == JsonMediaType -> { if (content == null) { EMPTY_REQUEST } else { @@ -187,10 +187,8 @@ import com.squareup.moshi.adapter {{/kotlinx_serialization}} ) } - } {{/jvm-okhttp3}} {{#jvm-okhttp4}} - mediaType == JsonMediaType -> { if (content == null) { EMPTY_REQUEST } else { @@ -210,7 +208,6 @@ import com.squareup.moshi.adapter mediaType.toMediaTypeOrNull() ) } - } {{/jvm-okhttp4}} mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") // TODO: this should be extended with other serializers @@ -247,8 +244,9 @@ import com.squareup.moshi.adapter out.close() return f as T } - return when(mediaType) { - JsonMediaType -> {{#moshi}}Serializer.moshi.adapter().fromJson(bodyContent){{/moshi}}{{#gson}}Serializer.gson.fromJson(bodyContent, (object: TypeToken(){}).getType()){{/gson}}{{#jackson}}Serializer.jacksonObjectMapper.readValue(bodyContent, object: TypeReference() {}){{/jackson}}{{#kotlinx_serialization}}Serializer.jvmJson.decodeFromString(bodyContent){{/kotlinx_serialization}} + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + {{#moshi}}Serializer.moshi.adapter().fromJson(bodyContent){{/moshi}}{{#gson}}Serializer.gson.fromJson(bodyContent, (object: TypeToken(){}).getType()){{/gson}}{{#jackson}}Serializer.jacksonObjectMapper.readValue(bodyContent, object: TypeReference() {}){{/jackson}}{{#kotlinx_serialization}}Serializer.jvmJson.decodeFromString(bodyContent){{/kotlinx_serialization}} else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } @@ -343,11 +341,11 @@ import com.squareup.moshi.adapter } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { + if(headers[ContentType].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") } - if(headers[Accept] ?: "" == "") { + if(headers[Accept].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Accept header. This is required.") } diff --git a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt index 662eff77a042..dfcdc11ef3dd 100644 --- a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt +++ b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -98,6 +98,7 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, diff --git a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 634abe57b900..8a9c47045ed7 100644 --- a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -105,7 +105,7 @@ open class ApiClient(val baseUrl: String) { } }.build() } - mediaType == JsonMediaType -> { + mediaType.startsWith("application/") && mediaType.endsWith("json") -> if (content == null) { EMPTY_REQUEST } else { @@ -114,7 +114,6 @@ open class ApiClient(val baseUrl: String) { mediaType.toMediaTypeOrNull() ) } - } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") // TODO: this should be extended with other serializers else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") @@ -138,8 +137,9 @@ open class ApiClient(val baseUrl: String) { out.close() return f as T } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter().fromJson(bodyContent) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.moshi.adapter().fromJson(bodyContent) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } @@ -167,11 +167,11 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { + if(headers[ContentType].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") } - if(headers[Accept] ?: "" == "") { + if(headers[Accept].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Accept header. This is required.") } diff --git a/samples/client/petstore/kotlin-gson/docs/PetApi.md b/samples/client/petstore/kotlin-gson/docs/PetApi.md index 27289c31c243..403e57a4b338 100644 --- a/samples/client/petstore/kotlin-gson/docs/PetApi.md +++ b/samples/client/petstore/kotlin-gson/docs/PetApi.md @@ -57,7 +57,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined @@ -155,7 +155,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **findPetsByTags** @@ -204,7 +204,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **getPetById** @@ -254,7 +254,7 @@ Configure api_key: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **updatePet** @@ -299,7 +299,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined diff --git a/samples/client/petstore/kotlin-gson/docs/StoreApi.md b/samples/client/petstore/kotlin-gson/docs/StoreApi.md index f4986041af8c..de2f4dbdcb12 100644 --- a/samples/client/petstore/kotlin-gson/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-gson/docs/StoreApi.md @@ -147,7 +147,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **placeOrder** @@ -192,5 +192,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json diff --git a/samples/client/petstore/kotlin-gson/docs/UserApi.md b/samples/client/petstore/kotlin-gson/docs/UserApi.md index fd98ce696add..e54decd3ba95 100644 --- a/samples/client/petstore/kotlin-gson/docs/UserApi.md +++ b/samples/client/petstore/kotlin-gson/docs/UserApi.md @@ -237,7 +237,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **loginUser** @@ -284,7 +284,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **logoutUser** diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 7ccfb70d6d56..59367631c91e 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -100,7 +100,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/pet", @@ -170,7 +171,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - + return RequestConfig( method = RequestMethod.DELETE, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -241,6 +242,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("status", toMultiValue(status.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -317,6 +319,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("tags", toMultiValue(tags.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -385,6 +388,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -451,7 +455,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.PUT, path = "/pet", @@ -523,7 +528,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("name" to name, "status" to status) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - + return RequestConfig( method = RequestMethod.POST, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -597,6 +602,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("additionalMetadata" to additionalMetadata, "file" to file) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index a3a2940291f4..87d76a0b30d6 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -99,7 +99,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), @@ -164,6 +164,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -232,6 +233,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -300,6 +302,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index a68290f0718f..444826b782cd 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -99,7 +99,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user", @@ -165,7 +165,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithArray", @@ -231,7 +231,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithList", @@ -297,7 +297,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/user/{username}".replace("{"+"username"+"}", "$username"), @@ -365,6 +365,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -440,6 +441,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("password", listOf(password.toString())) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -503,7 +505,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.GET, path = "/user/logout", @@ -572,7 +574,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.PUT, path = "/user/{username}".replace("{"+"username"+"}", "$username"), diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 7a1fafd594e7..f46f0ed6f553 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -105,7 +105,7 @@ open class ApiClient(val baseUrl: String) { } }.build() } - mediaType == JsonMediaType -> { + mediaType.startsWith("application/") && mediaType.endsWith("json") -> if (content == null) { EMPTY_REQUEST } else { @@ -114,7 +114,6 @@ open class ApiClient(val baseUrl: String) { mediaType.toMediaTypeOrNull() ) } - } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") // TODO: this should be extended with other serializers else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") @@ -137,8 +136,9 @@ open class ApiClient(val baseUrl: String) { out.close() return f as T } - return when(mediaType) { - JsonMediaType -> Serializer.gson.fromJson(bodyContent, (object: TypeToken(){}).getType()) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.gson.fromJson(bodyContent, (object: TypeToken(){}).getType()) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } @@ -185,11 +185,11 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { + if(headers[ContentType].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") } - if(headers[Accept] ?: "" == "") { + if(headers[Accept].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Accept header. This is required.") } diff --git a/samples/client/petstore/kotlin-jackson/docs/PetApi.md b/samples/client/petstore/kotlin-jackson/docs/PetApi.md index 27289c31c243..403e57a4b338 100644 --- a/samples/client/petstore/kotlin-jackson/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jackson/docs/PetApi.md @@ -57,7 +57,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined @@ -155,7 +155,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **findPetsByTags** @@ -204,7 +204,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **getPetById** @@ -254,7 +254,7 @@ Configure api_key: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **updatePet** @@ -299,7 +299,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined diff --git a/samples/client/petstore/kotlin-jackson/docs/StoreApi.md b/samples/client/petstore/kotlin-jackson/docs/StoreApi.md index f4986041af8c..de2f4dbdcb12 100644 --- a/samples/client/petstore/kotlin-jackson/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-jackson/docs/StoreApi.md @@ -147,7 +147,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **placeOrder** @@ -192,5 +192,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json diff --git a/samples/client/petstore/kotlin-jackson/docs/UserApi.md b/samples/client/petstore/kotlin-jackson/docs/UserApi.md index fd98ce696add..e54decd3ba95 100644 --- a/samples/client/petstore/kotlin-jackson/docs/UserApi.md +++ b/samples/client/petstore/kotlin-jackson/docs/UserApi.md @@ -237,7 +237,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **loginUser** @@ -284,7 +284,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **logoutUser** diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 7ccfb70d6d56..59367631c91e 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -100,7 +100,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/pet", @@ -170,7 +171,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - + return RequestConfig( method = RequestMethod.DELETE, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -241,6 +242,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("status", toMultiValue(status.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -317,6 +319,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("tags", toMultiValue(tags.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -385,6 +388,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -451,7 +455,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.PUT, path = "/pet", @@ -523,7 +528,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("name" to name, "status" to status) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - + return RequestConfig( method = RequestMethod.POST, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -597,6 +602,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("additionalMetadata" to additionalMetadata, "file" to file) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index a3a2940291f4..87d76a0b30d6 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -99,7 +99,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), @@ -164,6 +164,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -232,6 +233,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -300,6 +302,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index a68290f0718f..444826b782cd 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -99,7 +99,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user", @@ -165,7 +165,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithArray", @@ -231,7 +231,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithList", @@ -297,7 +297,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/user/{username}".replace("{"+"username"+"}", "$username"), @@ -365,6 +365,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -440,6 +441,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("password", listOf(password.toString())) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -503,7 +505,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.GET, path = "/user/logout", @@ -572,7 +574,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.PUT, path = "/user/{username}".replace("{"+"username"+"}", "$username"), diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 05f77db3037b..d01fa6041c35 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -105,7 +105,7 @@ open class ApiClient(val baseUrl: String) { } }.build() } - mediaType == JsonMediaType -> { + mediaType.startsWith("application/") && mediaType.endsWith("json") -> if (content == null) { EMPTY_REQUEST } else { @@ -114,7 +114,6 @@ open class ApiClient(val baseUrl: String) { mediaType.toMediaTypeOrNull() ) } - } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") // TODO: this should be extended with other serializers else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") @@ -137,8 +136,9 @@ open class ApiClient(val baseUrl: String) { out.close() return f as T } - return when(mediaType) { - JsonMediaType -> Serializer.jacksonObjectMapper.readValue(bodyContent, object: TypeReference() {}) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.jacksonObjectMapper.readValue(bodyContent, object: TypeReference() {}) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } @@ -185,11 +185,11 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { + if(headers[ContentType].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") } - if(headers[Accept] ?: "" == "") { + if(headers[Accept].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Accept header. This is required.") } diff --git a/samples/client/petstore/kotlin-json-request-string/docs/PetApi.md b/samples/client/petstore/kotlin-json-request-string/docs/PetApi.md index 90c97d53eb79..46b5ffc5506f 100644 --- a/samples/client/petstore/kotlin-json-request-string/docs/PetApi.md +++ b/samples/client/petstore/kotlin-json-request-string/docs/PetApi.md @@ -57,7 +57,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined @@ -155,7 +155,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **getAllPets** @@ -202,7 +202,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **getPetById** @@ -252,7 +252,7 @@ Configure api_key: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **updatePet** @@ -297,7 +297,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined diff --git a/samples/client/petstore/kotlin-json-request-string/docs/StoreApi.md b/samples/client/petstore/kotlin-json-request-string/docs/StoreApi.md index f4986041af8c..de2f4dbdcb12 100644 --- a/samples/client/petstore/kotlin-json-request-string/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-json-request-string/docs/StoreApi.md @@ -147,7 +147,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **placeOrder** @@ -192,5 +192,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json diff --git a/samples/client/petstore/kotlin-json-request-string/docs/UserApi.md b/samples/client/petstore/kotlin-json-request-string/docs/UserApi.md index fd98ce696add..e54decd3ba95 100644 --- a/samples/client/petstore/kotlin-json-request-string/docs/UserApi.md +++ b/samples/client/petstore/kotlin-json-request-string/docs/UserApi.md @@ -237,7 +237,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **loginUser** @@ -284,7 +284,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **logoutUser** diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 6d866a980574..a1a524e3cc23 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -100,7 +100,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/pet", @@ -170,7 +171,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - + return RequestConfig( method = RequestMethod.DELETE, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -246,6 +247,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("tags", toMultiValue(tags.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -319,6 +321,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -387,6 +390,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -453,7 +457,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.PUT, path = "/pet", @@ -525,7 +530,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("name" to name, "status" to status) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - + return RequestConfig( method = RequestMethod.POST, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -599,6 +604,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("additionalMetadata" to additionalMetadata, "file" to file) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index a3a2940291f4..87d76a0b30d6 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -99,7 +99,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), @@ -164,6 +164,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -232,6 +233,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -300,6 +302,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index a68290f0718f..444826b782cd 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -99,7 +99,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user", @@ -165,7 +165,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithArray", @@ -231,7 +231,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithList", @@ -297,7 +297,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/user/{username}".replace("{"+"username"+"}", "$username"), @@ -365,6 +365,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -440,6 +441,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("password", listOf(password.toString())) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -503,7 +505,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.GET, path = "/user/logout", @@ -572,7 +574,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.PUT, path = "/user/{username}".replace("{"+"username"+"}", "$username"), diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index c4700a701150..917c3d3f3d29 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -106,7 +106,7 @@ open class ApiClient(val baseUrl: String) { } }.build() } - mediaType == JsonMediaType -> { + mediaType.startsWith("application/") && mediaType.endsWith("json") -> if (content == null) { EMPTY_REQUEST } else { @@ -115,7 +115,6 @@ open class ApiClient(val baseUrl: String) { mediaType.toMediaTypeOrNull() ) } - } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") // TODO: this should be extended with other serializers else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") @@ -144,8 +143,9 @@ open class ApiClient(val baseUrl: String) { out.close() return f as T } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter().fromJson(bodyContent) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.moshi.adapter().fromJson(bodyContent) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } @@ -192,11 +192,11 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { + if(headers[ContentType].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") } - if(headers[Accept] ?: "" == "") { + if(headers[Accept].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Accept header. This is required.") } diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/PetApi.md index 27289c31c243..403e57a4b338 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/PetApi.md @@ -57,7 +57,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined @@ -155,7 +155,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **findPetsByTags** @@ -204,7 +204,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **getPetById** @@ -254,7 +254,7 @@ Configure api_key: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **updatePet** @@ -299,7 +299,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/StoreApi.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/StoreApi.md index f4986041af8c..de2f4dbdcb12 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/StoreApi.md @@ -147,7 +147,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **placeOrder** @@ -192,5 +192,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/UserApi.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/UserApi.md index fd98ce696add..e54decd3ba95 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/UserApi.md +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/UserApi.md @@ -237,7 +237,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **loginUser** @@ -284,7 +284,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **logoutUser** diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index a10b5ee2855e..e6271b33fc16 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -102,7 +102,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/pet", @@ -172,7 +173,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - + return RequestConfig( method = RequestMethod.DELETE, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -243,6 +244,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("status", toMultiValue(status.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -319,6 +321,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("tags", toMultiValue(tags.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -387,6 +390,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -453,7 +457,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.PUT, path = "/pet", @@ -525,7 +530,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("name" to name, "status" to status) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - + return RequestConfig( method = RequestMethod.POST, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -599,6 +604,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("additionalMetadata" to additionalMetadata, "file" to file) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 33f04bb5423b..fe498594da1c 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -101,7 +101,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), @@ -166,6 +166,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -234,6 +235,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -302,6 +304,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 7cb6348f010b..797a84aa61d5 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -101,7 +101,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user", @@ -167,7 +167,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithArray", @@ -233,7 +233,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithList", @@ -299,7 +299,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/user/{username}".replace("{"+"username"+"}", "$username"), @@ -367,6 +367,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -442,6 +443,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("password", listOf(password.toString())) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -505,7 +507,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.GET, path = "/user/logout", @@ -574,7 +576,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.PUT, path = "/user/{username}".replace("{"+"username"+"}", "$username"), diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index c6bd90a8cbe6..141689f40f80 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -108,7 +108,7 @@ open class ApiClient(val baseUrl: String) { } }.build() } - mediaType == JsonMediaType -> { + mediaType.startsWith("application/") && mediaType.endsWith("json") -> if (content == null) { EMPTY_REQUEST } else { @@ -117,7 +117,6 @@ open class ApiClient(val baseUrl: String) { mediaType.toMediaTypeOrNull() ) } - } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") // TODO: this should be extended with other serializers else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") @@ -140,8 +139,9 @@ open class ApiClient(val baseUrl: String) { out.close() return f as T } - return when(mediaType) { - JsonMediaType -> Serializer.gson.fromJson(bodyContent, (object: TypeToken(){}).getType()) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.gson.fromJson(bodyContent, (object: TypeToken(){}).getType()) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } @@ -188,11 +188,11 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { + if(headers[ContentType].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") } - if(headers[Accept] ?: "" == "") { + if(headers[Accept].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Accept header. This is required.") } diff --git a/samples/client/petstore/kotlin-moshi-codegen/docs/PetApi.md b/samples/client/petstore/kotlin-moshi-codegen/docs/PetApi.md index 27289c31c243..403e57a4b338 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/docs/PetApi.md +++ b/samples/client/petstore/kotlin-moshi-codegen/docs/PetApi.md @@ -57,7 +57,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined @@ -155,7 +155,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **findPetsByTags** @@ -204,7 +204,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **getPetById** @@ -254,7 +254,7 @@ Configure api_key: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **updatePet** @@ -299,7 +299,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined diff --git a/samples/client/petstore/kotlin-moshi-codegen/docs/StoreApi.md b/samples/client/petstore/kotlin-moshi-codegen/docs/StoreApi.md index f4986041af8c..de2f4dbdcb12 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-moshi-codegen/docs/StoreApi.md @@ -147,7 +147,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **placeOrder** @@ -192,5 +192,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json diff --git a/samples/client/petstore/kotlin-moshi-codegen/docs/UserApi.md b/samples/client/petstore/kotlin-moshi-codegen/docs/UserApi.md index fd98ce696add..e54decd3ba95 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/docs/UserApi.md +++ b/samples/client/petstore/kotlin-moshi-codegen/docs/UserApi.md @@ -237,7 +237,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **loginUser** @@ -284,7 +284,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **logoutUser** diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 7ccfb70d6d56..59367631c91e 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -100,7 +100,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/pet", @@ -170,7 +171,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - + return RequestConfig( method = RequestMethod.DELETE, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -241,6 +242,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("status", toMultiValue(status.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -317,6 +319,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("tags", toMultiValue(tags.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -385,6 +388,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -451,7 +455,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.PUT, path = "/pet", @@ -523,7 +528,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("name" to name, "status" to status) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - + return RequestConfig( method = RequestMethod.POST, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -597,6 +602,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("additionalMetadata" to additionalMetadata, "file" to file) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index a3a2940291f4..87d76a0b30d6 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -99,7 +99,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), @@ -164,6 +164,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -232,6 +233,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -300,6 +302,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index a68290f0718f..444826b782cd 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -99,7 +99,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user", @@ -165,7 +165,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithArray", @@ -231,7 +231,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithList", @@ -297,7 +297,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/user/{username}".replace("{"+"username"+"}", "$username"), @@ -365,6 +365,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -440,6 +441,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("password", listOf(password.toString())) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -503,7 +505,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.GET, path = "/user/logout", @@ -572,7 +574,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.PUT, path = "/user/{username}".replace("{"+"username"+"}", "$username"), diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index c75d4889d2e3..c218caafae56 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -105,7 +105,7 @@ open class ApiClient(val baseUrl: String) { } }.build() } - mediaType == JsonMediaType -> { + mediaType.startsWith("application/") && mediaType.endsWith("json") -> if (content == null) { EMPTY_REQUEST } else { @@ -114,7 +114,6 @@ open class ApiClient(val baseUrl: String) { mediaType.toMediaTypeOrNull() ) } - } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") // TODO: this should be extended with other serializers else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") @@ -138,8 +137,9 @@ open class ApiClient(val baseUrl: String) { out.close() return f as T } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter().fromJson(bodyContent) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.moshi.adapter().fromJson(bodyContent) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } @@ -186,11 +186,11 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { + if(headers[ContentType].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") } - if(headers[Accept] ?: "" == "") { + if(headers[Accept].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Accept header. This is required.") } diff --git a/samples/client/petstore/kotlin-nonpublic/docs/PetApi.md b/samples/client/petstore/kotlin-nonpublic/docs/PetApi.md index 27289c31c243..403e57a4b338 100644 --- a/samples/client/petstore/kotlin-nonpublic/docs/PetApi.md +++ b/samples/client/petstore/kotlin-nonpublic/docs/PetApi.md @@ -57,7 +57,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined @@ -155,7 +155,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **findPetsByTags** @@ -204,7 +204,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **getPetById** @@ -254,7 +254,7 @@ Configure api_key: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **updatePet** @@ -299,7 +299,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined diff --git a/samples/client/petstore/kotlin-nonpublic/docs/StoreApi.md b/samples/client/petstore/kotlin-nonpublic/docs/StoreApi.md index f4986041af8c..de2f4dbdcb12 100644 --- a/samples/client/petstore/kotlin-nonpublic/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-nonpublic/docs/StoreApi.md @@ -147,7 +147,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **placeOrder** @@ -192,5 +192,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json diff --git a/samples/client/petstore/kotlin-nonpublic/docs/UserApi.md b/samples/client/petstore/kotlin-nonpublic/docs/UserApi.md index fd98ce696add..e54decd3ba95 100644 --- a/samples/client/petstore/kotlin-nonpublic/docs/UserApi.md +++ b/samples/client/petstore/kotlin-nonpublic/docs/UserApi.md @@ -237,7 +237,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **loginUser** @@ -284,7 +284,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **logoutUser** diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 86649ad50821..f01ad9c676da 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -100,7 +100,8 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/pet", @@ -170,7 +171,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - + return RequestConfig( method = RequestMethod.DELETE, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -241,6 +242,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas put("status", toMultiValue(status.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -317,6 +319,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas put("tags", toMultiValue(tags.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -385,6 +388,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -451,7 +455,8 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.PUT, path = "/pet", @@ -523,7 +528,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas val localVariableBody = mapOf("name" to name, "status" to status) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - + return RequestConfig( method = RequestMethod.POST, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -597,6 +602,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas val localVariableBody = mapOf("additionalMetadata" to additionalMetadata, "file" to file) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index fc03f3fb2164..a71c936424af 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -99,7 +99,7 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), @@ -164,6 +164,7 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -232,6 +233,7 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -300,6 +302,7 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index d68ed63e17c8..478f791b874e 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -99,7 +99,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user", @@ -165,7 +165,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithArray", @@ -231,7 +231,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithList", @@ -297,7 +297,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/user/{username}".replace("{"+"username"+"}", "$username"), @@ -365,6 +365,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -440,6 +441,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba put("password", listOf(password.toString())) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -503,7 +505,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.GET, path = "/user/logout", @@ -572,7 +574,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.PUT, path = "/user/{username}".replace("{"+"username"+"}", "$username"), diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index cb6d8697017f..313f2e165273 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -105,7 +105,7 @@ internal open class ApiClient(val baseUrl: String) { } }.build() } - mediaType == JsonMediaType -> { + mediaType.startsWith("application/") && mediaType.endsWith("json") -> if (content == null) { EMPTY_REQUEST } else { @@ -114,7 +114,6 @@ internal open class ApiClient(val baseUrl: String) { mediaType.toMediaTypeOrNull() ) } - } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") // TODO: this should be extended with other serializers else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") @@ -138,8 +137,9 @@ internal open class ApiClient(val baseUrl: String) { out.close() return f as T } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter().fromJson(bodyContent) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.moshi.adapter().fromJson(bodyContent) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } @@ -186,11 +186,11 @@ internal open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { + if(headers[ContentType].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") } - if(headers[Accept] ?: "" == "") { + if(headers[Accept].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Accept header. This is required.") } diff --git a/samples/client/petstore/kotlin-nullable/docs/PetApi.md b/samples/client/petstore/kotlin-nullable/docs/PetApi.md index 42a28f741c76..e769fecd538b 100644 --- a/samples/client/petstore/kotlin-nullable/docs/PetApi.md +++ b/samples/client/petstore/kotlin-nullable/docs/PetApi.md @@ -57,7 +57,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined @@ -155,7 +155,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **findPetsByTags** @@ -204,7 +204,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **getPetById** @@ -254,7 +254,7 @@ Configure api_key: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **updatePet** @@ -299,7 +299,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined diff --git a/samples/client/petstore/kotlin-nullable/docs/StoreApi.md b/samples/client/petstore/kotlin-nullable/docs/StoreApi.md index 63391018afb8..30a28531120a 100644 --- a/samples/client/petstore/kotlin-nullable/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-nullable/docs/StoreApi.md @@ -147,7 +147,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **placeOrder** @@ -192,5 +192,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json diff --git a/samples/client/petstore/kotlin-nullable/docs/UserApi.md b/samples/client/petstore/kotlin-nullable/docs/UserApi.md index d91ca1e97cf8..94e67903d167 100644 --- a/samples/client/petstore/kotlin-nullable/docs/UserApi.md +++ b/samples/client/petstore/kotlin-nullable/docs/UserApi.md @@ -237,7 +237,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **loginUser** @@ -284,7 +284,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **logoutUser** diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 164fa99175a4..641f25e2ad29 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -100,7 +100,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/pet", @@ -170,7 +171,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - + return RequestConfig( method = RequestMethod.DELETE, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -241,6 +242,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("status", toMultiValue(status.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -317,6 +319,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("tags", toMultiValue(tags.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -385,6 +388,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -451,7 +455,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.PUT, path = "/pet", @@ -523,7 +528,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("name" to name, "status" to status) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - + return RequestConfig( method = RequestMethod.POST, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -597,6 +602,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("additionalMetadata" to additionalMetadata, "file" to file) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 5493c72bd74d..60120ce05d90 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -99,7 +99,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), @@ -164,6 +164,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -232,6 +233,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -300,6 +302,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index e8c090094860..3b44d8f38f49 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -99,7 +99,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user", @@ -165,7 +165,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithArray", @@ -231,7 +231,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithList", @@ -297,7 +297,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/user/{username}".replace("{"+"username"+"}", "$username"), @@ -365,6 +365,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -440,6 +441,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("password", listOf(password.toString())) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -503,7 +505,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.GET, path = "/user/logout", @@ -572,7 +574,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.PUT, path = "/user/{username}".replace("{"+"username"+"}", "$username"), diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index c75d4889d2e3..c218caafae56 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -105,7 +105,7 @@ open class ApiClient(val baseUrl: String) { } }.build() } - mediaType == JsonMediaType -> { + mediaType.startsWith("application/") && mediaType.endsWith("json") -> if (content == null) { EMPTY_REQUEST } else { @@ -114,7 +114,6 @@ open class ApiClient(val baseUrl: String) { mediaType.toMediaTypeOrNull() ) } - } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") // TODO: this should be extended with other serializers else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") @@ -138,8 +137,9 @@ open class ApiClient(val baseUrl: String) { out.close() return f as T } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter().fromJson(bodyContent) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.moshi.adapter().fromJson(bodyContent) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } @@ -186,11 +186,11 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { + if(headers[ContentType].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") } - if(headers[Accept] ?: "" == "") { + if(headers[Accept].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Accept header. This is required.") } diff --git a/samples/client/petstore/kotlin-okhttp3/docs/PetApi.md b/samples/client/petstore/kotlin-okhttp3/docs/PetApi.md index 27289c31c243..403e57a4b338 100644 --- a/samples/client/petstore/kotlin-okhttp3/docs/PetApi.md +++ b/samples/client/petstore/kotlin-okhttp3/docs/PetApi.md @@ -57,7 +57,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined @@ -155,7 +155,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **findPetsByTags** @@ -204,7 +204,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **getPetById** @@ -254,7 +254,7 @@ Configure api_key: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **updatePet** @@ -299,7 +299,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined diff --git a/samples/client/petstore/kotlin-okhttp3/docs/StoreApi.md b/samples/client/petstore/kotlin-okhttp3/docs/StoreApi.md index f4986041af8c..de2f4dbdcb12 100644 --- a/samples/client/petstore/kotlin-okhttp3/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-okhttp3/docs/StoreApi.md @@ -147,7 +147,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **placeOrder** @@ -192,5 +192,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json diff --git a/samples/client/petstore/kotlin-okhttp3/docs/UserApi.md b/samples/client/petstore/kotlin-okhttp3/docs/UserApi.md index fd98ce696add..e54decd3ba95 100644 --- a/samples/client/petstore/kotlin-okhttp3/docs/UserApi.md +++ b/samples/client/petstore/kotlin-okhttp3/docs/UserApi.md @@ -237,7 +237,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **loginUser** @@ -284,7 +284,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **logoutUser** diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 7ccfb70d6d56..59367631c91e 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -100,7 +100,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/pet", @@ -170,7 +171,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - + return RequestConfig( method = RequestMethod.DELETE, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -241,6 +242,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("status", toMultiValue(status.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -317,6 +319,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("tags", toMultiValue(tags.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -385,6 +388,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -451,7 +455,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.PUT, path = "/pet", @@ -523,7 +528,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("name" to name, "status" to status) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - + return RequestConfig( method = RequestMethod.POST, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -597,6 +602,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("additionalMetadata" to additionalMetadata, "file" to file) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index a3a2940291f4..87d76a0b30d6 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -99,7 +99,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), @@ -164,6 +164,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -232,6 +233,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -300,6 +302,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index a68290f0718f..444826b782cd 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -99,7 +99,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user", @@ -165,7 +165,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithArray", @@ -231,7 +231,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithList", @@ -297,7 +297,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/user/{username}".replace("{"+"username"+"}", "$username"), @@ -365,6 +365,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -440,6 +441,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("password", listOf(password.toString())) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -503,7 +505,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.GET, path = "/user/logout", @@ -572,7 +574,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.PUT, path = "/user/{username}".replace("{"+"username"+"}", "$username"), diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 217d6fe01999..d3ac6493d6ef 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -103,7 +103,7 @@ open class ApiClient(val baseUrl: String) { } }.build() } - mediaType == JsonMediaType -> { + mediaType.startsWith("application/") && mediaType.endsWith("json") -> if (content == null) { EMPTY_REQUEST } else { @@ -111,7 +111,6 @@ open class ApiClient(val baseUrl: String) { MediaType.parse(mediaType), Serializer.moshi.adapter(T::class.java).toJson(content) ) } - } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") // TODO: this should be extended with other serializers else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") @@ -135,8 +134,9 @@ open class ApiClient(val baseUrl: String) { out.close() return f as T } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter().fromJson(bodyContent) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.moshi.adapter().fromJson(bodyContent) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } @@ -183,11 +183,11 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { + if(headers[ContentType].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") } - if(headers[Accept] ?: "" == "") { + if(headers[Accept].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Accept header. This is required.") } diff --git a/samples/client/petstore/kotlin-string/docs/PetApi.md b/samples/client/petstore/kotlin-string/docs/PetApi.md index a30ce4af5589..39f8f0858aa2 100644 --- a/samples/client/petstore/kotlin-string/docs/PetApi.md +++ b/samples/client/petstore/kotlin-string/docs/PetApi.md @@ -57,7 +57,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined @@ -155,7 +155,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **findPetsByTags** @@ -204,7 +204,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **getPetById** @@ -254,7 +254,7 @@ Configure api_key: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **updatePet** @@ -299,7 +299,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined diff --git a/samples/client/petstore/kotlin-string/docs/StoreApi.md b/samples/client/petstore/kotlin-string/docs/StoreApi.md index f4986041af8c..de2f4dbdcb12 100644 --- a/samples/client/petstore/kotlin-string/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-string/docs/StoreApi.md @@ -147,7 +147,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **placeOrder** @@ -192,5 +192,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json diff --git a/samples/client/petstore/kotlin-string/docs/UserApi.md b/samples/client/petstore/kotlin-string/docs/UserApi.md index fd98ce696add..e54decd3ba95 100644 --- a/samples/client/petstore/kotlin-string/docs/UserApi.md +++ b/samples/client/petstore/kotlin-string/docs/UserApi.md @@ -237,7 +237,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **loginUser** @@ -284,7 +284,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **logoutUser** diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 8cb9c538aff1..bc8f157e4887 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -100,7 +100,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/pet", @@ -170,7 +171,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - + return RequestConfig( method = RequestMethod.DELETE, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -241,6 +242,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("status", toMultiValue(status.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -317,6 +319,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("tags", toMultiValue(tags.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -385,6 +388,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -451,7 +455,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.PUT, path = "/pet", @@ -523,7 +528,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("name" to name, "status" to status) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - + return RequestConfig( method = RequestMethod.POST, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -597,6 +602,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("additionalMetadata" to additionalMetadata, "file" to file) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index a3a2940291f4..87d76a0b30d6 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -99,7 +99,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), @@ -164,6 +164,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -232,6 +233,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -300,6 +302,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index a68290f0718f..444826b782cd 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -99,7 +99,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user", @@ -165,7 +165,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithArray", @@ -231,7 +231,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithList", @@ -297,7 +297,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/user/{username}".replace("{"+"username"+"}", "$username"), @@ -365,6 +365,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -440,6 +441,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("password", listOf(password.toString())) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -503,7 +505,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.GET, path = "/user/logout", @@ -572,7 +574,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.PUT, path = "/user/{username}".replace("{"+"username"+"}", "$username"), diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index c75d4889d2e3..c218caafae56 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -105,7 +105,7 @@ open class ApiClient(val baseUrl: String) { } }.build() } - mediaType == JsonMediaType -> { + mediaType.startsWith("application/") && mediaType.endsWith("json") -> if (content == null) { EMPTY_REQUEST } else { @@ -114,7 +114,6 @@ open class ApiClient(val baseUrl: String) { mediaType.toMediaTypeOrNull() ) } - } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") // TODO: this should be extended with other serializers else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") @@ -138,8 +137,9 @@ open class ApiClient(val baseUrl: String) { out.close() return f as T } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter().fromJson(bodyContent) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.moshi.adapter().fromJson(bodyContent) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } @@ -186,11 +186,11 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { + if(headers[ContentType].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") } - if(headers[Accept] ?: "" == "") { + if(headers[Accept].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Accept header. This is required.") } diff --git a/samples/client/petstore/kotlin-threetenbp/docs/PetApi.md b/samples/client/petstore/kotlin-threetenbp/docs/PetApi.md index 27289c31c243..403e57a4b338 100644 --- a/samples/client/petstore/kotlin-threetenbp/docs/PetApi.md +++ b/samples/client/petstore/kotlin-threetenbp/docs/PetApi.md @@ -57,7 +57,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined @@ -155,7 +155,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **findPetsByTags** @@ -204,7 +204,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **getPetById** @@ -254,7 +254,7 @@ Configure api_key: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **updatePet** @@ -299,7 +299,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined diff --git a/samples/client/petstore/kotlin-threetenbp/docs/StoreApi.md b/samples/client/petstore/kotlin-threetenbp/docs/StoreApi.md index f4986041af8c..de2f4dbdcb12 100644 --- a/samples/client/petstore/kotlin-threetenbp/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-threetenbp/docs/StoreApi.md @@ -147,7 +147,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **placeOrder** @@ -192,5 +192,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json diff --git a/samples/client/petstore/kotlin-threetenbp/docs/UserApi.md b/samples/client/petstore/kotlin-threetenbp/docs/UserApi.md index fd98ce696add..e54decd3ba95 100644 --- a/samples/client/petstore/kotlin-threetenbp/docs/UserApi.md +++ b/samples/client/petstore/kotlin-threetenbp/docs/UserApi.md @@ -237,7 +237,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **loginUser** @@ -284,7 +284,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **logoutUser** diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 7ccfb70d6d56..59367631c91e 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -100,7 +100,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/pet", @@ -170,7 +171,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - + return RequestConfig( method = RequestMethod.DELETE, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -241,6 +242,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("status", toMultiValue(status.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -317,6 +319,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("tags", toMultiValue(tags.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -385,6 +388,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -451,7 +455,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.PUT, path = "/pet", @@ -523,7 +528,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("name" to name, "status" to status) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - + return RequestConfig( method = RequestMethod.POST, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -597,6 +602,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("additionalMetadata" to additionalMetadata, "file" to file) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index a3a2940291f4..87d76a0b30d6 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -99,7 +99,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), @@ -164,6 +164,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -232,6 +233,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -300,6 +302,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index a68290f0718f..444826b782cd 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -99,7 +99,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user", @@ -165,7 +165,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithArray", @@ -231,7 +231,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithList", @@ -297,7 +297,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/user/{username}".replace("{"+"username"+"}", "$username"), @@ -365,6 +365,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -440,6 +441,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("password", listOf(password.toString())) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -503,7 +505,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.GET, path = "/user/logout", @@ -572,7 +574,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.PUT, path = "/user/{username}".replace("{"+"username"+"}", "$username"), diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index f82c6d3fa4c1..42e08a49f301 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -105,7 +105,7 @@ open class ApiClient(val baseUrl: String) { } }.build() } - mediaType == JsonMediaType -> { + mediaType.startsWith("application/") && mediaType.endsWith("json") -> if (content == null) { EMPTY_REQUEST } else { @@ -114,7 +114,6 @@ open class ApiClient(val baseUrl: String) { mediaType.toMediaTypeOrNull() ) } - } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") // TODO: this should be extended with other serializers else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") @@ -138,8 +137,9 @@ open class ApiClient(val baseUrl: String) { out.close() return f as T } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter().fromJson(bodyContent) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.moshi.adapter().fromJson(bodyContent) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } @@ -186,11 +186,11 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { + if(headers[ContentType].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") } - if(headers[Accept] ?: "" == "") { + if(headers[Accept].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Accept header. This is required.") } 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 aca195705472..87b7bc007a64 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 @@ -98,6 +98,7 @@ class EnumApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, 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 634abe57b900..8a9c47045ed7 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 @@ -105,7 +105,7 @@ open class ApiClient(val baseUrl: String) { } }.build() } - mediaType == JsonMediaType -> { + mediaType.startsWith("application/") && mediaType.endsWith("json") -> if (content == null) { EMPTY_REQUEST } else { @@ -114,7 +114,6 @@ open class ApiClient(val baseUrl: String) { mediaType.toMediaTypeOrNull() ) } - } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") // TODO: this should be extended with other serializers else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") @@ -138,8 +137,9 @@ open class ApiClient(val baseUrl: String) { out.close() return f as T } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter().fromJson(bodyContent) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.moshi.adapter().fromJson(bodyContent) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } @@ -167,11 +167,11 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { + if(headers[ContentType].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") } - if(headers[Accept] ?: "" == "") { + if(headers[Accept].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Accept header. This is required.") } diff --git a/samples/client/petstore/kotlin/docs/PetApi.md b/samples/client/petstore/kotlin/docs/PetApi.md index 27289c31c243..403e57a4b338 100644 --- a/samples/client/petstore/kotlin/docs/PetApi.md +++ b/samples/client/petstore/kotlin/docs/PetApi.md @@ -57,7 +57,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined @@ -155,7 +155,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **findPetsByTags** @@ -204,7 +204,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **getPetById** @@ -254,7 +254,7 @@ Configure api_key: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **updatePet** @@ -299,7 +299,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined diff --git a/samples/client/petstore/kotlin/docs/StoreApi.md b/samples/client/petstore/kotlin/docs/StoreApi.md index f4986041af8c..de2f4dbdcb12 100644 --- a/samples/client/petstore/kotlin/docs/StoreApi.md +++ b/samples/client/petstore/kotlin/docs/StoreApi.md @@ -147,7 +147,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **placeOrder** @@ -192,5 +192,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json diff --git a/samples/client/petstore/kotlin/docs/UserApi.md b/samples/client/petstore/kotlin/docs/UserApi.md index fd98ce696add..e54decd3ba95 100644 --- a/samples/client/petstore/kotlin/docs/UserApi.md +++ b/samples/client/petstore/kotlin/docs/UserApi.md @@ -237,7 +237,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **loginUser** @@ -284,7 +284,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **logoutUser** diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 7ccfb70d6d56..59367631c91e 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -100,7 +100,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/pet", @@ -170,7 +171,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - + return RequestConfig( method = RequestMethod.DELETE, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -241,6 +242,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("status", toMultiValue(status.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -317,6 +319,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("tags", toMultiValue(tags.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -385,6 +388,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -451,7 +455,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.PUT, path = "/pet", @@ -523,7 +528,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("name" to name, "status" to status) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - + return RequestConfig( method = RequestMethod.POST, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -597,6 +602,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("additionalMetadata" to additionalMetadata, "file" to file) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index a3a2940291f4..87d76a0b30d6 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -99,7 +99,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), @@ -164,6 +164,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -232,6 +233,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -300,6 +302,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index a68290f0718f..444826b782cd 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -99,7 +99,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user", @@ -165,7 +165,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithArray", @@ -231,7 +231,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithList", @@ -297,7 +297,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/user/{username}".replace("{"+"username"+"}", "$username"), @@ -365,6 +365,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -440,6 +441,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("password", listOf(password.toString())) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -503,7 +505,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.GET, path = "/user/logout", @@ -572,7 +574,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.PUT, path = "/user/{username}".replace("{"+"username"+"}", "$username"), diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index c75d4889d2e3..c218caafae56 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -105,7 +105,7 @@ open class ApiClient(val baseUrl: String) { } }.build() } - mediaType == JsonMediaType -> { + mediaType.startsWith("application/") && mediaType.endsWith("json") -> if (content == null) { EMPTY_REQUEST } else { @@ -114,7 +114,6 @@ open class ApiClient(val baseUrl: String) { mediaType.toMediaTypeOrNull() ) } - } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") // TODO: this should be extended with other serializers else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") @@ -138,8 +137,9 @@ open class ApiClient(val baseUrl: String) { out.close() return f as T } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter().fromJson(bodyContent) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.moshi.adapter().fromJson(bodyContent) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } @@ -186,11 +186,11 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { + if(headers[ContentType].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") } - if(headers[Accept] ?: "" == "") { + if(headers[Accept].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Accept header. This is required.") } From 3247903caacb6ad139a8ebebfdc5110e8608e831 Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@users.noreply.github.com> Date: Sat, 11 Dec 2021 13:48:59 +0000 Subject: [PATCH 083/117] [kotlin][client] update request exceptions (#11065) --- .../libraries/jvm-okhttp/api.mustache | 13 +-- .../openapitools/client/apis/DefaultApi.kt | 13 +-- .../org/openapitools/client/apis/PetApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 46 +++++----- .../org/openapitools/client/apis/UserApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/PetApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 46 +++++----- .../org/openapitools/client/apis/UserApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/PetApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 46 +++++----- .../org/openapitools/client/apis/UserApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/PetApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 46 +++++----- .../org/openapitools/client/apis/UserApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/PetApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 46 +++++----- .../org/openapitools/client/apis/UserApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/PetApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 46 +++++----- .../org/openapitools/client/apis/UserApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/PetApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 46 +++++----- .../org/openapitools/client/apis/UserApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/PetApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 46 +++++----- .../org/openapitools/client/apis/UserApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/PetApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 46 +++++----- .../org/openapitools/client/apis/UserApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/PetApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 46 +++++----- .../org/openapitools/client/apis/UserApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/EnumApi.kt | 13 +-- .../org/openapitools/client/apis/PetApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 46 +++++----- .../org/openapitools/client/apis/UserApi.kt | 90 ++++++++++--------- 36 files changed, 1410 insertions(+), 1115 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache index 8059b5ffa797..57dd2c62aaf4 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache @@ -1,6 +1,8 @@ {{>licenseInfo}} package {{apiPackage}} +import java.io.IOException + {{#imports}}import {{import}} {{/imports}} @@ -38,12 +40,14 @@ import {{packageName}}.infrastructure.toMultiValue * {{notes}} {{#allParams}}* @param {{{paramName}}} {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} {{/allParams}}* @return {{#returnType}}{{{returnType}}}{{#nullableReturnType}} or null{{/nullableReturnType}}{{/returnType}}{{^returnType}}void{{/returnType}} + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */{{#returnType}} @Suppress("UNCHECKED_CAST"){{/returnType}} - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) {{#isDeprecated}} @Deprecated(message = "This operation is deprecated.") {{/isDeprecated}} @@ -73,12 +77,11 @@ import {{packageName}}.infrastructure.toMultiValue * {{notes}} {{#allParams}}* @param {{{paramName}}} {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} {{/allParams}}* @return ApiInfrastructureResponse<{{#returnType}}{{{returnType}}}?{{/returnType}}{{^returnType}}Unit?{{/returnType}}> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */{{#returnType}} @Suppress("UNCHECKED_CAST"){{/returnType}} - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) {{#isDeprecated}} @Deprecated(message = "This operation is deprecated.") {{/isDeprecated}} diff --git a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt index dfcdc11ef3dd..e5f3a7b2fa5c 100644 --- a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt +++ b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.ModelWithEnumPropertyHavingDefault import org.openapitools.client.infrastructure.ApiClient @@ -47,12 +49,14 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath * * * @return ModelWithEnumPropertyHavingDefault + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun operation() : ModelWithEnumPropertyHavingDefault { val localVarResponse = operationWithHttpInfo() @@ -75,12 +79,11 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath * * * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun operationWithHttpInfo() : ApiInfrastructureResponse { val localVariableConfig = operationRequestConfig() diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 59367631c91e..c3426fbd0a4a 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet @@ -49,11 +51,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun addPet(body: Pet) : Unit { val localVarResponse = addPetWithHttpInfo(body = body) @@ -77,11 +81,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = addPetRequestConfig(body = body) @@ -117,11 +120,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey) @@ -146,11 +151,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) @@ -186,12 +190,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) @@ -215,12 +221,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) @@ -258,12 +263,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { @Suppress("DEPRECATION") @@ -289,12 +296,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { @Suppress("DEPRECATION") @@ -335,12 +341,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return Pet + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPetById(petId: kotlin.Long) : Pet { val localVarResponse = getPetByIdWithHttpInfo(petId = petId) @@ -364,12 +372,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) @@ -404,11 +411,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePet(body: Pet) : Unit { val localVarResponse = updatePetWithHttpInfo(body = body) @@ -432,11 +441,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = updatePetRequestConfig(body = body) @@ -473,11 +481,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) @@ -503,11 +513,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) @@ -545,12 +554,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) @@ -576,12 +587,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 87d76a0b30d6..e905c41311dc 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteOrder(orderId: kotlin.String) : Unit { val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId) @@ -76,11 +80,10 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) @@ -113,12 +116,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return kotlin.collections.Map + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getInventory() : kotlin.collections.Map { val localVarResponse = getInventoryWithHttpInfo() @@ -141,12 +146,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { val localVariableConfig = getInventoryRequestConfig() @@ -180,12 +184,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getOrderById(orderId: kotlin.Long) : Order { val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId) @@ -209,12 +215,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) @@ -249,12 +254,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun placeOrder(body: Order) : Order { val localVarResponse = placeOrderWithHttpInfo(body = body) @@ -278,12 +285,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { val localVariableConfig = placeOrderRequestConfig(body = body) diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 444826b782cd..9381925680af 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUser(body: User) : Unit { val localVarResponse = createUserWithHttpInfo(body = body) @@ -76,11 +80,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { val localVariableConfig = createUserRequestConfig(body = body) @@ -114,11 +117,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body) @@ -142,11 +147,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) @@ -180,11 +184,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithListInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithListInputWithHttpInfo(body = body) @@ -208,11 +214,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) @@ -246,11 +251,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteUser(username: kotlin.String) : Unit { val localVarResponse = deleteUserWithHttpInfo(username = username) @@ -274,11 +281,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteUserRequestConfig(username = username) @@ -312,12 +318,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return User + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getUserByName(username: kotlin.String) : User { val localVarResponse = getUserByNameWithHttpInfo(username = username) @@ -341,12 +349,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) @@ -382,12 +389,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return kotlin.String + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { val localVarResponse = loginUserWithHttpInfo(username = username, password = password) @@ -412,12 +421,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) @@ -456,11 +464,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun logoutUser() : Unit { val localVarResponse = logoutUserWithHttpInfo() @@ -483,11 +493,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { val localVariableConfig = logoutUserRequestConfig() @@ -521,11 +530,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updateUser(username: kotlin.String, body: User) : Unit { val localVarResponse = updateUserWithHttpInfo(username = username, body = body) @@ -550,11 +561,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 59367631c91e..c3426fbd0a4a 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet @@ -49,11 +51,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun addPet(body: Pet) : Unit { val localVarResponse = addPetWithHttpInfo(body = body) @@ -77,11 +81,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = addPetRequestConfig(body = body) @@ -117,11 +120,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey) @@ -146,11 +151,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) @@ -186,12 +190,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) @@ -215,12 +221,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) @@ -258,12 +263,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { @Suppress("DEPRECATION") @@ -289,12 +296,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { @Suppress("DEPRECATION") @@ -335,12 +341,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return Pet + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPetById(petId: kotlin.Long) : Pet { val localVarResponse = getPetByIdWithHttpInfo(petId = petId) @@ -364,12 +372,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) @@ -404,11 +411,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePet(body: Pet) : Unit { val localVarResponse = updatePetWithHttpInfo(body = body) @@ -432,11 +441,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = updatePetRequestConfig(body = body) @@ -473,11 +481,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) @@ -503,11 +513,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) @@ -545,12 +554,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) @@ -576,12 +587,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 87d76a0b30d6..e905c41311dc 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteOrder(orderId: kotlin.String) : Unit { val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId) @@ -76,11 +80,10 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) @@ -113,12 +116,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return kotlin.collections.Map + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getInventory() : kotlin.collections.Map { val localVarResponse = getInventoryWithHttpInfo() @@ -141,12 +146,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { val localVariableConfig = getInventoryRequestConfig() @@ -180,12 +184,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getOrderById(orderId: kotlin.Long) : Order { val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId) @@ -209,12 +215,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) @@ -249,12 +254,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun placeOrder(body: Order) : Order { val localVarResponse = placeOrderWithHttpInfo(body = body) @@ -278,12 +285,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { val localVariableConfig = placeOrderRequestConfig(body = body) diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 444826b782cd..9381925680af 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUser(body: User) : Unit { val localVarResponse = createUserWithHttpInfo(body = body) @@ -76,11 +80,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { val localVariableConfig = createUserRequestConfig(body = body) @@ -114,11 +117,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body) @@ -142,11 +147,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) @@ -180,11 +184,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithListInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithListInputWithHttpInfo(body = body) @@ -208,11 +214,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) @@ -246,11 +251,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteUser(username: kotlin.String) : Unit { val localVarResponse = deleteUserWithHttpInfo(username = username) @@ -274,11 +281,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteUserRequestConfig(username = username) @@ -312,12 +318,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return User + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getUserByName(username: kotlin.String) : User { val localVarResponse = getUserByNameWithHttpInfo(username = username) @@ -341,12 +349,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) @@ -382,12 +389,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return kotlin.String + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { val localVarResponse = loginUserWithHttpInfo(username = username, password = password) @@ -412,12 +421,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) @@ -456,11 +464,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun logoutUser() : Unit { val localVarResponse = logoutUserWithHttpInfo() @@ -483,11 +493,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { val localVariableConfig = logoutUserRequestConfig() @@ -521,11 +530,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updateUser(username: kotlin.String, body: User) : Unit { val localVarResponse = updateUserWithHttpInfo(username = username, body = body) @@ -550,11 +561,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index a1a524e3cc23..54cc4bbc49f2 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet @@ -49,11 +51,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun addPet(body: Pet) : Unit { val localVarResponse = addPetWithHttpInfo(body = body) @@ -77,11 +81,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = addPetRequestConfig(body = body) @@ -117,11 +120,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey) @@ -146,11 +151,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) @@ -186,12 +190,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { @Suppress("DEPRECATION") @@ -217,12 +223,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { @Suppress("DEPRECATION") @@ -263,12 +268,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param lastUpdated When this endpoint was hit last to help identify if the client already has the latest copy. (optional) * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getAllPets(lastUpdated: java.time.OffsetDateTime?) : kotlin.collections.List { val localVarResponse = getAllPetsWithHttpInfo(lastUpdated = lastUpdated) @@ -292,12 +299,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param lastUpdated When this endpoint was hit last to help identify if the client already has the latest copy. (optional) * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getAllPetsWithHttpInfo(lastUpdated: java.time.OffsetDateTime?) : ApiInfrastructureResponse?> { val localVariableConfig = getAllPetsRequestConfig(lastUpdated = lastUpdated) @@ -337,12 +343,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return Pet + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPetById(petId: kotlin.Long) : Pet { val localVarResponse = getPetByIdWithHttpInfo(petId = petId) @@ -366,12 +374,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) @@ -406,11 +413,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePet(body: Pet) : Unit { val localVarResponse = updatePetWithHttpInfo(body = body) @@ -434,11 +443,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = updatePetRequestConfig(body = body) @@ -475,11 +483,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) @@ -505,11 +515,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) @@ -547,12 +556,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) @@ -578,12 +589,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 87d76a0b30d6..e905c41311dc 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteOrder(orderId: kotlin.String) : Unit { val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId) @@ -76,11 +80,10 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) @@ -113,12 +116,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return kotlin.collections.Map + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getInventory() : kotlin.collections.Map { val localVarResponse = getInventoryWithHttpInfo() @@ -141,12 +146,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { val localVariableConfig = getInventoryRequestConfig() @@ -180,12 +184,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getOrderById(orderId: kotlin.Long) : Order { val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId) @@ -209,12 +215,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) @@ -249,12 +254,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun placeOrder(body: Order) : Order { val localVarResponse = placeOrderWithHttpInfo(body = body) @@ -278,12 +285,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { val localVariableConfig = placeOrderRequestConfig(body = body) diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 444826b782cd..9381925680af 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUser(body: User) : Unit { val localVarResponse = createUserWithHttpInfo(body = body) @@ -76,11 +80,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { val localVariableConfig = createUserRequestConfig(body = body) @@ -114,11 +117,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body) @@ -142,11 +147,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) @@ -180,11 +184,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithListInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithListInputWithHttpInfo(body = body) @@ -208,11 +214,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) @@ -246,11 +251,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteUser(username: kotlin.String) : Unit { val localVarResponse = deleteUserWithHttpInfo(username = username) @@ -274,11 +281,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteUserRequestConfig(username = username) @@ -312,12 +318,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return User + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getUserByName(username: kotlin.String) : User { val localVarResponse = getUserByNameWithHttpInfo(username = username) @@ -341,12 +349,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) @@ -382,12 +389,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return kotlin.String + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { val localVarResponse = loginUserWithHttpInfo(username = username, password = password) @@ -412,12 +421,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) @@ -456,11 +464,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun logoutUser() : Unit { val localVarResponse = logoutUserWithHttpInfo() @@ -483,11 +493,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { val localVariableConfig = logoutUserRequestConfig() @@ -521,11 +530,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updateUser(username: kotlin.String, body: User) : Unit { val localVarResponse = updateUserWithHttpInfo(username = username, body = body) @@ -550,11 +561,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index e6271b33fc16..9c9bdde5a87a 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet @@ -51,11 +53,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun addPet(body: Pet) : Unit = withContext(Dispatchers.IO) { val localVarResponse = addPetWithHttpInfo(body = body) @@ -79,11 +83,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { val localVariableConfig = addPetRequestConfig(body = body) @@ -119,11 +122,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit = withContext(Dispatchers.IO) { val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey) @@ -148,11 +153,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) @@ -188,12 +192,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List = withContext(Dispatchers.IO) { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) @@ -217,12 +223,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> = withContext(Dispatchers.IO) { val localVariableConfig = findPetsByStatusRequestConfig(status = status) @@ -260,12 +265,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) @Deprecated(message = "This operation is deprecated.") suspend fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List = withContext(Dispatchers.IO) { @Suppress("DEPRECATION") @@ -291,12 +298,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") suspend fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> = withContext(Dispatchers.IO) { @Suppress("DEPRECATION") @@ -337,12 +343,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return Pet + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun getPetById(petId: kotlin.Long) : Pet = withContext(Dispatchers.IO) { val localVarResponse = getPetByIdWithHttpInfo(petId = petId) @@ -366,12 +374,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { val localVariableConfig = getPetByIdRequestConfig(petId = petId) @@ -406,11 +413,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun updatePet(body: Pet) : Unit = withContext(Dispatchers.IO) { val localVarResponse = updatePetWithHttpInfo(body = body) @@ -434,11 +443,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { val localVariableConfig = updatePetRequestConfig(body = body) @@ -475,11 +483,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit = withContext(Dispatchers.IO) { val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) @@ -505,11 +515,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) @@ -547,12 +556,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse = withContext(Dispatchers.IO) { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) @@ -578,12 +589,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index fe498594da1c..94c499c7b7f7 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.Order import kotlinx.coroutines.Dispatchers @@ -50,11 +52,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun deleteOrder(orderId: kotlin.String) : Unit = withContext(Dispatchers.IO) { val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId) @@ -78,11 +82,10 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) @@ -115,12 +118,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return kotlin.collections.Map + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun getInventory() : kotlin.collections.Map = withContext(Dispatchers.IO) { val localVarResponse = getInventoryWithHttpInfo() @@ -143,12 +148,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> = withContext(Dispatchers.IO) { val localVariableConfig = getInventoryRequestConfig() @@ -182,12 +186,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun getOrderById(orderId: kotlin.Long) : Order = withContext(Dispatchers.IO) { val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId) @@ -211,12 +217,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) @@ -251,12 +256,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun placeOrder(body: Order) : Order = withContext(Dispatchers.IO) { val localVarResponse = placeOrderWithHttpInfo(body = body) @@ -280,12 +287,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { val localVariableConfig = placeOrderRequestConfig(body = body) diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 797a84aa61d5..8439a7f2bdbe 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.User import kotlinx.coroutines.Dispatchers @@ -50,11 +52,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun createUser(body: User) : Unit = withContext(Dispatchers.IO) { val localVarResponse = createUserWithHttpInfo(body = body) @@ -78,11 +82,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { val localVariableConfig = createUserRequestConfig(body = body) @@ -116,11 +119,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit = withContext(Dispatchers.IO) { val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body) @@ -144,11 +149,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) @@ -182,11 +186,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun createUsersWithListInput(body: kotlin.collections.List) : Unit = withContext(Dispatchers.IO) { val localVarResponse = createUsersWithListInputWithHttpInfo(body = body) @@ -210,11 +216,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) @@ -248,11 +253,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun deleteUser(username: kotlin.String) : Unit = withContext(Dispatchers.IO) { val localVarResponse = deleteUserWithHttpInfo(username = username) @@ -276,11 +283,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { val localVariableConfig = deleteUserRequestConfig(username = username) @@ -314,12 +320,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return User + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun getUserByName(username: kotlin.String) : User = withContext(Dispatchers.IO) { val localVarResponse = getUserByNameWithHttpInfo(username = username) @@ -343,12 +351,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { val localVariableConfig = getUserByNameRequestConfig(username = username) @@ -384,12 +391,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return kotlin.String + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String = withContext(Dispatchers.IO) { val localVarResponse = loginUserWithHttpInfo(username = username, password = password) @@ -414,12 +423,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { val localVariableConfig = loginUserRequestConfig(username = username, password = password) @@ -458,11 +466,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun logoutUser() : Unit = withContext(Dispatchers.IO) { val localVarResponse = logoutUserWithHttpInfo() @@ -485,11 +495,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun logoutUserWithHttpInfo() : ApiInfrastructureResponse = withContext(Dispatchers.IO) { val localVariableConfig = logoutUserRequestConfig() @@ -523,11 +532,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun updateUser(username: kotlin.String, body: User) : Unit = withContext(Dispatchers.IO) { val localVarResponse = updateUserWithHttpInfo(username = username, body = body) @@ -552,11 +563,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { val localVariableConfig = updateUserRequestConfig(username = username, body = body) diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 59367631c91e..c3426fbd0a4a 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet @@ -49,11 +51,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun addPet(body: Pet) : Unit { val localVarResponse = addPetWithHttpInfo(body = body) @@ -77,11 +81,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = addPetRequestConfig(body = body) @@ -117,11 +120,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey) @@ -146,11 +151,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) @@ -186,12 +190,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) @@ -215,12 +221,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) @@ -258,12 +263,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { @Suppress("DEPRECATION") @@ -289,12 +296,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { @Suppress("DEPRECATION") @@ -335,12 +341,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return Pet + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPetById(petId: kotlin.Long) : Pet { val localVarResponse = getPetByIdWithHttpInfo(petId = petId) @@ -364,12 +372,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) @@ -404,11 +411,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePet(body: Pet) : Unit { val localVarResponse = updatePetWithHttpInfo(body = body) @@ -432,11 +441,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = updatePetRequestConfig(body = body) @@ -473,11 +481,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) @@ -503,11 +513,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) @@ -545,12 +554,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) @@ -576,12 +587,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 87d76a0b30d6..e905c41311dc 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteOrder(orderId: kotlin.String) : Unit { val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId) @@ -76,11 +80,10 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) @@ -113,12 +116,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return kotlin.collections.Map + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getInventory() : kotlin.collections.Map { val localVarResponse = getInventoryWithHttpInfo() @@ -141,12 +146,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { val localVariableConfig = getInventoryRequestConfig() @@ -180,12 +184,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getOrderById(orderId: kotlin.Long) : Order { val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId) @@ -209,12 +215,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) @@ -249,12 +254,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun placeOrder(body: Order) : Order { val localVarResponse = placeOrderWithHttpInfo(body = body) @@ -278,12 +285,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { val localVariableConfig = placeOrderRequestConfig(body = body) diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 444826b782cd..9381925680af 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUser(body: User) : Unit { val localVarResponse = createUserWithHttpInfo(body = body) @@ -76,11 +80,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { val localVariableConfig = createUserRequestConfig(body = body) @@ -114,11 +117,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body) @@ -142,11 +147,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) @@ -180,11 +184,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithListInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithListInputWithHttpInfo(body = body) @@ -208,11 +214,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) @@ -246,11 +251,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteUser(username: kotlin.String) : Unit { val localVarResponse = deleteUserWithHttpInfo(username = username) @@ -274,11 +281,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteUserRequestConfig(username = username) @@ -312,12 +318,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return User + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getUserByName(username: kotlin.String) : User { val localVarResponse = getUserByNameWithHttpInfo(username = username) @@ -341,12 +349,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) @@ -382,12 +389,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return kotlin.String + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { val localVarResponse = loginUserWithHttpInfo(username = username, password = password) @@ -412,12 +421,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) @@ -456,11 +464,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun logoutUser() : Unit { val localVarResponse = logoutUserWithHttpInfo() @@ -483,11 +493,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { val localVariableConfig = logoutUserRequestConfig() @@ -521,11 +530,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updateUser(username: kotlin.String, body: User) : Unit { val localVarResponse = updateUserWithHttpInfo(username = username, body = body) @@ -550,11 +561,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index f01ad9c676da..413c98693aa1 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet @@ -49,11 +51,13 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun addPet(body: Pet) : Unit { val localVarResponse = addPetWithHttpInfo(body = body) @@ -77,11 +81,10 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = addPetRequestConfig(body = body) @@ -117,11 +120,13 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * @param petId Pet id to delete * @param apiKey (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey) @@ -146,11 +151,10 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * @param petId Pet id to delete * @param apiKey (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) @@ -186,12 +190,14 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) @@ -215,12 +221,11 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) @@ -258,12 +263,14 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { @Suppress("DEPRECATION") @@ -289,12 +296,11 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { @Suppress("DEPRECATION") @@ -335,12 +341,14 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * Returns a single pet * @param petId ID of pet to return * @return Pet + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPetById(petId: kotlin.Long) : Pet { val localVarResponse = getPetByIdWithHttpInfo(petId = petId) @@ -364,12 +372,11 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * Returns a single pet * @param petId ID of pet to return * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) @@ -404,11 +411,13 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePet(body: Pet) : Unit { val localVarResponse = updatePetWithHttpInfo(body = body) @@ -432,11 +441,10 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = updatePetRequestConfig(body = body) @@ -473,11 +481,13 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) @@ -503,11 +513,10 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) @@ -545,12 +554,14 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) @@ -576,12 +587,11 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index a71c936424af..eb69e3afbd35 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteOrder(orderId: kotlin.String) : Unit { val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId) @@ -76,11 +80,10 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) @@ -113,12 +116,14 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b * Returns pet inventories by status * Returns a map of status codes to quantities * @return kotlin.collections.Map + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getInventory() : kotlin.collections.Map { val localVarResponse = getInventoryWithHttpInfo() @@ -141,12 +146,11 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b * Returns pet inventories by status * Returns a map of status codes to quantities * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { val localVariableConfig = getInventoryRequestConfig() @@ -180,12 +184,14 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getOrderById(orderId: kotlin.Long) : Order { val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId) @@ -209,12 +215,11 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) @@ -249,12 +254,14 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b * * @param body order placed for purchasing the pet * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun placeOrder(body: Order) : Order { val localVarResponse = placeOrderWithHttpInfo(body = body) @@ -278,12 +285,11 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b * * @param body order placed for purchasing the pet * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { val localVariableConfig = placeOrderRequestConfig(body = body) diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 478f791b874e..75996ae34129 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * This can only be done by the logged in user. * @param body Created user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUser(body: User) : Unit { val localVarResponse = createUserWithHttpInfo(body = body) @@ -76,11 +80,10 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * This can only be done by the logged in user. * @param body Created user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { val localVariableConfig = createUserRequestConfig(body = body) @@ -114,11 +117,13 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body) @@ -142,11 +147,10 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) @@ -180,11 +184,13 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithListInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithListInputWithHttpInfo(body = body) @@ -208,11 +214,10 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) @@ -246,11 +251,13 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteUser(username: kotlin.String) : Unit { val localVarResponse = deleteUserWithHttpInfo(username = username) @@ -274,11 +281,10 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteUserRequestConfig(username = username) @@ -312,12 +318,14 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * * @param username The name that needs to be fetched. Use user1 for testing. * @return User + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getUserByName(username: kotlin.String) : User { val localVarResponse = getUserByNameWithHttpInfo(username = username) @@ -341,12 +349,11 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * * @param username The name that needs to be fetched. Use user1 for testing. * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) @@ -382,12 +389,14 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * @param username The user name for login * @param password The password for login in clear text * @return kotlin.String + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { val localVarResponse = loginUserWithHttpInfo(username = username, password = password) @@ -412,12 +421,11 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * @param username The user name for login * @param password The password for login in clear text * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) @@ -456,11 +464,13 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * Logs out current logged in user session * * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun logoutUser() : Unit { val localVarResponse = logoutUserWithHttpInfo() @@ -483,11 +493,10 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * Logs out current logged in user session * * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { val localVariableConfig = logoutUserRequestConfig() @@ -521,11 +530,13 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * @param username name that need to be deleted * @param body Updated user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updateUser(username: kotlin.String, body: User) : Unit { val localVarResponse = updateUserWithHttpInfo(username = username, body = body) @@ -550,11 +561,10 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * @param username name that need to be deleted * @param body Updated user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 641f25e2ad29..ffa00253a362 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet @@ -49,11 +51,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun addPet(body: Pet) : Unit { val localVarResponse = addPetWithHttpInfo(body = body) @@ -77,11 +81,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = addPetRequestConfig(body = body) @@ -117,11 +120,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey) @@ -146,11 +151,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) @@ -186,12 +190,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return kotlin.collections.List or null + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List? { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) @@ -215,12 +221,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) @@ -258,12 +263,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return kotlin.collections.List or null + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List? { @Suppress("DEPRECATION") @@ -289,12 +296,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { @Suppress("DEPRECATION") @@ -335,12 +341,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return Pet or null + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPetById(petId: kotlin.Long) : Pet? { val localVarResponse = getPetByIdWithHttpInfo(petId = petId) @@ -364,12 +372,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) @@ -404,11 +411,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePet(body: Pet) : Unit { val localVarResponse = updatePetWithHttpInfo(body = body) @@ -432,11 +441,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = updatePetRequestConfig(body = body) @@ -473,11 +481,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) @@ -503,11 +513,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) @@ -545,12 +554,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiResponse or null + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse? { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) @@ -576,12 +587,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 60120ce05d90..28c31e3db41a 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteOrder(orderId: kotlin.String) : Unit { val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId) @@ -76,11 +80,10 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) @@ -113,12 +116,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return kotlin.collections.Map or null + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getInventory() : kotlin.collections.Map? { val localVarResponse = getInventoryWithHttpInfo() @@ -141,12 +146,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { val localVariableConfig = getInventoryRequestConfig() @@ -180,12 +184,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return Order or null + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getOrderById(orderId: kotlin.Long) : Order? { val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId) @@ -209,12 +215,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) @@ -249,12 +254,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return Order or null + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun placeOrder(body: Order) : Order? { val localVarResponse = placeOrderWithHttpInfo(body = body) @@ -278,12 +285,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { val localVariableConfig = placeOrderRequestConfig(body = body) diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 3b44d8f38f49..9997944fa994 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUser(body: User) : Unit { val localVarResponse = createUserWithHttpInfo(body = body) @@ -76,11 +80,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { val localVariableConfig = createUserRequestConfig(body = body) @@ -114,11 +117,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body) @@ -142,11 +147,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) @@ -180,11 +184,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithListInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithListInputWithHttpInfo(body = body) @@ -208,11 +214,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) @@ -246,11 +251,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteUser(username: kotlin.String) : Unit { val localVarResponse = deleteUserWithHttpInfo(username = username) @@ -274,11 +281,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteUserRequestConfig(username = username) @@ -312,12 +318,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return User or null + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getUserByName(username: kotlin.String) : User? { val localVarResponse = getUserByNameWithHttpInfo(username = username) @@ -341,12 +349,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) @@ -382,12 +389,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return kotlin.String or null + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String? { val localVarResponse = loginUserWithHttpInfo(username = username, password = password) @@ -412,12 +421,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) @@ -456,11 +464,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun logoutUser() : Unit { val localVarResponse = logoutUserWithHttpInfo() @@ -483,11 +493,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { val localVariableConfig = logoutUserRequestConfig() @@ -521,11 +530,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updateUser(username: kotlin.String, body: User) : Unit { val localVarResponse = updateUserWithHttpInfo(username = username, body = body) @@ -550,11 +561,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 59367631c91e..c3426fbd0a4a 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet @@ -49,11 +51,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun addPet(body: Pet) : Unit { val localVarResponse = addPetWithHttpInfo(body = body) @@ -77,11 +81,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = addPetRequestConfig(body = body) @@ -117,11 +120,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey) @@ -146,11 +151,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) @@ -186,12 +190,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) @@ -215,12 +221,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) @@ -258,12 +263,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { @Suppress("DEPRECATION") @@ -289,12 +296,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { @Suppress("DEPRECATION") @@ -335,12 +341,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return Pet + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPetById(petId: kotlin.Long) : Pet { val localVarResponse = getPetByIdWithHttpInfo(petId = petId) @@ -364,12 +372,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) @@ -404,11 +411,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePet(body: Pet) : Unit { val localVarResponse = updatePetWithHttpInfo(body = body) @@ -432,11 +441,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = updatePetRequestConfig(body = body) @@ -473,11 +481,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) @@ -503,11 +513,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) @@ -545,12 +554,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) @@ -576,12 +587,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 87d76a0b30d6..e905c41311dc 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteOrder(orderId: kotlin.String) : Unit { val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId) @@ -76,11 +80,10 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) @@ -113,12 +116,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return kotlin.collections.Map + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getInventory() : kotlin.collections.Map { val localVarResponse = getInventoryWithHttpInfo() @@ -141,12 +146,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { val localVariableConfig = getInventoryRequestConfig() @@ -180,12 +184,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getOrderById(orderId: kotlin.Long) : Order { val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId) @@ -209,12 +215,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) @@ -249,12 +254,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun placeOrder(body: Order) : Order { val localVarResponse = placeOrderWithHttpInfo(body = body) @@ -278,12 +285,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { val localVariableConfig = placeOrderRequestConfig(body = body) diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 444826b782cd..9381925680af 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUser(body: User) : Unit { val localVarResponse = createUserWithHttpInfo(body = body) @@ -76,11 +80,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { val localVariableConfig = createUserRequestConfig(body = body) @@ -114,11 +117,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body) @@ -142,11 +147,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) @@ -180,11 +184,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithListInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithListInputWithHttpInfo(body = body) @@ -208,11 +214,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) @@ -246,11 +251,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteUser(username: kotlin.String) : Unit { val localVarResponse = deleteUserWithHttpInfo(username = username) @@ -274,11 +281,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteUserRequestConfig(username = username) @@ -312,12 +318,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return User + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getUserByName(username: kotlin.String) : User { val localVarResponse = getUserByNameWithHttpInfo(username = username) @@ -341,12 +349,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) @@ -382,12 +389,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return kotlin.String + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { val localVarResponse = loginUserWithHttpInfo(username = username, password = password) @@ -412,12 +421,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) @@ -456,11 +464,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun logoutUser() : Unit { val localVarResponse = logoutUserWithHttpInfo() @@ -483,11 +493,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { val localVariableConfig = logoutUserRequestConfig() @@ -521,11 +530,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updateUser(username: kotlin.String, body: User) : Unit { val localVarResponse = updateUserWithHttpInfo(username = username, body = body) @@ -550,11 +561,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index bc8f157e4887..fbadb8eb910f 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet @@ -49,11 +51,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun addPet(body: Pet) : Unit { val localVarResponse = addPetWithHttpInfo(body = body) @@ -77,11 +81,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = addPetRequestConfig(body = body) @@ -117,11 +120,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param apiKey (optional) * @param petId Pet id to delete * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deletePet(apiKey: kotlin.String?, petId: kotlin.Long) : Unit { val localVarResponse = deletePetWithHttpInfo(apiKey = apiKey, petId = petId) @@ -146,11 +151,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param apiKey (optional) * @param petId Pet id to delete * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deletePetWithHttpInfo(apiKey: kotlin.String?, petId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = deletePetRequestConfig(apiKey = apiKey, petId = petId) @@ -186,12 +190,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) @@ -215,12 +221,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) @@ -258,12 +263,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { @Suppress("DEPRECATION") @@ -289,12 +296,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { @Suppress("DEPRECATION") @@ -335,12 +341,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return Pet + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPetById(petId: kotlin.Long) : Pet { val localVarResponse = getPetByIdWithHttpInfo(petId = petId) @@ -364,12 +372,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) @@ -404,11 +411,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePet(body: Pet) : Unit { val localVarResponse = updatePetWithHttpInfo(body = body) @@ -432,11 +441,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = updatePetRequestConfig(body = body) @@ -473,11 +481,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) @@ -503,11 +513,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) @@ -545,12 +554,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) @@ -576,12 +587,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 87d76a0b30d6..e905c41311dc 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteOrder(orderId: kotlin.String) : Unit { val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId) @@ -76,11 +80,10 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) @@ -113,12 +116,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return kotlin.collections.Map + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getInventory() : kotlin.collections.Map { val localVarResponse = getInventoryWithHttpInfo() @@ -141,12 +146,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { val localVariableConfig = getInventoryRequestConfig() @@ -180,12 +184,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getOrderById(orderId: kotlin.Long) : Order { val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId) @@ -209,12 +215,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) @@ -249,12 +254,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun placeOrder(body: Order) : Order { val localVarResponse = placeOrderWithHttpInfo(body = body) @@ -278,12 +285,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { val localVariableConfig = placeOrderRequestConfig(body = body) diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 444826b782cd..9381925680af 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUser(body: User) : Unit { val localVarResponse = createUserWithHttpInfo(body = body) @@ -76,11 +80,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { val localVariableConfig = createUserRequestConfig(body = body) @@ -114,11 +117,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body) @@ -142,11 +147,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) @@ -180,11 +184,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithListInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithListInputWithHttpInfo(body = body) @@ -208,11 +214,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) @@ -246,11 +251,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteUser(username: kotlin.String) : Unit { val localVarResponse = deleteUserWithHttpInfo(username = username) @@ -274,11 +281,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteUserRequestConfig(username = username) @@ -312,12 +318,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return User + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getUserByName(username: kotlin.String) : User { val localVarResponse = getUserByNameWithHttpInfo(username = username) @@ -341,12 +349,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) @@ -382,12 +389,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return kotlin.String + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { val localVarResponse = loginUserWithHttpInfo(username = username, password = password) @@ -412,12 +421,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) @@ -456,11 +464,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun logoutUser() : Unit { val localVarResponse = logoutUserWithHttpInfo() @@ -483,11 +493,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { val localVariableConfig = logoutUserRequestConfig() @@ -521,11 +530,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updateUser(username: kotlin.String, body: User) : Unit { val localVarResponse = updateUserWithHttpInfo(username = username, body = body) @@ -550,11 +561,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 59367631c91e..c3426fbd0a4a 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet @@ -49,11 +51,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun addPet(body: Pet) : Unit { val localVarResponse = addPetWithHttpInfo(body = body) @@ -77,11 +81,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = addPetRequestConfig(body = body) @@ -117,11 +120,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey) @@ -146,11 +151,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) @@ -186,12 +190,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) @@ -215,12 +221,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) @@ -258,12 +263,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { @Suppress("DEPRECATION") @@ -289,12 +296,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { @Suppress("DEPRECATION") @@ -335,12 +341,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return Pet + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPetById(petId: kotlin.Long) : Pet { val localVarResponse = getPetByIdWithHttpInfo(petId = petId) @@ -364,12 +372,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) @@ -404,11 +411,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePet(body: Pet) : Unit { val localVarResponse = updatePetWithHttpInfo(body = body) @@ -432,11 +441,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = updatePetRequestConfig(body = body) @@ -473,11 +481,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) @@ -503,11 +513,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) @@ -545,12 +554,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) @@ -576,12 +587,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 87d76a0b30d6..e905c41311dc 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteOrder(orderId: kotlin.String) : Unit { val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId) @@ -76,11 +80,10 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) @@ -113,12 +116,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return kotlin.collections.Map + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getInventory() : kotlin.collections.Map { val localVarResponse = getInventoryWithHttpInfo() @@ -141,12 +146,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { val localVariableConfig = getInventoryRequestConfig() @@ -180,12 +184,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getOrderById(orderId: kotlin.Long) : Order { val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId) @@ -209,12 +215,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) @@ -249,12 +254,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun placeOrder(body: Order) : Order { val localVarResponse = placeOrderWithHttpInfo(body = body) @@ -278,12 +285,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { val localVariableConfig = placeOrderRequestConfig(body = body) diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 444826b782cd..9381925680af 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUser(body: User) : Unit { val localVarResponse = createUserWithHttpInfo(body = body) @@ -76,11 +80,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { val localVariableConfig = createUserRequestConfig(body = body) @@ -114,11 +117,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body) @@ -142,11 +147,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) @@ -180,11 +184,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithListInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithListInputWithHttpInfo(body = body) @@ -208,11 +214,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) @@ -246,11 +251,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteUser(username: kotlin.String) : Unit { val localVarResponse = deleteUserWithHttpInfo(username = username) @@ -274,11 +281,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteUserRequestConfig(username = username) @@ -312,12 +318,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return User + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getUserByName(username: kotlin.String) : User { val localVarResponse = getUserByNameWithHttpInfo(username = username) @@ -341,12 +349,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) @@ -382,12 +389,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return kotlin.String + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { val localVarResponse = loginUserWithHttpInfo(username = username, password = password) @@ -412,12 +421,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) @@ -456,11 +464,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun logoutUser() : Unit { val localVarResponse = logoutUserWithHttpInfo() @@ -483,11 +493,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { val localVariableConfig = logoutUserRequestConfig() @@ -521,11 +530,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updateUser(username: kotlin.String, body: User) : Unit { val localVarResponse = updateUserWithHttpInfo(username = username, body = body) @@ -550,11 +561,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) 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 87b7bc007a64..4a5e70c002a0 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 @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.PetEnum import org.openapitools.client.infrastructure.ApiClient @@ -47,12 +49,14 @@ class EnumApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Get enums * * @return PetEnum + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getEnum() : PetEnum { val localVarResponse = getEnumWithHttpInfo() @@ -75,12 +79,11 @@ class EnumApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Get enums * * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getEnumWithHttpInfo() : ApiInfrastructureResponse { val localVariableConfig = getEnumRequestConfig() diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 59367631c91e..c3426fbd0a4a 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet @@ -49,11 +51,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun addPet(body: Pet) : Unit { val localVarResponse = addPetWithHttpInfo(body = body) @@ -77,11 +81,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = addPetRequestConfig(body = body) @@ -117,11 +120,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey) @@ -146,11 +151,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) @@ -186,12 +190,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) @@ -215,12 +221,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) @@ -258,12 +263,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { @Suppress("DEPRECATION") @@ -289,12 +296,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { @Suppress("DEPRECATION") @@ -335,12 +341,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return Pet + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPetById(petId: kotlin.Long) : Pet { val localVarResponse = getPetByIdWithHttpInfo(petId = petId) @@ -364,12 +372,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) @@ -404,11 +411,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePet(body: Pet) : Unit { val localVarResponse = updatePetWithHttpInfo(body = body) @@ -432,11 +441,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = updatePetRequestConfig(body = body) @@ -473,11 +481,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) @@ -503,11 +513,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) @@ -545,12 +554,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) @@ -576,12 +587,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 87d76a0b30d6..e905c41311dc 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteOrder(orderId: kotlin.String) : Unit { val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId) @@ -76,11 +80,10 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) @@ -113,12 +116,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return kotlin.collections.Map + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getInventory() : kotlin.collections.Map { val localVarResponse = getInventoryWithHttpInfo() @@ -141,12 +146,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { val localVariableConfig = getInventoryRequestConfig() @@ -180,12 +184,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getOrderById(orderId: kotlin.Long) : Order { val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId) @@ -209,12 +215,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) @@ -249,12 +254,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun placeOrder(body: Order) : Order { val localVarResponse = placeOrderWithHttpInfo(body = body) @@ -278,12 +285,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { val localVariableConfig = placeOrderRequestConfig(body = body) diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 444826b782cd..9381925680af 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUser(body: User) : Unit { val localVarResponse = createUserWithHttpInfo(body = body) @@ -76,11 +80,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { val localVariableConfig = createUserRequestConfig(body = body) @@ -114,11 +117,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body) @@ -142,11 +147,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) @@ -180,11 +184,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithListInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithListInputWithHttpInfo(body = body) @@ -208,11 +214,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) @@ -246,11 +251,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteUser(username: kotlin.String) : Unit { val localVarResponse = deleteUserWithHttpInfo(username = username) @@ -274,11 +281,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteUserRequestConfig(username = username) @@ -312,12 +318,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return User + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getUserByName(username: kotlin.String) : User { val localVarResponse = getUserByNameWithHttpInfo(username = username) @@ -341,12 +349,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) @@ -382,12 +389,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return kotlin.String + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { val localVarResponse = loginUserWithHttpInfo(username = username, password = password) @@ -412,12 +421,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) @@ -456,11 +464,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun logoutUser() : Unit { val localVarResponse = logoutUserWithHttpInfo() @@ -483,11 +493,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { val localVariableConfig = logoutUserRequestConfig() @@ -521,11 +530,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updateUser(username: kotlin.String, body: User) : Unit { val localVarResponse = updateUserWithHttpInfo(username = username, body = body) @@ -550,11 +561,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) From fbb61658dfbcc2c1f5087511b0f74756553791ad Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 12 Dec 2021 16:32:08 +0800 Subject: [PATCH 084/117] [kotlin][client] rename ApiInfrastructureResponse to ApiResponse (#11094) * rename ApiInfrastructureResponse to ApiResponse * mark ApiResponse as reserved word * update samples, docs * fix typo --- docs/generators/kotlin-server-deprecated.md | 1 + docs/generators/kotlin-server.md | 1 + docs/generators/kotlin-vertx.md | 1 + docs/generators/kotlin.md | 1 + .../languages/AbstractKotlinCodegen.java | 1 + .../languages/KotlinClientCodegen.java | 2 +- .../libraries/jvm-okhttp/api.mustache | 6 +-- .../infrastructure/ApiClient.kt.mustache | 2 +- ...se.kt.mustache => ApiResponse.kt.mustache} | 12 ++--- .../.openapi-generator/FILES | 2 +- .../openapitools/client/apis/DefaultApi.kt | 6 +-- .../client/infrastructure/ApiClient.kt | 2 +- .../client/infrastructure/ApiResponse.kt} | 12 ++--- .../kotlin-gson/.openapi-generator/FILES | 4 +- samples/client/petstore/kotlin-gson/README.md | 2 +- .../petstore/kotlin-gson/docs/ApiResponse.md | 2 +- .../petstore/kotlin-gson/docs/PetApi.md | 6 +-- samples/client/petstore/kotlin-gson/gradlew | 0 .../org/openapitools/client/apis/PetApi.kt | 44 +++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 18 ++++---- .../org/openapitools/client/apis/UserApi.kt | 34 +++++++------- .../client/infrastructure/ApiClient.kt | 2 +- .../client/infrastructure/ApiResponse.kt} | 12 ++--- .../{ApiResponse.kt => ModelApiResponse.kt} | 2 +- .../kotlin-jackson/.openapi-generator/FILES | 4 +- .../client/petstore/kotlin-jackson/README.md | 2 +- .../kotlin-jackson/docs/ApiResponse.md | 2 +- .../petstore/kotlin-jackson/docs/PetApi.md | 6 +-- .../org/openapitools/client/apis/PetApi.kt | 44 +++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 18 ++++---- .../org/openapitools/client/apis/UserApi.kt | 34 +++++++------- .../client/infrastructure/ApiClient.kt | 2 +- .../client/infrastructure/ApiResponse.kt} | 12 ++--- .../{ApiResponse.kt => ModelApiResponse.kt} | 2 +- .../.openapi-generator/FILES | 4 +- .../kotlin-json-request-string/README.md | 2 +- .../docs/ApiResponse.md | 2 +- .../kotlin-json-request-string/docs/PetApi.md | 6 +-- .../org/openapitools/client/apis/PetApi.kt | 44 +++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 18 ++++---- .../org/openapitools/client/apis/UserApi.kt | 34 +++++++------- .../client/infrastructure/ApiClient.kt | 2 +- .../client/infrastructure/ApiResponse.kt} | 12 ++--- .../{ApiResponse.kt => ModelApiResponse.kt} | 2 +- .../.openapi-generator/FILES | 4 +- .../kotlin-jvm-okhttp4-coroutines/README.md | 2 +- .../docs/ApiResponse.md | 2 +- .../docs/PetApi.md | 6 +-- .../org/openapitools/client/apis/PetApi.kt | 44 +++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 18 ++++---- .../org/openapitools/client/apis/UserApi.kt | 34 +++++++------- .../client/infrastructure/ApiClient.kt | 2 +- .../ApiInfrastructureResponse.kt | 43 ----------------- .../client/infrastructure/ApiResponse.kt | 43 +++++++++++++++++ .../{ApiResponse.kt => ModelApiResponse.kt} | 2 +- .../.openapi-generator/FILES | 4 +- .../petstore/kotlin-moshi-codegen/README.md | 2 +- .../kotlin-moshi-codegen/docs/ApiResponse.md | 2 +- .../kotlin-moshi-codegen/docs/PetApi.md | 6 +-- .../org/openapitools/client/apis/PetApi.kt | 44 +++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 18 ++++---- .../org/openapitools/client/apis/UserApi.kt | 34 +++++++------- .../client/infrastructure/ApiClient.kt | 2 +- .../ApiInfrastructureResponse.kt | 43 ----------------- .../client/infrastructure/ApiResponse.kt | 43 +++++++++++++++++ .../{ApiResponse.kt => ModelApiResponse.kt} | 2 +- .../.openapi-generator/FILES | 2 +- .../petstore/kotlin-multiplatform/README.md | 2 +- .../kotlin-multiplatform/docs/ApiResponse.md | 2 +- .../kotlin-multiplatform/docs/PetApi.md | 6 +-- .../org/openapitools/client/apis/PetApi.kt | 6 +-- .../{ApiResponse.kt => ModelApiResponse.kt} | 2 +- .../kotlin-nonpublic/.openapi-generator/FILES | 4 +- .../petstore/kotlin-nonpublic/README.md | 2 +- .../kotlin-nonpublic/docs/ApiResponse.md | 2 +- .../petstore/kotlin-nonpublic/docs/PetApi.md | 6 +-- .../org/openapitools/client/apis/PetApi.kt | 44 +++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 18 ++++---- .../org/openapitools/client/apis/UserApi.kt | 34 +++++++------- .../client/infrastructure/ApiClient.kt | 2 +- ...frastructureResponse.kt => ApiResponse.kt} | 12 ++--- .../client/models/ModelApiResponse.kt | 46 +++++++++++++++++++ .../kotlin-nullable/.openapi-generator/FILES | 4 +- .../client/petstore/kotlin-nullable/README.md | 2 +- .../kotlin-nullable/docs/ApiResponse.md | 2 +- .../petstore/kotlin-nullable/docs/PetApi.md | 6 +-- .../org/openapitools/client/apis/PetApi.kt | 44 +++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 18 ++++---- .../org/openapitools/client/apis/UserApi.kt | 34 +++++++------- .../client/infrastructure/ApiClient.kt | 2 +- ...frastructureResponse.kt => ApiResponse.kt} | 12 ++--- .../{ApiResponse.kt => ModelApiResponse.kt} | 2 +- .../kotlin-okhttp3/.openapi-generator/FILES | 4 +- .../client/petstore/kotlin-okhttp3/README.md | 2 +- .../kotlin-okhttp3/docs/ApiResponse.md | 2 +- .../petstore/kotlin-okhttp3/docs/PetApi.md | 6 +-- .../org/openapitools/client/apis/PetApi.kt | 44 +++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 18 ++++---- .../org/openapitools/client/apis/UserApi.kt | 34 +++++++------- .../client/infrastructure/ApiClient.kt | 2 +- .../ApiInfrastructureResponse.kt | 43 ----------------- .../client/infrastructure/ApiResponse.kt | 43 +++++++++++++++++ .../client/models/ModelApiResponse.kt} | 2 +- .../.openapi-generator/FILES | 2 +- .../README.md | 2 +- .../docs/ApiResponse.md | 2 +- .../docs/PetApi.md | 4 +- .../org/openapitools/client/apis/PetApi.kt | 6 +-- .../{ApiResponse.kt => ModelApiResponse.kt} | 2 +- .../.openapi-generator/FILES | 2 +- .../petstore/kotlin-retrofit2-rx3/README.md | 2 +- .../kotlin-retrofit2-rx3/docs/ApiResponse.md | 2 +- .../kotlin-retrofit2-rx3/docs/PetApi.md | 4 +- .../org/openapitools/client/apis/PetApi.kt | 6 +-- .../{ApiResponse.kt => ModelApiResponse.kt} | 2 +- .../kotlin-retrofit2/.openapi-generator/FILES | 2 +- .../petstore/kotlin-retrofit2/README.md | 2 +- .../kotlin-retrofit2/docs/ApiResponse.md | 2 +- .../petstore/kotlin-retrofit2/docs/PetApi.md | 4 +- .../org/openapitools/client/apis/PetApi.kt | 6 +-- .../client/models/ModelApiResponse.kt} | 2 +- .../kotlin-string/.openapi-generator/FILES | 4 +- .../client/petstore/kotlin-string/README.md | 2 +- .../kotlin-string/docs/ApiResponse.md | 2 +- .../petstore/kotlin-string/docs/PetApi.md | 6 +-- .../org/openapitools/client/apis/PetApi.kt | 44 +++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 18 ++++---- .../org/openapitools/client/apis/UserApi.kt | 34 +++++++------- .../client/infrastructure/ApiClient.kt | 2 +- .../ApiInfrastructureResponse.kt | 43 ----------------- .../client/infrastructure/ApiResponse.kt | 43 +++++++++++++++++ .../{ApiResponse.kt => ModelApiResponse.kt} | 2 +- .../.openapi-generator/FILES | 4 +- .../petstore/kotlin-threetenbp/README.md | 2 +- .../kotlin-threetenbp/docs/ApiResponse.md | 2 +- .../petstore/kotlin-threetenbp/docs/PetApi.md | 6 +-- .../org/openapitools/client/apis/PetApi.kt | 44 +++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 18 ++++---- .../org/openapitools/client/apis/UserApi.kt | 34 +++++++------- .../client/infrastructure/ApiClient.kt | 2 +- .../ApiInfrastructureResponse.kt | 43 ----------------- .../client/infrastructure/ApiResponse.kt | 43 +++++++++++++++++ .../client/models/ModelApiResponse.kt} | 2 +- .../.openapi-generator/FILES | 2 +- .../org/openapitools/client/apis/EnumApi.kt | 6 +-- .../client/infrastructure/ApiClient.kt | 2 +- .../ApiInfrastructureResponse.kt | 43 ----------------- .../client/infrastructure/ApiResponse.kt | 43 +++++++++++++++++ .../petstore/kotlin/.openapi-generator/FILES | 4 +- samples/client/petstore/kotlin/README.md | 2 +- .../petstore/kotlin/docs/ApiResponse.md | 2 +- samples/client/petstore/kotlin/docs/PetApi.md | 6 +-- .../org/openapitools/client/apis/PetApi.kt | 44 +++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 18 ++++---- .../org/openapitools/client/apis/UserApi.kt | 34 +++++++------- .../client/infrastructure/ApiClient.kt | 2 +- .../ApiInfrastructureResponse.kt | 43 ----------------- .../client/infrastructure/ApiResponse.kt | 43 +++++++++++++++++ .../{ApiResponse.kt => ModelApiResponse.kt} | 2 +- .../ktor/.openapi-generator/FILES | 2 +- .../petstore/kotlin-server/ktor/README.md | 2 +- .../org/openapitools/server/apis/PetApi.kt | 2 +- .../{ApiResponse.kt => ModelApiResponse.kt} | 2 +- 163 files changed, 1076 insertions(+), 1025 deletions(-) rename modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/{ApiInfrastructureResponse.kt.mustache => ApiResponse.kt.mustache} (76%) rename samples/client/petstore/{kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt => kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt} (73%) mode change 100644 => 100755 samples/client/petstore/kotlin-gson/gradlew rename samples/client/petstore/{kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt => kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt} (73%) rename samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/{ApiResponse.kt => ModelApiResponse.kt} (96%) rename samples/client/petstore/{kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt => kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt} (73%) rename samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/{ApiResponse.kt => ModelApiResponse.kt} (96%) rename samples/client/petstore/{kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt => kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt} (73%) rename samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/{ApiResponse.kt => ModelApiResponse.kt} (96%) delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt create mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt rename samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/{ApiResponse.kt => ModelApiResponse.kt} (97%) delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt create mode 100644 samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt rename samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/{ApiResponse.kt => ModelApiResponse.kt} (96%) rename samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/{ApiResponse.kt => ModelApiResponse.kt} (97%) rename samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/{ApiInfrastructureResponse.kt => ApiResponse.kt} (73%) create mode 100644 samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt rename samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/{ApiInfrastructureResponse.kt => ApiResponse.kt} (73%) rename samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/{ApiResponse.kt => ModelApiResponse.kt} (97%) delete mode 100644 samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt create mode 100644 samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt rename samples/client/petstore/{kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt => kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt} (96%) rename samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/{ApiResponse.kt => ModelApiResponse.kt} (97%) rename samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/{ApiResponse.kt => ModelApiResponse.kt} (96%) rename samples/client/petstore/{kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt => kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt} (96%) delete mode 100644 samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt create mode 100644 samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt rename samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/{ApiResponse.kt => ModelApiResponse.kt} (97%) delete mode 100644 samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt create mode 100644 samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt rename samples/client/petstore/{kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt => kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt} (96%) delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt create mode 100644 samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt delete mode 100644 samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt create mode 100644 samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt rename samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/{ApiResponse.kt => ModelApiResponse.kt} (97%) rename samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/{ApiResponse.kt => ModelApiResponse.kt} (96%) diff --git a/docs/generators/kotlin-server-deprecated.md b/docs/generators/kotlin-server-deprecated.md index 2287e954abfe..7e53620aa6e5 100644 --- a/docs/generators/kotlin-server-deprecated.md +++ b/docs/generators/kotlin-server-deprecated.md @@ -74,6 +74,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl ## RESERVED WORDS
      +
    • ApiResponse
    • abstract
    • actual
    • annotation
    • diff --git a/docs/generators/kotlin-server.md b/docs/generators/kotlin-server.md index 81f75ca57859..0c0228d8a8c5 100644 --- a/docs/generators/kotlin-server.md +++ b/docs/generators/kotlin-server.md @@ -76,6 +76,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl ## RESERVED WORDS
        +
      • ApiResponse
      • abstract
      • actual
      • annotation
      • diff --git a/docs/generators/kotlin-vertx.md b/docs/generators/kotlin-vertx.md index 90afde4de81c..02d608e5274f 100644 --- a/docs/generators/kotlin-vertx.md +++ b/docs/generators/kotlin-vertx.md @@ -68,6 +68,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl ## RESERVED WORDS
          +
        • ApiResponse
        • abstract
        • actual
        • annotation
        • diff --git a/docs/generators/kotlin.md b/docs/generators/kotlin.md index 49e02994b749..cbf43a3a1e9e 100644 --- a/docs/generators/kotlin.md +++ b/docs/generators/kotlin.md @@ -79,6 +79,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl ## RESERVED WORDS
            +
          • ApiResponse
          • abstract
          • actual
          • annotation
          • diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java index e0fb899e2f35..0cd24435d482 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java @@ -98,6 +98,7 @@ public AbstractKotlinCodegen() { // this includes hard reserved words defined by https://github.com/JetBrains/kotlin/blob/master/core/descriptors/src/org/jetbrains/kotlin/renderer/KeywordStringsGenerated.java // as well as keywords from https://kotlinlang.org/docs/reference/keyword-reference.html reservedWords = new HashSet<>(Arrays.asList( + "ApiResponse", // Used in the auto-generated api client "abstract", "actual", "annotation", diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java index 80b54000dd81..3d2135e03c3c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java @@ -541,7 +541,7 @@ private void processJVMOkHttpLibrary(final String infrastructureFolder) { // jvm specific supporting files supportingFiles.add(new SupportingFile("infrastructure/Errors.kt.mustache", infrastructureFolder, "Errors.kt")); supportingFiles.add(new SupportingFile("infrastructure/ResponseExtensions.kt.mustache", infrastructureFolder, "ResponseExtensions.kt")); - supportingFiles.add(new SupportingFile("infrastructure/ApiInfrastructureResponse.kt.mustache", infrastructureFolder, "ApiInfrastructureResponse.kt")); + supportingFiles.add(new SupportingFile("infrastructure/ApiResponse.kt.mustache", infrastructureFolder, "ApiResponse.kt")); } private void processMultiplatformLibrary(final String infrastructureFolder) { diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache index 57dd2c62aaf4..f7a01d9dfbb9 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache @@ -13,7 +13,7 @@ import kotlinx.coroutines.withContext {{/useCoroutines}} {{/doNotUseRxAndCoroutines}} import {{packageName}}.infrastructure.ApiClient -import {{packageName}}.infrastructure.ApiInfrastructureResponse +import {{packageName}}.infrastructure.ApiResponse import {{packageName}}.infrastructure.ClientException import {{packageName}}.infrastructure.ClientError import {{packageName}}.infrastructure.ServerException @@ -76,7 +76,7 @@ import {{packageName}}.infrastructure.toMultiValue * {{summary}} * {{notes}} {{#allParams}}* @param {{{paramName}}} {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} - {{/allParams}}* @return ApiInfrastructureResponse<{{#returnType}}{{{returnType}}}?{{/returnType}}{{^returnType}}Unit?{{/returnType}}> + {{/allParams}}* @return ApiResponse<{{#returnType}}{{{returnType}}}?{{/returnType}}{{^returnType}}Unit?{{/returnType}}> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */{{#returnType}} @@ -85,7 +85,7 @@ import {{packageName}}.infrastructure.toMultiValue {{#isDeprecated}} @Deprecated(message = "This operation is deprecated.") {{/isDeprecated}} - {{^doNotUseRxAndCoroutines}}{{#useCoroutines}}suspend {{/useCoroutines}}{{/doNotUseRxAndCoroutines}}fun {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}: {{{dataType}}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : ApiInfrastructureResponse<{{#returnType}}{{{returnType}}}?{{/returnType}}{{^returnType}}Unit?{{/returnType}}>{{^doNotUseRxAndCoroutines}}{{#useCoroutines}} = withContext(Dispatchers.IO){{/useCoroutines}}{{/doNotUseRxAndCoroutines}} { + {{^doNotUseRxAndCoroutines}}{{#useCoroutines}}suspend {{/useCoroutines}}{{/doNotUseRxAndCoroutines}}fun {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}: {{{dataType}}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : ApiResponse<{{#returnType}}{{{returnType}}}?{{/returnType}}{{^returnType}}Unit?{{/returnType}}>{{^doNotUseRxAndCoroutines}}{{#useCoroutines}} = withContext(Dispatchers.IO){{/useCoroutines}}{{/doNotUseRxAndCoroutines}} { {{#isDeprecated}} @Suppress("DEPRECATION") {{/isDeprecated}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache index 8f30c1808e2c..78c16621cf8d 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache @@ -309,7 +309,7 @@ import com.squareup.moshi.adapter } {{/hasAuthMethods}} - protected {{#useCoroutines}}suspend {{/useCoroutines}}inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected {{#useCoroutines}}suspend {{/useCoroutines}}inline fun request(requestConfig: RequestConfig): ApiResponse { {{#jvm-okhttp3}} val httpUrl = HttpUrl.parse(baseUrl) ?: throw IllegalStateException("baseUrl is invalid.") {{/jvm-okhttp3}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiInfrastructureResponse.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiResponse.kt.mustache similarity index 76% rename from modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiInfrastructureResponse.kt.mustache rename to modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiResponse.kt.mustache index 98be9afd5fbc..d529ad5599f1 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiInfrastructureResponse.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiResponse.kt.mustache @@ -6,7 +6,7 @@ package {{packageName}}.infrastructure {{#nonPublicApi}}internal {{/nonPublicApi}}interface Response -{{#nonPublicApi}}internal {{/nonPublicApi}}abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { +{{#nonPublicApi}}internal {{/nonPublicApi}}abstract class ApiResponse(val responseType: ResponseType): Response { abstract val statusCode: Int abstract val headers: Map> } @@ -15,29 +15,29 @@ package {{packageName}}.infrastructure val data: T{{#nullableReturnType}}?{{/nullableReturnType}}, override val statusCode: Int = -1, override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) +): ApiResponse(ResponseType.Success) {{#nonPublicApi}}internal {{/nonPublicApi}}class Informational( val statusText: String, override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) +) : ApiResponse(ResponseType.Informational) {{#nonPublicApi}}internal {{/nonPublicApi}}class Redirection( override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) +) : ApiResponse(ResponseType.Redirection) {{#nonPublicApi}}internal {{/nonPublicApi}}class ClientError( val message: String? = null, val body: Any? = null, override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) +) : ApiResponse(ResponseType.ClientError) {{#nonPublicApi}}internal {{/nonPublicApi}}class ServerError( val message: String? = null, val body: Any? = null, override val statusCode: Int = -1, override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file +): ApiResponse(ResponseType.ServerError) diff --git a/samples/client/petstore/kotlin-enum-default-value/.openapi-generator/FILES b/samples/client/petstore/kotlin-enum-default-value/.openapi-generator/FILES index bb98f9a0031b..66329670bf9d 100644 --- a/samples/client/petstore/kotlin-enum-default-value/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-enum-default-value/.openapi-generator/FILES @@ -10,7 +10,7 @@ settings.gradle src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt diff --git a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt index e5f3a7b2fa5c..ef0c18333845 100644 --- a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt +++ b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.ModelWithEnumPropertyHavingDefault import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -78,13 +78,13 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath /** * * - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun operationWithHttpInfo() : ApiInfrastructureResponse { + fun operationWithHttpInfo() : ApiResponse { val localVariableConfig = operationRequestConfig() return request( diff --git a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 8a9c47045ed7..09194ef92717 100644 --- a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -145,7 +145,7 @@ open class ApiClient(val baseUrl: String) { } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") val url = httpUrl.newBuilder() diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt similarity index 73% rename from samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt rename to samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt index 9dc8d8dbbfaa..cf2cfaa95d91 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -6,7 +6,7 @@ enum class ResponseType { interface Response -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { +abstract class ApiResponse(val responseType: ResponseType): Response { abstract val statusCode: Int abstract val headers: Map> } @@ -15,29 +15,29 @@ class Success( val data: T, override val statusCode: Int = -1, override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) +): ApiResponse(ResponseType.Success) class Informational( val statusText: String, override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) +) : ApiResponse(ResponseType.Informational) class Redirection( override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) +) : ApiResponse(ResponseType.Redirection) class ClientError( val message: String? = null, val body: Any? = null, override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) +) : ApiResponse(ResponseType.ClientError) class ServerError( val message: String? = null, val body: Any? = null, override val statusCode: Int = -1, override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file +): ApiResponse(ResponseType.ServerError) diff --git a/samples/client/petstore/kotlin-gson/.openapi-generator/FILES b/samples/client/petstore/kotlin-gson/.openapi-generator/FILES index 1f38d3fbe2d3..d1f6eddcef2d 100644 --- a/samples/client/petstore/kotlin-gson/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-gson/.openapi-generator/FILES @@ -19,7 +19,7 @@ src/main/kotlin/org/openapitools/client/apis/StoreApi.kt src/main/kotlin/org/openapitools/client/apis/UserApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt @@ -30,8 +30,8 @@ src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt -src/main/kotlin/org/openapitools/client/models/ApiResponse.kt src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt src/main/kotlin/org/openapitools/client/models/Order.kt src/main/kotlin/org/openapitools/client/models/Pet.kt src/main/kotlin/org/openapitools/client/models/Tag.kt diff --git a/samples/client/petstore/kotlin-gson/README.md b/samples/client/petstore/kotlin-gson/README.md index 97f9b8166489..5ecae07a7add 100644 --- a/samples/client/petstore/kotlin-gson/README.md +++ b/samples/client/petstore/kotlin-gson/README.md @@ -60,8 +60,8 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) - [org.openapitools.client.models.Order](docs/Order.md) - [org.openapitools.client.models.Pet](docs/Pet.md) - [org.openapitools.client.models.Tag](docs/Tag.md) diff --git a/samples/client/petstore/kotlin-gson/docs/ApiResponse.md b/samples/client/petstore/kotlin-gson/docs/ApiResponse.md index 6b4c6bf27795..12f08d5cdef0 100644 --- a/samples/client/petstore/kotlin-gson/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-gson/docs/ApiResponse.md @@ -1,5 +1,5 @@ -# ApiResponse +# ModelApiResponse ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/kotlin-gson/docs/PetApi.md b/samples/client/petstore/kotlin-gson/docs/PetApi.md index 403e57a4b338..038c57e68ec5 100644 --- a/samples/client/petstore/kotlin-gson/docs/PetApi.md +++ b/samples/client/petstore/kotlin-gson/docs/PetApi.md @@ -354,7 +354,7 @@ Configure petstore_auth: # **uploadFile** -> ApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, additionalMetadata, file) uploads an image @@ -369,7 +369,7 @@ val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload try { - val result : ApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) + val result : ModelApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) println(result) } catch (e: ClientException) { println("4xx response calling PetApi#uploadFile") @@ -390,7 +390,7 @@ Name | Type | Description | Notes ### Return type -[**ApiResponse**](ApiResponse.md) +[**ModelApiResponse**](ModelApiResponse.md) ### Authorization diff --git a/samples/client/petstore/kotlin-gson/gradlew b/samples/client/petstore/kotlin-gson/gradlew old mode 100644 new mode 100755 diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index c3426fbd0a4a..b774e10e7b81 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -22,11 +22,11 @@ package org.openapitools.client.apis import java.io.IOException -import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -80,12 +80,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Add a new pet to the store * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun addPetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = addPetRequestConfig(body = body) return request( @@ -150,12 +150,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param petId Pet id to delete * @param apiKey (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { + fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) return request( @@ -220,13 +220,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by status * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -295,14 +295,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiResponse?> { @Suppress("DEPRECATION") val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) @@ -371,13 +371,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Find pet by ID * Returns a single pet * @param petId ID of pet to return - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { + fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) return request( @@ -440,12 +440,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Update an existing pet * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun updatePetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = updatePetRequestConfig(body = body) return request( @@ -512,12 +512,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet that needs to be updated * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { + fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) return request, Unit>( @@ -553,7 +553,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiResponse + * @return ModelApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response @@ -562,11 +562,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ModelApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse + ResponseType.Success -> (localVarResponse as Success<*>).data as ModelApiResponse ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.ClientError -> { @@ -586,16 +586,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { + fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - return request, ApiResponse>( + return request, ModelApiResponse>( localVariableConfig ) } diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index e905c41311dc..d9cc68f0042f 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { + fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) return request( @@ -145,13 +145,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) /** * Returns pet inventories by status * Returns a map of status codes to quantities - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { + fun getInventoryWithHttpInfo() : ApiResponse?> { val localVariableConfig = getInventoryRequestConfig() return request>( @@ -214,13 +214,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { + fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) return request( @@ -284,13 +284,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Place an order for a pet * * @param body order placed for purchasing the pet - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { + fun placeOrderWithHttpInfo(body: Order) : ApiResponse { val localVariableConfig = placeOrderRequestConfig(body = body) return request( diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 9381925680af..efbff7928151 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Create user * This can only be done by the logged in user. * @param body Created user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { + fun createUserWithHttpInfo(body: User) : ApiResponse { val localVariableConfig = createUserRequestConfig(body = body) return request( @@ -146,12 +146,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) return request, Unit>( @@ -213,12 +213,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) return request, Unit>( @@ -280,12 +280,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Delete user * This can only be done by the logged in user. * @param username The name that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun deleteUserWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = deleteUserRequestConfig(username = username) return request( @@ -348,13 +348,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Get user by user name * * @param username The name that needs to be fetched. Use user1 for testing. - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) return request( @@ -420,13 +420,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The user name for login * @param password The password for login in clear text - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { + fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) return request( @@ -492,12 +492,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { /** * Logs out current logged in user session * - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { + fun logoutUserWithHttpInfo() : ApiResponse { val localVariableConfig = logoutUserRequestConfig() return request( @@ -560,12 +560,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username name that need to be deleted * @param body Updated user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { + fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) return request( diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index f46f0ed6f553..5ac6cfd25b79 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -160,7 +160,7 @@ open class ApiClient(val baseUrl: String) { } } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") // take authMethod from operation diff --git a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt similarity index 73% rename from samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt rename to samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt index 9dc8d8dbbfaa..cf2cfaa95d91 100644 --- a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -6,7 +6,7 @@ enum class ResponseType { interface Response -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { +abstract class ApiResponse(val responseType: ResponseType): Response { abstract val statusCode: Int abstract val headers: Map> } @@ -15,29 +15,29 @@ class Success( val data: T, override val statusCode: Int = -1, override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) +): ApiResponse(ResponseType.Success) class Informational( val statusText: String, override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) +) : ApiResponse(ResponseType.Informational) class Redirection( override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) +) : ApiResponse(ResponseType.Redirection) class ClientError( val message: String? = null, val body: Any? = null, override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) +) : ApiResponse(ResponseType.ClientError) class ServerError( val message: String? = null, val body: Any? = null, override val statusCode: Int = -1, override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file +): ApiResponse(ResponseType.ServerError) diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt similarity index 96% rename from samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt rename to samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index b50d6f2bde47..773c82f431ae 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -31,7 +31,7 @@ import com.google.gson.annotations.SerializedName * @param message */ -data class ApiResponse ( +data class ModelApiResponse ( @SerializedName("code") val code: kotlin.Int? = null, diff --git a/samples/client/petstore/kotlin-jackson/.openapi-generator/FILES b/samples/client/petstore/kotlin-jackson/.openapi-generator/FILES index 816d952128d8..26ee35abac5c 100644 --- a/samples/client/petstore/kotlin-jackson/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-jackson/.openapi-generator/FILES @@ -19,15 +19,15 @@ src/main/kotlin/org/openapitools/client/apis/StoreApi.kt src/main/kotlin/org/openapitools/client/apis/UserApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt -src/main/kotlin/org/openapitools/client/models/ApiResponse.kt src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt src/main/kotlin/org/openapitools/client/models/Order.kt src/main/kotlin/org/openapitools/client/models/Pet.kt src/main/kotlin/org/openapitools/client/models/Tag.kt diff --git a/samples/client/petstore/kotlin-jackson/README.md b/samples/client/petstore/kotlin-jackson/README.md index 97f9b8166489..5ecae07a7add 100644 --- a/samples/client/petstore/kotlin-jackson/README.md +++ b/samples/client/petstore/kotlin-jackson/README.md @@ -60,8 +60,8 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) - [org.openapitools.client.models.Order](docs/Order.md) - [org.openapitools.client.models.Pet](docs/Pet.md) - [org.openapitools.client.models.Tag](docs/Tag.md) diff --git a/samples/client/petstore/kotlin-jackson/docs/ApiResponse.md b/samples/client/petstore/kotlin-jackson/docs/ApiResponse.md index 6b4c6bf27795..12f08d5cdef0 100644 --- a/samples/client/petstore/kotlin-jackson/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-jackson/docs/ApiResponse.md @@ -1,5 +1,5 @@ -# ApiResponse +# ModelApiResponse ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/kotlin-jackson/docs/PetApi.md b/samples/client/petstore/kotlin-jackson/docs/PetApi.md index 403e57a4b338..038c57e68ec5 100644 --- a/samples/client/petstore/kotlin-jackson/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jackson/docs/PetApi.md @@ -354,7 +354,7 @@ Configure petstore_auth: # **uploadFile** -> ApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, additionalMetadata, file) uploads an image @@ -369,7 +369,7 @@ val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload try { - val result : ApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) + val result : ModelApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) println(result) } catch (e: ClientException) { println("4xx response calling PetApi#uploadFile") @@ -390,7 +390,7 @@ Name | Type | Description | Notes ### Return type -[**ApiResponse**](ApiResponse.md) +[**ModelApiResponse**](ModelApiResponse.md) ### Authorization diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index c3426fbd0a4a..b774e10e7b81 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -22,11 +22,11 @@ package org.openapitools.client.apis import java.io.IOException -import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -80,12 +80,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Add a new pet to the store * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun addPetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = addPetRequestConfig(body = body) return request( @@ -150,12 +150,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param petId Pet id to delete * @param apiKey (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { + fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) return request( @@ -220,13 +220,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by status * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -295,14 +295,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiResponse?> { @Suppress("DEPRECATION") val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) @@ -371,13 +371,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Find pet by ID * Returns a single pet * @param petId ID of pet to return - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { + fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) return request( @@ -440,12 +440,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Update an existing pet * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun updatePetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = updatePetRequestConfig(body = body) return request( @@ -512,12 +512,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet that needs to be updated * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { + fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) return request, Unit>( @@ -553,7 +553,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiResponse + * @return ModelApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response @@ -562,11 +562,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ModelApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse + ResponseType.Success -> (localVarResponse as Success<*>).data as ModelApiResponse ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.ClientError -> { @@ -586,16 +586,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { + fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - return request, ApiResponse>( + return request, ModelApiResponse>( localVariableConfig ) } diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index e905c41311dc..d9cc68f0042f 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { + fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) return request( @@ -145,13 +145,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) /** * Returns pet inventories by status * Returns a map of status codes to quantities - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { + fun getInventoryWithHttpInfo() : ApiResponse?> { val localVariableConfig = getInventoryRequestConfig() return request>( @@ -214,13 +214,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { + fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) return request( @@ -284,13 +284,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Place an order for a pet * * @param body order placed for purchasing the pet - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { + fun placeOrderWithHttpInfo(body: Order) : ApiResponse { val localVariableConfig = placeOrderRequestConfig(body = body) return request( diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 9381925680af..efbff7928151 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Create user * This can only be done by the logged in user. * @param body Created user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { + fun createUserWithHttpInfo(body: User) : ApiResponse { val localVariableConfig = createUserRequestConfig(body = body) return request( @@ -146,12 +146,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) return request, Unit>( @@ -213,12 +213,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) return request, Unit>( @@ -280,12 +280,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Delete user * This can only be done by the logged in user. * @param username The name that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun deleteUserWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = deleteUserRequestConfig(username = username) return request( @@ -348,13 +348,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Get user by user name * * @param username The name that needs to be fetched. Use user1 for testing. - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) return request( @@ -420,13 +420,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The user name for login * @param password The password for login in clear text - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { + fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) return request( @@ -492,12 +492,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { /** * Logs out current logged in user session * - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { + fun logoutUserWithHttpInfo() : ApiResponse { val localVariableConfig = logoutUserRequestConfig() return request( @@ -560,12 +560,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username name that need to be deleted * @param body Updated user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { + fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) return request( diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index d01fa6041c35..4d9d2e534dee 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -160,7 +160,7 @@ open class ApiClient(val baseUrl: String) { } } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") // take authMethod from operation diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt similarity index 73% rename from samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt rename to samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt index 9dc8d8dbbfaa..cf2cfaa95d91 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -6,7 +6,7 @@ enum class ResponseType { interface Response -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { +abstract class ApiResponse(val responseType: ResponseType): Response { abstract val statusCode: Int abstract val headers: Map> } @@ -15,29 +15,29 @@ class Success( val data: T, override val statusCode: Int = -1, override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) +): ApiResponse(ResponseType.Success) class Informational( val statusText: String, override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) +) : ApiResponse(ResponseType.Informational) class Redirection( override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) +) : ApiResponse(ResponseType.Redirection) class ClientError( val message: String? = null, val body: Any? = null, override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) +) : ApiResponse(ResponseType.ClientError) class ServerError( val message: String? = null, val body: Any? = null, override val statusCode: Int = -1, override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file +): ApiResponse(ResponseType.ServerError) diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt similarity index 96% rename from samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt rename to samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 94a0b0b47d44..be6fc87dff10 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -31,7 +31,7 @@ import com.fasterxml.jackson.annotation.JsonProperty * @param message */ -data class ApiResponse ( +data class ModelApiResponse ( @field:JsonProperty("code") val code: kotlin.Int? = null, diff --git a/samples/client/petstore/kotlin-json-request-string/.openapi-generator/FILES b/samples/client/petstore/kotlin-json-request-string/.openapi-generator/FILES index 16c712325f82..c7a409ac169e 100644 --- a/samples/client/petstore/kotlin-json-request-string/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-json-request-string/.openapi-generator/FILES @@ -19,7 +19,7 @@ src/main/kotlin/org/openapitools/client/apis/StoreApi.kt src/main/kotlin/org/openapitools/client/apis/UserApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -33,8 +33,8 @@ src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt -src/main/kotlin/org/openapitools/client/models/ApiResponse.kt src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt src/main/kotlin/org/openapitools/client/models/Order.kt src/main/kotlin/org/openapitools/client/models/Pet.kt src/main/kotlin/org/openapitools/client/models/Tag.kt diff --git a/samples/client/petstore/kotlin-json-request-string/README.md b/samples/client/petstore/kotlin-json-request-string/README.md index f865de3689d3..56bfbfeeb941 100644 --- a/samples/client/petstore/kotlin-json-request-string/README.md +++ b/samples/client/petstore/kotlin-json-request-string/README.md @@ -60,8 +60,8 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) - [org.openapitools.client.models.Order](docs/Order.md) - [org.openapitools.client.models.Pet](docs/Pet.md) - [org.openapitools.client.models.Tag](docs/Tag.md) diff --git a/samples/client/petstore/kotlin-json-request-string/docs/ApiResponse.md b/samples/client/petstore/kotlin-json-request-string/docs/ApiResponse.md index 6b4c6bf27795..12f08d5cdef0 100644 --- a/samples/client/petstore/kotlin-json-request-string/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-json-request-string/docs/ApiResponse.md @@ -1,5 +1,5 @@ -# ApiResponse +# ModelApiResponse ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/kotlin-json-request-string/docs/PetApi.md b/samples/client/petstore/kotlin-json-request-string/docs/PetApi.md index 46b5ffc5506f..417acfb195b8 100644 --- a/samples/client/petstore/kotlin-json-request-string/docs/PetApi.md +++ b/samples/client/petstore/kotlin-json-request-string/docs/PetApi.md @@ -352,7 +352,7 @@ Configure petstore_auth: # **uploadFile** -> ApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, additionalMetadata, file) uploads an image @@ -367,7 +367,7 @@ val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload try { - val result : ApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) + val result : ModelApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) println(result) } catch (e: ClientException) { println("4xx response calling PetApi#uploadFile") @@ -388,7 +388,7 @@ Name | Type | Description | Notes ### Return type -[**ApiResponse**](ApiResponse.md) +[**ModelApiResponse**](ModelApiResponse.md) ### Authorization diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 54cc4bbc49f2..dcb8d97586b5 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -22,11 +22,11 @@ package org.openapitools.client.apis import java.io.IOException -import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -80,12 +80,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Add a new pet to the store * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun addPetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = addPetRequestConfig(body = body) return request( @@ -150,12 +150,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param petId Pet id to delete * @param apiKey (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { + fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) return request( @@ -222,14 +222,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiResponse?> { @Suppress("DEPRECATION") val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) @@ -298,13 +298,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Get all pets * * @param lastUpdated When this endpoint was hit last to help identify if the client already has the latest copy. (optional) - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getAllPetsWithHttpInfo(lastUpdated: java.time.OffsetDateTime?) : ApiInfrastructureResponse?> { + fun getAllPetsWithHttpInfo(lastUpdated: java.time.OffsetDateTime?) : ApiResponse?> { val localVariableConfig = getAllPetsRequestConfig(lastUpdated = lastUpdated) return request>( @@ -373,13 +373,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Find pet by ID * Returns a single pet * @param petId ID of pet to return - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { + fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) return request( @@ -442,12 +442,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Update an existing pet * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun updatePetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = updatePetRequestConfig(body = body) return request( @@ -514,12 +514,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet that needs to be updated * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { + fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) return request, Unit>( @@ -555,7 +555,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiResponse + * @return ModelApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response @@ -564,11 +564,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ModelApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse + ResponseType.Success -> (localVarResponse as Success<*>).data as ModelApiResponse ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.ClientError -> { @@ -588,16 +588,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { + fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - return request, ApiResponse>( + return request, ModelApiResponse>( localVariableConfig ) } diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index e905c41311dc..d9cc68f0042f 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { + fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) return request( @@ -145,13 +145,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) /** * Returns pet inventories by status * Returns a map of status codes to quantities - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { + fun getInventoryWithHttpInfo() : ApiResponse?> { val localVariableConfig = getInventoryRequestConfig() return request>( @@ -214,13 +214,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { + fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) return request( @@ -284,13 +284,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Place an order for a pet * * @param body order placed for purchasing the pet - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { + fun placeOrderWithHttpInfo(body: Order) : ApiResponse { val localVariableConfig = placeOrderRequestConfig(body = body) return request( diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 9381925680af..efbff7928151 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Create user * This can only be done by the logged in user. * @param body Created user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { + fun createUserWithHttpInfo(body: User) : ApiResponse { val localVariableConfig = createUserRequestConfig(body = body) return request( @@ -146,12 +146,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) return request, Unit>( @@ -213,12 +213,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) return request, Unit>( @@ -280,12 +280,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Delete user * This can only be done by the logged in user. * @param username The name that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun deleteUserWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = deleteUserRequestConfig(username = username) return request( @@ -348,13 +348,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Get user by user name * * @param username The name that needs to be fetched. Use user1 for testing. - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) return request( @@ -420,13 +420,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The user name for login * @param password The password for login in clear text - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { + fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) return request( @@ -492,12 +492,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { /** * Logs out current logged in user session * - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { + fun logoutUserWithHttpInfo() : ApiResponse { val localVariableConfig = logoutUserRequestConfig() return request( @@ -560,12 +560,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username name that need to be deleted * @param body Updated user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { + fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) return request( diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 917c3d3f3d29..c344dff4af62 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -167,7 +167,7 @@ open class ApiClient(val baseUrl: String) { } } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") // take authMethod from operation diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt similarity index 73% rename from samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt rename to samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt index 9dc8d8dbbfaa..cf2cfaa95d91 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -6,7 +6,7 @@ enum class ResponseType { interface Response -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { +abstract class ApiResponse(val responseType: ResponseType): Response { abstract val statusCode: Int abstract val headers: Map> } @@ -15,29 +15,29 @@ class Success( val data: T, override val statusCode: Int = -1, override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) +): ApiResponse(ResponseType.Success) class Informational( val statusText: String, override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) +) : ApiResponse(ResponseType.Informational) class Redirection( override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) +) : ApiResponse(ResponseType.Redirection) class ClientError( val message: String? = null, val body: Any? = null, override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) +) : ApiResponse(ResponseType.ClientError) class ServerError( val message: String? = null, val body: Any? = null, override val statusCode: Int = -1, override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file +): ApiResponse(ResponseType.ServerError) diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt similarity index 96% rename from samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt rename to samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index c53f3e313eca..61b35faee86b 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -34,7 +34,7 @@ import kotlinx.parcelize.Parcelize */ @Parcelize -data class ApiResponse ( +data class ModelApiResponse ( @Json(name = "code") val code: kotlin.Int? = null, diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/FILES b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/FILES index 1f38d3fbe2d3..d1f6eddcef2d 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/FILES @@ -19,7 +19,7 @@ src/main/kotlin/org/openapitools/client/apis/StoreApi.kt src/main/kotlin/org/openapitools/client/apis/UserApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt @@ -30,8 +30,8 @@ src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt -src/main/kotlin/org/openapitools/client/models/ApiResponse.kt src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt src/main/kotlin/org/openapitools/client/models/Order.kt src/main/kotlin/org/openapitools/client/models/Pet.kt src/main/kotlin/org/openapitools/client/models/Tag.kt diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/README.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/README.md index 97f9b8166489..5ecae07a7add 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/README.md +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/README.md @@ -60,8 +60,8 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) - [org.openapitools.client.models.Order](docs/Order.md) - [org.openapitools.client.models.Pet](docs/Pet.md) - [org.openapitools.client.models.Tag](docs/Tag.md) diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ApiResponse.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ApiResponse.md index 6b4c6bf27795..12f08d5cdef0 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ApiResponse.md @@ -1,5 +1,5 @@ -# ApiResponse +# ModelApiResponse ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/PetApi.md index 403e57a4b338..038c57e68ec5 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/PetApi.md @@ -354,7 +354,7 @@ Configure petstore_auth: # **uploadFile** -> ApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, additionalMetadata, file) uploads an image @@ -369,7 +369,7 @@ val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload try { - val result : ApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) + val result : ModelApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) println(result) } catch (e: ClientException) { println("4xx response calling PetApi#uploadFile") @@ -390,7 +390,7 @@ Name | Type | Description | Notes ### Return type -[**ApiResponse**](ApiResponse.md) +[**ModelApiResponse**](ModelApiResponse.md) ### Authorization diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 9c9bdde5a87a..1cd9901c0f91 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -22,13 +22,13 @@ package org.openapitools.client.apis import java.io.IOException -import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -82,12 +82,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Add a new pet to the store * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - suspend fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + suspend fun addPetWithHttpInfo(body: Pet) : ApiResponse = withContext(Dispatchers.IO) { val localVariableConfig = addPetRequestConfig(body = body) return@withContext request( @@ -152,12 +152,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param petId Pet id to delete * @param apiKey (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - suspend fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + suspend fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiResponse = withContext(Dispatchers.IO) { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) return@withContext request( @@ -222,13 +222,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by status * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - suspend fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> = withContext(Dispatchers.IO) { + suspend fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> = withContext(Dispatchers.IO) { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return@withContext request>( @@ -297,14 +297,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") - suspend fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> = withContext(Dispatchers.IO) { + suspend fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiResponse?> = withContext(Dispatchers.IO) { @Suppress("DEPRECATION") val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) @@ -373,13 +373,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Find pet by ID * Returns a single pet * @param petId ID of pet to return - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - suspend fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + suspend fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiResponse = withContext(Dispatchers.IO) { val localVariableConfig = getPetByIdRequestConfig(petId = petId) return@withContext request( @@ -442,12 +442,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Update an existing pet * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - suspend fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + suspend fun updatePetWithHttpInfo(body: Pet) : ApiResponse = withContext(Dispatchers.IO) { val localVariableConfig = updatePetRequestConfig(body = body) return@withContext request( @@ -514,12 +514,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet that needs to be updated * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - suspend fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + suspend fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiResponse = withContext(Dispatchers.IO) { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) return@withContext request, Unit>( @@ -555,7 +555,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiResponse + * @return ModelApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response @@ -564,11 +564,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse = withContext(Dispatchers.IO) { + suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ModelApiResponse = withContext(Dispatchers.IO) { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return@withContext when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse + ResponseType.Success -> (localVarResponse as Success<*>).data as ModelApiResponse ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.ClientError -> { @@ -588,16 +588,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - suspend fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + suspend fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse = withContext(Dispatchers.IO) { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - return@withContext request, ApiResponse>( + return@withContext request, ModelApiResponse>( localVariableConfig ) } diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 94c499c7b7f7..430d9449c484 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -27,7 +27,7 @@ import org.openapitools.client.models.Order import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -81,12 +81,12 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - suspend fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + suspend fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiResponse = withContext(Dispatchers.IO) { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) return@withContext request( @@ -147,13 +147,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) /** * Returns pet inventories by status * Returns a map of status codes to quantities - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - suspend fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> = withContext(Dispatchers.IO) { + suspend fun getInventoryWithHttpInfo() : ApiResponse?> = withContext(Dispatchers.IO) { val localVariableConfig = getInventoryRequestConfig() return@withContext request>( @@ -216,13 +216,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - suspend fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + suspend fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiResponse = withContext(Dispatchers.IO) { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) return@withContext request( @@ -286,13 +286,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Place an order for a pet * * @param body order placed for purchasing the pet - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - suspend fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + suspend fun placeOrderWithHttpInfo(body: Order) : ApiResponse = withContext(Dispatchers.IO) { val localVariableConfig = placeOrderRequestConfig(body = body) return@withContext request( diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 8439a7f2bdbe..d318fa7477df 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -27,7 +27,7 @@ import org.openapitools.client.models.User import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -81,12 +81,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Create user * This can only be done by the logged in user. * @param body Created user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - suspend fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + suspend fun createUserWithHttpInfo(body: User) : ApiResponse = withContext(Dispatchers.IO) { val localVariableConfig = createUserRequestConfig(body = body) return@withContext request( @@ -148,12 +148,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - suspend fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + suspend fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse = withContext(Dispatchers.IO) { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) return@withContext request, Unit>( @@ -215,12 +215,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - suspend fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + suspend fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse = withContext(Dispatchers.IO) { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) return@withContext request, Unit>( @@ -282,12 +282,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Delete user * This can only be done by the logged in user. * @param username The name that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - suspend fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + suspend fun deleteUserWithHttpInfo(username: kotlin.String) : ApiResponse = withContext(Dispatchers.IO) { val localVariableConfig = deleteUserRequestConfig(username = username) return@withContext request( @@ -350,13 +350,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Get user by user name * * @param username The name that needs to be fetched. Use user1 for testing. - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - suspend fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + suspend fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiResponse = withContext(Dispatchers.IO) { val localVariableConfig = getUserByNameRequestConfig(username = username) return@withContext request( @@ -422,13 +422,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The user name for login * @param password The password for login in clear text - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - suspend fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + suspend fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiResponse = withContext(Dispatchers.IO) { val localVariableConfig = loginUserRequestConfig(username = username, password = password) return@withContext request( @@ -494,12 +494,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { /** * Logs out current logged in user session * - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - suspend fun logoutUserWithHttpInfo() : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + suspend fun logoutUserWithHttpInfo() : ApiResponse = withContext(Dispatchers.IO) { val localVariableConfig = logoutUserRequestConfig() return@withContext request( @@ -562,12 +562,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username name that need to be deleted * @param body Updated user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - suspend fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + suspend fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiResponse = withContext(Dispatchers.IO) { val localVariableConfig = updateUserRequestConfig(username = username, body = body) return@withContext request( diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 141689f40f80..43f89e88cbdb 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -163,7 +163,7 @@ open class ApiClient(val baseUrl: String) { } } - protected suspend inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected suspend inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") // take authMethod from operation diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbfaa..000000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt new file mode 100644 index 000000000000..cf2cfaa95d91 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -0,0 +1,43 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +interface Response + +abstract class ApiResponse(val responseType: ResponseType): Response { + abstract val statusCode: Int + abstract val headers: Map> +} + +class Success( + val data: T, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +): ApiResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Redirection) + +class ClientError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiResponse(ResponseType.ServerError) diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt similarity index 97% rename from samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index dfb777a87f72..16e2038ba9a0 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -32,7 +32,7 @@ import java.io.Serializable * @param message */ -data class ApiResponse ( +data class ModelApiResponse ( @SerializedName("code") val code: kotlin.Int? = null, diff --git a/samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/FILES b/samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/FILES index 16c712325f82..c7a409ac169e 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/FILES @@ -19,7 +19,7 @@ src/main/kotlin/org/openapitools/client/apis/StoreApi.kt src/main/kotlin/org/openapitools/client/apis/UserApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -33,8 +33,8 @@ src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt -src/main/kotlin/org/openapitools/client/models/ApiResponse.kt src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt src/main/kotlin/org/openapitools/client/models/Order.kt src/main/kotlin/org/openapitools/client/models/Pet.kt src/main/kotlin/org/openapitools/client/models/Tag.kt diff --git a/samples/client/petstore/kotlin-moshi-codegen/README.md b/samples/client/petstore/kotlin-moshi-codegen/README.md index 97f9b8166489..5ecae07a7add 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/README.md +++ b/samples/client/petstore/kotlin-moshi-codegen/README.md @@ -60,8 +60,8 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) - [org.openapitools.client.models.Order](docs/Order.md) - [org.openapitools.client.models.Pet](docs/Pet.md) - [org.openapitools.client.models.Tag](docs/Tag.md) diff --git a/samples/client/petstore/kotlin-moshi-codegen/docs/ApiResponse.md b/samples/client/petstore/kotlin-moshi-codegen/docs/ApiResponse.md index 6b4c6bf27795..12f08d5cdef0 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-moshi-codegen/docs/ApiResponse.md @@ -1,5 +1,5 @@ -# ApiResponse +# ModelApiResponse ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/kotlin-moshi-codegen/docs/PetApi.md b/samples/client/petstore/kotlin-moshi-codegen/docs/PetApi.md index 403e57a4b338..038c57e68ec5 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/docs/PetApi.md +++ b/samples/client/petstore/kotlin-moshi-codegen/docs/PetApi.md @@ -354,7 +354,7 @@ Configure petstore_auth: # **uploadFile** -> ApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, additionalMetadata, file) uploads an image @@ -369,7 +369,7 @@ val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload try { - val result : ApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) + val result : ModelApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) println(result) } catch (e: ClientException) { println("4xx response calling PetApi#uploadFile") @@ -390,7 +390,7 @@ Name | Type | Description | Notes ### Return type -[**ApiResponse**](ApiResponse.md) +[**ModelApiResponse**](ModelApiResponse.md) ### Authorization diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index c3426fbd0a4a..b774e10e7b81 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -22,11 +22,11 @@ package org.openapitools.client.apis import java.io.IOException -import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -80,12 +80,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Add a new pet to the store * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun addPetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = addPetRequestConfig(body = body) return request( @@ -150,12 +150,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param petId Pet id to delete * @param apiKey (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { + fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) return request( @@ -220,13 +220,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by status * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -295,14 +295,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiResponse?> { @Suppress("DEPRECATION") val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) @@ -371,13 +371,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Find pet by ID * Returns a single pet * @param petId ID of pet to return - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { + fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) return request( @@ -440,12 +440,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Update an existing pet * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun updatePetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = updatePetRequestConfig(body = body) return request( @@ -512,12 +512,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet that needs to be updated * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { + fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) return request, Unit>( @@ -553,7 +553,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiResponse + * @return ModelApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response @@ -562,11 +562,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ModelApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse + ResponseType.Success -> (localVarResponse as Success<*>).data as ModelApiResponse ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.ClientError -> { @@ -586,16 +586,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { + fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - return request, ApiResponse>( + return request, ModelApiResponse>( localVariableConfig ) } diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index e905c41311dc..d9cc68f0042f 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { + fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) return request( @@ -145,13 +145,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) /** * Returns pet inventories by status * Returns a map of status codes to quantities - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { + fun getInventoryWithHttpInfo() : ApiResponse?> { val localVariableConfig = getInventoryRequestConfig() return request>( @@ -214,13 +214,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { + fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) return request( @@ -284,13 +284,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Place an order for a pet * * @param body order placed for purchasing the pet - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { + fun placeOrderWithHttpInfo(body: Order) : ApiResponse { val localVariableConfig = placeOrderRequestConfig(body = body) return request( diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 9381925680af..efbff7928151 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Create user * This can only be done by the logged in user. * @param body Created user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { + fun createUserWithHttpInfo(body: User) : ApiResponse { val localVariableConfig = createUserRequestConfig(body = body) return request( @@ -146,12 +146,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) return request, Unit>( @@ -213,12 +213,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) return request, Unit>( @@ -280,12 +280,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Delete user * This can only be done by the logged in user. * @param username The name that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun deleteUserWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = deleteUserRequestConfig(username = username) return request( @@ -348,13 +348,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Get user by user name * * @param username The name that needs to be fetched. Use user1 for testing. - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) return request( @@ -420,13 +420,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The user name for login * @param password The password for login in clear text - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { + fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) return request( @@ -492,12 +492,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { /** * Logs out current logged in user session * - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { + fun logoutUserWithHttpInfo() : ApiResponse { val localVariableConfig = logoutUserRequestConfig() return request( @@ -560,12 +560,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username name that need to be deleted * @param body Updated user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { + fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) return request( diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index c218caafae56..7282e53200b6 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -161,7 +161,7 @@ open class ApiClient(val baseUrl: String) { } } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") // take authMethod from operation diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbfaa..000000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt new file mode 100644 index 000000000000..cf2cfaa95d91 --- /dev/null +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -0,0 +1,43 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +interface Response + +abstract class ApiResponse(val responseType: ResponseType): Response { + abstract val statusCode: Int + abstract val headers: Map> +} + +class Success( + val data: T, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +): ApiResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Redirection) + +class ClientError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiResponse(ResponseType.ServerError) diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt similarity index 96% rename from samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt rename to samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 9db3de682287..1921982e7837 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -32,7 +32,7 @@ import com.squareup.moshi.JsonClass * @param message */ @JsonClass(generateAdapter = true) -data class ApiResponse ( +data class ModelApiResponse ( @Json(name = "code") val code: kotlin.Int? = null, diff --git a/samples/client/petstore/kotlin-multiplatform/.openapi-generator/FILES b/samples/client/petstore/kotlin-multiplatform/.openapi-generator/FILES index d95b6af6c45f..c917cc86876d 100644 --- a/samples/client/petstore/kotlin-multiplatform/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-multiplatform/.openapi-generator/FILES @@ -26,8 +26,8 @@ src/commonMain/kotlin/org/openapitools/client/infrastructure/HttpResponse.kt src/commonMain/kotlin/org/openapitools/client/infrastructure/OctetByteArray.kt src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt -src/commonMain/kotlin/org/openapitools/client/models/ApiResponse.kt src/commonMain/kotlin/org/openapitools/client/models/Category.kt +src/commonMain/kotlin/org/openapitools/client/models/ModelApiResponse.kt src/commonMain/kotlin/org/openapitools/client/models/Order.kt src/commonMain/kotlin/org/openapitools/client/models/Pet.kt src/commonMain/kotlin/org/openapitools/client/models/Tag.kt diff --git a/samples/client/petstore/kotlin-multiplatform/README.md b/samples/client/petstore/kotlin-multiplatform/README.md index 28a4e3f12011..0e965d57d6f6 100644 --- a/samples/client/petstore/kotlin-multiplatform/README.md +++ b/samples/client/petstore/kotlin-multiplatform/README.md @@ -51,8 +51,8 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) - [org.openapitools.client.models.Order](docs/Order.md) - [org.openapitools.client.models.Pet](docs/Pet.md) - [org.openapitools.client.models.Tag](docs/Tag.md) diff --git a/samples/client/petstore/kotlin-multiplatform/docs/ApiResponse.md b/samples/client/petstore/kotlin-multiplatform/docs/ApiResponse.md index 6b4c6bf27795..12f08d5cdef0 100644 --- a/samples/client/petstore/kotlin-multiplatform/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-multiplatform/docs/ApiResponse.md @@ -1,5 +1,5 @@ -# ApiResponse +# ModelApiResponse ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/kotlin-multiplatform/docs/PetApi.md b/samples/client/petstore/kotlin-multiplatform/docs/PetApi.md index 7b3efc23d8bf..efde11091c54 100644 --- a/samples/client/petstore/kotlin-multiplatform/docs/PetApi.md +++ b/samples/client/petstore/kotlin-multiplatform/docs/PetApi.md @@ -354,7 +354,7 @@ Configure petstore_auth: # **uploadFile** -> ApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, additionalMetadata, file) uploads an image @@ -369,7 +369,7 @@ val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server val file : io.ktor.client.request.forms.InputProvider = BINARY_DATA_HERE // io.ktor.client.request.forms.InputProvider | file to upload try { - val result : ApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) + val result : ModelApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) println(result) } catch (e: ClientException) { println("4xx response calling PetApi#uploadFile") @@ -390,7 +390,7 @@ Name | Type | Description | Notes ### Return type -[**ApiResponse**](ApiResponse.md) +[**ModelApiResponse**](ModelApiResponse.md) ### Authorization diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/PetApi.kt index fe81cdf5bc0d..1cdbc9d10529 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/PetApi.kt @@ -20,7 +20,7 @@ package org.openapitools.client.apis -import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet import org.openapitools.client.infrastructure.* @@ -303,10 +303,10 @@ class PetApi( * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiResponse + * @return ModelApiResponse */ @Suppress("UNCHECKED_CAST") - suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: io.ktor.client.request.forms.InputProvider?): HttpResponse { + suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: io.ktor.client.request.forms.InputProvider?): HttpResponse { val localVariableAuthNames = listOf("petstore_auth") diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ModelApiResponse.kt similarity index 97% rename from samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ApiResponse.kt rename to samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 0358a25b5409..614529156e74 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -33,7 +33,7 @@ import kotlinx.serialization.encoding.* * @param message */ @Serializable -data class ApiResponse ( +data class ModelApiResponse ( @SerialName(value = "code") val code: kotlin.Int? = null, diff --git a/samples/client/petstore/kotlin-nonpublic/.openapi-generator/FILES b/samples/client/petstore/kotlin-nonpublic/.openapi-generator/FILES index 16c712325f82..c7a409ac169e 100644 --- a/samples/client/petstore/kotlin-nonpublic/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-nonpublic/.openapi-generator/FILES @@ -19,7 +19,7 @@ src/main/kotlin/org/openapitools/client/apis/StoreApi.kt src/main/kotlin/org/openapitools/client/apis/UserApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -33,8 +33,8 @@ src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt -src/main/kotlin/org/openapitools/client/models/ApiResponse.kt src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt src/main/kotlin/org/openapitools/client/models/Order.kt src/main/kotlin/org/openapitools/client/models/Pet.kt src/main/kotlin/org/openapitools/client/models/Tag.kt diff --git a/samples/client/petstore/kotlin-nonpublic/README.md b/samples/client/petstore/kotlin-nonpublic/README.md index 97f9b8166489..5ecae07a7add 100644 --- a/samples/client/petstore/kotlin-nonpublic/README.md +++ b/samples/client/petstore/kotlin-nonpublic/README.md @@ -60,8 +60,8 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) - [org.openapitools.client.models.Order](docs/Order.md) - [org.openapitools.client.models.Pet](docs/Pet.md) - [org.openapitools.client.models.Tag](docs/Tag.md) diff --git a/samples/client/petstore/kotlin-nonpublic/docs/ApiResponse.md b/samples/client/petstore/kotlin-nonpublic/docs/ApiResponse.md index 6b4c6bf27795..12f08d5cdef0 100644 --- a/samples/client/petstore/kotlin-nonpublic/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-nonpublic/docs/ApiResponse.md @@ -1,5 +1,5 @@ -# ApiResponse +# ModelApiResponse ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/kotlin-nonpublic/docs/PetApi.md b/samples/client/petstore/kotlin-nonpublic/docs/PetApi.md index 403e57a4b338..038c57e68ec5 100644 --- a/samples/client/petstore/kotlin-nonpublic/docs/PetApi.md +++ b/samples/client/petstore/kotlin-nonpublic/docs/PetApi.md @@ -354,7 +354,7 @@ Configure petstore_auth: # **uploadFile** -> ApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, additionalMetadata, file) uploads an image @@ -369,7 +369,7 @@ val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload try { - val result : ApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) + val result : ModelApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) println(result) } catch (e: ClientException) { println("4xx response calling PetApi#uploadFile") @@ -390,7 +390,7 @@ Name | Type | Description | Notes ### Return type -[**ApiResponse**](ApiResponse.md) +[**ModelApiResponse**](ModelApiResponse.md) ### Authorization diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 413c98693aa1..33d1e110f122 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -22,11 +22,11 @@ package org.openapitools.client.apis import java.io.IOException -import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -80,12 +80,12 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * Add a new pet to the store * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun addPetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = addPetRequestConfig(body = body) return request( @@ -150,12 +150,12 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * * @param petId Pet id to delete * @param apiKey (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { + fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) return request( @@ -220,13 +220,13 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * Finds Pets by status * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -295,14 +295,14 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiResponse?> { @Suppress("DEPRECATION") val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) @@ -371,13 +371,13 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * Find pet by ID * Returns a single pet * @param petId ID of pet to return - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { + fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) return request( @@ -440,12 +440,12 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * Update an existing pet * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun updatePetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = updatePetRequestConfig(body = body) return request( @@ -512,12 +512,12 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * @param petId ID of pet that needs to be updated * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { + fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) return request, Unit>( @@ -553,7 +553,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiResponse + * @return ModelApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response @@ -562,11 +562,11 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ModelApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse + ResponseType.Success -> (localVarResponse as Success<*>).data as ModelApiResponse ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.ClientError -> { @@ -586,16 +586,16 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { + fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - return request, ApiResponse>( + return request, ModelApiResponse>( localVariableConfig ) } diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index eb69e3afbd35..02201f04d42b 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { + fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) return request( @@ -145,13 +145,13 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b /** * Returns pet inventories by status * Returns a map of status codes to quantities - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { + fun getInventoryWithHttpInfo() : ApiResponse?> { val localVariableConfig = getInventoryRequestConfig() return request>( @@ -214,13 +214,13 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { + fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) return request( @@ -284,13 +284,13 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b * Place an order for a pet * * @param body order placed for purchasing the pet - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { + fun placeOrderWithHttpInfo(body: Order) : ApiResponse { val localVariableConfig = placeOrderRequestConfig(body = body) return request( diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 75996ae34129..3475e9c4695e 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * Create user * This can only be done by the logged in user. * @param body Created user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { + fun createUserWithHttpInfo(body: User) : ApiResponse { val localVariableConfig = createUserRequestConfig(body = body) return request( @@ -146,12 +146,12 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) return request, Unit>( @@ -213,12 +213,12 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) return request, Unit>( @@ -280,12 +280,12 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * Delete user * This can only be done by the logged in user. * @param username The name that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun deleteUserWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = deleteUserRequestConfig(username = username) return request( @@ -348,13 +348,13 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * Get user by user name * * @param username The name that needs to be fetched. Use user1 for testing. - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) return request( @@ -420,13 +420,13 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * * @param username The user name for login * @param password The password for login in clear text - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { + fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) return request( @@ -492,12 +492,12 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba /** * Logs out current logged in user session * - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { + fun logoutUserWithHttpInfo() : ApiResponse { val localVariableConfig = logoutUserRequestConfig() return request( @@ -560,12 +560,12 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * This can only be done by the logged in user. * @param username name that need to be deleted * @param body Updated user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { + fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) return request( diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 313f2e165273..6ef92322fb16 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -161,7 +161,7 @@ internal open class ApiClient(val baseUrl: String) { } } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") // take authMethod from operation diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt similarity index 73% rename from samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt rename to samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt index c618544573e4..64824828dd41 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -6,7 +6,7 @@ internal enum class ResponseType { internal interface Response -internal abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { +internal abstract class ApiResponse(val responseType: ResponseType): Response { abstract val statusCode: Int abstract val headers: Map> } @@ -15,29 +15,29 @@ internal class Success( val data: T, override val statusCode: Int = -1, override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) +): ApiResponse(ResponseType.Success) internal class Informational( val statusText: String, override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) +) : ApiResponse(ResponseType.Informational) internal class Redirection( override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) +) : ApiResponse(ResponseType.Redirection) internal class ClientError( val message: String? = null, val body: Any? = null, override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) +) : ApiResponse(ResponseType.ClientError) internal class ServerError( val message: String? = null, val body: Any? = null, override val statusCode: Int = -1, override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file +): ApiResponse(ResponseType.ServerError) diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt new file mode 100644 index 000000000000..43947587cfe1 --- /dev/null +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -0,0 +1,46 @@ +/** + * OpenAPI 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 + * + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.squareup.moshi.Json + +/** + * Describes the result of uploading an image resource + * + * @param code + * @param type + * @param message + */ + +internal data class ModelApiResponse ( + + @Json(name = "code") + val code: kotlin.Int? = null, + + @Json(name = "type") + val type: kotlin.String? = null, + + @Json(name = "message") + val message: kotlin.String? = null + +) + diff --git a/samples/client/petstore/kotlin-nullable/.openapi-generator/FILES b/samples/client/petstore/kotlin-nullable/.openapi-generator/FILES index 16c712325f82..c7a409ac169e 100644 --- a/samples/client/petstore/kotlin-nullable/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-nullable/.openapi-generator/FILES @@ -19,7 +19,7 @@ src/main/kotlin/org/openapitools/client/apis/StoreApi.kt src/main/kotlin/org/openapitools/client/apis/UserApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -33,8 +33,8 @@ src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt -src/main/kotlin/org/openapitools/client/models/ApiResponse.kt src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt src/main/kotlin/org/openapitools/client/models/Order.kt src/main/kotlin/org/openapitools/client/models/Pet.kt src/main/kotlin/org/openapitools/client/models/Tag.kt diff --git a/samples/client/petstore/kotlin-nullable/README.md b/samples/client/petstore/kotlin-nullable/README.md index 97f9b8166489..5ecae07a7add 100644 --- a/samples/client/petstore/kotlin-nullable/README.md +++ b/samples/client/petstore/kotlin-nullable/README.md @@ -60,8 +60,8 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) - [org.openapitools.client.models.Order](docs/Order.md) - [org.openapitools.client.models.Pet](docs/Pet.md) - [org.openapitools.client.models.Tag](docs/Tag.md) diff --git a/samples/client/petstore/kotlin-nullable/docs/ApiResponse.md b/samples/client/petstore/kotlin-nullable/docs/ApiResponse.md index 6b4c6bf27795..12f08d5cdef0 100644 --- a/samples/client/petstore/kotlin-nullable/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-nullable/docs/ApiResponse.md @@ -1,5 +1,5 @@ -# ApiResponse +# ModelApiResponse ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/kotlin-nullable/docs/PetApi.md b/samples/client/petstore/kotlin-nullable/docs/PetApi.md index e769fecd538b..be940c52ee7e 100644 --- a/samples/client/petstore/kotlin-nullable/docs/PetApi.md +++ b/samples/client/petstore/kotlin-nullable/docs/PetApi.md @@ -354,7 +354,7 @@ Configure petstore_auth: # **uploadFile** -> ApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, additionalMetadata, file) uploads an image @@ -369,7 +369,7 @@ val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload try { - val result : ApiResponse? = apiInstance.uploadFile(petId, additionalMetadata, file) + val result : ModelApiResponse? = apiInstance.uploadFile(petId, additionalMetadata, file) println(result) } catch (e: ClientException) { println("4xx response calling PetApi#uploadFile") @@ -390,7 +390,7 @@ Name | Type | Description | Notes ### Return type -[**ApiResponse**](ApiResponse.md) +[**ModelApiResponse**](ModelApiResponse.md) ### Authorization diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index ffa00253a362..8f8335f8b75b 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -22,11 +22,11 @@ package org.openapitools.client.apis import java.io.IOException -import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -80,12 +80,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Add a new pet to the store * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun addPetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = addPetRequestConfig(body = body) return request( @@ -150,12 +150,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param petId Pet id to delete * @param apiKey (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { + fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) return request( @@ -220,13 +220,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by status * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -295,14 +295,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiResponse?> { @Suppress("DEPRECATION") val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) @@ -371,13 +371,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Find pet by ID * Returns a single pet * @param petId ID of pet to return - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { + fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) return request( @@ -440,12 +440,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Update an existing pet * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun updatePetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = updatePetRequestConfig(body = body) return request( @@ -512,12 +512,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet that needs to be updated * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { + fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) return request, Unit>( @@ -553,7 +553,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiResponse or null + * @return ModelApiResponse or null * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response @@ -562,11 +562,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse? { + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ModelApiResponse? { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse? + ResponseType.Success -> (localVarResponse as Success<*>).data as ModelApiResponse? ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.ClientError -> { @@ -586,16 +586,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { + fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - return request, ApiResponse>( + return request, ModelApiResponse>( localVariableConfig ) } diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 28c31e3db41a..b35fda447217 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { + fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) return request( @@ -145,13 +145,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) /** * Returns pet inventories by status * Returns a map of status codes to quantities - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { + fun getInventoryWithHttpInfo() : ApiResponse?> { val localVariableConfig = getInventoryRequestConfig() return request>( @@ -214,13 +214,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { + fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) return request( @@ -284,13 +284,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Place an order for a pet * * @param body order placed for purchasing the pet - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { + fun placeOrderWithHttpInfo(body: Order) : ApiResponse { val localVariableConfig = placeOrderRequestConfig(body = body) return request( diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 9997944fa994..87ad7db8960f 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Create user * This can only be done by the logged in user. * @param body Created user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { + fun createUserWithHttpInfo(body: User) : ApiResponse { val localVariableConfig = createUserRequestConfig(body = body) return request( @@ -146,12 +146,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) return request, Unit>( @@ -213,12 +213,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) return request, Unit>( @@ -280,12 +280,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Delete user * This can only be done by the logged in user. * @param username The name that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun deleteUserWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = deleteUserRequestConfig(username = username) return request( @@ -348,13 +348,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Get user by user name * * @param username The name that needs to be fetched. Use user1 for testing. - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) return request( @@ -420,13 +420,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The user name for login * @param password The password for login in clear text - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { + fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) return request( @@ -492,12 +492,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { /** * Logs out current logged in user session * - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { + fun logoutUserWithHttpInfo() : ApiResponse { val localVariableConfig = logoutUserRequestConfig() return request( @@ -560,12 +560,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username name that need to be deleted * @param body Updated user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { + fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) return request( diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index c218caafae56..7282e53200b6 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -161,7 +161,7 @@ open class ApiClient(val baseUrl: String) { } } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") // take authMethod from operation diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt similarity index 73% rename from samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt rename to samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt index 77066de4e559..20ac25b12500 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -6,7 +6,7 @@ enum class ResponseType { interface Response -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { +abstract class ApiResponse(val responseType: ResponseType): Response { abstract val statusCode: Int abstract val headers: Map> } @@ -15,29 +15,29 @@ class Success( val data: T?, override val statusCode: Int = -1, override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) +): ApiResponse(ResponseType.Success) class Informational( val statusText: String, override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) +) : ApiResponse(ResponseType.Informational) class Redirection( override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) +) : ApiResponse(ResponseType.Redirection) class ClientError( val message: String? = null, val body: Any? = null, override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) +) : ApiResponse(ResponseType.ClientError) class ServerError( val message: String? = null, val body: Any? = null, override val statusCode: Int = -1, override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file +): ApiResponse(ResponseType.ServerError) diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt similarity index 97% rename from samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt rename to samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 617982fdfe3b..5f584a05ac0c 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -32,7 +32,7 @@ import java.io.Serializable * @param message */ -data class ApiResponse ( +data class ModelApiResponse ( @Json(name = "code") val code: kotlin.Int? = null, diff --git a/samples/client/petstore/kotlin-okhttp3/.openapi-generator/FILES b/samples/client/petstore/kotlin-okhttp3/.openapi-generator/FILES index 16c712325f82..c7a409ac169e 100644 --- a/samples/client/petstore/kotlin-okhttp3/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-okhttp3/.openapi-generator/FILES @@ -19,7 +19,7 @@ src/main/kotlin/org/openapitools/client/apis/StoreApi.kt src/main/kotlin/org/openapitools/client/apis/UserApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -33,8 +33,8 @@ src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt -src/main/kotlin/org/openapitools/client/models/ApiResponse.kt src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt src/main/kotlin/org/openapitools/client/models/Order.kt src/main/kotlin/org/openapitools/client/models/Pet.kt src/main/kotlin/org/openapitools/client/models/Tag.kt diff --git a/samples/client/petstore/kotlin-okhttp3/README.md b/samples/client/petstore/kotlin-okhttp3/README.md index 97f9b8166489..5ecae07a7add 100644 --- a/samples/client/petstore/kotlin-okhttp3/README.md +++ b/samples/client/petstore/kotlin-okhttp3/README.md @@ -60,8 +60,8 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) - [org.openapitools.client.models.Order](docs/Order.md) - [org.openapitools.client.models.Pet](docs/Pet.md) - [org.openapitools.client.models.Tag](docs/Tag.md) diff --git a/samples/client/petstore/kotlin-okhttp3/docs/ApiResponse.md b/samples/client/petstore/kotlin-okhttp3/docs/ApiResponse.md index 6b4c6bf27795..12f08d5cdef0 100644 --- a/samples/client/petstore/kotlin-okhttp3/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-okhttp3/docs/ApiResponse.md @@ -1,5 +1,5 @@ -# ApiResponse +# ModelApiResponse ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/kotlin-okhttp3/docs/PetApi.md b/samples/client/petstore/kotlin-okhttp3/docs/PetApi.md index 403e57a4b338..038c57e68ec5 100644 --- a/samples/client/petstore/kotlin-okhttp3/docs/PetApi.md +++ b/samples/client/petstore/kotlin-okhttp3/docs/PetApi.md @@ -354,7 +354,7 @@ Configure petstore_auth: # **uploadFile** -> ApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, additionalMetadata, file) uploads an image @@ -369,7 +369,7 @@ val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload try { - val result : ApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) + val result : ModelApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) println(result) } catch (e: ClientException) { println("4xx response calling PetApi#uploadFile") @@ -390,7 +390,7 @@ Name | Type | Description | Notes ### Return type -[**ApiResponse**](ApiResponse.md) +[**ModelApiResponse**](ModelApiResponse.md) ### Authorization diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index c3426fbd0a4a..b774e10e7b81 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -22,11 +22,11 @@ package org.openapitools.client.apis import java.io.IOException -import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -80,12 +80,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Add a new pet to the store * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun addPetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = addPetRequestConfig(body = body) return request( @@ -150,12 +150,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param petId Pet id to delete * @param apiKey (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { + fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) return request( @@ -220,13 +220,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by status * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -295,14 +295,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiResponse?> { @Suppress("DEPRECATION") val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) @@ -371,13 +371,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Find pet by ID * Returns a single pet * @param petId ID of pet to return - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { + fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) return request( @@ -440,12 +440,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Update an existing pet * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun updatePetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = updatePetRequestConfig(body = body) return request( @@ -512,12 +512,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet that needs to be updated * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { + fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) return request, Unit>( @@ -553,7 +553,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiResponse + * @return ModelApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response @@ -562,11 +562,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ModelApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse + ResponseType.Success -> (localVarResponse as Success<*>).data as ModelApiResponse ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.ClientError -> { @@ -586,16 +586,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { + fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - return request, ApiResponse>( + return request, ModelApiResponse>( localVariableConfig ) } diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index e905c41311dc..d9cc68f0042f 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { + fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) return request( @@ -145,13 +145,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) /** * Returns pet inventories by status * Returns a map of status codes to quantities - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { + fun getInventoryWithHttpInfo() : ApiResponse?> { val localVariableConfig = getInventoryRequestConfig() return request>( @@ -214,13 +214,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { + fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) return request( @@ -284,13 +284,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Place an order for a pet * * @param body order placed for purchasing the pet - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { + fun placeOrderWithHttpInfo(body: Order) : ApiResponse { val localVariableConfig = placeOrderRequestConfig(body = body) return request( diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 9381925680af..efbff7928151 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Create user * This can only be done by the logged in user. * @param body Created user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { + fun createUserWithHttpInfo(body: User) : ApiResponse { val localVariableConfig = createUserRequestConfig(body = body) return request( @@ -146,12 +146,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) return request, Unit>( @@ -213,12 +213,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) return request, Unit>( @@ -280,12 +280,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Delete user * This can only be done by the logged in user. * @param username The name that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun deleteUserWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = deleteUserRequestConfig(username = username) return request( @@ -348,13 +348,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Get user by user name * * @param username The name that needs to be fetched. Use user1 for testing. - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) return request( @@ -420,13 +420,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The user name for login * @param password The password for login in clear text - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { + fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) return request( @@ -492,12 +492,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { /** * Logs out current logged in user session * - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { + fun logoutUserWithHttpInfo() : ApiResponse { val localVariableConfig = logoutUserRequestConfig() return request( @@ -560,12 +560,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username name that need to be deleted * @param body Updated user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { + fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) return request( diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index d3ac6493d6ef..17646c1df125 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -158,7 +158,7 @@ open class ApiClient(val baseUrl: String) { } } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = HttpUrl.parse(baseUrl) ?: throw IllegalStateException("baseUrl is invalid.") // take authMethod from operation diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbfaa..000000000000 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt new file mode 100644 index 000000000000..cf2cfaa95d91 --- /dev/null +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -0,0 +1,43 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +interface Response + +abstract class ApiResponse(val responseType: ResponseType): Response { + abstract val statusCode: Int + abstract val headers: Map> +} + +class Success( + val data: T, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +): ApiResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Redirection) + +class ClientError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiResponse(ResponseType.ServerError) diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt similarity index 96% rename from samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt rename to samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index d430296dc4da..15c64ef38acb 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -31,7 +31,7 @@ import com.squareup.moshi.Json * @param message */ -data class ApiResponse ( +data class ModelApiResponse ( @Json(name = "code") val code: kotlin.Int? = null, diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/FILES b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/FILES index cc7132b28748..247ff9a72382 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/FILES @@ -40,8 +40,8 @@ src/main/kotlin/org/openapitools/client/infrastructure/StringBuilderAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/URLAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt -src/main/kotlin/org/openapitools/client/models/ApiResponse.kt src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt src/main/kotlin/org/openapitools/client/models/Order.kt src/main/kotlin/org/openapitools/client/models/Pet.kt src/main/kotlin/org/openapitools/client/models/Tag.kt diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/README.md b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/README.md index 341e51a324e9..8fb632221cce 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/README.md +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/README.md @@ -60,8 +60,8 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) - [org.openapitools.client.models.Order](docs/Order.md) - [org.openapitools.client.models.Pet](docs/Pet.md) - [org.openapitools.client.models.Tag](docs/Tag.md) diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/ApiResponse.md b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/ApiResponse.md index 6b4c6bf27795..12f08d5cdef0 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/ApiResponse.md @@ -1,5 +1,5 @@ -# ApiResponse +# ModelApiResponse ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/PetApi.md b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/PetApi.md index cd0240ec9897..3997c8cf3904 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/PetApi.md +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/PetApi.md @@ -294,7 +294,7 @@ val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload -val result : ApiResponse = webService.uploadFile(petId, additionalMetadata, file) +val result : ModelApiResponse = webService.uploadFile(petId, additionalMetadata, file) ``` ### Parameters @@ -307,7 +307,7 @@ Name | Type | Description | Notes ### Return type -[**ApiResponse**](ApiResponse.md) +[**ModelApiResponse**](ModelApiResponse.md) ### Authorization diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 1af051c6c7fd..d3268ae63d6a 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -5,7 +5,7 @@ import retrofit2.http.* import retrofit2.Call import okhttp3.RequestBody -import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet import okhttp3.MultipartBody @@ -115,10 +115,10 @@ interface PetApi { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return [Call]<[ApiResponse]> + * @return [Call]<[ModelApiResponse]> */ @Multipart @POST("pet/{petId}/uploadImage") - fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String? = null, @Part file: MultipartBody.Part? = null): Call + fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String? = null, @Part file: MultipartBody.Part? = null): Call } diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt similarity index 97% rename from samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt rename to samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 0773d7f17d9f..c898dbd1529a 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -34,7 +34,7 @@ import java.io.Serializable * @param message */ @KSerializable -data class ApiResponse ( +data class ModelApiResponse ( @SerialName(value = "code") val code: kotlin.Int? = null, diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/.openapi-generator/FILES b/samples/client/petstore/kotlin-retrofit2-rx3/.openapi-generator/FILES index 04b505d1f173..d84bff350d27 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-retrofit2-rx3/.openapi-generator/FILES @@ -33,8 +33,8 @@ src/main/kotlin/org/openapitools/client/infrastructure/ResponseExt.kt src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt -src/main/kotlin/org/openapitools/client/models/ApiResponse.kt src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt src/main/kotlin/org/openapitools/client/models/Order.kt src/main/kotlin/org/openapitools/client/models/Pet.kt src/main/kotlin/org/openapitools/client/models/Tag.kt diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/README.md b/samples/client/petstore/kotlin-retrofit2-rx3/README.md index 341e51a324e9..8fb632221cce 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/README.md +++ b/samples/client/petstore/kotlin-retrofit2-rx3/README.md @@ -60,8 +60,8 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) - [org.openapitools.client.models.Order](docs/Order.md) - [org.openapitools.client.models.Pet](docs/Pet.md) - [org.openapitools.client.models.Tag](docs/Tag.md) diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/docs/ApiResponse.md b/samples/client/petstore/kotlin-retrofit2-rx3/docs/ApiResponse.md index 6b4c6bf27795..12f08d5cdef0 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-retrofit2-rx3/docs/ApiResponse.md @@ -1,5 +1,5 @@ -# ApiResponse +# ModelApiResponse ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/docs/PetApi.md b/samples/client/petstore/kotlin-retrofit2-rx3/docs/PetApi.md index cd0240ec9897..3997c8cf3904 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/docs/PetApi.md +++ b/samples/client/petstore/kotlin-retrofit2-rx3/docs/PetApi.md @@ -294,7 +294,7 @@ val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload -val result : ApiResponse = webService.uploadFile(petId, additionalMetadata, file) +val result : ModelApiResponse = webService.uploadFile(petId, additionalMetadata, file) ``` ### Parameters @@ -307,7 +307,7 @@ Name | Type | Description | Notes ### Return type -[**ApiResponse**](ApiResponse.md) +[**ModelApiResponse**](ModelApiResponse.md) ### Authorization diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 8f04b3fd8f9c..c174546cae02 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -6,7 +6,7 @@ import okhttp3.RequestBody import io.reactivex.rxjava3.core.Single; import io.reactivex.rxjava3.core.Completable; -import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet import okhttp3.MultipartBody @@ -116,10 +116,10 @@ interface PetApi { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return [Call]<[ApiResponse]> + * @return [Call]<[ModelApiResponse]> */ @Multipart @POST("pet/{petId}/uploadImage") - fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String? = null, @Part file: MultipartBody.Part? = null): Single + fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String? = null, @Part file: MultipartBody.Part? = null): Single } diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt similarity index 96% rename from samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt rename to samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index d430296dc4da..15c64ef38acb 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -31,7 +31,7 @@ import com.squareup.moshi.Json * @param message */ -data class ApiResponse ( +data class ModelApiResponse ( @Json(name = "code") val code: kotlin.Int? = null, diff --git a/samples/client/petstore/kotlin-retrofit2/.openapi-generator/FILES b/samples/client/petstore/kotlin-retrofit2/.openapi-generator/FILES index 04b505d1f173..d84bff350d27 100644 --- a/samples/client/petstore/kotlin-retrofit2/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-retrofit2/.openapi-generator/FILES @@ -33,8 +33,8 @@ src/main/kotlin/org/openapitools/client/infrastructure/ResponseExt.kt src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt -src/main/kotlin/org/openapitools/client/models/ApiResponse.kt src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt src/main/kotlin/org/openapitools/client/models/Order.kt src/main/kotlin/org/openapitools/client/models/Pet.kt src/main/kotlin/org/openapitools/client/models/Tag.kt diff --git a/samples/client/petstore/kotlin-retrofit2/README.md b/samples/client/petstore/kotlin-retrofit2/README.md index 341e51a324e9..8fb632221cce 100644 --- a/samples/client/petstore/kotlin-retrofit2/README.md +++ b/samples/client/petstore/kotlin-retrofit2/README.md @@ -60,8 +60,8 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) - [org.openapitools.client.models.Order](docs/Order.md) - [org.openapitools.client.models.Pet](docs/Pet.md) - [org.openapitools.client.models.Tag](docs/Tag.md) diff --git a/samples/client/petstore/kotlin-retrofit2/docs/ApiResponse.md b/samples/client/petstore/kotlin-retrofit2/docs/ApiResponse.md index 6b4c6bf27795..12f08d5cdef0 100644 --- a/samples/client/petstore/kotlin-retrofit2/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-retrofit2/docs/ApiResponse.md @@ -1,5 +1,5 @@ -# ApiResponse +# ModelApiResponse ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/kotlin-retrofit2/docs/PetApi.md b/samples/client/petstore/kotlin-retrofit2/docs/PetApi.md index cd0240ec9897..3997c8cf3904 100644 --- a/samples/client/petstore/kotlin-retrofit2/docs/PetApi.md +++ b/samples/client/petstore/kotlin-retrofit2/docs/PetApi.md @@ -294,7 +294,7 @@ val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload -val result : ApiResponse = webService.uploadFile(petId, additionalMetadata, file) +val result : ModelApiResponse = webService.uploadFile(petId, additionalMetadata, file) ``` ### Parameters @@ -307,7 +307,7 @@ Name | Type | Description | Notes ### Return type -[**ApiResponse**](ApiResponse.md) +[**ModelApiResponse**](ModelApiResponse.md) ### Authorization diff --git a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 1af051c6c7fd..d3268ae63d6a 100644 --- a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -5,7 +5,7 @@ import retrofit2.http.* import retrofit2.Call import okhttp3.RequestBody -import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet import okhttp3.MultipartBody @@ -115,10 +115,10 @@ interface PetApi { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return [Call]<[ApiResponse]> + * @return [Call]<[ModelApiResponse]> */ @Multipart @POST("pet/{petId}/uploadImage") - fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String? = null, @Part file: MultipartBody.Part? = null): Call + fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String? = null, @Part file: MultipartBody.Part? = null): Call } diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt similarity index 96% rename from samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt rename to samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index d430296dc4da..15c64ef38acb 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -31,7 +31,7 @@ import com.squareup.moshi.Json * @param message */ -data class ApiResponse ( +data class ModelApiResponse ( @Json(name = "code") val code: kotlin.Int? = null, diff --git a/samples/client/petstore/kotlin-string/.openapi-generator/FILES b/samples/client/petstore/kotlin-string/.openapi-generator/FILES index 16c712325f82..c7a409ac169e 100644 --- a/samples/client/petstore/kotlin-string/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-string/.openapi-generator/FILES @@ -19,7 +19,7 @@ src/main/kotlin/org/openapitools/client/apis/StoreApi.kt src/main/kotlin/org/openapitools/client/apis/UserApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -33,8 +33,8 @@ src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt -src/main/kotlin/org/openapitools/client/models/ApiResponse.kt src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt src/main/kotlin/org/openapitools/client/models/Order.kt src/main/kotlin/org/openapitools/client/models/Pet.kt src/main/kotlin/org/openapitools/client/models/Tag.kt diff --git a/samples/client/petstore/kotlin-string/README.md b/samples/client/petstore/kotlin-string/README.md index 97f9b8166489..5ecae07a7add 100644 --- a/samples/client/petstore/kotlin-string/README.md +++ b/samples/client/petstore/kotlin-string/README.md @@ -60,8 +60,8 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) - [org.openapitools.client.models.Order](docs/Order.md) - [org.openapitools.client.models.Pet](docs/Pet.md) - [org.openapitools.client.models.Tag](docs/Tag.md) diff --git a/samples/client/petstore/kotlin-string/docs/ApiResponse.md b/samples/client/petstore/kotlin-string/docs/ApiResponse.md index 6b4c6bf27795..12f08d5cdef0 100644 --- a/samples/client/petstore/kotlin-string/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-string/docs/ApiResponse.md @@ -1,5 +1,5 @@ -# ApiResponse +# ModelApiResponse ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/kotlin-string/docs/PetApi.md b/samples/client/petstore/kotlin-string/docs/PetApi.md index 39f8f0858aa2..3173ade5c868 100644 --- a/samples/client/petstore/kotlin-string/docs/PetApi.md +++ b/samples/client/petstore/kotlin-string/docs/PetApi.md @@ -354,7 +354,7 @@ Configure petstore_auth: # **uploadFile** -> ApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, additionalMetadata, file) uploads an image @@ -369,7 +369,7 @@ val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload try { - val result : ApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) + val result : ModelApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) println(result) } catch (e: ClientException) { println("4xx response calling PetApi#uploadFile") @@ -390,7 +390,7 @@ Name | Type | Description | Notes ### Return type -[**ApiResponse**](ApiResponse.md) +[**ModelApiResponse**](ModelApiResponse.md) ### Authorization diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index fbadb8eb910f..40c875dcdc7e 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -22,11 +22,11 @@ package org.openapitools.client.apis import java.io.IOException -import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -80,12 +80,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Add a new pet to the store * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun addPetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = addPetRequestConfig(body = body) return request( @@ -150,12 +150,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param apiKey (optional) * @param petId Pet id to delete - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deletePetWithHttpInfo(apiKey: kotlin.String?, petId: kotlin.Long) : ApiInfrastructureResponse { + fun deletePetWithHttpInfo(apiKey: kotlin.String?, petId: kotlin.Long) : ApiResponse { val localVariableConfig = deletePetRequestConfig(apiKey = apiKey, petId = petId) return request( @@ -220,13 +220,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by status * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -295,14 +295,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiResponse?> { @Suppress("DEPRECATION") val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) @@ -371,13 +371,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Find pet by ID * Returns a single pet * @param petId ID of pet to return - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { + fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) return request( @@ -440,12 +440,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Update an existing pet * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun updatePetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = updatePetRequestConfig(body = body) return request( @@ -512,12 +512,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet that needs to be updated * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { + fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) return request, Unit>( @@ -553,7 +553,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiResponse + * @return ModelApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response @@ -562,11 +562,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ModelApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse + ResponseType.Success -> (localVarResponse as Success<*>).data as ModelApiResponse ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.ClientError -> { @@ -586,16 +586,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { + fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - return request, ApiResponse>( + return request, ModelApiResponse>( localVariableConfig ) } diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index e905c41311dc..d9cc68f0042f 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { + fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) return request( @@ -145,13 +145,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) /** * Returns pet inventories by status * Returns a map of status codes to quantities - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { + fun getInventoryWithHttpInfo() : ApiResponse?> { val localVariableConfig = getInventoryRequestConfig() return request>( @@ -214,13 +214,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { + fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) return request( @@ -284,13 +284,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Place an order for a pet * * @param body order placed for purchasing the pet - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { + fun placeOrderWithHttpInfo(body: Order) : ApiResponse { val localVariableConfig = placeOrderRequestConfig(body = body) return request( diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 9381925680af..efbff7928151 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Create user * This can only be done by the logged in user. * @param body Created user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { + fun createUserWithHttpInfo(body: User) : ApiResponse { val localVariableConfig = createUserRequestConfig(body = body) return request( @@ -146,12 +146,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) return request, Unit>( @@ -213,12 +213,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) return request, Unit>( @@ -280,12 +280,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Delete user * This can only be done by the logged in user. * @param username The name that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun deleteUserWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = deleteUserRequestConfig(username = username) return request( @@ -348,13 +348,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Get user by user name * * @param username The name that needs to be fetched. Use user1 for testing. - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) return request( @@ -420,13 +420,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The user name for login * @param password The password for login in clear text - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { + fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) return request( @@ -492,12 +492,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { /** * Logs out current logged in user session * - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { + fun logoutUserWithHttpInfo() : ApiResponse { val localVariableConfig = logoutUserRequestConfig() return request( @@ -560,12 +560,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username name that need to be deleted * @param body Updated user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { + fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) return request( diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index c218caafae56..7282e53200b6 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -161,7 +161,7 @@ open class ApiClient(val baseUrl: String) { } } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") // take authMethod from operation diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbfaa..000000000000 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt new file mode 100644 index 000000000000..cf2cfaa95d91 --- /dev/null +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -0,0 +1,43 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +interface Response + +abstract class ApiResponse(val responseType: ResponseType): Response { + abstract val statusCode: Int + abstract val headers: Map> +} + +class Success( + val data: T, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +): ApiResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Redirection) + +class ClientError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiResponse(ResponseType.ServerError) diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt similarity index 97% rename from samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt rename to samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 617982fdfe3b..5f584a05ac0c 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -32,7 +32,7 @@ import java.io.Serializable * @param message */ -data class ApiResponse ( +data class ModelApiResponse ( @Json(name = "code") val code: kotlin.Int? = null, diff --git a/samples/client/petstore/kotlin-threetenbp/.openapi-generator/FILES b/samples/client/petstore/kotlin-threetenbp/.openapi-generator/FILES index 16c712325f82..c7a409ac169e 100644 --- a/samples/client/petstore/kotlin-threetenbp/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-threetenbp/.openapi-generator/FILES @@ -19,7 +19,7 @@ src/main/kotlin/org/openapitools/client/apis/StoreApi.kt src/main/kotlin/org/openapitools/client/apis/UserApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -33,8 +33,8 @@ src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt -src/main/kotlin/org/openapitools/client/models/ApiResponse.kt src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt src/main/kotlin/org/openapitools/client/models/Order.kt src/main/kotlin/org/openapitools/client/models/Pet.kt src/main/kotlin/org/openapitools/client/models/Tag.kt diff --git a/samples/client/petstore/kotlin-threetenbp/README.md b/samples/client/petstore/kotlin-threetenbp/README.md index 97f9b8166489..5ecae07a7add 100644 --- a/samples/client/petstore/kotlin-threetenbp/README.md +++ b/samples/client/petstore/kotlin-threetenbp/README.md @@ -60,8 +60,8 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) - [org.openapitools.client.models.Order](docs/Order.md) - [org.openapitools.client.models.Pet](docs/Pet.md) - [org.openapitools.client.models.Tag](docs/Tag.md) diff --git a/samples/client/petstore/kotlin-threetenbp/docs/ApiResponse.md b/samples/client/petstore/kotlin-threetenbp/docs/ApiResponse.md index 6b4c6bf27795..12f08d5cdef0 100644 --- a/samples/client/petstore/kotlin-threetenbp/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-threetenbp/docs/ApiResponse.md @@ -1,5 +1,5 @@ -# ApiResponse +# ModelApiResponse ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/kotlin-threetenbp/docs/PetApi.md b/samples/client/petstore/kotlin-threetenbp/docs/PetApi.md index 403e57a4b338..038c57e68ec5 100644 --- a/samples/client/petstore/kotlin-threetenbp/docs/PetApi.md +++ b/samples/client/petstore/kotlin-threetenbp/docs/PetApi.md @@ -354,7 +354,7 @@ Configure petstore_auth: # **uploadFile** -> ApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, additionalMetadata, file) uploads an image @@ -369,7 +369,7 @@ val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload try { - val result : ApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) + val result : ModelApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) println(result) } catch (e: ClientException) { println("4xx response calling PetApi#uploadFile") @@ -390,7 +390,7 @@ Name | Type | Description | Notes ### Return type -[**ApiResponse**](ApiResponse.md) +[**ModelApiResponse**](ModelApiResponse.md) ### Authorization diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index c3426fbd0a4a..b774e10e7b81 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -22,11 +22,11 @@ package org.openapitools.client.apis import java.io.IOException -import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -80,12 +80,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Add a new pet to the store * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun addPetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = addPetRequestConfig(body = body) return request( @@ -150,12 +150,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param petId Pet id to delete * @param apiKey (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { + fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) return request( @@ -220,13 +220,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by status * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -295,14 +295,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiResponse?> { @Suppress("DEPRECATION") val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) @@ -371,13 +371,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Find pet by ID * Returns a single pet * @param petId ID of pet to return - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { + fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) return request( @@ -440,12 +440,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Update an existing pet * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun updatePetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = updatePetRequestConfig(body = body) return request( @@ -512,12 +512,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet that needs to be updated * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { + fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) return request, Unit>( @@ -553,7 +553,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiResponse + * @return ModelApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response @@ -562,11 +562,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ModelApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse + ResponseType.Success -> (localVarResponse as Success<*>).data as ModelApiResponse ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.ClientError -> { @@ -586,16 +586,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { + fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - return request, ApiResponse>( + return request, ModelApiResponse>( localVariableConfig ) } diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index e905c41311dc..d9cc68f0042f 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { + fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) return request( @@ -145,13 +145,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) /** * Returns pet inventories by status * Returns a map of status codes to quantities - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { + fun getInventoryWithHttpInfo() : ApiResponse?> { val localVariableConfig = getInventoryRequestConfig() return request>( @@ -214,13 +214,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { + fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) return request( @@ -284,13 +284,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Place an order for a pet * * @param body order placed for purchasing the pet - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { + fun placeOrderWithHttpInfo(body: Order) : ApiResponse { val localVariableConfig = placeOrderRequestConfig(body = body) return request( diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 9381925680af..efbff7928151 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Create user * This can only be done by the logged in user. * @param body Created user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { + fun createUserWithHttpInfo(body: User) : ApiResponse { val localVariableConfig = createUserRequestConfig(body = body) return request( @@ -146,12 +146,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) return request, Unit>( @@ -213,12 +213,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) return request, Unit>( @@ -280,12 +280,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Delete user * This can only be done by the logged in user. * @param username The name that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun deleteUserWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = deleteUserRequestConfig(username = username) return request( @@ -348,13 +348,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Get user by user name * * @param username The name that needs to be fetched. Use user1 for testing. - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) return request( @@ -420,13 +420,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The user name for login * @param password The password for login in clear text - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { + fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) return request( @@ -492,12 +492,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { /** * Logs out current logged in user session * - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { + fun logoutUserWithHttpInfo() : ApiResponse { val localVariableConfig = logoutUserRequestConfig() return request( @@ -560,12 +560,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username name that need to be deleted * @param body Updated user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { + fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) return request( diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 42e08a49f301..8ae5de40f5d8 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -161,7 +161,7 @@ open class ApiClient(val baseUrl: String) { } } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") // take authMethod from operation diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbfaa..000000000000 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt new file mode 100644 index 000000000000..cf2cfaa95d91 --- /dev/null +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -0,0 +1,43 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +interface Response + +abstract class ApiResponse(val responseType: ResponseType): Response { + abstract val statusCode: Int + abstract val headers: Map> +} + +class Success( + val data: T, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +): ApiResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Redirection) + +class ClientError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiResponse(ResponseType.ServerError) diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt similarity index 96% rename from samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt rename to samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index a38d613adbe6..15c64ef38acb 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -31,7 +31,7 @@ import com.squareup.moshi.Json * @param message */ -internal data class ApiResponse ( +data class ModelApiResponse ( @Json(name = "code") val code: kotlin.Int? = null, diff --git a/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/FILES b/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/FILES index c817d8024848..113f981ccd51 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/FILES @@ -10,7 +10,7 @@ settings.gradle src/main/kotlin/org/openapitools/client/apis/EnumApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt 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 4a5e70c002a0..9e39ffb9d00d 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 @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.PetEnum import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -78,13 +78,13 @@ class EnumApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { /** * Get enums * - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getEnumWithHttpInfo() : ApiInfrastructureResponse { + fun getEnumWithHttpInfo() : ApiResponse { val localVariableConfig = getEnumRequestConfig() return request( 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 8a9c47045ed7..09194ef92717 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 @@ -145,7 +145,7 @@ open class ApiClient(val baseUrl: String) { } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") val url = httpUrl.newBuilder() 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 deleted file mode 100644 index 9dc8d8dbbfaa..000000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt new file mode 100644 index 000000000000..cf2cfaa95d91 --- /dev/null +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -0,0 +1,43 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +interface Response + +abstract class ApiResponse(val responseType: ResponseType): Response { + abstract val statusCode: Int + abstract val headers: Map> +} + +class Success( + val data: T, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +): ApiResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Redirection) + +class ClientError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiResponse(ResponseType.ServerError) diff --git a/samples/client/petstore/kotlin/.openapi-generator/FILES b/samples/client/petstore/kotlin/.openapi-generator/FILES index 16c712325f82..c7a409ac169e 100644 --- a/samples/client/petstore/kotlin/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin/.openapi-generator/FILES @@ -19,7 +19,7 @@ src/main/kotlin/org/openapitools/client/apis/StoreApi.kt src/main/kotlin/org/openapitools/client/apis/UserApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -33,8 +33,8 @@ src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt -src/main/kotlin/org/openapitools/client/models/ApiResponse.kt src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt src/main/kotlin/org/openapitools/client/models/Order.kt src/main/kotlin/org/openapitools/client/models/Pet.kt src/main/kotlin/org/openapitools/client/models/Tag.kt diff --git a/samples/client/petstore/kotlin/README.md b/samples/client/petstore/kotlin/README.md index 97f9b8166489..5ecae07a7add 100644 --- a/samples/client/petstore/kotlin/README.md +++ b/samples/client/petstore/kotlin/README.md @@ -60,8 +60,8 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) - [org.openapitools.client.models.Order](docs/Order.md) - [org.openapitools.client.models.Pet](docs/Pet.md) - [org.openapitools.client.models.Tag](docs/Tag.md) diff --git a/samples/client/petstore/kotlin/docs/ApiResponse.md b/samples/client/petstore/kotlin/docs/ApiResponse.md index 6b4c6bf27795..12f08d5cdef0 100644 --- a/samples/client/petstore/kotlin/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin/docs/ApiResponse.md @@ -1,5 +1,5 @@ -# ApiResponse +# ModelApiResponse ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/kotlin/docs/PetApi.md b/samples/client/petstore/kotlin/docs/PetApi.md index 403e57a4b338..038c57e68ec5 100644 --- a/samples/client/petstore/kotlin/docs/PetApi.md +++ b/samples/client/petstore/kotlin/docs/PetApi.md @@ -354,7 +354,7 @@ Configure petstore_auth: # **uploadFile** -> ApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, additionalMetadata, file) uploads an image @@ -369,7 +369,7 @@ val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload try { - val result : ApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) + val result : ModelApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) println(result) } catch (e: ClientException) { println("4xx response calling PetApi#uploadFile") @@ -390,7 +390,7 @@ Name | Type | Description | Notes ### Return type -[**ApiResponse**](ApiResponse.md) +[**ModelApiResponse**](ModelApiResponse.md) ### Authorization diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index c3426fbd0a4a..b774e10e7b81 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -22,11 +22,11 @@ package org.openapitools.client.apis import java.io.IOException -import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -80,12 +80,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Add a new pet to the store * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun addPetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = addPetRequestConfig(body = body) return request( @@ -150,12 +150,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param petId Pet id to delete * @param apiKey (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { + fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) return request( @@ -220,13 +220,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by status * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -295,14 +295,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiResponse?> { @Suppress("DEPRECATION") val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) @@ -371,13 +371,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Find pet by ID * Returns a single pet * @param petId ID of pet to return - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { + fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) return request( @@ -440,12 +440,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Update an existing pet * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun updatePetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = updatePetRequestConfig(body = body) return request( @@ -512,12 +512,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet that needs to be updated * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { + fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) return request, Unit>( @@ -553,7 +553,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiResponse + * @return ModelApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response @@ -562,11 +562,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ModelApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse + ResponseType.Success -> (localVarResponse as Success<*>).data as ModelApiResponse ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.ClientError -> { @@ -586,16 +586,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { + fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - return request, ApiResponse>( + return request, ModelApiResponse>( localVariableConfig ) } diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index e905c41311dc..d9cc68f0042f 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { + fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) return request( @@ -145,13 +145,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) /** * Returns pet inventories by status * Returns a map of status codes to quantities - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { + fun getInventoryWithHttpInfo() : ApiResponse?> { val localVariableConfig = getInventoryRequestConfig() return request>( @@ -214,13 +214,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { + fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) return request( @@ -284,13 +284,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Place an order for a pet * * @param body order placed for purchasing the pet - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { + fun placeOrderWithHttpInfo(body: Order) : ApiResponse { val localVariableConfig = placeOrderRequestConfig(body = body) return request( diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 9381925680af..efbff7928151 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Create user * This can only be done by the logged in user. * @param body Created user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { + fun createUserWithHttpInfo(body: User) : ApiResponse { val localVariableConfig = createUserRequestConfig(body = body) return request( @@ -146,12 +146,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) return request, Unit>( @@ -213,12 +213,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) return request, Unit>( @@ -280,12 +280,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Delete user * This can only be done by the logged in user. * @param username The name that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun deleteUserWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = deleteUserRequestConfig(username = username) return request( @@ -348,13 +348,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Get user by user name * * @param username The name that needs to be fetched. Use user1 for testing. - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) return request( @@ -420,13 +420,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The user name for login * @param password The password for login in clear text - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { + fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) return request( @@ -492,12 +492,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { /** * Logs out current logged in user session * - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { + fun logoutUserWithHttpInfo() : ApiResponse { val localVariableConfig = logoutUserRequestConfig() return request( @@ -560,12 +560,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username name that need to be deleted * @param body Updated user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { + fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) return request( diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index c218caafae56..7282e53200b6 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -161,7 +161,7 @@ open class ApiClient(val baseUrl: String) { } } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") // take authMethod from operation diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbfaa..000000000000 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt new file mode 100644 index 000000000000..cf2cfaa95d91 --- /dev/null +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -0,0 +1,43 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +interface Response + +abstract class ApiResponse(val responseType: ResponseType): Response { + abstract val statusCode: Int + abstract val headers: Map> +} + +class Success( + val data: T, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +): ApiResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Redirection) + +class ClientError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiResponse(ResponseType.ServerError) diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt similarity index 97% rename from samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt rename to samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 617982fdfe3b..5f584a05ac0c 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -32,7 +32,7 @@ import java.io.Serializable * @param message */ -data class ApiResponse ( +data class ModelApiResponse ( @Json(name = "code") val code: kotlin.Int? = null, diff --git a/samples/server/petstore/kotlin-server/ktor/.openapi-generator/FILES b/samples/server/petstore/kotlin-server/ktor/.openapi-generator/FILES index 10c026f11ff7..79943171ff21 100644 --- a/samples/server/petstore/kotlin-server/ktor/.openapi-generator/FILES +++ b/samples/server/petstore/kotlin-server/ktor/.openapi-generator/FILES @@ -10,8 +10,8 @@ src/main/kotlin/org/openapitools/server/apis/PetApi.kt src/main/kotlin/org/openapitools/server/apis/StoreApi.kt src/main/kotlin/org/openapitools/server/apis/UserApi.kt src/main/kotlin/org/openapitools/server/infrastructure/ApiKeyAuth.kt -src/main/kotlin/org/openapitools/server/models/ApiResponse.kt src/main/kotlin/org/openapitools/server/models/Category.kt +src/main/kotlin/org/openapitools/server/models/ModelApiResponse.kt src/main/kotlin/org/openapitools/server/models/Order.kt src/main/kotlin/org/openapitools/server/models/Pet.kt src/main/kotlin/org/openapitools/server/models/Tag.kt diff --git a/samples/server/petstore/kotlin-server/ktor/README.md b/samples/server/petstore/kotlin-server/ktor/README.md index d78e27dd2ea5..6ec361da3cd4 100644 --- a/samples/server/petstore/kotlin-server/ktor/README.md +++ b/samples/server/petstore/kotlin-server/ktor/README.md @@ -74,8 +74,8 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [org.openapitools.server.models.ApiResponse](docs/ApiResponse.md) - [org.openapitools.server.models.Category](docs/Category.md) + - [org.openapitools.server.models.ModelApiResponse](docs/ModelApiResponse.md) - [org.openapitools.server.models.Order](docs/Order.md) - [org.openapitools.server.models.Pet](docs/Pet.md) - [org.openapitools.server.models.Tag](docs/Tag.md) diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/apis/PetApi.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/apis/PetApi.kt index 95f5d7fb8808..0a4b29e2cabb 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/apis/PetApi.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/apis/PetApi.kt @@ -20,7 +20,7 @@ import org.openapitools.server.Paths import io.ktor.locations.* import io.ktor.routing.* import org.openapitools.server.infrastructure.ApiPrincipal -import org.openapitools.server.models.ApiResponse +import org.openapitools.server.models.ModelApiResponse import org.openapitools.server.models.Pet @KtorExperimentalLocationsAPI diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/ApiResponse.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/ModelApiResponse.kt similarity index 96% rename from samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/ApiResponse.kt rename to samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/ModelApiResponse.kt index 14f50dbb9ad6..5548175d9048 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/ApiResponse.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/ModelApiResponse.kt @@ -19,7 +19,7 @@ import java.io.Serializable * @param type * @param message */ -data class ApiResponse( +data class ModelApiResponse( val code: kotlin.Int? = null, val type: kotlin.String? = null, val message: kotlin.String? = null From d5979d3180c480965ccdc1ea5faaa9e88ebfd856 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20=C4=8Cerm=C3=A1k?= Date: Tue, 14 Dec 2021 08:44:22 +0100 Subject: [PATCH 085/117] [Protobuf-Schema] Added nullable (#11073) --- .../codegen/languages/ProtobufSchemaCodegen.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java index 5f55e9d47f04..d842a935a0fe 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java @@ -254,6 +254,9 @@ public Map postProcessModels(Map objs) { if (Boolean.TRUE.equals(var.isArray)) { var.vendorExtensions.put("x-protobuf-type", "repeated"); } + else if (Boolean.TRUE.equals(var.isNullable && var.isPrimitiveType)) { + var.vendorExtensions.put("x-protobuf-type", "optional"); + } // add x-protobuf-data-type // ref: https://developers.google.com/protocol-buffers/docs/proto3 @@ -500,9 +503,14 @@ public Map postProcessOperationsWithModels(Map o int index = 1; for (CodegenParameter p : op.allParams) { // add x-protobuf-type: repeated if it's an array + if (Boolean.TRUE.equals(p.isArray)) { p.vendorExtensions.put("x-protobuf-type", "repeated"); - } else if (Boolean.TRUE.equals(p.isMap)) { + } + else if (Boolean.TRUE.equals(p.isNullable && p.isPrimitiveType)) { + p.vendorExtensions.put("x-protobuf-type", "optional"); + } + else if (Boolean.TRUE.equals(p.isMap)) { LOGGER.warn("Map parameter (name: {}, operation ID: {}) not yet supported", p.paramName, op.operationId); } From 5416e92d19236d05e23a17e3a974ebe19072e2d3 Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@users.noreply.github.com> Date: Tue, 14 Dec 2021 07:58:19 +0000 Subject: [PATCH 086/117] [swift5][client] add support for async/await in iOS 13 and above (#11109) --- .../src/main/resources/swift5/api.mustache | 2 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 24 +++++++++---------- .../APIs/FakeClassnameTags123API.swift | 2 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 18 +++++++------- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 8 +++---- .../Classes/OpenAPIs/APIs/UserAPI.swift | 16 ++++++------- 7 files changed, 36 insertions(+), 36 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/swift5/api.mustache b/modules/openapi-generator/src/main/resources/swift5/api.mustache index 5ae1f5513d2c..2351c74fd9ba 100644 --- a/modules/openapi-generator/src/main/resources/swift5/api.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/api.mustache @@ -197,7 +197,7 @@ extension {{projectName}}API { {{#isDeprecated}} @available(*, deprecated, message: "This operation is deprecated.") {{/isDeprecated}} - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue) async throws{{#returnType}} -> {{{returnType}}}{{/returnType}} { var requestTask: RequestTask? return try await withTaskCancellationHandler { diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index bd8044516fed..bbf14432b19d 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -19,7 +19,7 @@ open class AnotherFakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Client */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Client { var requestTask: RequestTask? return try await withTaskCancellationHandler { diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 1b105b037f66..acc67addbbda 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -18,7 +18,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Bool */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Bool { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -73,7 +73,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: OuterComposite */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> OuterComposite { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -128,7 +128,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Double */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Double { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -183,7 +183,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: String */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> String { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -238,7 +238,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -294,7 +294,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -353,7 +353,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Client */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Client { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -423,7 +423,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -588,7 +588,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -671,7 +671,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -740,7 +740,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -797,7 +797,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 6313692d6d48..f950419aeac6 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -19,7 +19,7 @@ open class FakeClassnameTags123API { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Client */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Client { var requestTask: RequestTask? return try await withTaskCancellationHandler { diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index d541b28938d5..044d96d758d6 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -19,7 +19,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -79,7 +79,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -151,7 +151,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: [Pet] */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> [Pet] { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -215,7 +215,7 @@ open class PetAPI { - returns: [Pet] */ @available(*, deprecated, message: "This operation is deprecated.") - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> [Pet] { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -279,7 +279,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Pet */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Pet { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -342,7 +342,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -403,7 +403,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -475,7 +475,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: ApiResponse */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> ApiResponse { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -547,7 +547,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: ApiResponse */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> ApiResponse { var requestTask: RequestTask? return try await withTaskCancellationHandler { diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 510311783b9e..1548fa8814c4 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -19,7 +19,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -78,7 +78,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: [String: Int] */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> [String: Int] { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -137,7 +137,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Order */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Order { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -197,7 +197,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Order */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Order { var requestTask: RequestTask? return try await withTaskCancellationHandler { diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 7cc9a77f01b9..b44a7cdc7219 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -19,7 +19,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -76,7 +76,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -132,7 +132,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -188,7 +188,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -248,7 +248,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: User */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> User { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -308,7 +308,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: String */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> String { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -369,7 +369,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -425,7 +425,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { From eb224db540443792caba44c51c72b747d3a2d7a0 Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@users.noreply.github.com> Date: Tue, 14 Dec 2021 08:03:12 +0000 Subject: [PATCH 087/117] [kotlin][client] remove old Date usage (#11082) * [kotlin][client] remove old Date usage * [kotlin][client] remove old Date usage --- .../kotlin-spring-boot-modelMutable.yaml | 0 .../{other => }/kotlin-vertx-vertx.yaml | 0 .../kotlin-jvm-retrofit2-coroutines.yaml | 0 .../kotlin-jvm-retrofit2-rx.yaml | 0 ...m-retrofit2-rx2-kotlinx_serialization.yaml | 0 .../kotlin-jvm-retrofit2-rx2.yaml | 0 .../{openapi3 => }/kotlin-multiplatform.yaml | 0 .../kotlin-spring-boot-reactive.yaml | 0 .../{openapi3 => }/kotlin-spring-boot.yaml | 0 bin/configs/other/{openapi3 => }/kotlin.yaml | 0 .../languages/KotlinClientCodegen.java | 3 - .../infrastructure/DateAdapter.kt.mustache | 67 --- .../infrastructure/Serializer.kt.mustache | 2 - .../infrastructure/ApiClient.kt.mustache | 3 +- .../client/infrastructure/ApiClient.kt | 3 +- .../kotlin-gson/.openapi-generator/FILES | 1 - .../org/openapitools/client/apis/PetApi.kt | 492 ----------------- .../org/openapitools/client/apis/StoreApi.kt | 253 --------- .../org/openapitools/client/apis/UserApi.kt | 476 ----------------- .../client/infrastructure/ApiAbstractions.kt | 23 - .../client/infrastructure/ApiClient.kt | 251 --------- .../ApiInfrastructureResponse.kt | 43 -- .../infrastructure/ApplicationDelegates.kt | 29 - .../client/infrastructure/ByteArrayAdapter.kt | 33 -- .../client/infrastructure/DateAdapter.kt | 37 -- .../client/infrastructure/Errors.kt | 18 - .../client/infrastructure/LocalDateAdapter.kt | 35 -- .../infrastructure/LocalDateTimeAdapter.kt | 35 -- .../infrastructure/OffsetDateTimeAdapter.kt | 35 -- .../client/infrastructure/RequestConfig.kt | 17 - .../client/infrastructure/RequestMethod.kt | 8 - .../infrastructure/ResponseExtensions.kt | 24 - .../client/infrastructure/Serializer.kt | 23 - .../openapitools/client/models/ApiResponse.kt | 32 -- .../openapitools/client/models/Category.kt | 29 - .../org/openapitools/client/models/Order.kt | 54 -- .../org/openapitools/client/models/Pet.kt | 56 -- .../org/openapitools/client/models/Tag.kt | 29 - .../org/openapitools/client/models/User.kt | 48 -- .../client/infrastructure/ApiClient.kt | 3 +- .../infrastructure/ApplicationDelegates.kt | 29 - .../client/infrastructure/DateAdapter.kt | 37 -- .../org/openapitools/client/apis/PetApi.kt | 492 ----------------- .../org/openapitools/client/apis/StoreApi.kt | 253 --------- .../org/openapitools/client/apis/UserApi.kt | 476 ----------------- .../client/infrastructure/ApiAbstractions.kt | 23 - .../client/infrastructure/ApiClient.kt | 251 --------- .../ApiInfrastructureResponse.kt | 43 -- .../infrastructure/ApplicationDelegates.kt | 29 - .../client/infrastructure/ByteArrayAdapter.kt | 3 - .../client/infrastructure/Errors.kt | 18 - .../client/infrastructure/RequestConfig.kt | 17 - .../client/infrastructure/RequestMethod.kt | 8 - .../infrastructure/ResponseExtensions.kt | 24 - .../client/infrastructure/Serializer.kt | 18 - .../openapitools/client/models/ApiResponse.kt | 32 -- .../openapitools/client/models/Category.kt | 29 - .../org/openapitools/client/models/Order.kt | 54 -- .../org/openapitools/client/models/Pet.kt | 56 -- .../org/openapitools/client/models/Tag.kt | 29 - .../org/openapitools/client/models/User.kt | 48 -- .../kotlin-petstore-jackson.kotlin_module | Bin 134 -> 0 bytes .../main/org/openapitools/ApplicationKt.class | Bin 3936 -> 0 bytes .../client/apis/PetApi$WhenMappings.class | Bin 1458 -> 0 bytes .../org/openapitools/client/apis/PetApi.class | Bin 82237 -> 0 bytes .../client/apis/StoreApi$WhenMappings.class | Bin 1040 -> 0 bytes .../openapitools/client/apis/StoreApi.class | Bin 42521 -> 0 bytes .../client/apis/UserApi$WhenMappings.class | Bin 1459 -> 0 bytes .../openapitools/client/apis/UserApi.class | Bin 79974 -> 0 bytes ...tionsKt$defaultMultiValueConverter$1.class | Bin 1439 -> 0 bytes .../infrastructure/ApiAbstractionsKt.class | Bin 5327 -> 0 bytes .../ApiClient$Companion$client$2.class | Bin 1445 -> 0 bytes .../infrastructure/ApiClient$Companion.class | Bin 4330 -> 0 bytes .../ApiClient$WhenMappings.class | Bin 768 -> 0 bytes .../client/infrastructure/ApiClient.class | Bin 31155 -> 0 bytes .../ApiInfrastructureResponse.class | Bin 1608 -> 0 bytes .../ApplicationDelegates$SetOnce.class | Bin 3186 -> 0 bytes .../infrastructure/ApplicationDelegates.class | Bin 1711 -> 0 bytes .../client/infrastructure/ClientError.class | Bin 2831 -> 0 bytes .../ClientException$Companion.class | Bin 945 -> 0 bytes .../infrastructure/ClientException.class | Bin 1622 -> 0 bytes .../client/infrastructure/Informational.class | Bin 2740 -> 0 bytes .../client/infrastructure/Redirection.class | Bin 2479 -> 0 bytes .../client/infrastructure/RequestConfig.class | Bin 5445 -> 0 bytes .../client/infrastructure/RequestMethod.class | Bin 1652 -> 0 bytes .../infrastructure/ResponseExtensionsKt.class | Bin 1499 -> 0 bytes .../client/infrastructure/ResponseType.class | Bin 1580 -> 0 bytes .../client/infrastructure/Serializer.class | Bin 2066 -> 0 bytes .../client/infrastructure/ServerError.class | Bin 2858 -> 0 bytes .../ServerException$Companion.class | Bin 945 -> 0 bytes .../infrastructure/ServerException.class | Bin 1622 -> 0 bytes .../client/infrastructure/Success.class | Bin 2686 -> 0 bytes .../client/models/ApiResponse.class | Bin 3611 -> 0 bytes .../openapitools/client/models/Category.class | Bin 3046 -> 0 bytes .../client/models/Order$Status.class | Bin 2115 -> 0 bytes .../openapitools/client/models/Order.class | Bin 5914 -> 0 bytes .../client/models/Pet$Status.class | Bin 2093 -> 0 bytes .../org/openapitools/client/models/Pet.class | Bin 6141 -> 0 bytes .../org/openapitools/client/models/Tag.class | Bin 3011 -> 0 bytes .../org/openapitools/client/models/User.class | Bin 6313 -> 0 bytes .../kotlin/compileKotlin/build-history.bin | Bin 31 -> 0 bytes .../caches-jvm/inputs/source-to-output.tab | Bin 4096 -> 0 bytes .../inputs/source-to-output.tab.keystream | Bin 4096 -> 0 bytes .../inputs/source-to-output.tab.keystream.len | Bin 8 -> 0 bytes .../inputs/source-to-output.tab.len | Bin 8 -> 0 bytes .../inputs/source-to-output.tab.values.at | Bin 11858 -> 0 bytes .../caches-jvm/inputs/source-to-output.tab_i | Bin 32768 -> 0 bytes .../inputs/source-to-output.tab_i.len | Bin 8 -> 0 bytes .../jvm/kotlin/class-fq-name-to-source.tab | Bin 4096 -> 0 bytes .../class-fq-name-to-source.tab.keystream | Bin 4096 -> 0 bytes .../class-fq-name-to-source.tab.keystream.len | Bin 8 -> 0 bytes .../kotlin/class-fq-name-to-source.tab.len | Bin 8 -> 0 bytes .../class-fq-name-to-source.tab.values.at | Bin 5659 -> 0 bytes .../jvm/kotlin/class-fq-name-to-source.tab_i | Bin 32768 -> 0 bytes .../kotlin/class-fq-name-to-source.tab_i.len | Bin 8 -> 0 bytes .../caches-jvm/jvm/kotlin/constants.tab | Bin 4096 -> 0 bytes .../jvm/kotlin/constants.tab.keystream | Bin 4096 -> 0 bytes .../jvm/kotlin/constants.tab.keystream.len | Bin 8 -> 0 bytes .../caches-jvm/jvm/kotlin/constants.tab.len | Bin 8 -> 0 bytes .../jvm/kotlin/constants.tab.values.at | Bin 529 -> 0 bytes .../caches-jvm/jvm/kotlin/constants.tab_i | Bin 32768 -> 0 bytes .../caches-jvm/jvm/kotlin/constants.tab_i.len | Bin 8 -> 0 bytes .../jvm/kotlin/inline-functions.tab | Bin 4096 -> 0 bytes .../jvm/kotlin/inline-functions.tab.keystream | Bin 4096 -> 0 bytes .../kotlin/inline-functions.tab.keystream.len | Bin 8 -> 0 bytes .../jvm/kotlin/inline-functions.tab.len | Bin 8 -> 0 bytes .../jvm/kotlin/inline-functions.tab.values.at | Bin 670 -> 0 bytes .../jvm/kotlin/inline-functions.tab_i | Bin 32768 -> 0 bytes .../jvm/kotlin/inline-functions.tab_i.len | Bin 8 -> 0 bytes .../jvm/kotlin/internal-name-to-source.tab | Bin 4096 -> 0 bytes .../internal-name-to-source.tab.keystream | Bin 4096 -> 0 bytes .../internal-name-to-source.tab.keystream.len | Bin 8 -> 0 bytes .../kotlin/internal-name-to-source.tab.len | Bin 8 -> 0 bytes .../internal-name-to-source.tab.values.at | Bin 7371 -> 0 bytes .../jvm/kotlin/internal-name-to-source.tab_i | Bin 32768 -> 0 bytes .../kotlin/internal-name-to-source.tab_i.len | Bin 8 -> 0 bytes .../caches-jvm/jvm/kotlin/package-parts.tab | Bin 4096 -> 0 bytes .../jvm/kotlin/package-parts.tab.keystream | Bin 4096 -> 0 bytes .../kotlin/package-parts.tab.keystream.len | Bin 8 -> 0 bytes .../jvm/kotlin/package-parts.tab.len | Bin 8 -> 0 bytes .../jvm/kotlin/package-parts.tab.values.at | Bin 58 -> 0 bytes .../caches-jvm/jvm/kotlin/package-parts.tab_i | Bin 32768 -> 0 bytes .../jvm/kotlin/package-parts.tab_i.len | Bin 8 -> 0 bytes .../caches-jvm/jvm/kotlin/proto.tab | Bin 4096 -> 0 bytes .../caches-jvm/jvm/kotlin/proto.tab.keystream | Bin 4096 -> 0 bytes .../jvm/kotlin/proto.tab.keystream.len | Bin 8 -> 0 bytes .../caches-jvm/jvm/kotlin/proto.tab.len | Bin 8 -> 0 bytes .../caches-jvm/jvm/kotlin/proto.tab.values.at | Bin 18862 -> 0 bytes .../caches-jvm/jvm/kotlin/proto.tab_i | Bin 32768 -> 0 bytes .../caches-jvm/jvm/kotlin/proto.tab_i.len | Bin 8 -> 0 bytes .../jvm/kotlin/source-to-classes.tab | Bin 4096 -> 0 bytes .../kotlin/source-to-classes.tab.keystream | Bin 4096 -> 0 bytes .../source-to-classes.tab.keystream.len | Bin 8 -> 0 bytes .../jvm/kotlin/source-to-classes.tab.len | Bin 8 -> 0 bytes .../kotlin/source-to-classes.tab.values.at | Bin 2331 -> 0 bytes .../jvm/kotlin/source-to-classes.tab_i | Bin 32768 -> 0 bytes .../jvm/kotlin/source-to-classes.tab_i.len | Bin 8 -> 0 bytes .../caches-jvm/jvm/kotlin/subtypes.tab | Bin 4096 -> 0 bytes .../jvm/kotlin/subtypes.tab.keystream | Bin 4096 -> 0 bytes .../jvm/kotlin/subtypes.tab.keystream.len | Bin 8 -> 0 bytes .../caches-jvm/jvm/kotlin/subtypes.tab.len | Bin 8 -> 0 bytes .../jvm/kotlin/subtypes.tab.values.at | Bin 793 -> 0 bytes .../caches-jvm/jvm/kotlin/subtypes.tab_i | Bin 32768 -> 0 bytes .../caches-jvm/jvm/kotlin/subtypes.tab_i.len | Bin 8 -> 0 bytes .../caches-jvm/jvm/kotlin/supertypes.tab | Bin 4096 -> 0 bytes .../jvm/kotlin/supertypes.tab.keystream | Bin 4096 -> 0 bytes .../jvm/kotlin/supertypes.tab.keystream.len | Bin 8 -> 0 bytes .../caches-jvm/jvm/kotlin/supertypes.tab.len | Bin 8 -> 0 bytes .../jvm/kotlin/supertypes.tab.values.at | Bin 689 -> 0 bytes .../caches-jvm/jvm/kotlin/supertypes.tab_i | Bin 32768 -> 0 bytes .../jvm/kotlin/supertypes.tab_i.len | Bin 8 -> 0 bytes .../caches-jvm/lookups/counters.tab | 2 - .../caches-jvm/lookups/file-to-id.tab | Bin 4096 -> 0 bytes .../lookups/file-to-id.tab.keystream | Bin 4096 -> 0 bytes .../lookups/file-to-id.tab.keystream.len | Bin 8 -> 0 bytes .../caches-jvm/lookups/file-to-id.tab.len | Bin 8 -> 0 bytes .../lookups/file-to-id.tab.values.at | Bin 163 -> 0 bytes .../caches-jvm/lookups/file-to-id.tab_i | Bin 32768 -> 0 bytes .../caches-jvm/lookups/file-to-id.tab_i.len | Bin 8 -> 0 bytes .../caches-jvm/lookups/id-to-file.tab | Bin 4096 -> 0 bytes .../lookups/id-to-file.tab.keystream | Bin 4096 -> 0 bytes .../lookups/id-to-file.tab.keystream.len | Bin 8 -> 0 bytes .../caches-jvm/lookups/id-to-file.tab.len | Bin 8 -> 0 bytes .../lookups/id-to-file.tab.values.at | Bin 3654 -> 0 bytes .../caches-jvm/lookups/id-to-file.tab_i | Bin 32768 -> 0 bytes .../caches-jvm/lookups/id-to-file.tab_i.len | Bin 8 -> 0 bytes .../caches-jvm/lookups/lookups.tab | Bin 16384 -> 0 bytes .../caches-jvm/lookups/lookups.tab.keystream | Bin 12288 -> 0 bytes .../lookups/lookups.tab.keystream.len | Bin 8 -> 0 bytes .../caches-jvm/lookups/lookups.tab.len | Bin 8 -> 0 bytes .../caches-jvm/lookups/lookups.tab.values.at | Bin 12507 -> 0 bytes .../caches-jvm/lookups/lookups.tab_i | Bin 32768 -> 0 bytes .../caches-jvm/lookups/lookups.tab_i.len | Bin 8 -> 0 bytes .../build/kotlin/compileKotlin/last-build.bin | Bin 81 -> 0 bytes .../org/openapitools/client/Application.kt | 20 - .../client/infrastructure/ApiClient.kt | 3 +- .../infrastructure/ApplicationDelegates.kt | 29 - .../org/openapitools/client/apis/PetApi.kt | 494 ------------------ .../org/openapitools/client/apis/StoreApi.kt | 253 --------- .../org/openapitools/client/apis/UserApi.kt | 476 ----------------- .../client/infrastructure/ApiAbstractions.kt | 23 - .../client/infrastructure/ApiClient.kt | 245 --------- .../ApiInfrastructureResponse.kt | 43 -- .../infrastructure/ApplicationDelegates.kt | 29 - .../client/infrastructure/ByteArrayAdapter.kt | 12 - .../client/infrastructure/Errors.kt | 18 - .../client/infrastructure/LocalDateAdapter.kt | 19 - .../infrastructure/LocalDateTimeAdapter.kt | 19 - .../infrastructure/OffsetDateTimeAdapter.kt | 19 - .../client/infrastructure/RequestConfig.kt | 17 - .../client/infrastructure/RequestMethod.kt | 8 - .../infrastructure/ResponseExtensions.kt | 24 - .../client/infrastructure/Serializer.kt | 21 - .../client/infrastructure/UUIDAdapter.kt | 13 - .../openapitools/client/models/ApiResponse.kt | 32 -- .../openapitools/client/models/Category.kt | 29 - .../org/openapitools/client/models/Order.kt | 54 -- .../org/openapitools/client/models/Pet.kt | 56 -- .../org/openapitools/client/models/Tag.kt | 29 - .../org/openapitools/client/models/User.kt | 48 -- .../client/infrastructure/ApiClient.kt | 3 +- .../infrastructure/ApplicationDelegates.kt | 29 - .../.openapi-generator/FILES | 1 - .../org/openapitools/client/apis/PetApi.kt | 492 ----------------- .../org/openapitools/client/apis/StoreApi.kt | 253 --------- .../org/openapitools/client/apis/UserApi.kt | 476 ----------------- .../client/infrastructure/ApiAbstractions.kt | 23 - .../client/infrastructure/ApiClient.kt | 251 --------- .../ApiInfrastructureResponse.kt | 43 -- .../infrastructure/ApplicationDelegates.kt | 29 - .../client/infrastructure/ByteArrayAdapter.kt | 33 -- .../client/infrastructure/DateAdapter.kt | 37 -- .../client/infrastructure/Errors.kt | 18 - .../client/infrastructure/LocalDateAdapter.kt | 35 -- .../infrastructure/LocalDateTimeAdapter.kt | 35 -- .../infrastructure/OffsetDateTimeAdapter.kt | 35 -- .../client/infrastructure/RequestConfig.kt | 17 - .../client/infrastructure/RequestMethod.kt | 8 - .../infrastructure/ResponseExtensions.kt | 24 - .../client/infrastructure/Serializer.kt | 23 - .../openapitools/client/models/ApiResponse.kt | 38 -- .../openapitools/client/models/Category.kt | 35 -- .../org/openapitools/client/models/Order.kt | 58 -- .../org/openapitools/client/models/Pet.kt | 60 --- .../org/openapitools/client/models/Tag.kt | 35 -- .../org/openapitools/client/models/User.kt | 54 -- .../client/infrastructure/ApiClient.kt | 3 +- .../infrastructure/ApplicationDelegates.kt | 29 - .../client/infrastructure/DateAdapter.kt | 37 -- .../org/openapitools/client/apis/PetApi.kt | 492 ----------------- .../org/openapitools/client/apis/StoreApi.kt | 253 --------- .../org/openapitools/client/apis/UserApi.kt | 476 ----------------- .../client/infrastructure/ApiAbstractions.kt | 23 - .../client/infrastructure/ApiClient.kt | 251 --------- .../ApiInfrastructureResponse.kt | 43 -- .../infrastructure/ApplicationDelegates.kt | 29 - .../client/infrastructure/ByteArrayAdapter.kt | 12 - .../client/infrastructure/Errors.kt | 18 - .../client/infrastructure/LocalDateAdapter.kt | 19 - .../infrastructure/LocalDateTimeAdapter.kt | 19 - .../infrastructure/OffsetDateTimeAdapter.kt | 19 - .../client/infrastructure/RequestConfig.kt | 17 - .../client/infrastructure/RequestMethod.kt | 8 - .../infrastructure/ResponseExtensions.kt | 24 - .../client/infrastructure/Serializer.kt | 19 - .../client/infrastructure/UUIDAdapter.kt | 13 - .../openapitools/client/models/ApiResponse.kt | 33 -- .../openapitools/client/models/Category.kt | 30 -- .../org/openapitools/client/models/Order.kt | 55 -- .../org/openapitools/client/models/Pet.kt | 57 -- .../org/openapitools/client/models/Tag.kt | 30 -- .../org/openapitools/client/models/User.kt | 49 -- .../client/infrastructure/ApiClient.kt | 3 +- .../infrastructure/ApplicationDelegates.kt | 29 - .../org/openapitools/client/apis/PetApi.kt | 492 ----------------- .../org/openapitools/client/apis/StoreApi.kt | 253 --------- .../org/openapitools/client/apis/UserApi.kt | 476 ----------------- .../client/infrastructure/ApiAbstractions.kt | 23 - .../client/infrastructure/ApiClient.kt | 251 --------- .../ApiInfrastructureResponse.kt | 43 -- .../infrastructure/ApplicationDelegates.kt | 29 - .../client/infrastructure/ByteArrayAdapter.kt | 12 - .../client/infrastructure/Errors.kt | 18 - .../client/infrastructure/LocalDateAdapter.kt | 19 - .../infrastructure/LocalDateTimeAdapter.kt | 19 - .../infrastructure/OffsetDateTimeAdapter.kt | 19 - .../client/infrastructure/RequestConfig.kt | 17 - .../client/infrastructure/RequestMethod.kt | 8 - .../infrastructure/ResponseExtensions.kt | 24 - .../client/infrastructure/Serializer.kt | 21 - .../client/infrastructure/UUIDAdapter.kt | 13 - .../openapitools/client/models/ApiResponse.kt | 32 -- .../openapitools/client/models/Category.kt | 29 - .../org/openapitools/client/models/Order.kt | 54 -- .../org/openapitools/client/models/Pet.kt | 56 -- .../org/openapitools/client/models/Tag.kt | 29 - .../org/openapitools/client/models/User.kt | 48 -- .../client/infrastructure/ApiClient.kt | 3 +- .../infrastructure/ApplicationDelegates.kt | 29 - .../org/openapitools/client/apis/PetApi.kt | 492 ----------------- .../org/openapitools/client/apis/StoreApi.kt | 253 --------- .../org/openapitools/client/apis/UserApi.kt | 476 ----------------- .../client/infrastructure/ApiAbstractions.kt | 23 - .../client/infrastructure/ApiClient.kt | 251 --------- .../ApiInfrastructureResponse.kt | 43 -- .../infrastructure/ApplicationDelegates.kt | 29 - .../client/infrastructure/ByteArrayAdapter.kt | 12 - .../client/infrastructure/Errors.kt | 18 - .../client/infrastructure/LocalDateAdapter.kt | 19 - .../infrastructure/LocalDateTimeAdapter.kt | 19 - .../infrastructure/OffsetDateTimeAdapter.kt | 19 - .../client/infrastructure/RequestConfig.kt | 17 - .../client/infrastructure/RequestMethod.kt | 8 - .../infrastructure/ResponseExtensions.kt | 24 - .../client/infrastructure/Serializer.kt | 21 - .../client/infrastructure/UUIDAdapter.kt | 13 - .../openapitools/client/models/ApiResponse.kt | 38 -- .../openapitools/client/models/Category.kt | 35 -- .../org/openapitools/client/models/Order.kt | 58 -- .../org/openapitools/client/models/Pet.kt | 60 --- .../org/openapitools/client/models/Tag.kt | 35 -- .../org/openapitools/client/models/User.kt | 54 -- .../client/infrastructure/ApiClient.kt | 3 +- .../infrastructure/ApplicationDelegates.kt | 29 - .../org/openapitools/client/apis/PetApi.kt | 492 ----------------- .../org/openapitools/client/apis/StoreApi.kt | 253 --------- .../org/openapitools/client/apis/UserApi.kt | 476 ----------------- .../client/infrastructure/ApiAbstractions.kt | 23 - .../client/infrastructure/ApiClient.kt | 249 --------- .../ApiInfrastructureResponse.kt | 43 -- .../infrastructure/ApplicationDelegates.kt | 29 - .../client/infrastructure/ByteArrayAdapter.kt | 12 - .../client/infrastructure/Errors.kt | 18 - .../client/infrastructure/LocalDateAdapter.kt | 19 - .../infrastructure/LocalDateTimeAdapter.kt | 19 - .../infrastructure/OffsetDateTimeAdapter.kt | 19 - .../client/infrastructure/RequestConfig.kt | 17 - .../client/infrastructure/RequestMethod.kt | 8 - .../infrastructure/ResponseExtensions.kt | 24 - .../client/infrastructure/Serializer.kt | 21 - .../client/infrastructure/UUIDAdapter.kt | 13 - .../openapitools/client/models/ApiResponse.kt | 32 -- .../openapitools/client/models/Category.kt | 29 - .../org/openapitools/client/models/Order.kt | 54 -- .../org/openapitools/client/models/Pet.kt | 56 -- .../org/openapitools/client/models/Tag.kt | 29 - .../org/openapitools/client/models/User.kt | 48 -- .../client/infrastructure/ApiClient.kt | 3 +- .../infrastructure/ApplicationDelegates.kt | 29 - .../.openapi-generator/FILES | 1 - .../client/infrastructure/DateAdapter.kt | 28 - .../client/infrastructure/Serializer.kt | 2 - .../org/openapitools/client/apis/PetApi.kt | 125 ----- .../org/openapitools/client/apis/StoreApi.kt | 63 --- .../org/openapitools/client/apis/UserApi.kt | 114 ---- .../openapitools/client/auth/ApiKeyAuth.kt | 50 -- .../org/openapitools/client/auth/OAuth.kt | 151 ------ .../org/openapitools/client/auth/OAuthFlow.kt | 5 - .../client/auth/OAuthOkHttpClient.kt | 61 --- .../client/infrastructure/ApiClient.kt | 203 ------- .../client/infrastructure/ByteArrayAdapter.kt | 12 - .../infrastructure/CollectionFormats.kt | 56 -- .../client/infrastructure/LocalDateAdapter.kt | 19 - .../infrastructure/LocalDateTimeAdapter.kt | 19 - .../infrastructure/OffsetDateTimeAdapter.kt | 19 - .../client/infrastructure/ResponseExt.kt | 16 - .../client/infrastructure/Serializer.kt | 21 - .../client/infrastructure/UUIDAdapter.kt | 13 - .../openapitools/client/models/ApiResponse.kt | 32 -- .../openapitools/client/models/Category.kt | 29 - .../org/openapitools/client/models/Order.kt | 54 -- .../org/openapitools/client/models/Pet.kt | 56 -- .../org/openapitools/client/models/Tag.kt | 29 - .../org/openapitools/client/models/User.kt | 48 -- .../org/openapitools/client/apis/PetApi.kt | 124 ----- .../org/openapitools/client/apis/StoreApi.kt | 62 --- .../org/openapitools/client/apis/UserApi.kt | 113 ---- .../openapitools/client/auth/ApiKeyAuth.kt | 50 -- .../org/openapitools/client/auth/OAuth.kt | 151 ------ .../org/openapitools/client/auth/OAuthFlow.kt | 5 - .../client/auth/OAuthOkHttpClient.kt | 61 --- .../client/infrastructure/ApiClient.kt | 200 ------- .../client/infrastructure/ByteArrayAdapter.kt | 12 - .../infrastructure/CollectionFormats.kt | 56 -- .../client/infrastructure/LocalDateAdapter.kt | 19 - .../infrastructure/LocalDateTimeAdapter.kt | 19 - .../infrastructure/OffsetDateTimeAdapter.kt | 19 - .../client/infrastructure/ResponseExt.kt | 16 - .../client/infrastructure/Serializer.kt | 21 - .../client/infrastructure/UUIDAdapter.kt | 13 - .../openapitools/client/models/ApiResponse.kt | 32 -- .../openapitools/client/models/Category.kt | 29 - .../org/openapitools/client/models/Order.kt | 54 -- .../org/openapitools/client/models/Pet.kt | 56 -- .../org/openapitools/client/models/Tag.kt | 29 - .../org/openapitools/client/models/User.kt | 48 -- .../org/openapitools/client/apis/PetApi.kt | 492 ----------------- .../org/openapitools/client/apis/StoreApi.kt | 253 --------- .../org/openapitools/client/apis/UserApi.kt | 476 ----------------- .../client/infrastructure/ApiAbstractions.kt | 23 - .../client/infrastructure/ApiClient.kt | 251 --------- .../ApiInfrastructureResponse.kt | 43 -- .../infrastructure/ApplicationDelegates.kt | 29 - .../client/infrastructure/ByteArrayAdapter.kt | 12 - .../client/infrastructure/Errors.kt | 18 - .../client/infrastructure/LocalDateAdapter.kt | 19 - .../infrastructure/LocalDateTimeAdapter.kt | 19 - .../infrastructure/OffsetDateTimeAdapter.kt | 19 - .../client/infrastructure/RequestConfig.kt | 17 - .../client/infrastructure/RequestMethod.kt | 8 - .../infrastructure/ResponseExtensions.kt | 24 - .../client/infrastructure/Serializer.kt | 21 - .../client/infrastructure/UUIDAdapter.kt | 13 - .../openapitools/client/models/ApiResponse.kt | 38 -- .../openapitools/client/models/Category.kt | 35 -- .../org/openapitools/client/models/Order.kt | 58 -- .../org/openapitools/client/models/Pet.kt | 60 --- .../org/openapitools/client/models/Tag.kt | 35 -- .../org/openapitools/client/models/User.kt | 54 -- .../client/infrastructure/ApiClient.kt | 3 +- .../infrastructure/ApplicationDelegates.kt | 29 - .../org/openapitools/client/apis/PetApi.kt | 492 ----------------- .../org/openapitools/client/apis/StoreApi.kt | 253 --------- .../org/openapitools/client/apis/UserApi.kt | 476 ----------------- .../client/infrastructure/ApiAbstractions.kt | 23 - .../client/infrastructure/ApiClient.kt | 251 --------- .../ApiInfrastructureResponse.kt | 43 -- .../infrastructure/ApplicationDelegates.kt | 29 - .../client/infrastructure/ByteArrayAdapter.kt | 12 - .../client/infrastructure/Errors.kt | 18 - .../client/infrastructure/LocalDateAdapter.kt | 19 - .../infrastructure/LocalDateTimeAdapter.kt | 19 - .../infrastructure/OffsetDateTimeAdapter.kt | 19 - .../client/infrastructure/RequestConfig.kt | 17 - .../client/infrastructure/RequestMethod.kt | 8 - .../infrastructure/ResponseExtensions.kt | 24 - .../client/infrastructure/Serializer.kt | 21 - .../client/infrastructure/UUIDAdapter.kt | 13 - .../openapitools/client/models/ApiResponse.kt | 32 -- .../openapitools/client/models/Category.kt | 29 - .../org/openapitools/client/models/Order.kt | 54 -- .../org/openapitools/client/models/Pet.kt | 56 -- .../org/openapitools/client/models/Tag.kt | 29 - .../org/openapitools/client/models/User.kt | 48 -- .../client/infrastructure/ApiClient.kt | 3 +- .../infrastructure/ApplicationDelegates.kt | 29 - .../org/openapitools/client/apis/EnumApi.kt | 89 ---- .../client/infrastructure/ApiAbstractions.kt | 23 - .../client/infrastructure/ApiClient.kt | 232 -------- .../ApiInfrastructureResponse.kt | 43 -- .../infrastructure/ApplicationDelegates.kt | 29 - .../client/infrastructure/ByteArrayAdapter.kt | 12 - .../client/infrastructure/Errors.kt | 18 - .../client/infrastructure/LocalDateAdapter.kt | 19 - .../infrastructure/LocalDateTimeAdapter.kt | 19 - .../infrastructure/OffsetDateTimeAdapter.kt | 19 - .../client/infrastructure/RequestConfig.kt | 17 - .../client/infrastructure/RequestMethod.kt | 8 - .../infrastructure/ResponseExtensions.kt | 24 - .../client/infrastructure/Serializer.kt | 21 - .../client/infrastructure/UUIDAdapter.kt | 13 - .../org/openapitools/client/models/PetEnum.kt | 43 -- .../client/infrastructure/ApiClient.kt | 3 +- .../infrastructure/ApplicationDelegates.kt | 29 - .../org/openapitools/client/apis/PetApi.kt | 492 ----------------- .../org/openapitools/client/apis/StoreApi.kt | 253 --------- .../org/openapitools/client/apis/UserApi.kt | 476 ----------------- .../client/infrastructure/ApiAbstractions.kt | 23 - .../client/infrastructure/ApiClient.kt | 251 --------- .../ApiInfrastructureResponse.kt | 43 -- .../infrastructure/ApplicationDelegates.kt | 29 - .../client/infrastructure/ByteArrayAdapter.kt | 12 - .../client/infrastructure/Errors.kt | 18 - .../client/infrastructure/LocalDateAdapter.kt | 19 - .../infrastructure/LocalDateTimeAdapter.kt | 19 - .../infrastructure/OffsetDateTimeAdapter.kt | 19 - .../client/infrastructure/RequestConfig.kt | 17 - .../client/infrastructure/RequestMethod.kt | 8 - .../infrastructure/ResponseExtensions.kt | 24 - .../client/infrastructure/Serializer.kt | 21 - .../client/infrastructure/UUIDAdapter.kt | 13 - .../openapitools/client/models/ApiResponse.kt | 38 -- .../openapitools/client/models/Category.kt | 35 -- .../org/openapitools/client/models/Order.kt | 58 -- .../org/openapitools/client/models/Pet.kt | 60 --- .../org/openapitools/client/models/Tag.kt | 35 -- .../org/openapitools/client/models/User.kt | 54 -- .../client/infrastructure/ApiClient.kt | 3 +- .../infrastructure/ApplicationDelegates.kt | 29 - .../ktor/.openapi-generator-ignore | 22 +- .../org/openapitools/model/InlineObject.kt | 30 -- .../org/openapitools/model/InlineObject1.kt | 31 -- .../.openapi-generator/FILES | 6 +- .../.openapi-generator/VERSION | 2 +- .../build.gradle.kts | 8 +- .../kotlin-springboot-modelMutable/pom.xml | 66 +-- .../settings.gradle | 26 +- .../api/{PetApi.kt => PetApiController.kt} | 24 +- .../org/openapitools/api/PetApiService.kt | 88 +++- .../{StoreApi.kt => StoreApiController.kt} | 12 +- .../org/openapitools/api/StoreApiService.kt | 43 +- .../api/{UserApi.kt => UserApiController.kt} | 24 +- .../org/openapitools/api/UserApiService.kt | 82 ++- .../kotlin/org/openapitools/api/PetApiTest.kt | 156 +++--- .../org/openapitools/api/StoreApiTest.kt | 70 ++- .../org/openapitools/api/UserApiTest.kt | 146 +++--- .../kotlin/org/openapitools/api/PetApiTest.kt | 156 +++--- .../org/openapitools/api/StoreApiTest.kt | 70 ++- .../org/openapitools/api/UserApiTest.kt | 146 +++--- .../kotlin/org/openapitools/api/PetApiTest.kt | 156 +++--- .../org/openapitools/api/StoreApiTest.kt | 70 ++- .../org/openapitools/api/UserApiTest.kt | 146 +++--- .../kotlin/vertx/.openapi-generator/VERSION | 2 +- samples/server/petstore/kotlin/vertx/pom.xml | 6 +- .../openapitools/server/api/model/Order.kt | 2 +- 515 files changed, 816 insertions(+), 26447 deletions(-) rename bin/configs/{other => }/kotlin-spring-boot-modelMutable.yaml (100%) rename bin/configs/{other => }/kotlin-vertx-vertx.yaml (100%) rename bin/configs/other/{openapi3 => }/kotlin-jvm-retrofit2-coroutines.yaml (100%) rename bin/configs/other/{openapi3 => }/kotlin-jvm-retrofit2-rx.yaml (100%) rename bin/configs/other/{openapi3 => }/kotlin-jvm-retrofit2-rx2-kotlinx_serialization.yaml (100%) rename bin/configs/other/{openapi3 => }/kotlin-jvm-retrofit2-rx2.yaml (100%) rename bin/configs/other/{openapi3 => }/kotlin-multiplatform.yaml (100%) rename bin/configs/other/{openapi3 => }/kotlin-spring-boot-reactive.yaml (100%) rename bin/configs/other/{openapi3 => }/kotlin-spring-boot.yaml (100%) rename bin/configs/other/{openapi3 => }/kotlin.yaml (100%) delete mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/DateAdapter.kt.mustache delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/apis/PetApi.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/apis/StoreApi.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/apis/UserApi.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApiClient.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/DateAdapter.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/Errors.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/Serializer.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/ApiResponse.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Category.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Order.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Pet.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Tag.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/User.kt delete mode 100644 samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/apis/PetApi.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/apis/StoreApi.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/apis/UserApi.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApiClient.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/Errors.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/Serializer.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/ApiResponse.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Category.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Order.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Pet.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Tag.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/User.kt delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/META-INF/kotlin-petstore-jackson.kotlin_module delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/ApplicationKt.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/PetApi$WhenMappings.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/PetApi.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/StoreApi$WhenMappings.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/StoreApi.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/UserApi$WhenMappings.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/UserApi.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiAbstractionsKt$defaultMultiValueConverter$1.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiAbstractionsKt.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiClient$Companion$client$2.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiClient$Companion.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiClient$WhenMappings.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiClient.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApplicationDelegates$SetOnce.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApplicationDelegates.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ClientError.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ClientException$Companion.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ClientException.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Informational.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Redirection.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/RequestConfig.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/RequestMethod.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ResponseExtensionsKt.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ResponseType.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Serializer.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ServerError.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ServerException$Companion.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ServerException.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Success.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/ApiResponse.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Category.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Order$Status.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Order.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Pet$Status.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Pet.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Tag.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/User.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/build-history.bin delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab.keystream delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab.keystream.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab.values.at delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab_i delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab_i.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab.keystream delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab.keystream.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab.values.at delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab_i delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab_i.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab.keystream delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab.keystream.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab.values.at delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab_i delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab_i.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab.keystream delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab.keystream.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab.values.at delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab_i delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab_i.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab.keystream delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab.keystream.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab.values.at delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab_i delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab_i.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab_i delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.values.at delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab_i delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab_i.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab.values.at delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/counters.tab delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab.keystream delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab.keystream.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab.values.at delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab_i delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab_i.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.keystream delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.keystream.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.values.at delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab_i delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab_i.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.keystream delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.keystream.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.values.at delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab_i delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab_i.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/last-build.bin delete mode 100644 samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/Application.kt delete mode 100644 samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/apis/PetApi.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/apis/StoreApi.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/apis/UserApi.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApiClient.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/Errors.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/Serializer.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/ApiResponse.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Category.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Order.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Pet.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Tag.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/User.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/apis/PetApi.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/apis/StoreApi.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/apis/UserApi.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ApiClient.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/DateAdapter.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/Errors.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/Serializer.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/ApiResponse.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/Category.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/Order.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/Pet.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/Tag.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/User.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/apis/PetApi.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/apis/StoreApi.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/apis/UserApi.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApiClient.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/Errors.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/Serializer.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/ApiResponse.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Category.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Order.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Pet.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Tag.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/User.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/apis/PetApi.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/apis/StoreApi.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/apis/UserApi.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApiClient.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/Errors.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/Serializer.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/ApiResponse.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Category.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Order.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Pet.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Tag.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/User.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/apis/PetApi.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/apis/StoreApi.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/apis/UserApi.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApiClient.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/Errors.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/Serializer.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/ApiResponse.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Category.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Order.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Pet.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Tag.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/User.kt delete mode 100644 samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/apis/PetApi.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/apis/StoreApi.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/apis/UserApi.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApiClient.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/Errors.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/Serializer.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/ApiResponse.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Category.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Order.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Pet.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Tag.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/User.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/apis/PetApi.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/apis/StoreApi.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/apis/UserApi.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/ApiKeyAuth.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/OAuth.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/OAuthFlow.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/OAuthOkHttpClient.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/ApiClient.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/CollectionFormats.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/ResponseExt.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/Serializer.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/ApiResponse.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Category.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Order.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Pet.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Tag.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/User.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/apis/PetApi.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/apis/StoreApi.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/apis/UserApi.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/ApiKeyAuth.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/OAuth.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/OAuthFlow.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/OAuthOkHttpClient.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/ApiClient.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/CollectionFormats.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/ResponseExt.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/Serializer.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/ApiResponse.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Category.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Order.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Pet.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Tag.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/User.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/PetApi.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/StoreApi.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/UserApi.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiClient.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/Errors.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/Serializer.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/ApiResponse.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Category.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Order.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Pet.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Tag.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/User.kt delete mode 100644 samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/PetApi.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/StoreApi.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/UserApi.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiClient.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/Errors.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/Serializer.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/ApiResponse.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Category.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Order.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Pet.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Tag.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/User.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/apis/EnumApi.kt delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ApiClient.kt delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/Errors.kt delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/Serializer.kt delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/models/PetEnum.kt delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/apis/PetApi.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/apis/StoreApi.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/apis/UserApi.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApiClient.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/Errors.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/Serializer.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/ApiResponse.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Category.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Order.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Pet.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Tag.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/User.kt delete mode 100644 samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/InlineObject.kt delete mode 100644 samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/InlineObject1.kt rename samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/{PetApi.kt => PetApiController.kt} (95%) rename samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/{StoreApi.kt => StoreApiController.kt} (94%) rename samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/{UserApi.kt => UserApiController.kt} (92%) diff --git a/bin/configs/other/kotlin-spring-boot-modelMutable.yaml b/bin/configs/kotlin-spring-boot-modelMutable.yaml similarity index 100% rename from bin/configs/other/kotlin-spring-boot-modelMutable.yaml rename to bin/configs/kotlin-spring-boot-modelMutable.yaml diff --git a/bin/configs/other/kotlin-vertx-vertx.yaml b/bin/configs/kotlin-vertx-vertx.yaml similarity index 100% rename from bin/configs/other/kotlin-vertx-vertx.yaml rename to bin/configs/kotlin-vertx-vertx.yaml diff --git a/bin/configs/other/openapi3/kotlin-jvm-retrofit2-coroutines.yaml b/bin/configs/other/kotlin-jvm-retrofit2-coroutines.yaml similarity index 100% rename from bin/configs/other/openapi3/kotlin-jvm-retrofit2-coroutines.yaml rename to bin/configs/other/kotlin-jvm-retrofit2-coroutines.yaml diff --git a/bin/configs/other/openapi3/kotlin-jvm-retrofit2-rx.yaml b/bin/configs/other/kotlin-jvm-retrofit2-rx.yaml similarity index 100% rename from bin/configs/other/openapi3/kotlin-jvm-retrofit2-rx.yaml rename to bin/configs/other/kotlin-jvm-retrofit2-rx.yaml diff --git a/bin/configs/other/openapi3/kotlin-jvm-retrofit2-rx2-kotlinx_serialization.yaml b/bin/configs/other/kotlin-jvm-retrofit2-rx2-kotlinx_serialization.yaml similarity index 100% rename from bin/configs/other/openapi3/kotlin-jvm-retrofit2-rx2-kotlinx_serialization.yaml rename to bin/configs/other/kotlin-jvm-retrofit2-rx2-kotlinx_serialization.yaml diff --git a/bin/configs/other/openapi3/kotlin-jvm-retrofit2-rx2.yaml b/bin/configs/other/kotlin-jvm-retrofit2-rx2.yaml similarity index 100% rename from bin/configs/other/openapi3/kotlin-jvm-retrofit2-rx2.yaml rename to bin/configs/other/kotlin-jvm-retrofit2-rx2.yaml diff --git a/bin/configs/other/openapi3/kotlin-multiplatform.yaml b/bin/configs/other/kotlin-multiplatform.yaml similarity index 100% rename from bin/configs/other/openapi3/kotlin-multiplatform.yaml rename to bin/configs/other/kotlin-multiplatform.yaml diff --git a/bin/configs/other/openapi3/kotlin-spring-boot-reactive.yaml b/bin/configs/other/kotlin-spring-boot-reactive.yaml similarity index 100% rename from bin/configs/other/openapi3/kotlin-spring-boot-reactive.yaml rename to bin/configs/other/kotlin-spring-boot-reactive.yaml diff --git a/bin/configs/other/openapi3/kotlin-spring-boot.yaml b/bin/configs/other/kotlin-spring-boot.yaml similarity index 100% rename from bin/configs/other/openapi3/kotlin-spring-boot.yaml rename to bin/configs/other/kotlin-spring-boot.yaml diff --git a/bin/configs/other/openapi3/kotlin.yaml b/bin/configs/other/kotlin.yaml similarity index 100% rename from bin/configs/other/openapi3/kotlin.yaml rename to bin/configs/other/kotlin.yaml diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java index 3d2135e03c3c..c8d7a87716d0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java @@ -493,14 +493,12 @@ private void addSupportingSerializerAdapters(final String infrastructureFolder) break; case gson: - supportingFiles.add(new SupportingFile("jvm-common/infrastructure/DateAdapter.kt.mustache", infrastructureFolder, "DateAdapter.kt")); supportingFiles.add(new SupportingFile("jvm-common/infrastructure/LocalDateAdapter.kt.mustache", infrastructureFolder, "LocalDateAdapter.kt")); supportingFiles.add(new SupportingFile("jvm-common/infrastructure/LocalDateTimeAdapter.kt.mustache", infrastructureFolder, "LocalDateTimeAdapter.kt")); supportingFiles.add(new SupportingFile("jvm-common/infrastructure/OffsetDateTimeAdapter.kt.mustache", infrastructureFolder, "OffsetDateTimeAdapter.kt")); break; case jackson: - //supportingFiles.add(new SupportingFile("jvm-common/infrastructure/DateAdapter.kt.mustache", infrastructureFolder, "DateAdapter.kt")); break; case kotlinx_serialization: @@ -511,7 +509,6 @@ private void addSupportingSerializerAdapters(final String infrastructureFolder) supportingFiles.add(new SupportingFile("jvm-common/infrastructure/URLAdapter.kt.mustache", infrastructureFolder, "URLAdapter.kt")); supportingFiles.add(new SupportingFile("jvm-common/infrastructure/BigIntegerAdapter.kt.mustache", infrastructureFolder, "BigIntegerAdapter.kt")); supportingFiles.add(new SupportingFile("jvm-common/infrastructure/BigDecimalAdapter.kt.mustache", infrastructureFolder, "BigDecimalAdapter.kt")); - supportingFiles.add(new SupportingFile("jvm-common/infrastructure/DateAdapter.kt.mustache", infrastructureFolder, "DateAdapter.kt")); supportingFiles.add(new SupportingFile("jvm-common/infrastructure/LocalDateAdapter.kt.mustache", infrastructureFolder, "LocalDateAdapter.kt")); supportingFiles.add(new SupportingFile("jvm-common/infrastructure/LocalDateTimeAdapter.kt.mustache", infrastructureFolder, "LocalDateTimeAdapter.kt")); supportingFiles.add(new SupportingFile("jvm-common/infrastructure/OffsetDateTimeAdapter.kt.mustache", infrastructureFolder, "OffsetDateTimeAdapter.kt")); diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/DateAdapter.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/DateAdapter.kt.mustache deleted file mode 100644 index 8756321c4e0b..000000000000 --- a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/DateAdapter.kt.mustache +++ /dev/null @@ -1,67 +0,0 @@ -package {{packageName}}.infrastructure - -{{#kotlinx_serialization}} -import kotlinx.serialization.KSerializer -import kotlinx.serialization.Serializer -import kotlinx.serialization.encoding.Decoder -import kotlinx.serialization.encoding.Encoder -import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor -import kotlinx.serialization.descriptors.PrimitiveKind -import kotlinx.serialization.descriptors.SerialDescriptor -{{/kotlinx_serialization}} -{{#gson}} -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException -{{/gson}} -import java.text.DateFormat -import java.text.SimpleDateFormat -import java.util.Date -import java.util.Locale -{{#gson}} - -{{#nonPublicApi}}internal {{/nonPublicApi}}class DateAdapter(val formatter: DateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.getDefault())) : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: Date?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(formatter.format(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): Date? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return formatter.parse(out.nextString()) - } - } - } -} -{{/gson}} -{{#kotlinx_serialization}} - -@Serializer(forClass = Date::class) -object DateAdapter : KSerializer { - private val df: DateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.getDefault()) - - override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("Date", PrimitiveKind.STRING) - - override fun serialize(encoder: Encoder, value: Date) { - encoder.encodeString(df.format(value)) - } - - override fun deserialize(decoder: Decoder): Date { - return df.parse(decoder.decodeString())!! - } -} -{{/kotlinx_serialization}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/Serializer.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/Serializer.kt.mustache index ca5d3288a203..e3e570e7a0ca 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/Serializer.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/Serializer.kt.mustache @@ -28,7 +28,6 @@ import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper {{/jackson}} {{#kotlinx_serialization}} -import java.util.Date import java.math.BigDecimal import java.math.BigInteger {{^threetenbp}} @@ -97,7 +96,6 @@ import java.util.concurrent.atomic.AtomicLong val kotlinSerializationAdapters = SerializersModule { contextual(BigDecimal::class, BigDecimalAdapter) contextual(BigInteger::class, BigIntegerAdapter) - contextual(Date::class, DateAdapter) contextual(LocalDate::class, LocalDateAdapter) contextual(LocalDateTime::class, LocalDateTimeAdapter) contextual(OffsetDateTime::class, OffsetDateTimeAdapter) diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache index 78c16621cf8d..39495761e5a9 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache @@ -47,7 +47,6 @@ import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime {{/threetenbp}} -import java.util.Date import java.util.Locale {{#useCoroutines}} import kotlin.coroutines.resume @@ -419,7 +418,7 @@ import com.squareup.moshi.adapter null -> "" is Array<*> -> toMultiValue(value, "csv").toString() is Iterable<*> -> toMultiValue(value, "csv").toString() - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 09194ef92717..dc423d8a17df 100644 --- a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -25,7 +25,6 @@ import java.time.LocalDateTime import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime -import java.util.Date import java.util.Locale import com.squareup.moshi.adapter @@ -229,7 +228,7 @@ open class ApiClient(val baseUrl: String) { null -> "" is Array<*> -> toMultiValue(value, "csv").toString() is Iterable<*> -> toMultiValue(value, "csv").toString() - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/samples/client/petstore/kotlin-gson/.openapi-generator/FILES b/samples/client/petstore/kotlin-gson/.openapi-generator/FILES index d1f6eddcef2d..4bfcf9fb54e9 100644 --- a/samples/client/petstore/kotlin-gson/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-gson/.openapi-generator/FILES @@ -21,7 +21,6 @@ src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt -src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index c8b93b33bf6f..000000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,492 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun addPet(body: Pet) : Unit { - val localVariableConfig = addPetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation addPet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun addPetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Deletes a pet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deletePet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return RequestConfig - */ - fun deletePetRequestConfig(petId: kotlin.Long, apiKey: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByStatusRequestConfig(status = status) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByStatus - * - * @param status Status values that need to be considered for filter - * @return RequestConfig - */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("status", toMultiValue(status.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByStatus", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByTags - * - * @param tags Tags to filter by - * @return RequestConfig - */ - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("tags", toMultiValue(tags.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByTags", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getPetById(petId: kotlin.Long) : Pet { - val localVariableConfig = getPetByIdRequestConfig(petId = petId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Pet - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getPetById - * - * @param petId ID of pet to return - * @return RequestConfig - */ - fun getPetByIdRequestConfig(petId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePet(body: Pet) : Unit { - val localVariableConfig = updatePetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun updatePetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePetWithForm - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return RequestConfig - */ - fun updatePetWithFormRequestConfig(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("name" to name, "status" to status) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * uploads an image - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return ApiResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation uploadFile - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return RequestConfig - */ - fun uploadFileRequestConfig(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "file" to file) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index 215ed63420c9..000000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,253 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Order - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteOrder - * - * @param orderId ID of the order that needs to be deleted - * @return RequestConfig - */ - fun deleteOrderRequestConfig(orderId: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return kotlin.collections.Map - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getInventory() : kotlin.collections.Map { - val localVariableConfig = getInventoryRequestConfig() - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getInventory - * - * @return RequestConfig - */ - fun getInventoryRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/inventory", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getOrderById - * - * @param orderId ID of pet that needs to be fetched - * @return RequestConfig - */ - fun getOrderByIdRequestConfig(orderId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun placeOrder(body: Order) : Order { - val localVariableConfig = placeOrderRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation placeOrder - * - * @param body order placed for purchasing the pet - * @return RequestConfig - */ - fun placeOrderRequestConfig(body: Order) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/store/order", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 53748b934636..000000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,476 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.User - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUser(body: User) : Unit { - val localVariableConfig = createUserRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUser - * - * @param body Created user object - * @return RequestConfig - */ - fun createUserRequestConfig(body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithArrayInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithArrayInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithArray", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithListInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithListInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithListInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithList", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteUser(username: kotlin.String) : Unit { - val localVariableConfig = deleteUserRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteUser - * - * @param username The name that needs to be deleted - * @return RequestConfig - */ - fun deleteUserRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return User - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getUserByName(username: kotlin.String) : User { - val localVariableConfig = getUserByNameRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as User - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getUserByName - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return RequestConfig - */ - fun getUserByNameRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs user into the system - * - * @param username The user name for login - * @param password The password for login in clear text - * @return kotlin.String - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableConfig = loginUserRequestConfig(username = username, password = password) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation loginUser - * - * @param username The user name for login - * @param password The password for login in clear text - * @return RequestConfig - */ - fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("username", listOf(username.toString())) - put("password", listOf(password.toString())) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/login", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs out current logged in user session - * - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun logoutUser() : Unit { - val localVariableConfig = logoutUserRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation logoutUser - * - * @return RequestConfig - */ - fun logoutUserRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/logout", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param body Updated user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableConfig = updateUserRequestConfig(username = username, body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updateUser - * - * @param username name that need to be deleted - * @param body Updated user object - * @return RequestConfig - */ - fun updateUserRequestConfig(username: kotlin.String, body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt deleted file mode 100644 index ef7a8f1e1a62..000000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -typealias MultiValueMap = MutableMap> - -fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { - "csv" -> "," - "tsv" -> "\t" - "pipe" -> "|" - "space" -> " " - else -> "" -} - -val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } - -fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) - = toMultiValue(items.asIterable(), collectionFormat, map) - -fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { - return when(collectionFormat) { - "multi" -> items.map(map) - else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index bcbb1cf86273..000000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,251 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Credentials -import okhttp3.OkHttpClient -import okhttp3.RequestBody -import okhttp3.RequestBody.Companion.asRequestBody -import okhttp3.RequestBody.Companion.toRequestBody -import okhttp3.FormBody -import okhttp3.HttpUrl.Companion.toHttpUrlOrNull -import okhttp3.ResponseBody -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.Request -import okhttp3.Headers -import okhttp3.MultipartBody -import java.io.File -import java.net.URLConnection -import java.util.Date -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.LocalTime -import java.time.OffsetDateTime -import java.time.OffsetTime - -open class ApiClient(val baseUrl: String) { - companion object { - protected const val ContentType = "Content-Type" - protected const val Accept = "Accept" - protected const val Authorization = "Authorization" - protected const val JsonMediaType = "application/json" - protected const val FormDataMediaType = "multipart/form-data" - protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" - protected const val XmlMediaType = "application/xml" - - val apiKey: MutableMap = mutableMapOf() - val apiKeyPrefix: MutableMap = mutableMapOf() - var username: String? = null - var password: String? = null - var accessToken: String? = null - - @JvmStatic - val client: OkHttpClient by lazy { - builder.build() - } - - @JvmStatic - val builder: OkHttpClient.Builder = OkHttpClient.Builder() - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - protected fun guessContentTypeFromFile(file: File): String { - val contentType = URLConnection.guessContentTypeFromName(file.name) - return contentType ?: "application/octet-stream" - } - - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> content.asRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == FormDataMediaType -> { - MultipartBody.Builder() - .setType(MultipartBody.FORM) - .apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - if (value is File) { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"; filename=\"${value.name}\"" - ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) - } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) - addPart( - partHeaders, - parameterToString(value).toRequestBody(null) - ) - } - } - }.build() - } - mediaType == FormUrlEncMediaType -> { - FormBody.Builder().apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) - } - }.build() - } - mediaType == JsonMediaType -> Serializer.gson.toJson(content, T::class.java).toRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { - if(body == null) { - return null - } - val bodyContent = body.string() - if (bodyContent.isEmpty()) { - return null - } - return when(mediaType) { - JsonMediaType -> Serializer.gson.fromJson(bodyContent, T::class.java) - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") - } - } - - protected fun updateAuthParams(requestConfig: RequestConfig) { - if (requestConfig.headers["api_key"].isNullOrEmpty()) { - if (apiKey["api_key"] != null) { - if (apiKeyPrefix["api_key"] != null) { - requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! - } else { - requestConfig.headers["api_key"] = apiKey["api_key"]!! - } - } - } - if (requestConfig.headers[Authorization].isNullOrEmpty()) { - accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer $accessToken " - } - } - } - - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { - val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") - - // take authMethod from operation - updateAuthParams(requestConfig) - - val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - .apply { - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - addQueryParameter(query.key, queryValue) - } - } - }.build() - - // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { - requestConfig.headers[ContentType] = JsonMediaType - } - if (requestConfig.headers[Accept].isNullOrEmpty()) { - requestConfig.headers[Accept] = JsonMediaType - } - val headers = requestConfig.headers - - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Accept header. This is required.") - } - - // TODO: support multiple contentType options here. - val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - - val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) - RequestMethod.GET -> Request.Builder().url(url) - RequestMethod.HEAD -> Request.Builder().url(url).head() - RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(requestConfig.body, contentType)) - RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(requestConfig.body, contentType)) - RequestMethod.POST -> Request.Builder().url(url).post(requestBody(requestConfig.body, contentType)) - RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - }.apply { - headers.forEach { header -> addHeader(header.key, header.value) } - }.build() - - val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() - - // TODO: handle specific mapping types. e.g. Map> - when { - response.isRedirect -> return Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> return Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> return Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> return ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> return ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - } - } - - protected fun parameterToString(value: Any?): String { - when (value) { - null -> { - return "" - } - is Array<*> -> { - return toMultiValue(value, "csv").toString() - } - is Iterable<*> -> { - return toMultiValue(value, "csv").toString() - } - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { - return parseDateToQueryString(value) - } - else -> { - return value.toString() - } - } - } - - protected inline fun parseDateToQueryString(value : T): String { - /* - .replace("\"", "") converts the json object string to an actual string for the query parameter. - The moshi or gson adapter allows a more generic solution instead of trying to use a native - formatter. It also easily allows to provide a simple way to define a custom date format pattern - inside a gson/moshi adapter. - */ - return Serializer.gson.toJson(value, T::class.java).replace("\"", "") - } -} diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbfaa..000000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2c0..000000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index 6120b081929d..000000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,33 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException - -class ByteArrayAdapter : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: ByteArray?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(String(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): ByteArray? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return out.nextString().toByteArray() - } - } - } -} diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/DateAdapter.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/DateAdapter.kt deleted file mode 100644 index c5d330ac0757..000000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/DateAdapter.kt +++ /dev/null @@ -1,37 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException -import java.text.DateFormat -import java.text.SimpleDateFormat -import java.util.Date -import java.util.Locale - -class DateAdapter(val formatter: DateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.getDefault())) : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: Date?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(formatter.format(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): Date? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return formatter.parse(out.nextString()) - } - } - } -} diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/Errors.kt deleted file mode 100644 index b5310e71f13c..000000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/Errors.kt +++ /dev/null @@ -1,18 +0,0 @@ -@file:Suppress("unused") -package org.openapitools.client.infrastructure - -import java.lang.RuntimeException - -open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 123L - } -} - -open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 456L - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index 30ef6697183a..000000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,35 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException -import java.time.LocalDate -import java.time.format.DateTimeFormatter - -class LocalDateAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE) : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: LocalDate?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(formatter.format(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): LocalDate? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return LocalDate.parse(out.nextString(), formatter) - } - } - } -} diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index 3ad781c66ca1..000000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,35 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter - -class LocalDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME) : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: LocalDateTime?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(formatter.format(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): LocalDateTime? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return LocalDateTime.parse(out.nextString(), formatter) - } - } - } -} diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index e615135c9cc0..000000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,35 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException -import java.time.OffsetDateTime -import java.time.format.DateTimeFormatter - -class OffsetDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME) : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: OffsetDateTime?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(formatter.format(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): OffsetDateTime? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return OffsetDateTime.parse(out.nextString(), formatter) - } - } - } -} diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt deleted file mode 100644 index 0f2790f370e2..000000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt +++ /dev/null @@ -1,17 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Defines a config object for a given request. - * NOTE: This object doesn't include 'body' because it - * allows for caching of the constructed object - * for many request definitions. - * NOTE: Headers is a Map because rfc2616 defines - * multi-valued headers as csv-only. - */ -data class RequestConfig( - val method: RequestMethod, - val path: String, - val headers: MutableMap = mutableMapOf(), - val query: MutableMap> = mutableMapOf(), - val body: kotlin.Any? = null -) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt deleted file mode 100644 index 931b12b8bd7a..000000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Provides enumerated HTTP verbs - */ -enum class RequestMethod { - GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt deleted file mode 100644 index 9bd2790dc144..000000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Response - -/** - * Provides an extension to evaluation whether the response is a 1xx code - */ -val Response.isInformational : Boolean get() = this.code in 100..199 - -/** - * Provides an extension to evaluation whether the response is a 3xx code - */ -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") -val Response.isRedirect : Boolean get() = this.code in 300..399 - -/** - * Provides an extension to evaluation whether the response is a 4xx code - */ -val Response.isClientError : Boolean get() = this.code in 400..499 - -/** - * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code - */ -val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index b80e0390de2d..000000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.Gson -import com.google.gson.GsonBuilder -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.OffsetDateTime -import java.util.UUID -import java.util.Date - -object Serializer { - @JvmStatic - val gsonBuilder: GsonBuilder = GsonBuilder() - .registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter()) - .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) - .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) - .registerTypeAdapter(ByteArray::class.java, ByteArrayAdapter()) - - @JvmStatic - val gson: Gson by lazy { - gsonBuilder.create() - } -} diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index 54df813fceec..000000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,32 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName - -/** - * Describes the result of uploading an image resource - * @param code - * @param type - * @param message - */ - -data class ApiResponse ( - @SerializedName("code") - val code: kotlin.Int? = null, - @SerializedName("type") - val type: kotlin.String? = null, - @SerializedName("message") - val message: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index fdefa74fda0b..000000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName - -/** - * A category for a pet - * @param id - * @param name - */ - -data class Category ( - @SerializedName("id") - val id: kotlin.Long? = null, - @SerializedName("name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index 049c89df3134..000000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName - -/** - * An order for a pets from the pet store - * @param id - * @param petId - * @param quantity - * @param shipDate - * @param status Order Status - * @param complete - */ - -data class Order ( - @SerializedName("id") - val id: kotlin.Long? = null, - @SerializedName("petId") - val petId: kotlin.Long? = null, - @SerializedName("quantity") - val quantity: kotlin.Int? = null, - @SerializedName("shipDate") - val shipDate: java.time.OffsetDateTime? = null, - /* Order Status */ - @SerializedName("status") - val status: Order.Status? = null, - @SerializedName("complete") - val complete: kotlin.Boolean? = null -) { - - /** - * Order Status - * Values: placed,approved,delivered - */ - - enum class Status(val value: kotlin.String){ - @SerializedName(value = "placed") placed("placed"), - @SerializedName(value = "approved") approved("approved"), - @SerializedName(value = "delivered") delivered("delivered"); - } -} - diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index af29ef2b61b7..000000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,56 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.Category -import org.openapitools.client.models.Tag - -import com.google.gson.annotations.SerializedName - -/** - * A pet for sale in the pet store - * @param name - * @param photoUrls - * @param id - * @param category - * @param tags - * @param status pet status in the store - */ - -data class Pet ( - @SerializedName("name") - val name: kotlin.String, - @SerializedName("photoUrls") - val photoUrls: kotlin.collections.List, - @SerializedName("id") - val id: kotlin.Long? = null, - @SerializedName("category") - val category: Category? = null, - @SerializedName("tags") - val tags: kotlin.collections.List? = null, - /* pet status in the store */ - @SerializedName("status") - val status: Pet.Status? = null -) { - - /** - * pet status in the store - * Values: available,pending,sold - */ - - enum class Status(val value: kotlin.String){ - @SerializedName(value = "available") available("available"), - @SerializedName(value = "pending") pending("pending"), - @SerializedName(value = "sold") sold("sold"); - } -} - diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index 28e82b1df685..000000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName - -/** - * A tag for a pet - * @param id - * @param name - */ - -data class Tag ( - @SerializedName("id") - val id: kotlin.Long? = null, - @SerializedName("name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index 62baf33e927e..000000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,48 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName - -/** - * A User who is purchasing from the pet store - * @param id - * @param username - * @param firstName - * @param lastName - * @param email - * @param password - * @param phone - * @param userStatus User Status - */ - -data class User ( - @SerializedName("id") - val id: kotlin.Long? = null, - @SerializedName("username") - val username: kotlin.String? = null, - @SerializedName("firstName") - val firstName: kotlin.String? = null, - @SerializedName("lastName") - val lastName: kotlin.String? = null, - @SerializedName("email") - val email: kotlin.String? = null, - @SerializedName("password") - val password: kotlin.String? = null, - @SerializedName("phone") - val phone: kotlin.String? = null, - /* User Status */ - @SerializedName("userStatus") - val userStatus: kotlin.Int? = null -) - diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 5ac6cfd25b79..f25dd2bb9fa1 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -25,7 +25,6 @@ import java.time.LocalDateTime import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime -import java.util.Date import java.util.Locale import com.google.gson.reflect.TypeToken @@ -247,7 +246,7 @@ open class ApiClient(val baseUrl: String) { null -> "" is Array<*> -> toMultiValue(value, "csv").toString() is Iterable<*> -> toMultiValue(value, "csv").toString() - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2c0..000000000000 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt deleted file mode 100644 index c5d330ac0757..000000000000 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt +++ /dev/null @@ -1,37 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException -import java.text.DateFormat -import java.text.SimpleDateFormat -import java.util.Date -import java.util.Locale - -class DateAdapter(val formatter: DateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.getDefault())) : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: Date?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(formatter.format(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): Date? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return formatter.parse(out.nextString()) - } - } - } -} diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index c8b93b33bf6f..000000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,492 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun addPet(body: Pet) : Unit { - val localVariableConfig = addPetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation addPet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun addPetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Deletes a pet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deletePet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return RequestConfig - */ - fun deletePetRequestConfig(petId: kotlin.Long, apiKey: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByStatusRequestConfig(status = status) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByStatus - * - * @param status Status values that need to be considered for filter - * @return RequestConfig - */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("status", toMultiValue(status.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByStatus", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByTags - * - * @param tags Tags to filter by - * @return RequestConfig - */ - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("tags", toMultiValue(tags.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByTags", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getPetById(petId: kotlin.Long) : Pet { - val localVariableConfig = getPetByIdRequestConfig(petId = petId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Pet - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getPetById - * - * @param petId ID of pet to return - * @return RequestConfig - */ - fun getPetByIdRequestConfig(petId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePet(body: Pet) : Unit { - val localVariableConfig = updatePetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun updatePetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePetWithForm - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return RequestConfig - */ - fun updatePetWithFormRequestConfig(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("name" to name, "status" to status) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * uploads an image - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return ApiResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation uploadFile - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return RequestConfig - */ - fun uploadFileRequestConfig(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "file" to file) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index 215ed63420c9..000000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,253 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Order - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteOrder - * - * @param orderId ID of the order that needs to be deleted - * @return RequestConfig - */ - fun deleteOrderRequestConfig(orderId: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return kotlin.collections.Map - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getInventory() : kotlin.collections.Map { - val localVariableConfig = getInventoryRequestConfig() - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getInventory - * - * @return RequestConfig - */ - fun getInventoryRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/inventory", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getOrderById - * - * @param orderId ID of pet that needs to be fetched - * @return RequestConfig - */ - fun getOrderByIdRequestConfig(orderId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun placeOrder(body: Order) : Order { - val localVariableConfig = placeOrderRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation placeOrder - * - * @param body order placed for purchasing the pet - * @return RequestConfig - */ - fun placeOrderRequestConfig(body: Order) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/store/order", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 53748b934636..000000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,476 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.User - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUser(body: User) : Unit { - val localVariableConfig = createUserRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUser - * - * @param body Created user object - * @return RequestConfig - */ - fun createUserRequestConfig(body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithArrayInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithArrayInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithArray", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithListInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithListInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithListInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithList", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteUser(username: kotlin.String) : Unit { - val localVariableConfig = deleteUserRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteUser - * - * @param username The name that needs to be deleted - * @return RequestConfig - */ - fun deleteUserRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return User - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getUserByName(username: kotlin.String) : User { - val localVariableConfig = getUserByNameRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as User - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getUserByName - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return RequestConfig - */ - fun getUserByNameRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs user into the system - * - * @param username The user name for login - * @param password The password for login in clear text - * @return kotlin.String - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableConfig = loginUserRequestConfig(username = username, password = password) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation loginUser - * - * @param username The user name for login - * @param password The password for login in clear text - * @return RequestConfig - */ - fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("username", listOf(username.toString())) - put("password", listOf(password.toString())) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/login", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs out current logged in user session - * - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun logoutUser() : Unit { - val localVariableConfig = logoutUserRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation logoutUser - * - * @return RequestConfig - */ - fun logoutUserRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/logout", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param body Updated user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableConfig = updateUserRequestConfig(username = username, body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updateUser - * - * @param username name that need to be deleted - * @param body Updated user object - * @return RequestConfig - */ - fun updateUserRequestConfig(username: kotlin.String, body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt deleted file mode 100644 index ef7a8f1e1a62..000000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -typealias MultiValueMap = MutableMap> - -fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { - "csv" -> "," - "tsv" -> "\t" - "pipe" -> "|" - "space" -> " " - else -> "" -} - -val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } - -fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) - = toMultiValue(items.asIterable(), collectionFormat, map) - -fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { - return when(collectionFormat) { - "multi" -> items.map(map) - else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index 637ca64c247b..000000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,251 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Credentials -import okhttp3.OkHttpClient -import okhttp3.RequestBody -import okhttp3.RequestBody.Companion.asRequestBody -import okhttp3.RequestBody.Companion.toRequestBody -import okhttp3.FormBody -import okhttp3.HttpUrl.Companion.toHttpUrlOrNull -import okhttp3.ResponseBody -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.Request -import okhttp3.Headers -import okhttp3.MultipartBody -import java.io.File -import java.net.URLConnection -import java.util.Date -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.LocalTime -import java.time.OffsetDateTime -import java.time.OffsetTime - -open class ApiClient(val baseUrl: String) { - companion object { - protected const val ContentType = "Content-Type" - protected const val Accept = "Accept" - protected const val Authorization = "Authorization" - protected const val JsonMediaType = "application/json" - protected const val FormDataMediaType = "multipart/form-data" - protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" - protected const val XmlMediaType = "application/xml" - - val apiKey: MutableMap = mutableMapOf() - val apiKeyPrefix: MutableMap = mutableMapOf() - var username: String? = null - var password: String? = null - var accessToken: String? = null - - @JvmStatic - val client: OkHttpClient by lazy { - builder.build() - } - - @JvmStatic - val builder: OkHttpClient.Builder = OkHttpClient.Builder() - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - protected fun guessContentTypeFromFile(file: File): String { - val contentType = URLConnection.guessContentTypeFromName(file.name) - return contentType ?: "application/octet-stream" - } - - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> content.asRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == FormDataMediaType -> { - MultipartBody.Builder() - .setType(MultipartBody.FORM) - .apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - if (value is File) { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"; filename=\"${value.name}\"" - ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) - } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) - addPart( - partHeaders, - parameterToString(value).toRequestBody(null) - ) - } - } - }.build() - } - mediaType == FormUrlEncMediaType -> { - FormBody.Builder().apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) - } - }.build() - } - mediaType == JsonMediaType -> Serializer.jacksonObjectMapper.writeValueAsString(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { - if(body == null) { - return null - } - val bodyContent = body.string() - if (bodyContent.isEmpty()) { - return null - } - return when(mediaType) { - JsonMediaType -> Serializer.jacksonObjectMapper.readValue(bodyContent, T::class.java) - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") - } - } - - protected fun updateAuthParams(requestConfig: RequestConfig) { - if (requestConfig.headers["api_key"].isNullOrEmpty()) { - if (apiKey["api_key"] != null) { - if (apiKeyPrefix["api_key"] != null) { - requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! - } else { - requestConfig.headers["api_key"] = apiKey["api_key"]!! - } - } - } - if (requestConfig.headers[Authorization].isNullOrEmpty()) { - accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer $accessToken " - } - } - } - - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { - val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") - - // take authMethod from operation - updateAuthParams(requestConfig) - - val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - .apply { - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - addQueryParameter(query.key, queryValue) - } - } - }.build() - - // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { - requestConfig.headers[ContentType] = JsonMediaType - } - if (requestConfig.headers[Accept].isNullOrEmpty()) { - requestConfig.headers[Accept] = JsonMediaType - } - val headers = requestConfig.headers - - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Accept header. This is required.") - } - - // TODO: support multiple contentType options here. - val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - - val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) - RequestMethod.GET -> Request.Builder().url(url) - RequestMethod.HEAD -> Request.Builder().url(url).head() - RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(requestConfig.body, contentType)) - RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(requestConfig.body, contentType)) - RequestMethod.POST -> Request.Builder().url(url).post(requestBody(requestConfig.body, contentType)) - RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - }.apply { - headers.forEach { header -> addHeader(header.key, header.value) } - }.build() - - val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() - - // TODO: handle specific mapping types. e.g. Map> - when { - response.isRedirect -> return Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> return Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> return Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> return ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> return ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - } - } - - protected fun parameterToString(value: Any?): String { - when (value) { - null -> { - return "" - } - is Array<*> -> { - return toMultiValue(value, "csv").toString() - } - is Iterable<*> -> { - return toMultiValue(value, "csv").toString() - } - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { - return parseDateToQueryString(value) - } - else -> { - return value.toString() - } - } - } - - protected inline fun parseDateToQueryString(value : T): String { - /* - .replace("\"", "") converts the json object string to an actual string for the query parameter. - The moshi or gson adapter allows a more generic solution instead of trying to use a native - formatter. It also easily allows to provide a simple way to define a custom date format pattern - inside a gson/moshi adapter. - */ - return Serializer.jacksonObjectMapper.writeValueAsString(value).replace("\"", "") - } -} diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbfaa..000000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2c0..000000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index fff39c7ac243..000000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,3 +0,0 @@ -package org.openapitools.client.infrastructure - - diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/Errors.kt deleted file mode 100644 index b5310e71f13c..000000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/Errors.kt +++ /dev/null @@ -1,18 +0,0 @@ -@file:Suppress("unused") -package org.openapitools.client.infrastructure - -import java.lang.RuntimeException - -open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 123L - } -} - -open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 456L - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt deleted file mode 100644 index 0f2790f370e2..000000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt +++ /dev/null @@ -1,17 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Defines a config object for a given request. - * NOTE: This object doesn't include 'body' because it - * allows for caching of the constructed object - * for many request definitions. - * NOTE: Headers is a Map because rfc2616 defines - * multi-valued headers as csv-only. - */ -data class RequestConfig( - val method: RequestMethod, - val path: String, - val headers: MutableMap = mutableMapOf(), - val query: MutableMap> = mutableMapOf(), - val body: kotlin.Any? = null -) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt deleted file mode 100644 index 931b12b8bd7a..000000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Provides enumerated HTTP verbs - */ -enum class RequestMethod { - GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt deleted file mode 100644 index 9bd2790dc144..000000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Response - -/** - * Provides an extension to evaluation whether the response is a 1xx code - */ -val Response.isInformational : Boolean get() = this.code in 100..199 - -/** - * Provides an extension to evaluation whether the response is a 3xx code - */ -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") -val Response.isRedirect : Boolean get() = this.code in 300..399 - -/** - * Provides an extension to evaluation whether the response is a 4xx code - */ -val Response.isClientError : Boolean get() = this.code in 400..499 - -/** - * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code - */ -val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 8b34e629c4ec..000000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,18 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.fasterxml.jackson.databind.ObjectMapper -import com.fasterxml.jackson.databind.SerializationFeature -import com.fasterxml.jackson.datatype.jdk8.Jdk8Module -import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule -import com.fasterxml.jackson.annotation.JsonInclude -import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper -import java.util.Date - -object Serializer { - @JvmStatic - val jacksonObjectMapper: ObjectMapper = jacksonObjectMapper() - .registerModule(Jdk8Module()) - .registerModule(JavaTimeModule()) - .setSerializationInclusion(JsonInclude.Include.NON_ABSENT) - .configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false) -} diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index c341f8ca321b..000000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,32 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.fasterxml.jackson.annotation.JsonProperty - -/** - * Describes the result of uploading an image resource - * @param code - * @param type - * @param message - */ - -data class ApiResponse ( - @field:JsonProperty("code") - val code: kotlin.Int? = null, - @field:JsonProperty("type") - val type: kotlin.String? = null, - @field:JsonProperty("message") - val message: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index 2ed5390c1f3a..000000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.fasterxml.jackson.annotation.JsonProperty - -/** - * A category for a pet - * @param id - * @param name - */ - -data class Category ( - @field:JsonProperty("id") - val id: kotlin.Long? = null, - @field:JsonProperty("name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index c7df5b55614b..000000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.fasterxml.jackson.annotation.JsonProperty - -/** - * An order for a pets from the pet store - * @param id - * @param petId - * @param quantity - * @param shipDate - * @param status Order Status - * @param complete - */ - -data class Order ( - @field:JsonProperty("id") - val id: kotlin.Long? = null, - @field:JsonProperty("petId") - val petId: kotlin.Long? = null, - @field:JsonProperty("quantity") - val quantity: kotlin.Int? = null, - @field:JsonProperty("shipDate") - val shipDate: java.time.OffsetDateTime? = null, - /* Order Status */ - @field:JsonProperty("status") - val status: Order.Status? = null, - @field:JsonProperty("complete") - val complete: kotlin.Boolean? = null -) { - - /** - * Order Status - * Values: PLACED,APPROVED,DELIVERED - */ - - enum class Status(val value: kotlin.String){ - @JsonProperty(value = "placed") PLACED("placed"), - @JsonProperty(value = "approved") APPROVED("approved"), - @JsonProperty(value = "delivered") DELIVERED("delivered"); - } -} - diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index be5b168e2d8b..000000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,56 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.Category -import org.openapitools.client.models.Tag - -import com.fasterxml.jackson.annotation.JsonProperty - -/** - * A pet for sale in the pet store - * @param name - * @param photoUrls - * @param id - * @param category - * @param tags - * @param status pet status in the store - */ - -data class Pet ( - @field:JsonProperty("name") - val name: kotlin.String, - @field:JsonProperty("photoUrls") - val photoUrls: kotlin.collections.List, - @field:JsonProperty("id") - val id: kotlin.Long? = null, - @field:JsonProperty("category") - val category: Category? = null, - @field:JsonProperty("tags") - val tags: kotlin.collections.List? = null, - /* pet status in the store */ - @field:JsonProperty("status") - val status: Pet.Status? = null -) { - - /** - * pet status in the store - * Values: AVAILABLE,PENDING,SOLD - */ - - enum class Status(val value: kotlin.String){ - @JsonProperty(value = "available") AVAILABLE("available"), - @JsonProperty(value = "pending") PENDING("pending"), - @JsonProperty(value = "sold") SOLD("sold"); - } -} - diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index 7243f42ed7d8..000000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.fasterxml.jackson.annotation.JsonProperty - -/** - * A tag for a pet - * @param id - * @param name - */ - -data class Tag ( - @field:JsonProperty("id") - val id: kotlin.Long? = null, - @field:JsonProperty("name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index e8f639e50928..000000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,48 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.fasterxml.jackson.annotation.JsonProperty - -/** - * A User who is purchasing from the pet store - * @param id - * @param username - * @param firstName - * @param lastName - * @param email - * @param password - * @param phone - * @param userStatus User Status - */ - -data class User ( - @field:JsonProperty("id") - val id: kotlin.Long? = null, - @field:JsonProperty("username") - val username: kotlin.String? = null, - @field:JsonProperty("firstName") - val firstName: kotlin.String? = null, - @field:JsonProperty("lastName") - val lastName: kotlin.String? = null, - @field:JsonProperty("email") - val email: kotlin.String? = null, - @field:JsonProperty("password") - val password: kotlin.String? = null, - @field:JsonProperty("phone") - val phone: kotlin.String? = null, - /* User Status */ - @field:JsonProperty("userStatus") - val userStatus: kotlin.Int? = null -) - diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/META-INF/kotlin-petstore-jackson.kotlin_module b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/META-INF/kotlin-petstore-jackson.kotlin_module deleted file mode 100644 index 38c4425da8d5a75423570d04d4b47c016fb8370b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 134 zcmZQzU|?ooU|@t|0WL)@f&8L$z5IgIyu^aclKlLfVj*6~f`XjPC3=~8X+?>}B}JvlC8b5FLV}J3nT|<7equ66Z?SiYkVsH!aRHE->RM5f JnpX@F1pvVZD~A98 diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/ApplicationKt.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/ApplicationKt.class deleted file mode 100644 index d44eb27f99ac8a125e94cd99b920c3a280cbdb98..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3936 zcmbVP`BNL$9sfKDvtlhSfsN%HRbx_PKrE6mPGn5Wz-)rCe z_iKL!5Xb8b4|6A{@q%IN1ygWtx!OpfV3`?RnB1Nc3K&Dnvc9TomTu>?OAE_JhTi%a z>hij2Gx)ns%`+VBx|*y~rG#VJxpSxHgE)kG6+Q$Q)FHtO!+nw~0Cktt)S4@dyn-N! z<3+)6q$JGb+AK*DB+t8dfQWVmNiJC3Mm z!%>Du?*gB(Ov4r$Im6Xbf;+}Y!BlXJp?=7;O)<bTYZZg=N~>@@ifq?S^CP zmNsrI>P1V8aoZJ6F+v_Xn;(XO`Tv5!L-0jQoymq}1&2YK|y2oO{;(FHA;{CBRTK@pK zbJ=i(nTd|`Ty%Dc3!ZcI!qQr_q%=CiSEFa5L_N^AT*w7*mLXNqX51(^hU-Snyq+`M zzC}m3SFE+Xku`Ns?ciW+P;*UTxZ2~7#YknmU+bsec&z`-+4vc)q(YPgKh6*-$4rJ> z7UdMBo2!jg*E09ckvlBY6_*w%R(ECCZufhkk|aX%|?lUWNg?XjzerZrfZ$ z77SXsA|iOi=62LO62w*p-{+YzG&dZ;|^t)BlD z3X3una%9-mKQfsd8BJ1L^c|a?<~RQTD&%a8)>78A z;j;{(vWjaXu4_16HB|6<%H4?>8C>HGjOf3JFE!u`_%gMI9lFS(Zdyh*fUi`geWX)TcM2|RW7ex~9z$!V*}1suH36cMS8sUTj#B!5u82xaLB>RbS)CV} zYfO>T0%54ueR`qbr+eyV+5ZZDPT(q&%d{c%tS)ro_vKgpR8N_F(4^&C@V1a!8vEFa zT=?jHmb&%v?VAC0`=;t^@zKxm`WAZl`q^Jzs`n`3jO3uBbhlBm-IX&{bXm`=xSU3` zrkY{1Z-tQ6jZvW`2vlJ*D`fqgycve(q-h&7#r%Tdl;4DsJfmClx?@U;@=GIy~hcx`Wp4b#!bYoMv@w0}rj^ol{#lk>0?gp_A+Aq0_!~#FPH>MA}27 zp@BoMV=(OxJ(fz>g%YVvyk{Gu(}@QEaBre6T<53LS8>6I^xx39g(uRXiyN4JBcX;H z!s<3IwPSV@@7qE;-Hs<|75cyiKD31e+GgZ-U<1Y`mOPok#NmWmD|ul*$&FHS_;5HF zZrsN59TXBxiRMI0qBRjpv~9sjhugxTaBH|F+#GJ&Kry+6>m{@|2+&8XJ2Gt@H>WG` zKSA(&OYmp>gLQ;IO89$vH}Sb)+WQ9&-N9F0zylAxhz|c?edue6`Yk+{4%ctso7?#I z8=>cG*lyEB__0CHXW)MuHdF;aQ!uDtl+nMuC)$D5zj&LvY2$vU3N9%~DRf*Sdmil` z85IPF(Wi|kVuy$%DXq*9Hn(`eu`1>)9(2)@`Ce`ciuH zHG2B+M{H3zA4yG*%&NOHP@VEVWYq3dq_Vo8_C#WlJ!E(FlbZ7>K^*ajSNzhlM8=Iu6*e#{F8Xu`+Ehys_bq};@9}iB;C~Su7bI^jXQMY;*g8q IyZFO@0D2Hju>b%7 diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/PetApi$WhenMappings.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/PetApi$WhenMappings.class deleted file mode 100644 index 9251a566438420e501ebd3b79975c4d828e8061e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1458 zcmbV~+fLg+5QhIvfCMmYXz3w6AJPInnKQJ|1EpL<0#QLlFSs(v0*1u4Y$sJ8tFBa4 zRmB7Jp{oA&G8d8D8>G?Bx8r=9S$qEc{dEdp1|Jlr{P58B1MNA18~c7MvKuW|d$G-Z zWPjB0YT(vBA8BvX2?EzUj7m@nm1C#t*e%C9w72$;bt5jJs4!Mr_d4yJFK*m8I{SHT zN};e<&wno zc<}r=PrZ)nAWyx)v;45>dQL05Y~8{w+)n@Rj>1UYJMhD{6T3d2TexSO`wGL`y6J}e z*nDE)p{dtcU&|(DJq-QO!edh(XMIP9T^*j)Cr$l{g_60^GYe%yFDwiinzArtXvV^@ zp*ahdp#=*ghL#jYH%|PRU(DXrvD0*7XPJ}M?iM-NDqZ*?3j5g>>6YWEP89mq{H9i@ zZg;%cZR=e(a`#($)${x~yKz*R=F9G*P_9(dch7^WX~$V+zgcFtS!S@Ph2_uJ@g&dk~D7qz}>#B3?C5t4L%|c7@Q!M3_c~6x5R&* zfFV9ne4_Y7@rk{@oq!=eQGBBKMDdBe{&WI{_(buE;uFOu_WH947~&JfCyGxLpV;fq zCt!$A6rU(QQG8;rznFj_K2dz4_(buEz5dGt4DpHL6U8TrPc;5Fjs}MVYh1^fUvV&& U_fV{3C5zX1BfGbCyu&J&e|BPM-v9sr diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/PetApi.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/PetApi.class deleted file mode 100644 index c6d591f86366919c06af52f045a62cfb816c5d88..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 82237 zcmeFa31AdO7B^m1-Cfl)B;?{6&H&*E0=Xy2;HrR#D3^jDied->A|Z)6Koq=}74KV7 z#B+`7Evw;j6+F?^)%99k54?5N-Ss|K^Z!+KbM4Hb)K)K=7$HB{DAPdc%@qE-e35tIbu5p7i~r%DldeTnCt zRZ+L1qAntDH?U2$=J<++g>_|>)%7`L)zvi(s($r3(`y>0H&#`Rqr_ZTvuKq~x>GW6 zSxrM#Wp&Q+E0*U}RyS1CRhL!eOsQ_DL*~lzdO=bt>0Q3GqI}uRvbwV66-Y6qUK3Kx z3o~WL!s9E-8^%oy$IOysmVkLlB%NgVNgC+^YU=mKhRUj(sg>2sDi$4FR=;#wS*;+w z&@KB`R#!IcM~N{~=ITQNe$t!tr6f6=OQr2kNnwI4KD^?D#)|rei8a-WE0+i|u+urG zRWvNEStLj%7&mjqtl8+HxH8kKdv)0kg>gw_2pQ@lgGm-B<&k}hKwO&ePlGrp~SzWqG3W=eFbPx(qm+H+iE3|Jd*DxCMlpK5SOSRMU+^zWp(ux zlnfi$mP~f*3ZWXsq{L5xq?D3DVX>Q1RaLR1tZEkIz9M3DK<+aZIu*^Vtk0~hUQt$6 zxoE6SenUymSmh}J+}}_3B?lmDnEvdgbu}x?7FJaVG6C{jR$g9FU!T=jy9nitZ){kq zMoK*;%M$KbZ*CgbNx^c2T8*#+$t20+gU}<@6)Pt+R#q*ls6#iRM_Th-{|NpaOs4qJ zjfYSo(2X<88kQ!Jsj{;Mk!j$Ho*Wt~PHf0=26O$P4T8*oq+n<-2Z!r0g^rBDyrU<^ z6okXb;eIlc%mUluR7#K|Ae?e`MrCGIELn~@AG{nBqm1?%HkTafCv(U=N^CUju*QnI zRg|Q;(&>$fByu#FFI#&I5~8HKRkP%x5S=%-r7vsYD+vEvugnUaRTvs3fwCRCOcAljWE#s#SFK z@X`}*5~(4zGTjNTl)BB!nj~8!2>2(tFsH1lu_B2y%G3>HgjgO(6Ex@?TCpmLtZ}HE0%oDJ6ob7Lf|C7XbXNi+Ix8%hr;*cT2cAJmH!X!n zU}X^GEVO0H^jWjVPoFpmT`@J{NAP$p`JIpamYj{5WT6}Z;7D8fN4j&!xsv*M&h&L~ zMH$9QeG<9A5rzvXNy5l#fIy6yy{fjtCKsbi&~i$KM>b4%K%}I5eR3(eOp43p5Qs1% zCoV0knT*mTSAv~Y71c``mZ}b)l0?>%tGkh_$Ti@8S#51qWw~0pbB?dCskX_r zNLAa2I+VnyLj-f%tJQVndReO*Q1W<8TeVn$ZlZ+P-rxk89S}Az8=ecW+dk_mnznd&78edPPz4&b!dHMU4@)>Z^z8x=5Z?1 zUg|q3>7)BvcF9ES>>}p&yD7=9#@;5gTy1zV7giut-;mi*lUZF;Jx2Z1fNYr#iLs7E z+vHw9xkt|Kbev7@!=zN-xUgPrS|(I1uBofYT2!&Ptg#9_KPHkRPVN{xod_Q3G*cp? zVswm7l|-7!W;ro#p`<9GcF67-D@U%^lx-L(4K-71R#w!3IT+^;$a#D<`IDTW8zlS7 z>N8ts%N`q%Wn{KZ9-?G`+U`v{v9=D&8nyyz+VD1gNo1$9m3tVA0EUFKwUI)J={U}o zz1?k05_yz7Ca2)XDfvx;6uk8^YwpsDYV37tA$ZuV?!pcPlV0QUSt~0W%H^(7{*aYR z2|F6Y>nZYQA9<2IjhVKlZc!z+x=G|Oa$sJyNMTc+@Yrdfkckmhfgbhx+(dMNM{@~NMEO#TU8 zF2_Kv#Qw1%2Sa!H80^N%Z1QhP21ib%CyrUUa^)D60G)|>81HzCZ1Oo~7q`%ZkXv>{ zxc|STWU3zj*c<1RV-~NkXvmSXIs9=`+(jtrCF($D>cDJRuiimx>ZX;|Evu+go3%dV zYd`sld;^)n>Pg7~2~96yCbX_2IPo3%UXuL5*@U-l3=*6}{v#9oL`hzP!wfH&mDnSn zR8c2L3l=gA_e09cmti$>rZPFc#*5UlhXKlM;JR^mfd-l3Tpc)r#`#{hFdpQSJ$cJ zJEz^!x`2`8&Tb&vrg+ERH&$o43{OC0X);8X;^jLfN-~#M*%WWv{lPyhS`C@yjdgX{ zfmE%^^bQ-w+BDsd)fy|-zIAdRQQsgXH6m$EbvS)}<{`6YOwW|>`k7_bi!$Z3qn<#f zCx#zRH}F1>6O{0T7CE@W(xzkG0fGMOP5WR{qXFzpAMhGZ$%OXUpJ)TJ=_pwv zyz>s#yNc;GaxIxqS5_?-4pg#YQFwzv$N1@3xdiwyT%GM==Qp`+`I1ZXWG(Wex2Zav z9I~`f{*D*peG^?=!%Jh->pCs=5tEis5=wCF$Dku<$XWB9Ln};~5qs+y%j7|V^9uxI zU-}zA9Y=AJ)59GZktqa)2n)QYPAsd!k~+AJ1V${WG6^V7pcDOcJUtNWs7q1)A}HQ? zMa78~<&9F7yFM zYqZ=?=TNzzC0Kok*_5brTDQ{#T};Wi1gW^0CY^|PHo0e&#}pK=RVkJAAddxIy-3Md z8=UmC=~%qT(BtVcKdq!lk?6T%6k$PeWG0ql$6U4q?61Y%8%)I;d90JH*sQDf(;A9b zjik!@S&iyUX>ns!5?$el#LDR5=C)W)|ClJc(^ay(lOl#&WC}r7V*T`EcN{bfOZN)8#&RHO2cj$HG!p1$l`&6mwr*z^b$8Z)MW8QD+3s?}Fmh+lOu4 zBDFwMQXFft4!>JYtSYOo$5;=?=yH*{LilIZ1*6kU<{_>IUe=v98YUXo38@M{D>mMthw z4Laa*PdCtw7&6%9xw0c)CL~qNsfoVYIa998h`Hr@dV`-Xp*OaJ(v*eaoamQ1 zdb5xIUcRdp>_ORrHu>qT@~tk{VQ}W6nu>b0tyRym9}&}}Hik%LTK$^$a`K0is4S(33!tXri6q}^U*~Kxv+%Bzm8brfH0Tu2#pY3-&4Oqfx?0Y#N@U4{hb&Fk zP1+-(3huch4(F3liN$VO%uTA|igr&YgS*r?$C}77D$#1oN~c5%Wax79uwqnXt$>X$JcG(!rN=Dn(B zY82~LRIeC}RzIXgw^7CQ^_tn{HIkC-cH60|;xEawZhrCJ7SN%E5wDI(M#7Pw8#QfP~+zi%g#ukwU%lNzv6Wq;j5BWc+%UryjT* zuF+YwKug+79l%c|u-zVXho3GO_d3?^PfYOcVHS&;%samfVQWe6f zNE|H#9K%cIqP{M2GqbF+PB0ToB-*n8^PtT*9@Hc_V{sC*aVSGpGaSmKxJUerwN({z z6VGto!WwF@3y54D^#T)7IUSSj9>vKb$0f03*4@vNSPFn=O}V@V=y18z)2PqE`IRao z4bs275hqnu6^NRF7mqhU8O{xa_W;d>o+A&5-12J1f)8w<U*Z1_|DVdICr>BvJZfRa?!ajsnG7RnRq#f{Zk{twcj zJRD(%$;5BfIJU2!h1hSzdPC$aq;hj7vpY`2nKv;kMM-S2QxmN4Xe!6a7elzjp=Tv*F$$`;AfcS>f&FVsc9 zI^;ft&)pWG7t(PeT`AYIvMOM)WeWCUji~ct6lgPfZlt71FF-j?ZKf>8IhD;Yv5xAX zuOmtm?Bv+(Ely%*O>`bZmgh}YY$jMOm zUZ=4+AeVB39LkYQtA|EU#n}3lWlNS+)Qv^qEAnmjJ3nFM04OK2wFt3u1RLu zZuxd&1|_b#H0*$)r#qj%NJJE=@`7b zIqyj7Z9+%-J=6$Ode-5M)i^t^m{Pr>vc3{zJRPa=VZ~f*Kw2k@`qe+Hrm?QP!kIvN zI1dL_ENooj9d~1Ut0~NJiiyY%Zv?v;!K8pclxzgM%M{0kQjB0~ASIM$1k(d)TggI7wi2A`hcW^gTM6dg^<;?* z;q`O}X$bWQ^a%Adg1rJgw-QWyJIJa~ZzI?z(0ePv!FVVT2*fah&E)*h09mt((l6Ocu3$)eRk+@d zljMMZE7?HF)kK(0#5C5Ebe%eV<5qH`LFPJ-H+L%Y%~6>{{(#>reYL}DJ~#cA^jo%& z+t!m*#q~Qh*OAmMD_+vO!bzPr&3l3*ZzuQ6OW(Aa{P7`hBmI8B?pw&#P?8Z$4kUTM zZ!-l0B5Fc3(Uvz=b;5OSunW?CSpuw8lzOKzsYP|_w^+D!KkBsJ4XTj`-# zG?N3#>6geQfgXnCC)Zsb5YEyIcAO=miCA-Ks5=RO@a*+uz;-%ko(!vhj%lU~H`9t8 zbV(B(A4uLpm#-&7w$mE*V_mCcjVf7R8GGV-(u|1>9BHN}J4{J^0v1?Jq%n}%Oiv4? z2h!y-onZuf$h|_;@+^~04|GR;#oQ(ml>3TidZx2>kwF_C(H#XDXVfw%f z9!Sri>ze8L*yT7=^M&rzJTx#gs;Z%^;IPo}?eyY#f#E%e1+q5N%VgEb0@=bV*ORf^ z>3Y?|lfgb8s;hVuMPf6(T4fo%oo<*%RWsX3dmYk-cz`$4n>Nu~7Btg8sHON?y$)OO z2g8kkD}tK{w*s4+CUUydlG~$}oICYXfbXE|Lt;De&%-W{-ZO6}S$(zaO>7TP8Ep5& z+zh%&{&xRnx<#&8GRp>;B}rx39!~Zrne4&M6nhISZCbGB-iw+T>>5H+8c10Sbn|_J zFhPHoe`J9A8>IeaczY6L^fb5@GM)5@n+ypAnM09y4%`6kjwhsr6q3H3%_azp4;nyZ z6sp|V-9a5CJ6B8E5qx#3sOl(xZGm)kL`BS2EutO_;tsGh~(obLkbZFsdC1(2^ zN?D0hLM!6YBEwtAz)n$8)n604W?13(kQi2cwNt`oO#Y|3@c_!Fs1E46XBBjJBat*) za05ZYJ%GZ!)~=RPi&jSyOWq@5be-ys2vTxPw2&=$aOs z`*ntE9Z@8!F=1rv6_TdyYr>zk7i;N}l!HIL)3uD*yGvR~PE1M^w^&5(P1MlW1GX(C zVkIZH;3kb&odHVFJq_=2+NWgL{%rgyx%2HsdXi_xUZxj&6WmG8wUAzMtF@ssY@2WU z=c{Qcelz!s-d<_uWI=w*HsHN-EqNQ5&?p#~?L&IP^}>2K6mA%<`^Y9^5z4{8x%fAa zlp=0FQb5MzWqLf$62>EZAnYFIz%8crWI1hwTciC`w12Ad>*%TEcQ8Y^jGj(5(lf}D zaL>^*VYPY|&Xs-(>$0`9AN?Ke4{L(Km_vuaT46Xng=WJaO&jT07zfO!=K@4MAL4rf zy%oy)chgJg!*I_)fBx_E3i?mD@934xqSvrVaFgk^a8263Rr#mUKd{T`ZR`qqJFXnM zgWUmt6TOQ)PVa`hU-`RfGuur!vybQ&BLnULy45&@ZZoFS?ZymxzcGv6ZOnncfIeWH zME_)*0sn0JkZ}XuY1~a8Htwf?Ft*c2jHl?M#_RMk<8%7B@dbUtBy^W)!|zU?GKbJV z!~IqH6r+WsRY4TjS_E)N^nJKbl)r+0YOSFEv`(e}vTlR> z8~wNSHvPGymI{edr~ zKk^myKl~KKty$X z7qepD6|BU!5zkF5g~ z5%*}w9I51DBFD^MaQtu?xsX1Kxb8-8+|=_Na`aW9zoG`2D)c-;gN?o{frD! zLSIC>0DGStPhSG%9_%CB9U>|BWUu46>}C2llFoMHYLZtFm%%Q94d|=%?<5)Ht}lH} zmS)zwrKylAO@&lx<_fnov&JpW9PgH99_W^4mbj&v0ZEw=`?DTbgyMTbfnxmS(MROS7`w(lGXPY5X5Z1%G`18^GZ<1884R_`2MvgRlH(5sCLQkjLPm@zrZ>6Zv+w>ihYCnrxVBS^f zYG4QW9@2HUb7AQ7KK+0s+XLw)`XT*@B(ce29sLJ>?MCmm2h)!s8?d0YZ=|2lPjLas zV&CzYp+6-)GTwI~{TC!ckOO_^(SL(7wiskI{fvH21V%+BLSGPp@pB*jl75BtX+QtL z^lSPJj$eoQ%jmbDY?5C7TFmxOV;f=nPodvqd@!lmK!2b=%69|*T3E>ahfuZ=54KE2 zU>?J+ldlaF8`We4(immTQH=9E#`M0ptSzB1I z5K=%pf(0^IzYI2D&=!_y2)c!31*`xM+0cEk13sxNAx4FKM$j*nC7=coUs*RcQDKuzd_=i6p5kF-X=uQdz>Qw^Wu$ zYK6w6>(rjUgUakGFkGed4^*Su$sAUekeNeCfuzKhC6W?XmT;*8If|n!(Osf+5?OM7 zZ>21eESnmoEMWv7gRZK?D1={u`w;GXL^nZQ;s`7XhKmjklByEEP)aBh8Zrcknx_wu zto0$XBlIDp{tOf$0%;CR2wk3g=4G(qQhx(E9p!|fj&ef4jMh#_mO2*>44j;pc0v}E zA+n@)0-G9H+a~s#$VaK2!1jrZ`E@sEa1&kgzf;?xP2}1Co!Umi-cqn*z}`|3EUeLk zX|H2_p2ArAJn4bH-n@lSOxQa`!rt9A?A_giy;A}yaba&qK`qW;cVO>S5&&Tj_C|P~ zjEIK4QzBq*{8%SbL?m-zZ^SCt+ZTe4lZ3t1=uUTG?{o=!Lm5uO-mX4e4A?sr^>tux ztPt^F@1BvccaM0m_prdQsH%pB2S}>~Z3462by#{;R6882f*c;${T-Y1Gd9XLKY>-(1dm}mu_QrF3*t^@a6KdkhX-#Bm%T0K*+(f zVviPgAWNJrVNw__alk+Pf)i*MeRe$X5<}S%C4_S0!5$9C)(JwWJMfIQbAsfR!r1nN z7G|sVAhtauspioLBn#E+oiOv&^rxE|4`ADadbPz(Tzst)#Nu|QgxB^09m5t!;!opN zdy$|9*Y*NM(-vpq&&AgECPfEY>mWdSUo1K4 zEKKK+b6~Z-Ry#>9=5*Uhu1QcWPNh17f!QUtU7{v#WABpN8*OwEHTDkKf;Ds&P8?_B ztbI11;UmaMG6!?=T%c%2lKsg%>>7_Ehazq!nU9pmz#R)WpUi=M^-{PK*#vSbI}mQF z_NQroy7JFr)5&@^joiX!l6%-;)ON?pkQey$T%xGYj8;$G=V+C7poWrh$yI%P>u^Wt=*p0?LtjTzq z-D@IT%yW1Sf?lH62AI%bWAKW(OAI7$uhp`9DW7$sg zB=)d*2K=+xqvj3lar18Wgn2*mZfCp9=h&0xU)fXU^XwV(1NIlV7nR?_UNT$Q%T^M5 z%^JyGw{qbJ*_+l3_Lg-Fd)q2!yR1s~jBK%MGf%Px8!ukTg zeGUIRR%QLbKIBR4BR&Q0Q1%I*%0A^svVZbp*uQuM!qx0EeiHkfpUS@AXR$B&d3e5@ zea)|B-|*YnxBMRV9lwwLz_+s>`QO-o_-pKEYy?_FAA^Wd1{FC56UFRnG1D-`e8UpU z4KC^oAx^^cnTAjN&hU$~jc#JSkt8-6$>J8o-9hGyyGWUMoh%gZkaD03i^R`lv2Bqh z_F%X?a=cwame~ix9Y@L}TEz|`A=*QuRRd^mjaCh$$r`QdPyVIRssQ<%IA~R0;8qS= z)tkJd(W*YU(%3<(dXYOdT9t+?x*fDCo!q3+suXgIMypcUUtwP>ai$*ZMUt#=rk?CZ za*=~vu-}vO70#4uT<@kcZgSHZC%Ea11~;8K-A!j6=B6_Tx#`RyUb_Ey>7cyplxsfY zrF+gzXFaV^nZDMu8kOm1?b4`Bz`9zaGCizoH7e87x>Tbw>DCn*mB|3Y;Gi-+_^le1 zNmC(-%B1t#H7b+A57nqlDwo%I-Pt^AmO^Ec=}zktg~}w+19+7}Wd@NG zMWI4vx{+C8op(7bsK)cBlYVG%8~+WTV(V^3WTh(ZGs~82F42Kn{Q#X*Zq5#;~!(l*X%pTTl>; z80?Go$zZv#UZv62s}i=cfZV`VRa&P81XAs@g#}>~n!!r2wcEn>b1X8IWv3a_+LevZ zU=zE{U84~k&rG+=+_g1=lO`nz4HntK9&&RZ=1n=5x(18;Av_iCD7f>bZQ;eu?9h2nknYY@ zI8EJEz$P{Q-?n4C2lZ2CjNNV{b6UvRju|66tbI5~*%8J_q!5jGXpS;rOgvLeFlP@6 z*5-@x3hoq?qjZwvQTk=3i}9)A&>;SKxpNjg-ckFFOG6z(wnIhXIP#D~bU*@0+8)_L zgjC1F$}nrB2jjHQs}5`Apg6y-I!O$tt48h0ql4ch()S(1H;GV51ik5)PNLvVqLeU3 zI>2rcrG!-;t2$%aBULxi^u@7sl{KUsnK4c7ikXliwFX+xdwkOV3T-% z#$%jE(7|guM=)lOh7F;jTG~n6L0)VSX$sYvR_6elLfbBkG=$m<)EvB~Ex$UA{;0Y+ za7|2VoiQHsOrY8{uv1{o65C#a3Cgqc+Dp{5`BQ6ZooV1?!6r%LC-yUW2-~jJK;YKE zoud3c@Q0C8$pPdvTxM|!IS9W^CZ_|)IURt_8F(8x6M)TGq9ZV*!Gx}-2zxD?x|7K$V*=qDBj~j!?b4Dil(a6NH=U|#< z457uwP&&oP!Xf7{I^7sfXBi{tY@;7N(&$f*hJP$fla4b+(hH1idabb!{j)Ke{@oZ$ z-!^jTS8y!`%xjE7HVAH%QN)UkQnnIql`#%(lJ*Z${yoNI_Ly-nd)%19o-n4e*8s}A zX3SFlSH^7im2reYjH8Tx#?i)5_}RuW#sp)5G1EBCm}5*f<{M?kGGn2!#wa%~F%}t@ z8WqN6#!}-}qY|!0`8$nTW2bR~@r<#;_{dmkddlWA101 zV(xF8Y93&mVa_(rgj=Wl<;FSYa^qZcm2r`InQ^hX0sf7~rRH|ya`Q>!3iDayeaX1e z{Mfk4{KQyqerjyM8T7SqHz_}0+-wDm-&@0s+pGhO+pUA)PdDzgmKb+ijmACJ$;Oq| z>Bha*4aPy%UB(}+`;Ggox8OcB{>Uxke$I_a+;1Gjli{Zt<9NE!%(INmybP|~*v1zb z+j*_=0Bt1 zxZe1?xYu}1G#jsr2NCxuIa@qV&KF;i3+yyab}Wn_(b_YHXWuE0+Qd4&5#Bew9qp|Ds~N#=ok&{^rhWhLnNA}p`AWhJ+&bc zjF?CEMBI+zP-dggv^I;)qP&I)+xKJ?Ok?4^58Lpyz}4_$*B z>n+#d#@gf>+*tR!1~=C2uE7nAjLpH~bOT;D(pG1~)v*HMrsF zp25v3>ricQ^S1S_Hn=$sWVkIuJGaYrK|B95 zcTxUNKs)ogpdDq%gY#|}_2}zcx}Y6>8mqOz)e765kxtw5j0kQ@)0}od8TqTU(P^Is z617XE3)%@^&KDm>`xSEO*9SI*Z@`N>z>1V;M;c>b7U7W+z5}lVDqYY{M|f-(w4=oe z!&l#V*RD*t{PG~Icm_EgPr0p0#RLMnpdEMPpzfq~dDbBk6LA|~LjBnxLAj9XTkaAj z7_&#apq)K{ow}eMwTE6UA_qWQ@gl9Dom&Cv`~mJZ<@bR(Y3EY0l-wD8GCjgsg%t^*a=0V11@V_w+ zHdD+)%mL=1=1?==%r>W*` zpKh+UmYAnljpnJ=$>w6~bn`Up2D7JimwASDzj>zh7TkyC8Qe0@;@s@P{bo;|3_sQM z^K|pKJj-0m%izk*b$pR|4zD%O<&EZfd=0{D%?tP?=7s!9^CG^%yqMpN=R3_y`Tgc) z{1NkVzRSFVKW$#cUohA6f16kHFU<|2k9n=gH8+Y0=5=DSdA*onUMiNFH;M-HCh=SI zW^s=BdvOV#uQ8j%b>^+&dh-wBUh_85Y~C&&MBJm~J{-?)1+=pb(9U*1I}ZTbc@W3= z4*}YF2++>MILLnl(9R=(cDBZWc8=j;{rA=?^DAk z+z!RZQQF+6Cciu;#mDH8GW}-#Fuq&vyOM48bbO$HQb@&eO*l7r=~u% zgOBUT`_%BIIqyC-gyel{xMEG-r-l!V4G46X-{{fzsr8R}pBiq0J3ll~);;n*HLu>% z8mC*E`_!D&-hFE7F?^p|BALVYsmaXv$XmC>?^ElR_C3}r>?t8_I_^# z*(6EEMBk^@DadA^yid&zbq@`Ktpd!;lDzxWlJtFQktm0}ib{TxFjZZ)Hzv{=Cn@?g zeoXXjYPb~7y-h7CvD?&!1_lL&s@v2&YaChE2x}bq7;TO7Yi~>>WbwDB-_@X}_);-WY?mcSijyHKPS*%MFoqN<$NC1Srd(;q~CnKWoQR^OY zj~afglPMySxz;#{RrjdbA#g=H8>0Cht+hC&A=BYR-LgttMFK^I<8duXB$Y zR)%=@sP%}vM=c|R{v6X9Co7N@Rn^e2;PB80b&uMJp2Gvf!uP15h2A}Cvg%Rys71Fn z>K?TY(yDvZ1TLqP_oyvM5V8@it#QhfH4go`BWoOFTpzO4^=i1eE$;Pd_|3as4OuqG zEVy0`(NWi{;kotoYGG@fBc(OYampIU?AR8kZ4zaW(H>lraF)1sI0;jb_xU(hIB~Lc z+6E^MonK^u6PISY@Jb{|6OTf|5Ka389273*eQr1^Z)1DYKCyP7kg(-V`y~EP)yD-w zx@rSqiv}LU);8@kCow>#eHw|vG3`-N2Vikf&#+aCqb1!j9S};u%BEvF@s5w3vF+H{ zbVvn*JRY6!2Z$1(;(-&bM!K@qaX&uPDMB6GiYCF1&eDr(ThmEG@hxjQL#XXps(Tq) zqHT-Yb*@!SBGrjU1U5AX<1fOdW^Yi7u&DVZk<+LQ9oUiQc9a?QC&rWj7wV-KTole=$>~GuqV@8bEv^}Hs zi<>qXALmuJGarzxK#pI;M;Bhg$35GdG;pUZn!sa9Crsf4zAX`o2)eNg~L0g^0#S!yYg4#>iUb#ZDgbQCvvO#AbA1q z@8(0~ALb64V(z4a&4=kQ^AS4Se3b5EK1N5ITWPMjjTXQUn)lKY^KrV^e1bNbPtu#r zr|2g0X}ZCy1$5ojAs-7YnThaXg;utrcRWwNjjD zoha5>tHcG?N#Y8`Z6I%mjpQBiG!s}JoY@{v6fu7rGI?@vCpXTUAN zrF!zJvwcY^P15!-{b`D}hZ#UEZ4c9re4y=N`jCHUdzb)Z-m!=2g;C(x!}KOEXnUBR zaf@2SpM7L^tm~OO0+rtbbwb~xWPY%`gFgBU4?O}ZAf5#pM zvo3M$VQk2WV-F+9!P*{%lT7 zSyS7?;C8cx2pjTtv&=6L!tG}Mwfm%}zyfBU=*!JoVQUHQbZeuqwGPrMY>h)vL1Jr5J!}o{6lxuIZ@R<251-Q|cuyu| z1=g#MKr}8vG@(E=z;Q1|q22$1n?MRKNcwRW;~8d+%YwRF0MPHIBfl=p1Zi7z;Nzp{`NiDbbq$(&yGOSW7KR9=!GHYy+==9+Sst$Ij%LFjZJkEPT9?!L))jP_broH2 zt*5tI*U-DIYw5#q&sZDj->ntuNxG;BU9yHD9*gGv9>& zp7j9`^pC7=)<3K?>p818aPZOAC)OD2Q)`^{PirFlDb~NOW312MzES=P>st$-2eVGK zzPE0J`*nqn)Ndez#qg3FX4O% zd@1LA1sD7j_-An+zl!_efTzO0m#4v{^KCqXzt1y7I`1L+^PVD;_Y#A7su;%oVkG=L z-djxNeZ*||NAbR*p7$50^8w;_+!W{Yf#Oc`w8vl=QPRRgC_fj z&=h|*P4!QLJA!8T=hGhkD!8+#Uupmtvw_<)??z0^y%7`V4g=_;xCyZ@dELDc6Z$RA z$IkkYXWSbxap$FbBj%IdjhNSXH)3w|Zp6G;YXBsZ%iJ3=jozeyK1ZJ-eO2hMbSKGF zq301AZ1g3$^aYr8_QO51CG--YrdqRB0-tN;6lurI|HuY36vhH1j~WG_%Al4R>wo(u{w(rNIPR zmxdcLb=y=(m8L?fH0xfsH0w6EG;6h6nsusMnpN+XX032bv$EaNtkG_1{2y*G$;8Iw={f2ZvcHA{n1B!>E0A7K6P&j z6%V>Mg^Hc-O`&45dsC>`=H3))?{;qrwV!rx3RNL>Q>gu{dsC=gqctPC+qv#dq4q$n z8Ii;$i*@>@(7Wxy`lisa_Ko_c(8a#v^-ZDUeHZGRLJ#zv=iC(P&vtJL_0QLu5yJPp z{sYGAs|0(WGq5ie*O`-m^q&xjjo0~$flSgnAFIc!L z6si%G?082tV(1w#Asq$Ph;OVvF>9WY!K%h=Vg4;Fb=Eu+A9)Ly`e_TR3E>NHIOXm= zZ!>|V<$w@3RhINi(r=OJx3FIF5PZzd;z~SG_^;Cq%wgtG=&Li zVKWH<6yQxHZSHom@4WQ=Hk0uZu?!^zU}`E2O=0PGsI*C)Za#oorsf>6h0JayM}?#r zW5nl>km6WvVd|L}c{W(Rq)})!CF{u&8PYabu*?d%mZjRzw678DC+$n6p=p1Kh^tJa zWk?#D4hRg8hNc50T%IbSbZxi=8?iGbF8&-?+|+WpM#qz-p=qY9d!(VMS8r)(n%oMj zN!O`8LsOMGY-pND=CGlu%p5`?i5r?GCvIr!QuS=i+8CND`#5RS70U)K)Lk|;%Fq;Q z5*LDj^3YenNmYuKaBJbNf-1$kgqUNI#{2$QrZhG6hf+g>VMR&;meQpNK>r|MX=RG; zt}=x*mHTW9x$SE3yt}qT{X>K@MY<7G*jc(`zh|M+`g=&jr3F@~w-M|EX;Bt?u+sAc z3zo-PMh=l7Em)A8&;TPiFfc$`!43%was?$cG$KlCR%8Ww0#D0orCE{gYF5lfeI3n; zp^jz+G*GA?Xnqp(QKZ6%YNMlC(LFKMieZ7lfnid$!W`;i*pih^W{=26saj#O$e1o( z?=i2TYO%SCm3u{Op?Xo(#mc?H%1BiVIRnHnbB;F94zG0mKz$q)>sXfx*&&&)YBkQ&#_S zXN2d;h-fqC)Ce>aN(+AK(FGo5U#I~su;bDU~jqC z*g(nEM3_y)ga)x==A4H5I;t4hm&8-W=oP7o(KDVZ#_+)KsH%oW1V@Ill`2Md&yj%< zVO0#Y&@*$ERgY4|h;D6^DnIK4Hzq_(#Jf1zIib&c#!lhZ02AmjX}YsA;0E2FTuPa<OEGR&OEsIlMGT5DpW;ue+U#wr zTHR)Eku`09Z~VC`H+!9|qjs|=WMlTaQoV^sZO_zi+M(7tm6`Rnf4x@0*}F6yHJrUq zvs+w|?<6OsI!=4l>y!%3)3*O+Pf=fdT|<&Xw`2w4kv1)oN)&r|-5d>+}% zk0g)sqsd?ReDXb?PYFMUrto8F5nn(j^W*5Dyo^re3+Z9_P~_o!E}g@Vr1Rj<=QHTB z0Hx3474#ZF(ogcG^c8+Q-Oa1$7jQrE<;>4(*#Nka`~+6S8(AaVO1={AbnTy^{CoJB z>@j{8dz}B4z0B9LH{rj>&t~88b#NC--$>&Z!Ch>Oz$Z@+hdY&DYOLdz8RzrMjSKjN z#wAE|IsA?M3VbT{N_-CW3S$>vZ@kT~G5(FuqkhfLG=AjQ;_mH@W`BO2na8g;^Z5hA2V|x+*J>2ceU&HS(*Qh(U?=m0ccbT8?yUnlpJ?8iPUh@Z}`I-OTqPRA~ z&o^1a`5&#Z@C*6<)-=8uS5IuQ%J_A-R${BQns2k#@a@+5`~mB7_}B0Ut-JX{aE~c} z7k}K^#h`y!0qPW*l+P~?N9l4_UHV2`+NSa zkMSRU-T8lf8T=<-AO5p16VKU#`0@nx?Jt<`Kw@;J#%-_-cgDcbV|}?hxI4 z4~it;BO=-NXQY2mr1(A)seUTb{9L5_yNeWmZ_&fwPxSQn7rp#rL~nn-=;IF|?f{zO zpFj(tI#A?aL4#1eDfVANOa1F<$bUcFWAr!vr|EwF*WtdRg-R`FDVa<2wOYXFl2*&F>4T3%pRUw$ zdg6PNrzo|YUhH8yMychbvd8EsrIwRsKJ1pJLaHP znt762nz_a;%^d5NX6Cu2@np9&6;h?CkSdL*x}|ZSTblKnTblKzTblKlTbi}YEzMfx zmS(MXOA|-BrKylAO@&lx;%K)tG21Oo40lTt*=}hf)h$hAxTWz&-O~6IZfUqF-%-oy zXP0ZWoc{KFt(Mc*9;?-IdfItfEvJ_~LaXIu*rT*sP7mJ`)^0zq(X* z{vS|}>QdR+YnoA;%G&lS7YFw67Yzj$P+86 zf=D}75#56Q2?Y zwM(m&B2Pzz0PvvnnAMV+D6O&M#K9SdEJ7}xj29vEtx z>grgvBZ$ScuE|)B{=GUGw^HQkXvktEXuCql<)M`#Pe*i+p%aQc?NjT#B2OapWSiQq zVc}g4jR0&Dp%+gZ17$!hC{mFp0cyw-k6vpPV5Nb2W^q(xL9k=`1hfc6GEOPh!=JM=YKq&)%WhMv>>2 zk&Ua!vzN%WR^&;XY|LJ7rN|Rat&{2}b1(txyL95ok-QjYJ?0hn{yKL|%C2u)Kg0Il zgFpPz0`O|@(rm5F)28KnP)|uSQnRHE&8RI``)$WdW~4Gt8&aLSU*}!h|E`+NBb9mf z7R|lZC7N?rui_^>>kmhI6U{P_BZ@|0>RT>{$P+Y|i5bODY z;%Yt#DmGKZ1$-*}Bg8fQ1hIjyf`6*m$ghIh%`M^veup@lZxT21C&W#Bm$;d~B7V=` zg8zYN;y;L6;qH>Y$PjnK-6OKay<#@p>0*;OSNu_2DDD#%iMzyQNOL9p>&5-z0nscT zh5wY;BHk6-#OGqW_*UE~ei9GZ1H@tWDDj}3Cmyor!<8d^y4Yc#A!gcZ@!LB1=ZS;t z3&c+QdhxLR2HbA(nEjS`-2PNNVSg@m+24!DeM~&%>n{H6%Mefd`iN(InRw0?&qA5! zIVkh|70Nu%Lz(AADD%7oWuBLz%<~GAd0vGw&)=cU^BRsj01~E~~9sY|M(5>* zii%LBA~0ig9#RGKJw_K57lC<_(M5`l4x@`ob2X!jBo{TKi%Nr<(M6?Txy$HaE(%qQ z4$9&cqk{$cUc-Y01#ZKGg=nqA=wKll<1ji1=DLgy7L|lE2ElZvhl0fgUdCeZTxSG( z9YzOBz$M+W!IEMx8|tacE6xSaoovNmufyo#yl^#(^So*nLrmOk`Cc`PRqGr^7eit^ zMi&G9-~Wg zrGQ9@E|JA6Mwb+XC9I^-ldux>w{Ag6ktbm#V6MyPl3-ZIN-)|qqe~#AZbpnY&9M@& z*I{%?DY&E=T>{zA*-BAQovk$28wjOfufyolyl^#3^Sx@8LQLFj1zt5vRqGr^mqKDZ zMwb@ldW|*G8)r{k-q^^?L$%$!d3oOGK)f6taze?=larm7H$PnKJjjoiw=i7mJk?^S z5AyQl?BQe&f>u$n*9&=h7?@r+M1H;$Bh?Z4vL;SPTxJ$PmfXArsJ5H8Am1B3c?ICU?uY_88G3mOya5E# z;aV3IhHG7*TC6*wK+Y~+M-&7L!yQq8fgA3K0*H{;5rt|PsE#O9Jk}jii1kEwM4@D{ z+YxHLbULCCq7v?i!h9)Esv`3`WRhVR+8YD-2KC2#4iTu8Q7>D2$l7^9nI` zU1k zyhY(!7pWHOjwq6|kJk}J#d+b5D8fh%cSI3H$m@up8V0H(f^yY%r=}p*8{H8>$zr!7 z)OzZ4L=d79?ua0kcHI#{Srextg24#642I|QykK}zM>s5(a@F)YA{a5V=LIo#U4|4x z!d-?GW9+&eQ4H?ujwr@<#A9YLWXa2mYI}JL!lS7e+}9mZEay=?rY_^$6`>5jjfj#+}9mZD(6tQBTBJr@bW^g zyu8KX(NwBhtUIDq&Ocs9l$I2E9g&|aw>EA^hY^ow#13UP*UkoUMYr*lLun#RtW2^TT3jdlKryk2!>v;}era$*bQe5hk(>vXJqO>m1Yzz$0%DU{_oNeUtUZmiddSbMzKBDoYgY2}NR zPFo}=T^%cD0H^38**YC7H_mR+Mc7m5Btco8lO%}!s~hX}CuUnOwpdR7PFne@q0<)2 zX-3ClE9S<^*6CQeeRPX1#wx0ll*sa&Bqi9lxv}A1EeZE(shsYdv~u&U)0WBsrem@B zaARfbbgbMkxkZ=CckiOoyrFnGFOjV-&6mMa$$J%Bgg03oTO{9Po!An*cIns>`P${g zLQ-WZiUdSeC6Sc#^09q&H+%A9BCle}+0|a?8;Sf?M6Ef(WOsH7rV8Y9Xxy4N^_rN-z+yd)-=ujC{=MpMT zmL@j`I;mSl#L9CCoeRCGa>-)}Hl0zly`mj(J4K;XPZW%MHoX2o)(ePdb3(4*4q@ zD`iB55yTsg7c6mt#UXhXp<)XV)Uh%j=1?~=Ry{B1Q~+HP#GY2hhUA_~{Va1~xp$Ld zqSHZn5}|^{SW9$E8VG?K_QRK==e2o)<2A26VFEQXwuHW$$t-A=TAQP0DHgjWXgsm+}% z5MllL;)F2)C@RH>*F?~_@+iWI2hZeLg!6!~+*7CwGOQ~DW;@3bvJuY4Nwp10(#-8e84&^IjiF3qAWKQZaf;V;^j$$TrhOJTriyUx$*~8O8+2V)7_v~ zmdq^oH7bXEkgqP@gIrtG0}fo(;e>k7hZD{(;D|b%2xpQnH68_w#V`fAsgl27J0SNv zDv`{OYKF7OBML9SJfraPt3wK%Ury}d{Bn1to+L3TU*3aU@6-cYpbje316rUCD%1nI zMIBUVdf=Kmsc?RiDIreSs5m{Njw;lXT!C`+4@f1CD!lk29gphBqY5`33#vn?0ENh- z3ik&{z8CZglbJD1J2~V7ChCZXQvHC2$>R#=7g-TZFV2Hxtvs&?XM)s6Jm`vHl;CAV zS4{@pc$r_GS$J9Gp+&@lTT_`I{h@wA5c8&!Nae>yG@J!{hlmHao-)770eSKzk1jL? zbd5Z^&`;o+JiE|OG9|<-Kj?OiJiJg(A?!lY2=xO}$-@gbUNT+9qiu3U_2RwsC`2A! z{C`cIxo(v)5QT4yXn6x(0I@0xC~2r^p-e}IC@n+}CHqc~cqv{53cha^`${R!8UN$m z44dfbJ=01iQGWoRI~5rJS+s=VhmF-pFld2i5m9qMXqM^ku=-n9ke_=^t9H8$axC!q#qjUYf?7HQXCU1Phf0a!w|x&2v>_9qA* z`SX<7{_MLW(*3mko&lFed82AzX_PmLF>C4@#rRTv0}Zj3Mu8(31dSS0|w(iX2I-L6u`UDRUf= z>X@fSp(9F!Z4ZCW_I6nVux8$?S)#w|kt0y-NPGD6)Z6~Z9h;zcB+x;8Uwda9{LIH8f;B z7hG1gjk5ZBX}H7s1M;`FGP(t;2Afvfh%-Z^u)T^j16-RY|K{MU8`5!ej#~ll%yD~;$8$WH<8qFt Xb3B{l`5beOA9K8zdDnhENUPNjYDM95TSDTHSx=rkr*9qdW z2ogdF^#OP&#O!W;Q7PP18rk2B{g20E|M~mt3_ufG3{9m+o(j42Lt&H}M_w=%TpEx3 z$mizvoWZ8Cb1y@Tb!*#HXToFsS#*pt#gMderc=M83*KngqS#MGlxSQ@n>oLxr2Oqqnd+4N-rD~Q+ma)x__z+y@YqbjX(5_zfG?^nPuo(v3PLF z9V9Mdm%au&WytQTA!n#`r_zWCKNOJ|jQNg~$|N_5+y*rxfH8}`4ra)3mvPk z&p~GOgjP>z^@LVWcv1gy4l=7Jw0c6TC$xIPi~84dkXb#U)e~Ahq16+n`ft=4>IdG_ axK8sMYK+%Mrj3on8faRt)y7+F((n(lApm&* diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/StoreApi.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/StoreApi.class deleted file mode 100644 index 3240ab8d74c1ebbf3bb557f2407ad758d1922756..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 42521 zcmeHw349#Iv3GU%?#ybnx_zw=EMxh$b!#Q94cOSm$oK*q8w0_SrNtJOC83qDfk3#A z1PG9X%bej5Aq0XUGGHJMNw~umAS6H%2v&(}0;Qi3uYW6iOS*z)$qSi7L%Q7%iCh@^&L&EEep3c#M(GwlPxHc zCL<0PNo6zAFS|0A){bSJ&CRm~ z*{$5vy2b!y3)*K>Ye#caOUZF3Y%XbP>4>$r)Hj#ZwQ$4ZO$~9Ias`cS*cfZrw4%Pf zelrBsUKcmCAeCfkEnk0Jtf6CeU-Ao4J{1HhkA{JomSkr~Q*+6Zrj|{y#)IqQ8<*C% z*)&3sHK(bisbhaZYU;GrAsR*DAdRHag0d2&bl$OoD$|tmVX@;oWATpptu4nkZLn#d zA(vbl>)6=ZXj38hTd;7+!c_~=O17XPGqpQ3W`}5BnwUWos7TO=k~nK`iSCY) zlTELj5}?U~GLmkm3d&7rpQDpDO-DzbP~Y4cTYjvd$$j+0wB8*NqM0-+NHeGyif%f- zBeu1}D0=*m4x35^<+R7zn(G^4MUAmz>pPn}1Rax1-;9dh*F!d5HxIRpN&0$<_5_}^8|(aC2G@r zLH@S-_IM07un+N1>&XzwL|fz_96MB=J(mFN7GkWg^z)3`l;EbuR_!68ymUC zm9Y(*;l?1aS$)(o5clh;AxQPqC@28#5ABS#pC~BLRW(n+Lv$={;3jQEM%2`P;>s9W zl$sGqkjHVfDU-$#G&af1;*m|z{6G_IemyJ|ELKV-btWAI+UWR9Y9(aJPuOYqxlO3n z-dG=B22-Og`;j3!fwp8)Cv6qvYthN6W5w8t5S>IPbH1;+s^~VaXd$=Arc)g$tY%9X zqSH9{*XeYZ5ADS@A6jqE%%roJNegm2Bz9tm&T;ae3$dVEv?x6{C+L7aI;OXo8K|qy zr*CjqeG{_`V{Q+Jd$Z|6a9y`-<*Iqh=EIj{ElGL^X?}|?&Y+9v5*UE>tk7tCZ*@k# zZ_{^}`ga|xb8xI4svi&0At;1_(t)m@wd%ySSb(mA@X_+Y-GwLptLYk6jBC;L z2}3Y{V}1Kd_Ngrmum#scoXxS84INN3IPJO+eUEO;q#NiaxUKrOw&tb=Jp(B@F5cP_ zpj(iutrI-dBn!9q)S(Y&;c;~e$6>94U(CvaKKzBf__3g2R$9L94mj{`g zxHUi-e?)ij`;-yXTIOcqX$&xGFs6|^`xN0L?%6MTrTHn+jV{3U2Y=m3JVP>G* z-GWA$zUD5Ok4b5gNxoN5c?;%fg$;V*R=7TfSiGaKqqVT5wPlum)PZ7!4vAvN&jslI zAl=8tTFeg6gD^kw&h>FUb3HJ2EG8HUH~y7mnWuQkTiaS{R_3^@<#ikV}6`49MK#vI;r{}B- zx3;yzOTmL{1L4hFL-d3*AAJ($9z(*Jov~74H23qqG042`m-I9n+h+vrmnH?z{S~d* z7;C{4r45RQ8TWITIKaGhZeF>isiT3X#{8fN6Ek@fhS#s?g$#P0UUVk%O_;BT=+|^( z5R=N6lYEbvcNQ71XVY(k^a{_URVPnPX2MISPI+c03|Wt|Fg35y@3{EyVTv|mM%aXj zNk<8kYx69)|M~#EE@(pXVBb1x%a$#(bOuxhOVQdG!wbhBq5p2R2ch(Vt&JxpIDAXc z5~HD*bd@x~&ctIKC2VhSon7ae$&`1M17~-FkGTvsU4!`{a^k+!LZIuxnH_WELU?S#;Iq6A{x#M3m z=zaP?P+6LagIB*MOx8|{wcGR|OfwXCaec!k*jLA=b~u`nXB_N|+n zOOA80m2ju6Z)#~QNiKkH{xA9{NPnk)2%0g3f;N2&hr6X669qlY=EWV`5~5G|b>m<3 zZ@h9Pm@YP4ICZ~q+ATfHO>J=87Dn=a;F(>~E{!!d)w9{O>Ax|+J;8eEsba;*rrknd z>fVb$BBL!-4@Y6lVq!3O$D;q04FEcDhViUT4y2*(KLFsGee zcD#c%Gbw9pOCo=~aPi9J%L>pZ{5ZEU~w>mMrjQiSJ;~gQfuahtl z266d{Rdvgktqh1sU>A!Ocx@MS;6UO}w*gbcROVa26Y_9u1v@=g4z?L2{kM8)i&s13|>XVSHwD|WhRmC3!LMhMSW1L66*!cO_P17SzXF%uG?w0z)+u^ zCKb2P!mW5c;^`qTeF-e2Ah7DZa8(uf`nP*&Grbj!JZ*YuS>gjykvD z>;=%5Tf|nb7MZ+Jmz={EC&P|nUWNH*NSwkveogQjH(us9&ewW#8qYjuh|`e|{-wSd zYLl{r?l}3`EU`1iS)BFkl;uq4xh?Pto&k5+s3#DDs{69pNw1*I_3=1{d?Llv6B6eO zymJ3b;FY_i-Hhk-TppYpUdxNq)F2~qTYRfWml;O-?y^gQ;$m?r-uRp1X6?Vdy|q0g zzT+qp-sICA#!1C(ad}W&!DQ1dY_J2a+ZI<1D(wNAbahZ{6W3tmU>54?4o}jUDoks- zFH?@?<$_Sl>%{dz5fe8I(4zWe^e6QNO5B(sZsPZ&ian^^7PkaN7r#lBIwCG?Y>mbB z{L0L#3RA{0)&d;XUik#kUUZG7!Ce&b%YKoe>t-F6#Dcr32S6(XCXRLU!a8ZjHSOU}0oUg^ zi-ssMJzch$>6}y|D4y+b$FuPhbvjF_KOFTsjCvK4qPB1G&6xs z5}N6t{)Cnwr3JSh%$Nl`w}nAYb8kj?Qgkg8vyUd_nI<_y*tCg}jW$+KtVOw_Ti@mP zA_EdZmlw@RQV#vLg$&u|ZI*4DCKEIhEPZ3~07)%sRETMBbkHcBA>j6)tMH~`jHu?; zhWh5!_3aDUSYSeuZto^J5!9A;u_X6_V!3YZu59tfl`aGQ&gMY3z@^*7pcA?m=?p+XN*G}>(oEUScIhwEBSfca}> z)P~m^^&G~vP;-(joU!CdDZu4p8?dysKgg>^3s;52CmKx_SYXLDXfl92hk8I@@uaVX z#Ilh1Z>%ATo5XI%_bk9_P)G{)Jr_${SMU9`GH||sK>8d3=ua&UJh2WF_GwcW_diM4 zj2R}r_t4qV;^CY(G2=7h0j4bjm{-aSK}G#J{A5bD%# zCnVNdLPjTA`Gb#u3?oI$4~wh3wqwgN2^_|x0g5%t!f7l_$#GbilKVgzvC4sWxIX3~ zy*n)NzTL~Eg=C?efCXE*FM25H#oW!vD;%G=o!Ix0v!|)*vp7ErFTKXiB*$QyHB!qK}D-elR(`j>PnZQF%s)1G0>v zZLHlb=tHnWUJb{ZCA*VoNl9C*Lw|Wv9N$vE0rsRAeSboEKvo4w(o(?xvJx?g#hW~L z$sGVmJuez#7|P8jD14kH_#bGtT(575Z?TptHX*68OweV!PAd({QBsFprv+thc2EXz zn~R{YMTiH2{D^bqW*}LO+I3pFEENal)nbMl%K?)(i+HnKQOq)H(s23iCuPN( zfKvK+t_=^1iFd;$tgEkLU&K?wrk2>U&duv%?Is0t1IGtzZ)FmL-hv=JN6}%OEm#(b z!TdMHn?S}xn&%}x)54T$Wz&Wh%<|h&&6u7=QgQ}Ywsy8R#CRlQG&na4V(U9Mc&i$i zV;Ksoohp;c1E-VFF8WZFd%(X|<(3?NFRkmQ zSTv|2nJN+r2cuaklFd1qqB$y(8_tR5sYre}?>^crfQ3TZ(SmTneFPVKC2io?DS~#< z*Q3M2!=l4gWJGxQeRKvVofRFaBBR11@1wI(C>#!(LNhsrLebIT(Yt6ybc~9O4QFw& z^SIcI@R)A8U=4Nceij1k+WlRk?R4pyaIl*$i;iQ?uFT(dA6+Mr_l5-Dk5E=Pcpu#? z=qj>(UF1_&QohNZ-*q4TK+ziK_J>0%{KJ&O(O@{})jq?KwY4Vy&ip&?rMs`BTrKq< z8>u6!TUUQscOcrK@a={(#U^E_|fqXM?)%-6%KjNf6mXl>Cv_M zkKapAMKif=&u*ue(3`(0zD+Bi%ESfeJ+zSUc^c762yY>LjN}`L!v@1?PykXA1DBnH8cMWwCO5{H8cNB-MT3|>Fu?^Xm-$_v~H+K9@HaWMG9tWmfvHR zkh@Fgp0J(%b}#*NW;cDhHvcp5xLwF_X1B1rMOGJ04`&t#3<3x(Zzl!T7KpqZBA<2D zxf^EgqWgyT3Gdr2Ms>-#$((k{vgF%tF}6#NPfq#bHf4O5==|To>4YwN@_z@XMO`!@ znbQI>84E4byC`#~n7MX`nDrBF*Hk1YoE6Pw#SLo34d+LPsmSo~uq5*~B0R!as!EO- z^ENU(GCE2{!r|QTD9=(MrcK?9Zc)Y->oH@ivbsfOG_+k*cZ>bPp>8q%K3<-QW`(oz zxAAZm%V9c7-Jy+mkukRY4DT-TuMyE~3WM-rSJJqhV%1uXui<}=>K0$!AsTjxSeKX= z&bn7@x{~(YDK_gIZ9THZb+*x*dcu{|jZp%Lbc>T5q2xY_Z>+nhGo0Hkz8=jFV?f>z zEl`nRZ0A!FQb_C&SLz}&cZzLmg>L2md9Ov@s1>%l#rL+0o7Z)VTeTUz25n#)>PMJ>0RK%@ z2=ft6fMe>S)18*wmSVqdH+Nxcm$)Ko@1)>bcxZ9w+Mm*ltGG8|+QAH5wY{c5+{MrC z*&%kY0pudvxJXDBxj&KZ0nYZ|4)Kt-lSZ-E+yzdQJeVl+7CL-4t)~o|q)jvYHjUGN zgPwGcbG8A%9lZZtVE!-36cnd^ue@=+F=Gr}Zpj zuTf)Jsl7_AuL;8tCAOPJ^uyA&A&4tb6bKY)!_!{__l(+JXy787E|PUvcX=C&X%8`wYRlT_Wmy*NMfxn^E=$;t=01vBdXNvDEjlSmAp~9Ez|;Uq28>_&yM8eg786 z_=kyg{;|03E9(8TMT5UiH2Rl|L;Qz}n7@<$?LR|o@SiU>`tL#5iTH0slmEB$iT`(a z_ByU_(g*&x#c}?BiA`1&LbYhIYDBBGK(twP;&|&&#E%ql>sZlYZ4#YUn>fMRiu=>W zR_lCmqIJ1A$+}vcY+Wx-vAV>m*3ZP(tw+V_)?dUKwojaCj}T|sW5n6^M6uPLBhIxC z7U$V(#rgIz;v4p{xNj8~*l}^8-61Zr&lcaZzacKRFGboFRBm5I)%IglV?Rx`_Ny?4 zf2KM1hqPZH3t=414HVJ5KqbNws+NnP>vOQ>GaKvOKfzn?7-(I-_^Ei9#$rT|6F(C_ zhu3?T=89j4N8sJx!&c8n@pKgZhE|Bj#N!wpuL7xg0%;?lw}+#|<1~!A=v#ryZD26okDV@f1!8- zPcy|%|7+rpkZw>!tz*QS;w@|nYquwhw-L*rrS>7>9n@jd3h2$dpbYm!GsU08pUFn= z7b5l^+0c`F#9zewuycz8KJi!a0bc(n1*VC=fwGTA1Zu>Gh$#vL4ibNd9!SPU#D9s8 zcm^3*1_|yW!K>7;lE_8)d`d3i$t9LD(8)x3;$zxCKDmf!)Q?fkWaL~SmZ<#`I7$zU zMT08h(*p6?%vn)C)_eS6i-8p1^r)pGHUlZvKtM_W$cvAGlmG)MzTQAehKewj63%cI z?2)4>n$7Eu*=C6?X{8YhY#xw;m|1DWQku6YX@HawDl(GSA{j^-#p{n6eVNHI22y~n zFpx4@MaG0fyq0Nzl+k?xDS&`3i;iX9lYtbEZw68_daU;4o7^52q6@p=#tqSQ3MYUR zE(}B}BYhwxBYhynrMk9XAVuR`ncnjrKuVCC`niCVu?(bG(NJ_85E}p~K@Ug?_5q}@ zZZOW4t#P&)NkB?46-b$p0;B{JKuRz@AZ0>$TzEn%kiwiM0V#Z&3Z#6oo01Hqe6cxA z22#G*oE9YkDa>gfKneqqj1h+%%p$`8#2!xI;l#rk)76%$l4Hia0bX%{;T(pBjio}Y zPap-@No6$C04V?u4UiHFhx!Fl9An$h@OFTdEMic`15yxQ!wJbi%G_`$2}r@iHqMch z%>h!voC+Z2#~ARC2m>h&YVH6j9pM}XQu4xi45Tnp$`-#Dkg_zK1%4SwsbbJ20i?`G z0aEe}kdn(lN?!iBK5>+N!~3Ri8l4y^icZov%B0~%;fVJ zUX7#p0Y?Kzk@&d4;3)KC_-hwP*%$Ex5SAhwg>X^Wze`-)EfvI&%_guw`W^gx++g?$ z3SJSlG`<4preAyo&pdnuMYeGf;44T@!B=qK6JPle_;cWu5?am3NdRjA17j-%edW+^ z`~3kc;USdh6IB^%mF2vE(YqO%$syq>{gc^aFl8W;c&qP!&;KGw=8MFOhD!$R<~~3G7#1iMKhRjopd``(N(Ld4 zE=rOX8D<=z2Lfc8gn@|9A_pEw>ER>k5W$%4Z~58*N75t$eg{TIhDv7;SY!{#Y5SLi zKfq#*NK4S#^qJ=M2Z#)jpWbWUE*g?1p?*7!p^(o>1Iy+m_%kTOULs~dkk3gCfW?vc za}kieMa_XfhCr>){sZ<=+EeyJT*l|mA`JM^gBuVU8uIZ`!2ZY}AA5zA1AFW>QaCLs z)y54`Qhf|w7SWLKi7A1=6bx>Lb9ytghonAlyMS|y^KcHrS#pvNqilp6T1jIO#?dN# zPjxsI(Q2APYiKGRf$yeQQG|}9TD%n0($NS<(j0LKEkig)e1~G#)N5J-STXh?A0T#9>7@0pYlrJ`=Zy9MOf7Hf|Ne#P>y5+$KhgYsEg;4m$zY zB5@hM7yJRX%ik^Y#r+7s5cgnBb%%Hh;cxhQ?=$g$+z;UZ@esme z=K8q4ZWT|+3&oT2BJq^`mUsqO$Fm48>FWdH*YW}JvV2s$CSMo7lYheX1MvqH5O1gv z;*Y>Po>2RWH&vN;2+C>Q~~w)$3xndIx3S$0z96apY4{`h3#w8zn7-kiM45EMJ+-_RWz6zSVM=?-*Pg zMV9-kWQBjW9POVcEB*E2aes@9_&a5_|9XTj#D5`c{Evvo{7>N7FL8ZVJmh~~ z*81O+QELLiM7f_;B=@&Uo7UrS|b-&N6Up)BkniLMOLRg*g8|z zS?9^c)&+8j^=-M-x>GK*?v^X8m*t_>2l6mm$d$GwSJ~Nekv&DOwkzZsdx1Q{u9Iu+ zLveqkJjy;s9&N9aU$NWdF?Oe1XP<(!GwDeCY+7gELtnL@qk8-IwBCN78tsoL7RW^? zq>X_o)D);jSWfFS&QVS^^lyW6jHb^F&M^jO|2Q~D7}%SGbBw^bQVz~B68N2ia}1-$ z49+o}erj-z0$_Iz&XG-*8Jr`B&Nnzmh%PWVN0z(~tL2Py=2K@Y$g{qG(Lh5>sp=z%>L zM=(CpbN2`@sq^-POb6;fjwXY4c#B@%sv!1>c%TPjW>pYtg;5vfFrbJ2+8PK4gC5u_ z;(;EBG3YTSj7>8$qGMHLTsWJ-5wnztRm(nhk7P3Fu@Cc}40?EcGw6}oV`VPiKJO~Z)r-cnl0c78D(EpQ1@yqmqiuGNgwg{&CWgm{C#HfP z%xMzn!MCZP#}~UP$)Lv*bI8O+iQA( z9?QZx;Mdtb0-uloJyLg%3`^cUQcxga11{*jd!#5_l)`FsQe<*;ibg%A44)jHlt4Yu zLJ##|)>BZA)Yhh;9)sl7sE5t_Gk|*Jc&Nuc@Z&D%!MjKHN8m3QjzqXHZ1)5`@-*ln zLxX`HD0oFQph1to0H6n+d7uZ1Y~vyTJ&>FNdf>i)(BlXOJ&w_PN_@RmetGROWk*Tx zEPC0zKiGr!lcZgwPuzodlcY_7H?cT-N%|==B;I&i z0UQ87(cs7U0h;9yKnB#-W7!u9t-HGS4wC+4G$=QT{UZaD_`k)EyLaSEZqWT^1={I$ zO6(aKSU7{DAcN~~Ixxs!RMN#k(xU@$3<89tN2kBlaA#~gJ4FVPZ}R8pJ;x`*GKqa6 z=}^J28W;;nt5JHCd#J;pdqjrBm<#2mq9M)>ks%W5e}BkO2=%$1jtzp&?vQjS^``(SZL^k2i#YECouKon(k#j(ip^)pd7rh-J$!#3s zVt*1W(vzQ|;vxZGAmB^d5z>RJAz>^IEeAl@JA5%MXR|~PzJ{`U#@!3jgT&APjp{(4 z8Yaly>aureeeR|$vSla<9XSc;$jLxPPR405U&HphuTdeL0%YV=nu4EPslsosRMY7+ z4`~O{nN){gTB)P65zeF~@~dC z`6u54^3T2p<$Jz|>4%6UZ5u1hpQ>}k!q^F9`~Enbh}l}u-nv3 z`*bzSK1UVX7a{FCbf$e7ooD}?&bMEuZ`dEuH|@{p!hnx10y1(@pp-5FGID8P5yCnG zK4W%)1PwYeR%97;WE@Vra?p`6^rk^a@Y@mw9SLK{hl7rcpqC9gG7>wQoLwNp=|+Q& z(<0vYZ9kwHgBVV{Sy z3#7n*wn0aR`A;_JNS^;xgO21|H=11_1=hu87f7y-F*=e5?8Mmxl5bU*T_8FBkIXKR zZ2uc(7f6;|Zgzo$#16l+3nWuS%r209sKx982~wTe1rneoW*0~X`rkoEV08^T5`dmO zq0teW4l?M7MTLR68XfUdUSPRKM|?m>j?w4{jynUs;qC(YD)#W?_u2)LijNe?Va_Iy z2?3xcQ;33B%qWn|CvyEpZko{j5t zL>m#}2xr5_{RH0%e}cneDv}Q)N*qNs^QUs`l{5+`W6j(p$9e~1$?;vZyN?66uI~T9 zEu0r;mR3F3%v*v^>=0UPb_ntLY}h2^><}8wnA!O7Sa%&dS{P0wISbO!3E}*3A-0Ri ziF~Zlc5|#zPPd%Ai{9^|!~Vxk`BHyNmRy&5J^7Y#8ud(a%9o-|_W-r=UGlqMN^Vb% zo}17mj`~t^dm_1_BwUS;7wiL9V_f>nQ`uZx?f>1WZ2jPBU#L^r^!Oq8>g*6+qAj~TqmDntCoA8+Ch_zQoGIY<{gHDkEchA+tJg@c>5oL&zO_y25Dh>I|doVN{cHvLM+_$@O=(f39LL_N?fTJ z^i;)k8mRqq`k48U8FXhOec|SNKnz+78Kx35XDbe|wS6M59)6xKYyEbqi=lsBLMo84 z6@N)M`re|Lgr$F8lDwAY@0*Kyw^vt1zJx1CPrRQSpeX%u^y@lJ?AFl_u;RME8XfEB36S{wha0kNebdV~c zBM>&Ka%xqT2y@JJKXct*Upv(PbiUe;E>m;qdNq%pM0j2uNUvjmpRE?)48w&uzwjWj zk6MH?3=hWng>%GIwI9wdoFj@=CC)6Y6UV5pFEZQop87$Msxws=8jCrtZMqJ!+%6 zU!9>IS7)kM)LH6p>TLC)I!EnR=lX1QjxS4{@0*~$fpD?DM%5+0sJhfQUwzxxg0M|} z$9J>(uJ8NmGT&{;a|iO?h3oz5a^DN;3g4@^zM-!2eX6eZXQ*rZIqEF`aCNPJy1LFk zLtXE$RX6zO;kroO=s!x`gm9a_cBmitJJjv|Q`8Urw<5f#?(qL!-Rb|M`jP)lrvF*~dtx5ud`?0wYF?S0il_9R@3)syzY>M45#uB+A4 zz}KI(Pf^d=XR3Sc^VReA_tgfwTfJaEs9v<+MfgCy5Xe$51+vw#fqbgd2| z_3OY)^>UyIVUv0#(5zk!Y*nuXPEo%LoQ?QJ>JNdd)a!xk)Ej}D)E@)4D@h-!c}f4>Ojlzh|sbZ)LQpk21cd z{*iH^`e(+a>f?;7aDSuvB%@3HJL6XMX~uo(KN%0H&oUlC+Ea9U#?y3H#(!vgFidv` zr_epYD(Vi-p&h{^5H`~N!B*NC{5rzrbQgaYpjH9R_j#v7+V1I)*gxr>4*5Ipbja7e z(;=VnPKSKnJ00>#?{vs(%y$7fI0@1{9rD}eyMQe0q%@~Ps*zM7r{na+(K z*i6JGsL@m^XW?|iF{*%SWHIuE6orf z$8>GhpWNE4H{9B+d)(S^0Hcwl^#ivy>khXztKO~6YIJL}|6;zE7=bWsrbK zp^YDe!_VCzk!ia>iIzLocj}d77s$vGCSUE4$B&ob@B$I^>alP}0J9c0#qoWI#@qwb z`S+(}Ef?csxt8N!DG!n>@Pm2Ju3S2AMKI|%=7NW`b~HD&1gEbobYlkvXB3tdCgR#8^t7ON;PbBk4!qsb0ONt7^Q4S60=!4X><5YaKyXR--YF zperF$Sc}nS3f4lrj-YGHAtfW|TIhyb41Bu9D!qYF3-LOFu4Sv{ z7OV2utc9Am#UdV?wYqhVpljJeI3**|+L{Va(6tzPo}gigaaUP85hjs!0yH`1r9lHt z8pedl$EMuLR|^%_Wh>aK=(GwR08Sdz!lYH2varV$5#-d*E4db3rV^qtY3K-(2GwxV zs@S6Gd{w2WS(mNi!R4f}9yn=`j!COBWl>)h?7#Co!nNo!kqVc`2u#08gM^%X)jY6u zzUng6tZ7%XjyY)+F1>1QiIWyFWl>)>%%D@IhHKH!YbsqHYhVFQTCJN_%lfVJ)xwQ9 zWoubsoiz9elg2G^(%6wPU#PDZ)}XAawrpZ0x{aBvE!R=bt5YlCkW6YNJ0vGH0_$l~ zBWyjL)EW$RlUjqJK7Ci(3?MwljD10lYI#U20b!GrM%H^O2ZaHTLpv&V3)Imi1u zamV{RapU~CK8Ti`e=W1gzMmtQLa^(1(lADK8m0#DSSHQQSBk`HlL)`)JcTvaB_JYp z`fh1h882GtM609h^mQt#gj@2;LF3)bFgzy8K3_+xqwMoJ8fBNS(@-0`d^amxz85w8 zpcEwPl!BgmrC>|ltnm0=)Z>vozD})xU2u7fAa2TGV#WU6p@%$B0Ji#Cw%XtGjpOfi zas}cTPOX2)6{+wj(5j8Owawh|t%?{tWL7eTkOOFS+j#o!r zpU-{EK0i^I?XoGrUOy2x%s~Ggzt8ou-}j2LQwgoAZb$3LMLx&RL=mMWcHCJ=GDOy19YU$jX2Nwyg1sV|4k7R~ zz%9V@fJEFd1JUc502hezOdwH|J(;EhGCXH-z(m{>D5#TyA>%}#btd9iFc?5% znRzOpA5}m{OvEY0W)j|$#~JLCGx%VCTtkJfa2`QDbcCk>CgP0RC{F;K6lj4Hfiz6S zDTPY3^JkU9h%}mpL5PMsY3%$>%uUnIU#Ds3@5H=eTg}ejNn_`4Vx}zW)6Spe2sJd~ zh30u`%Ff?;%FbWMwDUJH(`)E%S3_&r`8!Y9`8zRo{v1Pn?ED?!!}Xhpkqf(hEe`GU zHK*F=J27_onws|bCZ-)eeoKk)^Cm(@$uDOgMXFBD(SJA-&%HaKPR^C{kSY&63fmCm ve7WE#%8QGS;^J3vSr(@|;$+3iuOr!U@v)BF5tmk6mU3Jc#Ko4lT=;(gidq1Q diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/UserApi$WhenMappings.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/UserApi$WhenMappings.class deleted file mode 100644 index 2a3170461c2fea1aea6bc83150f91ee5384f6289..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1459 zcmbV~+fEZv6o&uZ0xd9TQ9RW1p$d2!%2`1Wk&7k}5>UM0YG^kw(9TR|rZqm6V`7Xk zJb({n{5zX<(PX?KS=sB`Yx?c3J+uD&{dERl8Xpv@et2a2f%crhjeWlv+4ZKYz1ZeH zvOh&STnpUF=VR?{IYHohM^OPvp>*PO9J}dwNA~u?iLS>5 zkIg3*9-DfF_4RaQHp0*kEj%^#an^Tr*wNv6ebUsQStytry|7R;^vc4Zp(zVPhNdkH z8=AFX8Jf2+VrWrebo11Y`Nixl9Xkytc9uA4txlekt-1?8MD8HnqPyjIs#Ar&b-$q% z$~$c@c3XPSjogE#Uh_OZPH!BQs(jgf6pE#C_uccLa<}6&v)?qc+cdM+G_%t*v(GfM z%WfN`A}--F6y5{5k+cou)K6SH`#tm>HIDaJV) z(^AQ@iesvaYig_ON^0w>OS4dZq6VRuUI&^AFK$cf7E=A*1ZtSqR zob7XL@rvTC^5TjmS#v6C>Z+V}f9JFB#MMQL?H-42`$(!)8nw02Q-aal!8R&hl|Wv%XCP1f|v+Ua%W9S6o^<7q3TV7U?b?l1eS!ETqrPUS1l0FY|K!LMAKw?P1_!Xu_=AY;L*eA&@k)AhH=)pa@o?_+N#{FgYfU1>T<c`fSWinzYxgg%DFqD9x(pq*YqwHZHp>Y!i{)|_X%VPm z`9Momadk~8XM+SYen&SrKRb;*>b0yu5TtarrC|erdw;0O4mW@;chT ztfqfi#fswcvc;oaHlDMt&9$c~aNjT+$M!?jIQ-d5t1FKyUQ}MH*#02s;*yfmnwreI zs>Nt;LS5}ry;N#ATbA_11{`W^8!5}9YQ4lJvB`wv127{MrN`}GS6055I9xBxNK>4f zm%!gaY)Tl@cra%Q(>SxZc4-QmN|V)(O#@a8cc?8rzBbF7g_=WZ6`KJ{!P;I93|H4` zCK^YMnXDrwHcJSHvctk`CYuGcwa_WW=72bh7cZvH%qm^79IPL>9M#+e?Pg%}*x_L| zm(AzQ#lQ}&E3ID1S(;Cs!J0^6N3bJlv`3*JTB=?-s}v(@To746)k5~m4y+F=Zp4i6 zO0g2uEdysPuB`;ZyESTLipd9nQg%!SwwNv9EIrQ6{P&8LVGfoS*GvblHUC?X!j`e} z4(wRA9E_(zXE$D6hU2ENN>)YXe&tiCKfKJzG$O@-Kf=P?;_|xE6jn#2YuO6FA9_pE z{m>+Rd_nXX+K!|o_^H9M6i z@HEak7%H5DtwFIfFqSFPXU(24ed1(H#ngnC!0}n^><~MXodZs?h*khFvMc?g+_~&L zf_}coz78ra##*UKVHbMD@N3Reu(E1F5TjAZB96$3ON*;#(SB4>0_JfA&{YfnCXd3+xwHRh5^O=&d{J z*qX`;mtBogRdwh?VKaS5K<@5(buIfH_3ApbJOOO0s@7#UaK>DA6VO^*T{`(!b;V%g zt!(Um3n0;Yb_;Fnw{kXmT3JmE_WS;cnCrh(qjq%v*-MG#*7UE&=*y~0iS6D7&f(Yb zIA54Puk{cxSl>u?b*FcxM|TO04D< zPVT!s#-y-^*(1b)w{tc=NeIDynK^H1X$8(YRUkZ^Rv*I&1Wd1P`K;s0YD?%?NiQlm_7N#)(5#%=k@J@)m&ECZkVHW`Lf{MN0gdG@?jSo2h zkHHqO55w#O_7R%*fi^n;#XbQG^1j6449%bhhaiLBIOuqD3GmS1U)g72_9^=taJd`{ zwG8LS+AJ*H<)d&KD|Xr6IUA73N{=6P+;PW^(giS?;KTUJTkNubg1h*Q9)Q|35%Kx| zlC!C1{o`z$RRS(vQ(Buv+#K=PDgGwZ=qqZH$2!0bYxI|BW%ab;>Sg+4lD=%d4zsV= zH=rr(o}BHM6nlvyp=lq1iGQH$ z5eC=A=lF;=R8-u?q2;)09JVx5no#2rW9!?p&u6*fZkRhfgs;H(=ti6FdYycC_03Hi z7+T_;28OvDAKBxYn=BvUNsuh>2$JRa`tIC_GMAUT9G~00fj?|owf#%#s;hAVDPP$? zkT#5Vd3qSTHFm6V)pU-isU=EHC|X$&FJIID;8`=K_ot8j{>2rG`xD#IPXN;u%MbDm ze9%LV5@%?Miz`lTCf8pOn7{742bda<;ABcWeB;lIU5oePy{UK~{ecI@oWlEg0Q#q} zYrWJ!fU2sjsZHUTUdCW>=@~O;Pnj`&mdp1+cOiYicQ|MJ?+*RR4qzA`PCddm?;vxk zm|jVH$^O;F6|`}nlckH}2Mj(c%tzA}5W;fxj*D$SF+7`kk<<8?YRb`)<$3fT zAI9U7-CW~aW24V?UJzmyFXSwilw>Pkl?)mfsEth!+b1< zD5s0RG7?KD4iZ-QPMug>jxBY-E)Qj+Vmb;aCGehXXg>(C`h| z=u^o1U? zQdTpoPRo>zsVh(6D?E}ouJLm7M@;M=jG_}?N$s7Gu-p<$D832|6z33}hEw>-)VY)R zDfr}rz+ve`O)#g@Id~Pv_qKzLrMMjQ(nu)gf4l%yXYezr=vj?q1m1ha@#!6cfPJyv zpgAjOj#(#s5SJI%)L^a0b4)ua{9Jw>?bPSvcu{Q@a&mhecDD=hIhrKt7*s2MQIokc z9cg~9E(!CC`EMY9D626d{Oan;>J)yNM@5$>zkU;{D}H5|uO+a_E`Fl|ptco<)Swk? z?{-L6hxt|f8Y~%{@_gE%j|qYbo|^2ZoyT&iB6!R1_;q2vgkQg#BWH1fR;TgT9KSKd zZ=#R2+&ySq@%k{og+A-Xco^=#xU#fHpR3Gis(+*P3&Dif^BR!PdXP^`wG#MkqdK=^ z`2%xAqAC3Mtcqq5Qi&7;r_x*Bic{ed|3S`O($w`SJL6fL#q4Ph4M zn>=aNG@r?Ap>=!}zXz>&gwWr#axZ27G0ak^N=FY(<%`D3- z&ZO_6$;Bm0N5wb)YVVYpiI1hsZ2dpM;8Oq>r$-Xb0_ZMq4WVJ1$Rx=_rh)4h?UK+1 zU+@U&dMAWB)LR zF+%3(R#4;D3`jFRg-ws!0lBm^g+8rkdx%?v&KOyyKf*BO`48O!Ec)z{x{o2HnIU-$ z#f*uxL{+p{Ag1$qjebhs1q?uh{k~B7w1g7+n~zA>e325P)nLNrn5Q2cTCR<&8iFR+ zOFfOBF5vnz=r2FhFxGc@Wl3@Q+~VrV#JX@SN_KV=b~Ln>bhU)N4AoNo)_vUKyD!-e zw0Ncj+zcOX87c5Ey-*6bU7_pM1Gp}Yz#ZhBo55onWglv^PmMA?vaksK;4LigURmwZ3DwobE2mUw<-@R{MC*@ri^T?Tls}61~iZ4+!Qg$ zLvp5f8X^quzj8W|%UMw~LvQ)?nLy209P+@)vs1)SZ%T$W-*{e%7~wTO(mSwCf`l?f zjHUzI#UhKdgOWlBme=S+8>P`D+Q4YE*P+ogB3EQ%D=V*DQdU8aaVfW+ofhY?nfby| zs0yD+$3bV|3dn-o+Dfl_iYUMl5L5)Yj=_Fb!W?ByjL#RohXtfJPC3Yb2EME_6Y<=b zRP-r}mdV%@F;0vRi?IS?oDLp+>+!e((wpYiPkxHn-^1=i)JQma;FBitSV0H@m(C2Z zgOs<~Xtt~wW+u=VMuEz@S`U9IK@X7Sii4W(LNrAj>~-M~)c1@sy!x@kA^Z4Gf=_De zFFA7#XlsT?Tael`H~NAUahTWiEKCxanve~HE9Q`01~4|MnGUpBcL2=_?ccGitg6!5 z8dw~Zj;=Ybc*&B|>d{b5tjKZ2{4f)2Kj;_)Ody1SU?G5gtm8A59o#9^#*>rdq$B2)Uiat0TO6=(u^58b?jBPc zwDG23|OujuZ5aQC3kpy>9uU(rS}~<6Qz}o6K+^ zS;pp{d01TqF8y$1<<(_)R@hG$jQRhN{Kh#$o1JxnTHRJSA$ ziD6qe5axQ#B-Dq2mH>^?e;uIBx0%DFSjJfYFOb@YvG7?V(mQWvT}MolQEMyfK7SMI zwT<T0;V~tn?nX8yq8eCU1B=by&YXId zHg78%H$VLso7jYHY~uZ~P((%S&FsKPsDT|4u^ZTQ>t1`lOwF3Jnayrs3u0jz?I5Em zk#MY|jCP_DN5?wLXlkT$EKNq!BWYXMBF?rjNd96Ok&G=2LbAHnMq_&N%jCGgM9+B=_7=&lBNF-t^jieMR#d=11Zey!ry=1g^q$5>>+zc6! zUJdN@d8~ft4j`?5=Vgp-WNYR{!VT<#SRd-yMd_DpVV4V(y)xeK?W|)YyoFuG**d1I zdS=PBEZvk&zh(=&Ub1=Kb^52J0y5 zx7AY7-^Yu3W19ac>$sKOH9vjhCiaK>fsORLp_<#ww!~6ov|}VCc)yk2H?aHWr*GTL z9*T9Ku|2wxJ-x7j?HIjY6P!H*5o}PHLKunU5`+~9=P)K70yp}RF}r9hdmcph=SZIh z_EJQ}I>!2f0NBU}*eh#UkB#ijk=xiS8`*o24h`(%2KIS9sJ%n_KQP>Nz<7uBFZ95# z+RDC~&n>=*{Y#ULjHZEd(q%LQ)%(P{$Y@uPM>iSm9_f}qNj)Mx3{f0RDMLvhl~_+1 z?G@=6>n)@GBE5aei1km%(loXzHXxE7=^q);z`i4r*=UHRa|8Qv8+)yu%|aKi(On#f zv25nn$OayspTSdrv|v=cb3Gd#>5#$Gbjh@>%teumO}q;&9`C7}d5R5;^octi9sB730vK&;;k8DTX9-(eXJsXgSx(q&) zH}H}5tix75dj2M!b-&&lWwdjoV=R?8Tv&6sNV?%~35=~9u{pg(=26Npw(gPcu^uuS ziKG&@GrJv99xH3$xx~UAGc2rQ1CPd1Hu9ndzHcO@fluDTaqfmu}-r>iL97$IX2CS~hSi zuhcKAn-r_l#d=ci@oQNF7#lFsz)$p$lKLpzH0oJhB(;IBj-^M^X`9ZF(JpjWXtX_3 zvFVXc=&zbr&!Tj$XyB)Ndlwt|LrM5R3fQ|)HT{|fem2+#ICvyIgRg1e7vPlRvF2a< zta(smP@}HKGNXfIL$>mZ=SPNg9URHr#4n|;vxPLmE7r2nTlrc&!V`hM5W1^z)Cj~T zzD`#exs_ivpX*`nrtGyS8*?H~1HWM-zj1zH`2SiH}TE1XHk`_ zs7i{ivNc}pPgLx_O&n(nY;A_H=WRewq$p>sb1f_03H#lUVnXpB>5ui%fBp2o0$(tS zjhu$ClTBw`S}cYFip}LHJQtyl3CA+FljX6VZLOvl43ujDWF-QCAnr^v6FRd3oO2dPSwGGrc>zaYdi6k_mi>S38dAIccLe-kVN|W zFXO!(>)tAE$GT<<|4;Lnt~;?)B*&?+;qSWe=oIk$PBuJA7${8q{CR{Xd>D(IvDi*F zEh$I>XUk~-(%j}pkmyyiJlKQPa<4pC@Z?Qm1N2})w9@SOJV=?zL&7Lpg2jgHWPRHN zNq7IG=6i-6eh-0R$JZw%9LDHBJ&pTuXNsPHo_p3o|1^>ab0^%Clb!)I9*lMsQ7uN@ z7+A+W0>;6-<+D ze#+TBBn&%*y>SP`Cn!E)FHmWz;w zki#ZHzCRb?7=A2U&dU*MO7x6;=2YCYjqdX1qIlMt$$2ZG6 z`4)LM|DD{*?~zaNt@3q#uly(fll+3;XEA=ivX#)7EaFzm3Ra2FN}4`k!Q!`S%nWP~|vzwnW4 zLbx2^3|1g2uoh?It^~ol@@@P9){EOL9n}30>kYX>AO0|Z1pD>tushh!AI0h9EnIW) z7~b|^PqUf)asC8W?+#q@@FeoO!6|kQYCOTZu-{_UZRbz1&g>fa+Ea~Gb}_pIYvvh< zA1-CT=FcLplkAS$Ja(W)Pn~)WJ?O7f&m%QJ_GDxDpHZ%t%wUE5FDMrgAFyNj3xM23 ze2n`A2y$2PI>co!@|Re;cnjATyo|gIaS8myUg58@j#zg+`D@ggRpYm&Q@S;s(ydu5 z{MM{Wzcp)u-*Z8g3EBw~%VSZ~^d!{w#6TdZ`(yi%~Zq513Z_W9@Z_U}{x8~gAx90rbZ_U}@ zx8^MNTf+)8t*L*2HeSbk^iW^IpY07`H=;gc1NH28SNE~mdiK-R1ME;eM;XxIABow2 zlclPAaG%CosFCKr#g_56G1KYpQ|x3tTb*_49sVv$b)Use5%1}8mGBjMALTl^W8e(% z0soM7bo=s+{3HG`OA!aEHT)C2?ZEGJ2k=ip8}PDoujhZ|pW%{%V?xJ*Lx09XY(nVQ z{Bux*Vv|DW^S=W!ju>nt{|EmkQ&<)Kk@|uute-#fFZoy4pMDWOh=0w$f%tWBxS0P7 zkS*3NTm^3b6pj&Y_+w&w>}t_l%25Jh)Vf!Gc~?(Psn4LA4_i zX@U#!Q%oZ=gw<{v(QX@|Z6{i{jj*SK=6utL5l9|`P=|0fOd}q|2Jiz+BMK9>f$i%1 zq}BKBrV;-=vy*ny2yKVdZW{4FYV6c*8qsbVK?VnV$uvT!|GlOW^E}fCd>iAhRnv%O zi)o49ZcQWFQmtjvh_*l>y9{F*(Q>u6n?|$@>!+DU><%tOeXW^B?C%K{cLPOh5_SV8 zZW_@l5Kmm(MD0c2KBV4mWEznqsN_u}k_6at-x5qCl7j^qAchwFXT}I=ZQL}XRX{Dz z9!oHdXcbI5-bo#~ckmvVMzmwSjRq;LB5XI*-j4Ogsy1V0_Fv{Panp!a=MD>O*Ur$Y ziGje!}{h&BS-Rps5t zG$Ki8Elz1*8u1eWHDemFmmnsZM*KvOfgMAF0mt3~nP3{x29V9pZrn7Y38XeE_!CVd zc7^oQOe6LRyadyTy#~+N4D1T8Ek-4QX~eEza6gegbn9bEs}?0qO(XUiyuC8aCZ-XG zLUD8$l&gn9tvU;)5wl<#F&m~4bFjP3g;~Tr7)Bhgkq8UeWD#Za z5SEA{Rw2eBOf>N%6HnH0jhM{N5tG!-WCUQM;yX?h^f4{n8y2v z>3pD=!3T+nd>=814@W#ojOAHkCO=9X%FD$pzD~^Mw~D#^E^#=22;mtqpT7p5@y`*y z6-Nn26pI584iY5@%S~LN4Tqdf-<>FW3Mo}$pN4!zgitVBf;Y1z3C02>I#7W{~ zak9)n*iW1y4;HKCbaASjAx@ODM4g z@(FRSd|jL;|0&LwUx*7VCN8vG#GS-N);Oh ztru5Yx1r3PD7z8yR&kB>qPW(26Y=}vI_n2q#8u5mkE|$C9M1>nc+*_2uG~!K|M!W^nh__%G z@h(gw-h*kx`!J380HzV|!8GC{m_~dI(}+)C8u2MiBR+y@#Ah&#_!~?kK8I<<-(ec@ zPnbr00n>;tVH)u@Oe4O5X~e%^8u4$KMtlp?h|gde@f}PfzK3bV4=|1R5vCE}h3X{> z-6nbHb}2%Ck}~w5v_elHZwFfd)$T%=M*I?{5ydc#SOn9E#ZUp4!Ze~3rV&e_1TKSV zL>WvY76zsfGBAyB0@H}^1Jj5%0@H}MnQt2LOkf)ETwogUL|__mRbU!%ZD1O4Nnjdr zS-WXOyJ^H;GmSV%onuTR?sEGZ(}*nhI%68KBvfWhBlZtnXiOs}ht5mNG-BWIfqP;a zA>7tXBf>w`G$N(lG@{)!qTMtC7fH0=8u9<^jU4T!5$&cC|MU02w3|k>n?~$S(}>RP zrV;I?5fI@uxi!OR)P3d4Zf=ceBElmR72jPAV0UBEKyPa_+3reQxf z^Q(5#2<4esfNQs#M!gm2|Y;m9%K0EB~N4#GGSkJs^P`3rHG+*e!u7LReUU`$qa=3Dy$aEy+}$|crV zxzw5@%dAR-tK_lP&2pKwUY1+8q0F5qyAknLx!ihDR#`DlHAk z7RVb_jl5Z%D(ltR@dOorV;1DG~#@i zMqB{XhznpEaS==-E{18u#W0OHyWKRR{niN9<$w9D5&sKKBT})U=^xaHjKg&nxLDbp zJ0e4*;}}$O!NPMJUvk-$5bK=)w z{QL$ppq{V%-_qAX_3Y{YEq!fQb+@a!_ok|Q@c%|tcZZwVoSm%Hy9I!)vRl6cpqWBi zzQ0>Fck-25_Ww^FMuPW$OO@L0``;3zpXT}BGSuBFr9I{Lex7o>MHrs`YPTM_!@VC0 zXaz)Tik-}%J@6A6am8;d;C9m^Qv3eg`qbVdNNQU#l8CF)TABN19A|OLG=?B?KjT)Q zB<*FqTR3g71VCLirWOLS+CQ$;w&jxEly+LQT&s@NLNk8U*aX^dj(#iH}OvbXu0Y* z{585}eeVEF@FY$eV6!tC_aklu=O=g(H-*zCA7b^btG-RVUVSe>OHh;TC1^%_)D&7^ z<3}5huXd+3uq)=le9Xn_O@XvYq2-QrU0h%kzde30LE8%h^!#jb;7@Oq5- zdfbT#9&E$krVO=IiXOm-W>?Fj4HEcq8!iclwCVyomU z2=AEqT@$~j<5T5(>~i@oyFq@y?vNj{ml58QAF3& zZ21n)m+$gI#AD?vd^|2oUMBy}Pry~lx5zK}CixY=PkzInLwH^Oi+>{j!@rmR5lVh1 zy2zbkHo{zsBXlrvijL2>I>O_&lepgMEN;MWKX0-!5F$F>Vf7R{tX|@EtH1b{H9+jN z`b*myB>P%}mX~4H3eaYj;B~N@pPy) z$C_(ZS@W#p5ua?$x2~{`ux_%Bv~EM)4c1ZCcI#;CQEQ>~n6=1y-6}yS)A85VvDVkt zGMigfc5mxfb|&KCR*gN;s>pVYpwI08?6hRTdZF@cUl)YPg)l{&sx86zOpV=Db{7GuXVW^WL=>~ zSm&xq)><{wTBnMw->PG*t5gM^kF%~(CtBC4Ro3s+1=e-y66<=k4tc+0>(%w_PPK#G zrCwwk)cb6s`hxvYear54yCMu`o86IYi#rZsHoKFQPhuP^;%R|jZWrG#mxlwt+`k5X zxt|AqxvvL)xo-u2xi1HPx$6VJ+&col+}{O$xi|QJx#DTo*<3chgQb|u#;;))n#;zo zW9NC7jmvd@IeE2TPA>Dy$qK)mb%0;an&OwUy8Gp|7vdgUjJ%t`$GR}Zu?^YYHs^%|7vdgT>olr=T84>Zs#ihYHpp|0g zn0<3KH|WH_ntPfXGXAGSa4EQVHFtM+Uvo8g$ere2&F#+hujY2=iZomk-pbY7L&QGJ zqF*hK;D;d@DOt+fqGTD~u4HNd5%WFz5%YE>i}^YBb|s7d3-o(-^K-kBrTtf^_x`U? z|M>I&6>2dmP_q0HVnb3``@cf{3#6waEI_z`elYst1~CRd#@)%&H|LPPc^m(+{{QbE zr@jmQ)4xsKVLhAMu6lt))7;w!yl7#f+~pUk8-0o=xZ4Q6^^uNBxJ0U4i8r~e8`l_6E)eHF+wMCII z7utoyOI#ZfZCm|{+*H?1-D~O>58Cdu6K(nB-8i(ppqX(VGJ5isk%&*$+g8a64 zC%FN%y)eK775|Zb(blM6o`B5oNvL0*g!<(v><3Rl{qi)_FV8^z@+{OZJD`4f4(gYu zp?>)@)GmKPcmd(hY?gHcD@CZYZf2{jTM+It@dgub)bXj-Ms~Tif!$#Jk=2;#q+HVyb$qN>lQxV`V(Jf-N#R`w((o6 z2lyuIA^bM%Bm6mp*RAdR6YFvQz4f?I))S(O^^BN}FxT3F@T!Sl)A9M%>rlVE0rkt9 zP`|tbwadE*AM1FB^$FB3pF;iecc@?f0rkt@p?>)S>X)yee)$^em)D_w`3CBje?k57 zZ>V3sh5F?`+DqsR>qmI{SWv(GD6h6{1V`Qq&!LCy6!{e5=j~4NuXd{Z7M?^qt$$m# zoo@BCGpt^A7pu43-5O)}KfiZbRJ- z_DE~HJ<5929&J5lXIrn^=$&1tuWn^b9-OAx4oa8iFmlZzdg~OWFKlzw&&R+ z?W61ipniGHKG#0TzSy2(-;3}N((l*@L;dn9)Gx0={qic*FFWkd?L!=9Pj$v4>}$_( z_OoX?Q|&{YL+!(y`A9FaXFC=49H+*f>l|;-b5`SdjXmGF*k0gVYaij z7Q!<2a=ZG)`ahw5!TkH`mx&4LmnY0GqfT@C1?rar0`<$BK>bn@s9(wh^-FoP>X%>P z(-68N`e9VjA63O423G@2BV4@nIWR&_A*^Y?X9f){7tME)Lt=LMjaVd z5j*C}Xei>sIc7wIDB3Lc-NLSyY#!xAM<(WMWNYT3xP^*|aJI63^EV3UawbG9yjC$c zq9X1lHazAG*RVITF%h?cUqZyI(Eo>2o zN`EP5u`ZD=TUZ5WYuOS?RdcqD)yBF;y2iT6X!i)jo%*WBm9ZW&8j1AS!cIV?o{^rW z(nw07Qmj`5Xj&EPEu(!Rov7L=1Zh>IcLO_p9)4tR2j-%Fr?0=k4SN^F`cls>O21?a zyIi2`mGORWXXyMEb`@vqn6m1bCD*caQ#$<`gK%B>#x_;Hu~Fq%2e^Uwt*`QM?aWKR zIsN9%^c$V28tbHA1~@bg%Gf#c7oZcWq@o|`rY_t_|0rftfP!}igXO# zH~FE}6dLNI8`;wf8`zG~>w!5)?lSO??*N z)+yEx1ORn@i4)Vy5(JrGB{bW+ouhGQ^Ze(w6=GLeN z9-g1UQ#P}QHbRq-(!f4$@H7c289YswOxwy_6v@DmfvDAc>Smr|gChMRgBp0x`naDA z^)UM!QA2Ca}5gk?w|L(0mnkhyWO^d=Mv|7 zj4{p1J2miVtm8&r)WG+pA8?$!g&zXO*D2B|{SsQ%{7|rvG5!)qI@2)S7M6KE`GCYa zvj_msUd#Gy<#Xp#TK{uY17Ea>dww$eMLKQf%h$4jTY05^S>2>q-8R0Yo<}J6__geA zEPP<3fuHChCGAoCJa|2;jifd3)v=672C>>MGTN2+eIpi2#im6%qrYliJoXkjOqn^eFM~B4r*~%}TAK9ntkjUUo z{8H*UTSx=EVl5lJm9NzUJQ3Inp|=`EjX-ST>vWZoTlrP4Zzkp#L6xhhN{X(sHD2sbRP4S@{C>?t4Y>yzoRq<&!CA+`B)QTS^1H|>Ntiei zz7ZpLvgxdA%jL8@vn3arUTv<|tQXCmHJ{^qh+u@f3{Q8vO};e!S{ch8yVJA|7z1cc ztuwLJ!L}}sC!IzA)<)@(3rg)OY{o*+Xl<-WX?1uW#FhuBe{AyS*|VQ3#(u8-(#|$X z5=1lF43EI*h4!~e5>PTOH%Wm?*6XGXz-TDDE+niX8YHwfJh^4<^{h1oQ1bmk+bsd} z+;7?hidf2Sf8B4-pta(Jv&TT2@x$rXhH233%nW!Ha9oo1J6$=Zt9{R2%g~ zbK-iUW=Gp*RndX23nc?Q!a^{y!=Jtw&C z37W;ry$x{hj1;~*t4MhyNwn69eZ^AQ*9hO}xF6z?>|glq`8O0q-{Kblzrip6eT`rJ z`wv|5|HGEx`rT#hdse}IV83ENvKsh0orJv8IA>>afglk$JIAhO>k!u4b!>xu9KtCk zUTxx2b=+W|%AT}WvzP7D*}L``ydy#v`%FH_K8sJW&*n$i=kSI08vaZBTwZFQ$B(g3 z;m6vm`EtZn_Hn%0KA->2zJT9p|C+yHU&KGNFX3O>mkI|V&Av?ZwXYP}2;=OvVv2pW zSc7n$eJ#SRCSI@Ohwas87u%1@o9)MBz5Ten#ePcOYd?+fXC1#_|3$uFzaZbS zUzOk6uUVG;sui~1um;(0S=sj6R)PJfH69)`he3ri%YM(A4K>bE`y+(E>G)K5(wu7l z-MYa3%DTn=+PVvIgZ(e-S^Hb-4f{XVd#L+~{hjrr{k^r*{=tU$+V0|T1f}Cqj%$x{ zLUxhU2`Zk>Q0sJpDksf8(aEsaI9=>t+uzxjIbH3$?e+G9PIvopr-%I&!go%0CxZWb z+P6A=?e)$8#F_TB&Jd@kQ|R<^>JW}|`Z~uu{hTwL{>~a_fO9d@>zqN(%}%Csn={zC z3#B*X`2lCB^SCq2dC3{>yzY!}-gZVgA339ybh4Ckveif@M@@8c)f^{JEpYPHB4?;N z(J4@8JB8{>r$}Ax#MDiA{=G9!ZFI(~KRCZo4?Fv+$DRGubI5xMoAN8%ab2$5Ozyfl zJml`jJGck(6t@JShIe*P;HmDp2-o8mC&{m80UL*l9QP5E`BS*$aU{zW2k?hjh#z2l zeR}gL#@DA0-xu}`5A#P@FW%qy`t;y~jIU1w-a#|@0F#_iy0fb&N7%e`kDsdfHzZ zU!NZKcH`@lVLxtseY)898(*I^`$6ODlkR-Pj^%H|GbY3N3p+{sF{SDh`TC?eFF~8| z9%dokIgbC5zmIaAokD&s|A2qUIypo52L2KMn03V3ovM9(Qn2dZ*S<{zfaCBIpfEy;6h@IqgcL?SWwci$g+!4?Vbrr(g;9tUM!l);i3+2j-=r`KHIZhf zo6>>KM_2ZhI9JA!sT@}rQRP@D5=vfS6iQxU1m(d=P&ZI>$91E#t6-FtfFzR3wMjZl$Q3`ahEh&t&zP?in%iL2K zb%ZuIL1BdSe9A~v7)^+zBq)sVvYJXH6!R2DJt-FoqXsN|V1yJ#8Y!JUg;8CkGbxPH zB59;B@(l-eQ5a3vdTde{MPt|-;tHdYjTA=dMq!jj3Zt|PzNT4?(ZI;SMqP~!ie|B>y5NPjYr!^W7JAntueAAw$>O;4KzkqV}noh`Pm20`3Msc zRzN%0nrg@<)ey`;pc-;^qZ-1yKsAIaS5XzHhLGJzHH7D;s-bxs&=b$QX9QiWHl4W; z+wGz@X`~g(Xs(3T0JNkJinO6dvznl`HkqTHZgv@l?qr*^KhU1+iVY2BkM%yg1Bs9C zmK7qNXn5johL)VJhkjtJdDNKtc#pQ4+?xbC(c^Bc<=M?(v_Nz>!!i1upG$8@chcUM zxX{|0Z^pFlrqyX~U2D@Sh-CCNtpG_@QH_}uIYq)kc> z^?|ECFj|zo0?N~$>@`pwno?*Ru|ztPW;)X*ZAlN;?E${E6Ed>B2I{AdtI_RdjQ7J~ zsXyz4(3uZly%F#OJZu2uzL`9e?ZXGNp?nC-MqZQ;#T`+@5QZZRW#gO)Y&ycx&Lmdq z9Dp$0#4}7hQ^&_TGubK540gVA7`xn=#U4O-%$dzza^|ofoVmQSGmmFDhx0BDEZdv~ zyr(mr_jP9Q0f;l51Nac<2tM06l9xC~^NXE@{C7?4Ob8eM)IqT(S#P>P3%a@$r%MYA8#fXn}w&O0b$8a~;GfGp6EPbPjTM2%bb<=3g<)nBhpR6?guvgbFLE zIx9Rvut zJ;<}v4n9V`$#c{PJlEw2X*}xo;05kbg#Gv^tp&+ph0yPH<=Y^)?g{N)I)4!I_g?Hv zqw$EqZEQcjoj;02|B}&obZ3tkjYk*un9+E2We*sQM+W@Y%!XLG;y!dJfw?rjpiXmTwpX09pzbmIl0C!C+GR)r8OQ78;5(&{*Jj+>I0+kaNHh7y+TCG1gX<>Rja}SfY`Sj8_l3c4#_+`mH3(;d zTDL(C2CB8A&HKWPdVsyMmi2%;%cyPamB5LGeO}L-bCbC$;pb$UxXF-LnCEBUiG(2r z4!o+M+%nSRgDGXC$8ej9^^(!vkzS-`=^yFii;!aj60$s5a%^BEBQhW|uz`I?P6!)~ z6GCbO`*9n4t)9(-6#2j8nj^nVL|wgnKk<?xqi&B-m#7x|zwAdfAvr&)p5#@e)nd*1QPm~qM>Re0qlz~6qiU=c^Zlr_S}da_ zwb;+gk!to{Q;Wg<>A&kS6<3R;X0YO&YJ_${?hxSRpGS|LP z|F;-YBe%y^nJx|yyDm;TSu}EbY!ys0YV;(zZL;e0Hi4r7AvD^jg5OhX%TR-LQW@ogM%i<6w_3Ylc*T7o6r&_(z&>iNCYK_6%ncgUaERm%-+#h@~>USItWb>lm%BR>dA z!YNSuPhoxe!E6M=D1Hdk{Zm;UpT;Kf>FfYL18UGip!PhJ9nKF!n1ygCJ3^(hqflozU_ECT1a+!CL!D;NLwuAv z19wrLiEy5d&sFE!=i-ja->3`i`w;%Ber7u)|qnIF}e4p-+nVReZ!SpCKs zg*aDT=1f&rI1AvK_)B$)bBtQ+oT%10tJH6ubJbPOC5W$7*EqMUYY}eJ@gwSH=Mh!! zJfm)LzE!uVA?jAB_SdUCb(_jpH>o0ZE!6xssmbbg^-FaJRQtE93U#MCTWwI6sg3Hl zYOT6X{XspT4pPskyVVP-!DR?a;YZ8VCU=NB&>gN0az`N^qsF^AYO^~@ZE;UUI9=WA zo}vEaUZn1GFH`rsS0jD1dcfVN9&|UUhunMB!|ua)ep+pJUr>*_@2SV!kJaPuXX;7! zOZ8N!vwAv|p`HyDsvV)3>bcM&^?YcF`g5pKZ4aHJUI<;PUJTu&UJ9*OFNZebd8>Lg zbiaBnv`xJpdQQC&dQrU@dJ}o?^Fu=)^10zId|tRGKRi5?&kslW5#jOt$nboGGQKce z#eW%Ijc_HOOXdmkX#A=|Byh;=9XMpB8}kG*RPf9bdcb9QJbw%d?+AO}cgSQP`3{-v z?Z6>(W8jc^ci@nDOW=@sTi}p6g5~lZaCqz`DfJu-BnIfz^GFSpquCh#XSCK^?!yZC zUr?^6_!iEMFTkC&tN5NR(S7MA{=sVXPq<}>FWIm3Pq=jvH}gK)^|6zQXXm&R-(!+qPBZKUdyc2srWGiDpa8&=TXQdU)u3XpQHn8XoUEs)nn4N7c}W#%x2eIpN91QFT;! zxp7qO8(w7`RXc~z^Bq;g>wHJm@H*d7HM|anZQt+Ws7iODHgQhntOwiIb53Ow805=T)r@_(tu zzd{@eO7fvg#s-fD;bholfD$C1DOKQt1D{8Xn)giSD7wR&H)S`S||AiCd1zM<0F&#h!hn@ ziNY~RM=7@uWwUkJF?h%iXXh3mJ1?73$VMs}&I8nu*_18_=M`!Qc{xSle5!`r+?;Se z!7V_Ns!{3OSYBREykcH{P%*zCs2Cj+RE(kSIh^}y%~x|^MZ;|;M`OMdObu(3xFjvvC)FU zpc?w=w^sz5n`%I>hvpWV96l55VYY} zLqAQmqA|fjC<1ytL>FbpyIGVSbh8L#;#bQFx>=-0=OMZX6cZr2C@(uebP<+bfaoI7 zgpcSVO~-`jB8^55(M3f>$Asu2!lFSm7z+_PVH!yw-KS|h5seV8QHzoQL&-Rq;US>2 z>@k>jGZ3T$N<*6J625X#8+^gX9Ug#xkGQkPfMSE%Sb7HQ*<*lg5AE4wihwkOcRU0O z13eB_2GYUO$i@Te5;s9Iq1V~j@m^z8LA%+x@m^=^5qlGmolUI6YdQ*8d4<6gWM^Yl z26KQ`@`6b~E5s{k7P50Rj=gEX1Ccq+1CqdvKM^@&Xd&o{$N_!CCn6`CXh=^)4)w&F zh@8AQ8D{6i8FF?`oFixF#91=ZRM$*IP6Aub&cVX;Cn5(F?N3AwmZm=uIl#V|h@2we z&!31K(2`#_7v1*j=4J;=2aVF&(G!tNoY1eEn-i=a;67MBXeL-cNK>!PMC1}{2__;p zKR-SZxmdOFiO2;B`Kuv2S1$rR5qTQNW+L*inV5;lBNY1+p*Kr!BJw~g@rlUGA%fBq zkw-o8CL%9CfiCmn3_Ck7&ash>(ofH!t4nd_7__5&6V=f{DnF z=ENr=A1gUN5&0mYU?QS=8R&_K(w1$`G}%#XHfAECgkpap^k(W!L=>bFpNJ^-bu$rB z>WMcI(fkCujK&#yb~Mh>k&e?PZJEJDL=)J0b`)#ZM@SSD?jxiCYuBHM0$|@vL;=ns z0Wu3fOMcw~bUUb<6JJdQz`mJ?0^*_mL=@mi5Yz=-1$Fb|y)MurHWN`m{3n=*f@o2E zA`0l-;_t)R1t6hdA`0~~&=XNeTe?3Hh1iVDL=+N={fW?be0E-0T?M7zs}1e!q9nngjz3;z688HEHsm+CztBx(fLW2 z%cosKm&*t9)p;0hKCK+@J+v;%p$xx@}lE)CA)(kBAt5(($x zfMts0QF~sIJW#)%8_Xek8PBDi(3GWPwbw{K@mw!ApBRA2rO}yOIyC!D=i^9WibSbB zuSgVUS3ftHPB7abw}5!RSC&3AOxXhBGA0)%F+Z0^XL9NE=r>(}P1F=Ar1rcbg*dkP zx$#*ojL&KjaXYUp9lTB1B3fT27iSMYmqurD>Ad7OT}0pA`9;}-@L^s+qb|y!WFg^R z=jP)p*5u~XSFD#?fKM)yTR@*&UM|R!TG1eo)%1p)s)Yp^=$I#qutMs z(z-MG^o{A~7t;DL`SeLNd~#g2GO2V?-IDO|Jrl4%QUT;-`|=4&Yw?86^rRCePqWNy z&??C$ygcudA94;)GNCi+tYs3KxdXH(m!M44HgXA_^jLVdkxS?To>)RBsUDb%U(Y)P z>w0tsCTNgnU`i>er4m6c?{uJx`dtJpl1i9bm`|@3rZA}GeeO{$Bb3ldEJjm{gc3UG z$t1jbo=Cz=dm;%hZ6p%Z9z;JRktm{Wl0bqIB-fx5t(S+5obpIsfp0#Y2R`DJ15j{k zok^!BlYp>;Y5+wF%k(Vrpkt9Org41K!2lc>3{leJxf~400pf-v_E#)F% z@~AcJ_kK~oi^#>I(7C7ujOtn>hR}JaMf}0kA~8ge4Eji72%Vc7BPoPeFN&SV)PuB# zgb-dn%Fvp|$wcE;3nA#i6GG^06roMj%cYG@=aT3FOUmS8(RpP7oAxH1?F%8YVzJBI1>4(=Z(%QA9j#Is;^T!U!6KcXHBW1AICZ z_*IF&n>5KIymUd#6G%{15=eNt=(1*vesS6ag0$Z?R5cfSVCtbiIIDy$IuJ($h@GBbUzt1 zM3w1OqifIueYnIQFgE>AKyOTaUo_#p0Xnp7B3_9;X#xmXh;ayXq@p*dL8l#ENY^Ja z@~hw+o%rDQ6g|K(!>>;wiglAR6@EVUQ&S#|kf6eU0kRL0L1R=IJld;4 z58%@A2P{+X0Rtmph4(-m0dMgh2(=`wh*tv1Cp?&rVTojuz(T*Fq@S zXfabmq6_^L%O=r<_X4Fzbm8X{(sc#&jkePuKPZnzNOa-9puSKAwN2gbp21e2h z?};9WU;?nTl=TA!MtiUKKpg>Z@*Xq zt3eMSnD_&hviAVQ&_?Y&P)ERaB;-hVFdd^+Lt+m7hLV0h)h9Veyh<;eArXNX(&gNXkJ8Ithay>9~g@v3CZ< zG1#1!Ny4FDk$}TX_{ZxgD9X!0k4?hBA=!q`A<+gU(1@07(8&fTKy%C#h+YY-pB?ZGze}8x;uNPh$3hWIQ)vqr}PA6d=h)kPP7F zgWmmIoWgaInkLDHW+~vE)Sk!2NV4H4>EvN@LGdO@l8qo~7#28EoU0e$_~sX&(HZuL z!>3MC(zbb$AhajsQ_Spl7Mg8-hF(> z87+1e(`6&Y5VbHPse!4<(aaVLk6?0&_@(|U7K{9+k||=bC`GO~<_KIqA(n`xN3gCn z{JR?dYK@pv!)~f!`_?dA5ragh8vcEaz!eoY)d*1|!ZjkbMx@n{hvrT;CxA+S* zCSo)(#7BRW@yxa;3Tk3ZcF*<8IcLu0%hwN|0L;D-sJiHzO_(wqPq9G(p;gk!Q0&RxLS7~);C1MhEhF~lY&YXqGrPu8+Hh2abm7-2}4t1C~6)zV!O3$%9~ z@R7aUSQdsix#5(>X|-dtvdoeksr5*ORbvcnlT6JyhMC>%{><)n#>sUV$-CRR-R)s# zmd&Sg&T#w`n~mMie14U5(zG5rtd|#lCOI&U_||GdSKu z(k!*-m;0I7G}MohZqn8bRHPEsuvHiS6FXnqOx@sKjr-E-UE|2(P#M`0W!08}Bzy74 z2GQdD>V3q0-V$_lKf$tPrG#Jdcn}C$i-EhU;pu>miF*A)HyL_XwpqiAaI7l*z#=1MWS(BC3>5FhaQlR_&f^4 tON2a2wVhi%~cL8I2+ISfkamkX)t6%{pFu96EfT;k}0Zv3T{SAy&Z*Bkp diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiAbstractionsKt.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiAbstractionsKt.class deleted file mode 100644 index 157ae0f97df153e5df29a5ca302483526b8912a1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5327 zcmc&&>r)%o75`l!q-7DdSg>PZJEjIZAix6oQGzKc#imvb*fkg@#;LQ2H7rOgtX&Z& zbrU;H+B8kyPxqPHZAss)(@AmL>Ck-a_f9|cZ|L-Urta^qUaKG*$J3c=q&@eZJ@>rN zx%cXC|M}xz0L1Zof&NT(K9*TFEPdH@GMSVeOQuZ2a$=@+DXZH~HkWjAStB;QY!1(I zswW*YW7#L2AcR18QD4zxDczcnotj-VlEl^sG$k{s6elD+W~9ut=@?mo{T*Xv>PaVS zTJuLcH=+dE#-vV*hBKShP0NnymX&dIS8Qw|<4ojIsiPEK7BZU2rgcYwBJk)^#z~o0 zY;h$`3nH5JH2B zdTgn1LEfk!!UD>IZZC{v<_v+Fj?P2~8k$rzqM38YUQw`JAYfe1=_y-aTNSaL=R??m zh+NacHA%Tq!n<1w^-ky##d%+6k^I*iX=^phEx(q5|4RD+F5R zj7xeh<&5)ZPV1?hF_N)XjI0~2)-jJKFXgO!*khxGQ6D2Px(UgkN9aABIYdUg=MCrB zeRSE|(Yc8zGC8p+(F5ueLJtnq!H0taAtzJzj=;H&nFq0HGi3`|pL5JqY|OMBYX92c z)WAm8Lme|yQ&lo>69I!gRaXra%dI5X>ybi5%6QbWVAHmOekNX8Usf<6u(Oa3<*Kt| z!`ZC#z&XaWtXElT5KplkmN%lJAA^`-*EVGa zI~nd)+u2Ua>s>11nMqIM6ZN=&i$yN3-NpAo=mJ6Z{t4rX#m(PBEEJT@q;bT2#5V)J_@07x1E7d5!&$xs+}< zSNN^me+!ER8rz)(({5*noyrsmn>{{qlZx$>9l3GNupQHK4?#uJ?VkKB=QoMfcC-Cb zo-L073GQMgL9Q}N@x8#3*Q$~{j}8ymaqsQevU6BogFIX2iX_{5+Gf+z)b(qsZ--Cyg^L44PPV8%rIxUj zP|h0*aFkY&MVO7GGGvWFcMe}PM_lEZRmGx`khIlBvC67GO(7Uxr z8gEm4;c&}ttx0P<(eTdAKuD?46veOk6{VxLz(NpD!7byPvDMxm+r0;9YRevNo7S{L z^!n~2U6EG$m0(zj9tbz>ZO$vEsana(-sX5!>^pA;wn-<)W$qTL%6s&xu-d3HU^hGVm(8a<18a>>qE0%srgE>dhfWl5!zYZ6EMeZJc$_+u zvm7&RB&-$FHd*Au#}Rc#$JEn^~=o;9)sj5d}@>ZxfxYf6d& zvi-fhOEIbt5=vN>ksV3twr%hdqE2RV*`zUQ%JW-uesav1&CMUb;uyR<$pA$PoToSF zj6Uuaep$C@k>_X5ekKbQG5nk`Kzxueh=|-+Sk1rS>|cEEBYZKc)vaM`bgb)bY?Cke zS?13V@lt@WAL6h7AneAW>%S&E7I^jF5`Vf&d*p5Gyn&%rba!dH-En*sJG-{EBbl zyzvF7dOuA##?fist1h4p3mm73%X0oK=U1U}52)p@9#Yj14X1&8+fC?o#cwzdvO>5R z^hz&1nD@#qcL}Y(jYCp3;VK|K2s9MD8n0j#kw-^*OSoAIs z5-*jClXWd&*pGm+;Jdz2?$O5Fz@Lu}_-l^TM*IVTKVjmjh(D~ZVd@WfavkRff;C5!NZ<~h z5g4e8)ZGEM`Wx6IM~g(MkzjX3y@O>R?!flp-0IzbMuO|eF|nduYj}1Y&k0c@y2Fo( zHGFCf*UQN?jM{h6%>=s3(5gXP;4p}k`@A6B`FVm_VBcLPf!|93oDCx9`eQ$B=bs16 zpJp88Ujk?8naeD)>x3_3Ctk-k+~j+iZ89S-Gn_Bs)6By&I7Et9n4xm?8GM#f&Qh0G z@i~UJpJ(XT_|{LZ6ZkxFGD5eAe}zzvWX{U)->L}z#~wWVuWu6mLLycPzeeF-z!wYa z_qu8T>TRs9BlQ*z{f=r?)`cI^^D42o2th|l8Xw-oZIV7SIX-+^-Pn}XlkVR|YIL%- zI2u*ETKih7kUs3@M1Jwsi{%rV&CNh9Y^mj|j~(++oOCW;^sYGRsL?UCudS~;esG{q z?K{|auq{3iKg3agye-~+a3FqIjUF$X;WlnH`oFh@YQ%fn`lM_LOOo*xy}d&3e~D@I za@yncE3vRnzpq+31Zjxsqz^YTa6LUN)YS?N-XJW*H{VW{snd;p&O}Da>)i7-B-U zRl{W%nVl=`@iuonF6++A%AQ-*RAY?7r!F9g1Z*1?1{h{arc-;auJ~Ng;<=Pc^X^8< zN|!^=BdW~bwlj|N4E@JFWuRXC^ND1WNMWcSgBWI5`FEZ;Mi}h6tJgx|)m)!p>Wmhp zdkCsLic2;wVvJ$(v}PV5fSctU;mLJ=*i(e!@Q7x2-XYOzLod!pgAc_V;%&D`6STBEvwAOC{enRT$99M$gjR zG_D)X-B02sruu30kRf?|{}vjW_ES(b((__kx#S zg;I;ATa;}P2#V)_YnP~tQo4S@<3Zrk2@I~ws;2@W>(qo@RU>t7in`?HD?p;yRH0vW zH-srR-s9c=gB2NCb`%WsX~4MI2eqp&m8bjEPmvY!u8?J9qw@zyzNZ00mfo>WkW_50 z9+4R6at~^M#DxQlAKo|Xj^5!@271ry|c<>32x}YdlDQwf^E?^8#$?v1v20Wv`MWV=e>|?BveL~1t m>cZR`M2eX2JhyS@$h%v_0vz+oya5Yv4~vuvuoPf9K;jo{xN(C3 diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiClient$Companion.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiClient$Companion.class deleted file mode 100644 index 3cb0f55310027b00fd8c69a9bd754e9f28d95b02..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4330 zcmbVPTUQ&&5&n7*k{ARG0&H%!!4|uKjfL2F?KP}7m`fIOF#$~MkYqE61`mv8l<5&( zoXe7pt=7!()C_PO7IRF-UT3M+em1)zwvBRaaG){{5fN{{>(S ze_*)ndOK-1&mA*w`L1h=bk?@GO=l;4e{+{-{TS*PI#Q`EZu1?}=UdAjiT8Yq3x=MJg+14|Ehp{qZJW5$^Tq9h zafbK=>2@st4ny7G&^klI4);m%JU?J)9UNK+bQOHdPA{5yI&ia+HlbJoIIF&AIXmOk zlsk0t%7V0em;0NZX*nWoI*#j`K3OHwORm3Eux;WReO>3o(8SPYX0u#~R2h6Kn@^wx zx{hWT3=#jaMZTB_ApC!>Cu}Wc@yp~(>qCaFO1)|$(B7f6pJQmGa}Naf95crm+Dje` zyNn_AzuZHA|TnrRyy+P$gh06p{?*N_n%ppG)7{&#lT}&C(Uf z6j6yu;^{Koy~n?dE zt%0a_5~xSC0UEwYE({%v;Vxw_Az3%=LRD0$xp%M6*pk}sr>EytHR zVyCD1wppgQKe?`iz6N5jqp>^E$s~;D%><*FV01^~38U$9B;IVatXwdR?&f49Nl4ZAXe+VB6N2`l`i&l9=)E;d3@6W|dy;x2-e>d^*M)%V zqH&4DT&{)mN`N#)NPCTeS`2Rl3~w4OCx40#${QSGbj66uQjzx=nkEbWW7o5u2JaDN z8pWPZPx9J9o^q>o*7b7J6dsFw%Q6+MP0}8C_KcGaQJd}w*9ol?4|8^C*{E`)SkR*M z{s-@DLQP7KO01ZV3>RzGmQd0~RpFAws#bbaIJYQ{a&JJkmV!R0KU75W>5jgM?ZcDooW6WHn`IU6#Hd=s3VLs`Yu*qa9=zX3AP# z;C>Er=sV z{|rB+)dE8*%6a9zZuqMUcg3XN#>SC4R6x*=?+5_C>66b&U-TtSMC{ff9_(o0I_ zKrL*8mDqY;ifyPSwriExl%Q9{Hc|`QXeG7_FU6LriR}xO*p#4G!Dckz1_h~#xh8U` z{4f=czYZ3^p>G*>Z`0U{o48fJIE`)s=sBVvHlO0X#ZNI=H?~ywcI4{c@g;_1%t`xL z$flm+6_#RwVwCjXdma7rSSacbCCL3sM-GIPMyi#P1nL3_nhfMLjWW^dhd;wgr6Y}y zpn4^Uy0T@g77v%BmkzJhK3shZ53o+hBls<8)oG?thx#rB$nR*a;V1Y#jUTTrPA=== zI;yL;M;~78E6ry0t9_ZiGfc1h`}Oq4y*|94XRc(fWp3WMozaJ9bjX|kGvWIR-Sfi@ z)Xm{h@b^`0lvZDx!`JZ*qT+)MFoAEv+`y1Po4}?(Tp$}vwgkAqw!n_SV*yKGS71b- zOCTd~NnkHvYY@-{Y=L%xoPZ;6PhehPLBJKr3)~R6DR4{RTLPYd5Eu|roiETSa8aP} EUq^BZfB*mh diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiClient$WhenMappings.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiClient$WhenMappings.class deleted file mode 100644 index 9f70f9043945fa2c4f1d933ac21deba02c91fc4b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 768 zcmbVK+iuf96r61?PJ#g!$|c+{fhOGCmV$%|NKtB0ODT?;P=xZdNtR?=XKn0t_%1*~ z2%&xeAB8x!%R8#HTF;EnnX%9A?>|3}0BqnH!>b^g+CeB352X$QKeord6iVAteT;al zqhzd;NZ9RAcCr_Z_cNh(c^FDHjSVmc>wqt~?Q=D?z0rXfYXb#_m4>5|dH=K2r!=oOaJ{#E6U|&} zF)Viv15GoxX>@$THQ%D6m@f)+4OqHaL`NA#O6mOAAz62ViD0PjB}&V=*q5;!`J$~< zpt+WTimi1TRxvfP>gnt{$>Sue1s6uIGDvQM%N@FdN=5R|i8H+V0O6wY+G+w0U_voJhu7 z>yoYUNa>`O=oI-vC1%Q58D1SOZ45Uzl+IbUGE$dR$-$HnkDS*UNhBx7>d$8yKWt`a zsPVR%+GIT1+%SIl%-E_G$z)4q>AY0q@l2B^%n#Y1^!q&^y+e|}3uBQMjyRk37aw7GQU>Lzd^ z8HqQC8%t}N1A7xRtmoh1b$tRf= zjg_7nZH%at%aqp*XH?1uty5x6E#YPigX#G0_*ZNJjQ3F?_4QBz^<(N|BAjK8Riz@P z0Tv3Yz7vA}9y*Q&Fdf$gK?+c%oj@mgDL{ijhKbxJ2zK;? zncQ{pNH_`nV+{ry>>A&71cwkT9}T5pUK&Ef!QZCV#$*%}Crg*d;!UIK!^yBlBbl^t zJTmRP)^KB|ffz#ARV;^}<)cwFTFhiA(+T00md0qEl(W*cqt>ihGfLubjWtgkh zdX37N`kCWB6`c!}DW2RKZLE*PRjR~LCq$d0$&;C88bif&m)5Ni>`j(V(eLAHW_Bm0 zQzOg67}*p^xm4d+d{#KVDiR+*90FHG)m{qH81!$n6*4~snm%o9U8F_mhDzg@7BxdT z0(DYj0?Q&OC6a+;EYKWl9wlET(JY{&7+n`@Y=jXIdNq1hxMhM-txtT338g=ttP#|^ zz^);tfJpLA@=}N}?o6oA^45r*v=jMBrW-_TO!im|DwIIMTOicQ0 znv+4ZXfBhpSytzpxNWu(nCDTgfSV7YOJT;ail>PYsdOeLydjc2J#xN}77Ew}v?$HW z>MT-eF-8KwGsBIo5g(ncgPsF&!u9n`6T9K6O5%#6?(fY+FWleMS25J*ho!YT17CDBafn?N-dcGHF3y` zq>Y+Xj1m6sLrj&Lc=kFg3c-2Dy5}gX@3Xxr1SKF)TFA$>AEU zhBcIn%e1vE@kk;8#gepGON@`!>I(vHnOPSi#B--pNxHOb56!!3&OxgB% z1cNnN2LmYORgUkB=0s~tODvv@)X%|`Nc(0p8ta+*qZKSfGEmnVk7Fo}=Lf7Nqcyt3 zOB;l0>pCED&R-FatqCs^E8gW8ip_zr;fOV-5G4XLYUj)jEQ7ragq!OFVzrb{z<(vi zP+Xr##*0@)&M#gqbOe^hW+yC-g9UN`1{2*?Js|l;)1k%D;&8Dr-qXT$D@Iu^P_d27 z;__nHa;{g9WZK@%S=`1p&UW`wWZsP-H)%H|eudhK&>xUhE@3uKH zI<(ao5?*7gvUJfjQ}fbX$unzPA+A`#8XFUVHPPgXfI(d#9B*h9QHbwEflbgQKLIBg;38HEPD~%=Y=k&Xh^;2)@4m8mc`X6hj4m(j1=B6 zQ}N-vUaaau-2j%~9i=M$2ul%E2)?;)`cq^YocGa>sm)7w(-v6k)LY?`)C#^g*Fl-@ z1r~Ta4N0s7SSo9L^b@)-gSOKBSirD|u9yNp$VU&-eO_8Z4*?oY!;O&EG|#}CSuC~N z>0tr-Qz+Yfjdq~#cqFQtSKcr!_^&EmYS0=z1?$t=f<-?vsWrJmZoeQl<9a-1 z!#IHP%cIzT!u85Dv|6vy=+{`dd+5ESAyer$SO#D*rbD_SaZr`+regWQg8N%K;HBs2 zcd)V8b1%g*q|pn|60|$Ak73E)@98Ds?7j@m0T$^v{*kWtkV3D(D(O{oxH%D__Neg>4CrDrGxY)^fW0J=h-dL)4vcZGwE&F8-fLJ3rBUMHg+vZ z!;fLVL+=W_e}n!8Go~p? zw0?!T(ih>zNYb_hca}`y9aQ&p2~3kFm}u1yOr~!iqj-16wH}H#+?|@V7|=XpsRLnc zhg_(77EMYY=>G+g6R;GX3`(<2yEYv`rZeJ=D!UNJu#Buxn~F0)QVUu2u$whqmnVl4 z5w!EMR|u)X8BG38I8&`v&SV4tD)Ey7fhlyl7@ z9JEZQBml=G+6)&pT0dIjd@tt-pSrIu+Qpsak7-qpMF%sk$M_IWIhJ|E8q0mTpWu=o z%xjLUG0Y1%ZrenfJU3pB_wjMu-wTc-!lc3q&J8D5`1p9i?&mlFkH832B(cLT)zvX^ zdQ#;Rv5v!0X#%g}FdD1+0+i3=t#7m4L#N$0Y zjwe70yG|rTxt>oJSWm&yV>mRUWGIy=u)_F@%B6TQ;8rt#@mn#OB93sRA2U6znO@Z<=# zaFLX2b#{*?pzD+z!EG`o&c}0ju8_=cFje(v2*PlT76LTd97Qc=HW`~4TN8;Rsu%I` z8A6ekF#Mch!{n|eoCtJoHhi?L$*|!XFNAJE6=y}TgkrHDD`x$uOoHALqH`867J9sd z>7*WFu*^{Lf)$Zw5zc|EBvd{J4le>`txdJq#MP}ZUKE!xDT`}-d@hGQyp$2SI!fnF zCsk#PQ;o&zqX_l;csX_^9ARvNEE8cYS}79|_3}#LC^-<>Wh#N4HBuRd+SwGbQ(N$* zk(cK-FuhkJC z?)b4@x)7*ZVu_@WFVZX4fh}|9&aas>yH;ZadECf$NTHbAoi3Ox=;;71;Y$TYmm#KM z*rVAoG3}G%;bt+%ATm;KTL`c4@|A+;9#}`+%|3do*p)9=^S1;Q*QDDw15Vnv?}+!; zB1F|wJxED$S~7;OgU`tunL$s0^lYfXkoY~lXtMc7US^6rFW^g+LcC#xzc7xl-TfF>Zz6btFG%*i(u{aVL zKHf@mMDMW)BcBEkVgh;XR-(6B2^TSN7&BKW$U9~O`ZaHM=z z{iVtXcX*SrSt4K66mIeHF1Qf9lYb^~8B2?qDbce${Btiqz>gp$&_nVM>FukG_{R7i zVln4(+FArPMA%w7YKV1YM-$jgAkif^V}MM{MqPTGnt@6Pm#?%fwq&L0%2EPS?M=UXZz7eDwuJ5&tc)D%B z9Ty?TM6wu5un5JA?RLJ+8klZ1c7iU64;hUfqQXAUlF-h6^pPU)IyrFgJEbFJBET)O z6Cz2V$vlHBjyM8QLcHYoM7zvXra?B&>zr(mwOO`wf~+v&6^Bh4NI(RBqKT!l=+=!E zQfNmY(98wsQ;_0Z=e5@2{~^do;lW}cLZZeVK~kfN3Y{*o-EG0HPm3E-36ZGiVoxdb9vW0OPh29X8W!j7wEqs5FJp%6j}3#;s@WvgIZm z*-o$kDc|{c|YVT0ItpZuSRs`Txg01yf)$*J|#m26*8($ckZINGadG*sAocDH zV{TFJQwnua90@KPbpH4 z6F4B4eN61wE{DaD3)Cr1tHtp-7JqW^xJ*9cBp|QCQ++wJfA9K`7nFFFoW1M4_^0G# zc@@p6*J-F1@2tD6K1bGTh5h!f5A>~2$`FIqMuk^Xa(qR2UB=V*U8c<#mXnG4EIVL!kuu#=p#d;Q zU>0B!d!HGjb87Eq0W?;*cm~$lNRFnJ}IXMMDQfT%+-8rw1MX-kP7dbUoj(gu0 zH;&^e^%XehcoYl8A;a+nmQ^v9C8<6LUFZTaswI+4;OJ9ilyL?H&J~2!3eJ`fGv_w# zxZ~l^ktwHRU#ZMQC(@QkTRJn^yed*Z9qC;JXH;djSD7QM_>`kv3sV90V#Bsps0w0Y z(~g2!hH6-wW(yOxS|O#@qs&w0r=RmQv;2wDQ;mFonW`XcmT6Nf#GMty#+;2X?BYz4 zopIf?$L`tIc)U+JOIhqy7Ac5^^*2pkcME~4oa0rN3f}oF2VwLoxI4$qYi-6JFjCXJ zI+}6tH%0budMoJD50 zHZ6<9jT*R7I4W^w7{{^zVN@1(?$-)RrxD<*X>LZ`QKZZx*yws|W3BPJh&ZDIBcwk} zjVxK%QS{!Zy*dl&8WF4y+1q|>`R+q;TR@A7T$E>3$_L`d3V4E16RNE~#Vdy*6`Kgev!#jUYK4Hx#rxF2?*P&bh zlRr4ub8<;;#!l)(BY#18o2lyuQs!<7Ey|s+gHCyLFHH)09MxXGCzRo+_W3h* z(KN;h4g~2#nf}aO1aq*NW{A=mOnYfTD9fJ}%63%e__ITO9M!r0KD+2F@n%UV&sMcm zugdqU{ycwvJJl_qwvKILn9g=;*h>X%G_xc(Dv1qXNINMuvYlEN<*wOD7g%GvsEvk{ z7Vqvhl$4-F?Tji7!sl8(oH zFb*e=q0zW-@E7;FREDdZ8gTyRdR&iE1wBQT^lN&Eo(0TvfH{EsAE}x?L5nY_nsLH{ z`{LwoF-}ew(*$J&`nn8sd=Krerf*TUEL{U>%af(=pp=gpDx+)ZyU^h4X)Ij_xGWqT zT}d19>_PtxbOYXcF|JE!6WvHE=(-r~zbiDH2h&Y-Gx`yw&2$U&UX;ARtl)El6X{mK zIdt72)vh~A6pcKJXekioc<45|9pWtn_&!5`C-|LD2!X@geIL{H=m6Kc&E(FF&T{n1 zbsu zAXkslI_UmAxL%}R(Cf61-lWIqEx^1D*mrRM7{R&>+RwST_oF9~mVJuH(>7ecvZVVy zOS(l#mu^wgrTalky6>^1`$9{)*ICkCZ%KE9O}Zyo(mlbF?g@r;7n#xx+l%duZhMi* zb3#LiE`;qJ`6RjcL71j{LQcPPFKrD;Tk6_H4=_|kb+(byv01>Bz_6+d+9(uq`CaX_ z?OtFYD*Lj|dz!dV&hxu+qwUnbnF?X<{7yA@=T7>0E)3${Hqy=8zAhGR8EO9}4}V1i zV8~S3$`jc+9mNh9AXU!d-MWRtOSn5Ej9ce=r>ysNsRulaol_dLAutpUIt2rth|**j znkg`AQ(@9hg|Rq|ns99Y0y$yCrltgP}cjL4JpOWla@I%6hoNEwk|buuDHKSATuCWy*yGn9WUGZZ6l zwx)K_fG+&q3PxDdRn+D6e==Poz}^Bn8M^v34Wwr%fE8s3{RR{F9474mt)So0<@7x4 z{{d^thF}uSDZ9a%vKy=^yTQ~7I$xhMtSktQz&8>GJr9!(tziGi+-KpAKqa2feQ_84 zL4odXg*A6nJ4>E`2hvG1uGmJe8gNh0`P=Aq>tT+LVmBRJw1eJCy@4LNchX!X$mL>SThJ-!j2$ZVrpTxY`VSU?}p zLe9fCF!{6q#(A+6l@U<7ztJ%1(z*aK7zn=$OqhC8Xi)k!`eCWRDhhJ>&u0Z83hBQV zZAXI>;T-G{HdG4CHuj8YXJ0$_0gK&jl)GRz=Pk zoIiIha^#erv6F|k^Qe&9Q7zn8zgxPi04OsY)=;LSI!pMcmfxD~&o=zl22nEn)*OG1 z<**9xlq*7cj_Q1W-Y%|$vs>UVFdCJJ5*mdH{UB^fsIQ~CpWl=6bNzkWd5myppTmT= zb=*i;%uZV1cenGzkV}Y59#1x9Ek!n*AiuklZsZ!!xzUuI=JC{{YCP56IOO)bQ@tM6Cta#ke*?m|q}r`XSo`BigY6U97lB@h)u4eI?tbLldyb$zO^$#$&fIJP^i#R-Pd0j>gTBT`}KGH%D_ou)aGwLEjx=vzOW(8AHVOXei*0xIYRF@b~u* zXy-(mGt17yHb;m3v7OhnIo`L|^fI}fj+V(6v?=%W^3d4EAETgtvyCIYJp9jicySw@ zVCP{TZ{T*myp1w;^OZ28S3N3MQb%wyW~q7n;-NNyp@IH^X_SVJuMUJTsV^<^pHL9+ zAHReDXb$hS%~Z0RUzfvs9=!8_T*;m^1UvZ8qQP!{V-d?i9tQF+0@8G8y<2Hv2R0je zI1GL)wv?>0dp52Pnn5{oCo1bv1C|X(ybXWSLTVj|brl{NP^AUm zSKVE2c+~|STlq4v>qq?2WUNk_4vZIR=rL91e=5$)Ql5x`9;vw*7BySqE*b-|jFR@S zxqXy6CP{$|q2?Ts1`%)-7p6M(pF}XUumgLTBM~8@8)^R;BPi&gjGi+)3zE>w?yrsA zz0Cd^WxJQzUn8?&c2vqdq}i6XRW6<@JCHNVJ0u{im{@~W8rIRUkf9DlaSqi;ajQ5K z+hrjUHNub{zFC*P^kz8ia|jak-mpivn}5C0iHC0ldO9_uVi7+*Y)^94!&-QET7Ot1 z2ll+344|VumYRv|u91A{dsNNknvUj2MJ~EUSWb3(#Cfm}6R~yK3V*O14?QBGotY{; zwj=ShQyYioS%rUKa|fb&$J%%aoR7StZSB-NoA3|8&|~R4)q082fI#d(q!B!H4mfZQ z@)%*P?RB_T8TW{Bub1~KBui^3f|%%XT1qbC^cUq9^tSRI zz3uSRUmb(!9mi05*D;LVbd=C*j#Avm(%&5O=sm|-xSvZOIM&cdj?3upj&IQ=j_c@B z$M@+n$3t|vV?TZDc!K`nc%D9Syn_2d`qc3$eTM5xad&3ZSGYQyIQHkn4$!%d*?AQ! z&Tq5B`5pSwxe+j%aKD|M&K>M>K8pK(R-Lb~$N3I>ogdQW&VSMsE)Qq8yzF!J<4jio z_aU6^3ULmuLV2&{zOGvC=UT~r*NwRLagpm8KF;+V_jmmkFfRc1CEWka16*J5K(~Vj zxIG+j2lzzyC?4dlq$}Lx=t}o2E_To6!R{qI#9fd3N*?B3$HQ@z%KJ@R=Dvx`-S^}0 z+RI#_y17!#;h>t&RcZm3s(v1>_Q!oNSF5M+81*#VXYn|-p2w@_@dR}ZU8!C~SE;ws z2K9EjTD_OPr9Q+bsjuLAgTAFPpR6f#jpnASH4pAS+Ms38ceDUqtA%mZ(MGMFuGd=V z2CbDgX&0e<8GTQ?j&9O!q?@%{XtVYMJl{jNY7fzE+8#bddyFS)Px55#S)QW3%Tu)v z_*730pXM2jGjpfV?VhQ0hi4|;>ZzkUJu$k=vz~t7xtxCJ`3{~p(cPY#>BkzLQRp zhY0d<&|ogV3mxeL9ht>{LyKHIogt4M;{4wAPls)*}s(&D%l>^z=4>a^q z+UOGg1X+zN=)}eRPqfHZ&gP-~DGoGvlykXQ9$xS|&oFzFCE1%S$=;j`&EA~fFneYW^aytW^a!DW^b;|W^b}2dy^&Eo9i~SH`k43Z>|QjH`hwDH`iRV zH&?CMo6BwX27NNd=6==eO_pSDvLt(Rzi#&Ce%b8Jz18f^eZSe8dz0Cl`zEtD_YAW) zp;bC3)z|R@g`Z(Q@*(X-{4a34Kz#+N9&zX-PraY!%h}ITAEIx_+0RznAQPMTf5-=2 zS;U{CMW*&FHSrgi=`3wGt(UWvAxr;8_SmQGp^Ib!GE=ML#r!4UyjpK^p;sjO35f^q^8ETwqNoA<IdkgVep* zF8Vr?i@mb_HOh7`v%f}W_h!2~5d1pIJV|f13&&k#`tbih+jX(#x%k*JPDqvMjgK|k zwMFx6IreOq(OS=Torq6n3i1D`2yhMlpC>gmnP<{zJR8@U#(jZtUnuW0c_E$43lN1p z3puLAbQi8Iyad1ZeKx(y=g^0|l>Wiz;`e>S_~G7V^f~Z+#S57EOng;38$Tji$3gs( z-xOZX=WzpmuP(}0;MWLl!PSP}-1{lV_$gd3atpu7No6>$k-Qq$dgH!9-p}Prlq6rO zwDM)jrF^+^4elHHO66|83fHyrzK6f7?BVN_7kHxs2f`hr_<4S2c35T=5D}l!TlkA$oVvH zbN&wZm-%7mN8IlGl6SZqdT|wMK{D^Bd@4@xByf^TER|7xc zTE|bi?!omU|I+n3KjnIpf8}}$Fz*2NJ>37vPrI}E8FydY2k^7*AV24x#J_c)#yb(0 zKj04Y@7&Ayd3OuH;9iUSI{v-;dVUGlYx2I8|K#4vueM(v& z9nP<*qxdDY4EJ&TmRieyQ5WML=D(_I`CavL{+oIYA5b^)d+Gzc8kw#Q>K^_;-OnGY zAL06pKhO&JBdw6vYel?48-RO&S8FHo-?borthM4=!~fLQ@~7Hm{F!z&|4ZA5^3D9Y z_9Om6yNCa+-Opd*Jm}}zBiy0wS4cacu=aaJ(f+77wS$UF`$}*HUo0J^SW~GnkEo_KmGQdE%6KKLjMr)_<0U@5)iYjAX2#3mH1jmF zB=a<~B=a;5)y&g4$js9q_-kgoUNG}C%5F1HgM65o@jB1U(?FNZj91j`%_&NH#!Hm+ zj8~)Cn=@ke<{V@8<_wv=IRj>I$cGudIbJk-gC-fhx$v>3p3RdbJ>wZz`i;|x45+yz3^@-V= z`+c)F_oHTS?tSLi+*{1vkPkC@bDv}O2CXtPUY}SQug|QE*GE>yYoC?z+HYmNc3T;* zJyyo+pq26Zjg|2dB|YPHz{+^7u`*skE8}&dmGK&>wiy|(E3}z<#*5wBGe*X1vgbN0 z<8{Ewcpb1ZUI*~0pU8L>d3NdSO!}h4{GK{I(3qzWz9NAwMn0VGXPUcsX%5Z(77Vlv&%cB8=ay%vrQUnTsDZ*iNse zKfbNR7$#o90lpoAyZkW=YHHzcPyj5jJvC>-= zL~#sitG(5gqFq_2qO8(tSW!O4Y*2P-V#s-Oj2HO2z2E=vJd zr!bF6VIG^pJl2MJoQ1iv%)(q*W?`-@FSF>cEFb3`Cx%rX3{`^Y@-lECR2i&9NesLa zJ*v56u*Nheg{+h4$9GC_<~IEyIiNU8V_SE-d2@^q$)6@q`W#* zRe^`#xIq;{tj1L9Wrz~mf+`_u7`S*Js*ue@T}8PGS5aARz*SUYI&?UULT_6k2BFuD zwcy5@aFt~yTxFR7CngZWs<){Oq9kdkgdpm5!7>w15F%vM3Gt9{L5Q?bC+1tPtAcPy z8iE!LL6Zjb7Zl^G8dpB35)T#SKq?;~R08X`ib0UHstWIjX(_`Ze+SDu;=f^CgrW;! zEGZYAW4!VKWickREJh{EV?shx%PXah0|=_BKcFmFBwvWKKqP?B0NN_WPxb)u(H{T= z`LW6nAiazRQi33OvVjl-A%$XM1jDVeKqTtNV8YNtl@K|Y9ig^CQ8t80YONF;ql76J zL%~2Wkw(d&9CVAfLZhYNNTsO|lV+5R{y~X=6S^Ss@PS z9I0>lEqy@n1`-Iw1B&vgj1D+@}-SK8JLLnuLK81u%x%*50R`AwS}-&x3*c zRc|Of-P(Q|Vz4jL3dk}n4usy-Tu;^WurC-gwR)Q&s}H4Oc-Hy9LADqy+TlyV`ywL6 zYOOwxZK|d3zTgugv@c>?sqlAoB!fXKwWuSN{s+c(Yn!z0%px8N-HW&kl*@x4r0gUW z%-sp~&eZpbRf>`t?!BB)&X3+T&9l zG2E-A&LHWk6q1}ueZPdOShcW%YqQoN{}SG_ki!i+>rN8F3!!ThIMjm88!{ECD$cmlocwCmwCsg$ z_4O)~wk5D+FLoWfOj4B;)wZjr-{sfaA1j==k;y(J zFHd%nY?gjAc@*e_eg;?|?k1rIO6OQr*r*cvA~dPHMs zPJoFbdFkyKwczDM=yS3L&D-nFmEUl^@hfgN)_=j$PlOpb(~N_QHLuLMi6*T|lKGhC z3UNenHkl;)3?9!!ns`EXOtZJB2DcB8Y2*Fba|df@-Un^m#XUk%I{;Itqj7*Gg`&c` h!hMCZLPg=S!p6)cgdR&_LBUq2Dm<7Wd4+<4`!}zIlWYJ0 diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApplicationDelegates$SetOnce.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApplicationDelegates$SetOnce.class deleted file mode 100644 index ab4fcfc583e0682a260a5befcd16ce4f3ad75046..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3186 zcmbtWTT>KA6#ja4nOTP0vfco1sB3@~Tp)C7_CFbC@+&@7#L+{P)-20QACP z7e20Ko~>YPIxxslb2%VGaWOv*pCA`_Mxd3I%=w+poQV+CTG@?8D-@O6(7G};3b)6 z8V-^2O{PHHNZGWC+|_V|K^-)0(;K2-wM!+fIHuz$jx#icu(riTLy|$GpiUAPhP~}u z;}qIki+9jggOg|{4MvGdqsY*;6>0_8mKeWeT&5N&oRYS5Qo^=Uv|6R1reT?%@nQ_8 zDGZ(yT&YDj+9Yca!@ixA_`u%PaTt9Jdp6xMz2G{Z%Ft`*XNYfN$lEc)aOO>9$oio2kb#e(TISSy3^ifkZ<4z; z43mY~$^7*2e#~X$BsK;xJ%si!M7r-6ZlD) z{}Xa`ouRQJW`cW0(eMlksj|Ehp{CE|5U1^|zlGdJ2*nbSiUjAcwTCHPX;SpHhyJ9* zgmRg6DRf$(!NyhaSg|@x1c#S;ij`ZsB+7>lIdb;Z_uYaZZjP+MK;|(oJcYJ5QUNs)` z#cW(?oT`tjbV0kl{zbhMK_I3Q#1&`{sZlb$di{Hq+MiPFCFs)(Co2wn-J?WK1a+h! z#kxw|6Q1Mpu0^A;BpjO|^A=C327{_Dd{0TqPU&}gi5{-%yg6?h@=2zmA9ac})luIp zEKL}tY1s}K8gi!1C(FyT+zly-oKrBY8N)RtM@URgm2J;l=2?5i6eiI(TKw?l14CJx zwQcT>T80puI*guo%5H&QGNq=y!DfulmgmRsdz>B(>4@e~@=PFii#Td_3KauErCE`M zOX;V`M}cVEU)TEQb*QJ*oFmGYi26y|-}$Xxoz^L2aGVxYZ2mZi3!%Y(`@n!qXz)NZ(q9$nSDT~ji1cd&;Nmx^ zOLaZL!Bq4KF8+v119bTNBh>hFv-4gedMG41nhlW zCT@bV;g!sWS2CejZXoTP?BvwzY;%e#?IpQ(xl#Q@} zf*&RC%CPJYI5!N?k=v3iSA1m}6|oEkwKeL2w3d03ri)RU>kmag{~A>+mpZkIYk?w} z4`g7>*QnA3l{CuB$HL2d=_+{?u@sB4Rosx*Ku%erQKu6HvnZe?gdBlIbOl8$)BJ6I zV)(kgO9AUw{f}Qgm2a)AF6pOQds=tne~X?{`8?NCIlbpZPiOD>fgU|IuEQoPmkGrb zA@fsX}p0$D-d0CKGh)CklG T3Lg7!G1n$;L>fRfxNa3&sj57U*V8b`X4l#o zN8$zL35lP;D^EOvkcdPjWR*95RK=OK6QHgjqLO!J&YACA=R5x6#jn2ssNgQcdKB+@ zQCEb#D|HkF%JTy$LhZ@$Y0Q<5d%o_)!rSb21L<=uqwo_Eh&`@_%7QTz_W2R_0v_&p z58L~~*IA?(vP$TOp)VNjlzaeyy;hL29F_^N}f!3~Uz`rWsP@g`}4y7ir8gIJHKz zwb|JEl#W%R|KJTKPf7YfXx`zPQx~kmqZCaJGYj?BY9}I$NTg>6r0T3P`2FK4*P6Cm ztI$7oEr$+9a5B#C-&oWAsZgfx2=Np`BEWODirNvdYY}UV!CME&#a`c zr=9+BAyaW3t6-Pt>V77HXP^II=S-*yqg*h5n&^K_6Km024(Y~lc|f4$uFy(Hu~^>c z{(*`@)1%ou-o(WmomL3=s?ooFpov;rQHQuNQJ0};^bXr1ZkdTN?1+3G?C@9`d8o`a zmycX^GXBd03bb^UK zCVwQ^!h5vZWJh;+pVl`9I202vMmvQ|bpJtu&f>!%-l6>?`m#hBMl|> vTuXk}apP2)t6?7RkQO(0!4%3^*oCWbQDIS`q>xcqQn;lsrC=*8E8PAQ>JYPm diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ClientError.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ClientError.class deleted file mode 100644 index 603a689cdcaebbd858e21f5b9e3f80ae8e0d3c73..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2831 zcmbtWTTdHD6#iztzAXlf0}VJ_oQ5REgxDt620{abByJ2zv5P82t+X~1ve@3WcGjqQ zsrVI@^4h09^r5X9CCWpE^4R~-zf$$gu1ywjsMSjL?ws+teCL~U&iK#2-~9n#9$O6a zmc5g;n%vZzhGSWEk*(GZZaP`Rd~WN)v0GKAW%KN+ySrxFmK_FT_-3(ur?{){>Djt& z?qr`-c6rrVSSt4DZne?r2t{_IRj=!nIwv6E9qz2SUWU^%C;h|_LO2QqeH6`kVF-rny^`SL zlmcmjqPN7Vwapn=fuWxwmwbDH^h_a!LBwUaGlc8~*SEP%5eGe7Eyt*5*Yzejdw6tb z(FeTb*oL{Y;8Q3X!s(*1_7SRZxZ40VX|0V*8d>k_axNHL7y6G_21 zLuk=34QGkrV%nEsyBG^Tf0C6MD)(>yU9StUS)Zp<$eP)TV1!|^W;u1k%Wue%O zUJ^BdOsU zZb(p58dcgY25LSRWM0a57=}6k*14l^>yA!MpfvUZG*_8?#7V5UBBU6gmafs(cAnv{ zgZ;Foj4Il}{^2W5YbnMf-fNnc1N2R4N+dFRu%A&Q2m5h0A4#YQL|;pi3qKONhKFbBxw~+4okgUG@&J2i(E9Ph*VIscqcd4Ecd+%tqh^L+WkjAw|Jj2)9ku1)h+^~UaC(J=W&t5M;0 zSAuD); zq%2tyzX)c2N9-3@{fVn2Hz)Cwo-t1W{TLw0AC5YJLb4N%hJPkS1s@zub#X*#B1w51 zM=^06MXHOjm)N;OG%_(7x|nJ^G$_1EdlPes^KWrE^Bd;gAeWhajaX*)$UKHh zQtj1?;+oYx15PjawSC`PHE%b|TD9|Fc+xCEjiV!qyrATR!N{NtqK+e`JPBwOAI~B)> z13!clS58PAP?RG-3NhYLxNrd^%QNrIJbOIjZ{NRs1+anp3{SN=jdfQj-jz=4)W%6F zg>tb}Cx%;RdWq{95mz&I=WQaoPHMGS)txR^5?4gXP5LAML@k+Q5tmR$} z-yM2}@`fJ^d4JRfqq|VC!bqMrgt0W1m$hw%*->X!y24qfjaX^%q;0igc=&IfFX9@* z*ss}>zhjIxcD3zjs#Sd~7$)jciTz%uDa;{nro>FubwY)4Dv$6_vRqS2m}<(c74#RP z7rJK>u`9h`{-CFv?1+Z6k`&LB(vJIYXR%Jh%TXUeHt=7HUVe*EOqSY!{DaRZeagbO zY4>5EggdmCM+q21l#L~i3&eQwBeDTmFE0OCJTpodiG3wI=n$0e!bCeVfei9>q%fKr;Yv~h!U$f;06EulQEovpd}yl3sM zqe_)f{taGv;(-?gC=y60>LY&?V)pEODD6WP>wG&iH~X8J-^~2`-(UX#SVNuRZmc?f z+!vDfLlei5_S;b?r13-fLUC=>plt?9`1QoP{jx3kCX8hcjG=nK54j(4+3}wZqzQZC z!uJ$|rwum)U61z#0}B|&I>PK;u%#9jgCa7>=HVdEkTySrn&DpKYDsM{WH&<@nuiQi z3yt&ac8v;UXCqi_GR!C72g0-z52g0Glrg15HEI9pAc}Y^5(G5)mivp%BF0eikj4Z< zt|zqS9V)H-W+;a3w*Uk|qZ^wjl>WhCj~F&WNgnx6#0x%%Or26l_>R>MS6!htY`&$- zW#lkr(-`-NvkC)on4~pn^_%3cg$jAp6iQP~&x0pK{WlqExBb0ha5t&JLyq$GxYy^B z+!(g5$oc#k29Y*#THcN@e4iUmHm7%(qR7m?N~E?D6;`DYVO=uquQIewjw+s0agzVZ zk>`}gz2tB`$IZA?m6M}e`88*S-Dml&n`O^+N=`LhVJoS!OLDsEtYlvQoOMdsXA@_d zOAytxn=84mf600_(i+3eg>GFQTgn#Cx2&^PHp{D1+67 zQ=Z;+3~a+c^RSN3iyg#~D45SpQ9&xP& z?X9;P4^&%x9ojh4Bgp0u@B$8QQ~GJ!f0XU=lT^hl-Y4eolkDIFOxr3+&R_yLxb$U% zG@njt5Hhtt;QgAoZqhrO7_)dla&hQ@0!g-&v?l~;F9&qmp)1suj!~}7{0Z+jQXO1| zxHWVeLC^(U$9oBEA<5RkL%NrD$aIYaJJe&CB+W+Iq|0{Ms9W7B;nX%^EH;rvSZBHiy$s;pSe_$OsVLquEw0k>i;?jd7A(L diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Informational.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Informational.class deleted file mode 100644 index ab8af7092fd5ac457e9405a344f4d7498745a889..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2740 zcmbtW-%lGy5dQXjw$B#>hhsNDNJ2|~fC;h5ucm>}kOUGphNRd+m7-QU%!V93-&wb7 zl)O~@6_u*K^{EeiXsbqz`cNSr``ACI>g=5fHjvb6C2MzQZ}yvSW@l#o=ik5o0pKbs z4A=c&v*0(mXEz<``>rU|T!(wI;CRmiTgaeQldXUkO5SrnXxP&6J=;x!F?=~!ys!1gXXnd30xmQi!t5}y%0<)n1fQ!`XXj@b?*3n(By znGU`c893f1*%=QRZ*jRE*p4R(w&(eDh8z`z6<@BjT$i-^Ho2^HKxHQ;kAkI@{Fz*GKCt}%S|?|R1&o9aM%PZ%cG3?vxN)_v(ZUSVsyLFFQOK&3&2q7q9u zHIc-J45w-@c&+}_4(tXejgn}m6vL%XhVAM(>f7X68sj)`;v-xzkYl*kV_EE%Q}tDo zCow_!)0JTiH+s#?PNdm1@|a3t5|K-*ZYWY` zO-i?q83y+aE^}#b*wUsN(i+<_>Y7Xq7K!Vj2qng-LhH1(F~jiJ?#_8r8`8|(owt+K zA4--HP4wLwGd05)+TF?P#_o>At{NFVqdj6p?cTLa!itS(MLlB}niZ#2A~Qm(D6om+Wn!=>R%m<>>g+jSk~ST zi9zKV#f()M?)7@(?`-cBNl;lt*E8MZQb<4G(_40}E_{z+^qnWK)TxD^UTt~OY4DP_ z?FeVx!Z5vyt$CueUZAUrJ70KzTIWhF&{D7&DY^ag{*GsHcMh zQz9urvq5u4b@y&&=YK`|r%=62qXGm@VwuKt zq<}v3lhkRB(wMB8x!Ye!tI zRGc+sKs`BRG$M2kE3`KdqnN1cPu(X)?&S0&EzH=> z#2egP$xn?E$y*VtC#0xDOZA1ZRQ!_2lI0xjMiyguN;(=I;d7e5t1K@(HQ!ec=Hu`M zGV_(O{ne5=H8wN$-a|dUAYJc;nJ=3&<1?497jMs)`9%|}L~x6u@ChaG?PrLUFdP2n zaA#kdFX2<%rClsM0~5H1`_GUO=ofe(uqcoaSP~cr$6Pp)cvfIYU|3*KDCLx(ze0HU E4=Z@UZU6uP diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Redirection.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Redirection.class deleted file mode 100644 index 0fa433897dff4974540326682034a326e2511924..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2479 zcmbtW%}*Og6#vcoYrPmSh6H0ErGX}3AZrtnrkK+38C(pB0HLa=hs8`_@v>{}j8Su` z_$w;q+EWibv{56X9wNlCe^k}CyN22n5NaiR-n=*Odw%omKmYpUBY+9KWSDT=J>98t z+o+n-aV(*iEtA_)H|^K1A*5R?%bLseb-ru5yev(}j)5_JH@!JkIxvn5-7@Sw{pHR9 z9TsLvw{$mKHH%FF*14!Uw&2s7n}wMI!}I^^D26bDCZr*2V&2*146Mk|y2s^4gDf;W zQcNI1;gZR>u6{TB^}%6#x8fsL3_}fnlvqa)u__hi)P7mL-RJIYubB- z28EI-AC zR|IS@x*??m+R*Mb@D4+C+O$nM!_YZgY_Rr1j%+cME=#WnI@(}&L)4Ki6>SXnDvq>F zTR%8DB+N?g+J>bUZLg)mEQ=U=8M@2+yj*!@xW*wTjiRWxiQ(aJ5Udfz4U+oJjBF*) zk9!*W@Cn1?TSD_3(wlFpJcdshS{l&8@Z|Ow3!aAOr;xxPhT^!7&lsK!|0fq-HQjiq zA%bCsxyv_FD3-2j=>mUk)GRqqDD#Jc_S7xPj%5WyLU^zjD>8;r29+OH z-X#;zd^g0pgX6r!2Myd_EOj?cnl zL-e#OB-+h0ygNO(0M9`!P&9Uf4`n)siji zU4hf)gG93R?B^&!SlOMR5;o~BZhN2Cj!)_o2=Bplj90l7(sB9tfl;mq$7ble*78wB zGQ>B`J)0(`OXIS4y=F`EkQePEQSuZy?XtOL>!u_(flu#1hdcHLQbZgs6%*tuKhviBc~S$^MR(UudIXnO093 z=s}UzM4&*ll{l&#orK5B#&>_E!$#xG6~;k6T}}DWH6mSi_$_(xpq?H}Wj;#jZv1b_cA%qff3Kp?`di+-fWSPk@%)7&zZ8X`=)Afg6o( zJ;g8n_-NUZmLJTIP3ETZT6R&x8l`7YO;4zvr`re>@wxwbhA+;!sUixPCMmw$1{0XU jSKDY8Xcc%aFe?xhm=kF8SK81gEszrE6i@}?0`q?Z`16D# diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/RequestConfig.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/RequestConfig.class deleted file mode 100644 index 1763aca2dbe0a61403fdc6a971b423c7906449ea..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5445 zcmcgwTT>jz75;j5mmP)$W(QVWR+7QU7#8pX!pISbSQi8<1Cl|(QKTdumJvI!%;1?> zV&~$JIPs$&UDit;Qk6;`{E$=y>JdXY;0Ed1=#n=;*HJ6tZ5yG1AM% zdj-SwuG`i_b0Z4Ipl<5BdOELL8|m9?n?}})BE-WZIHwFfuZ?PC6XlR54g(2+aO!xF=`wk(4 z!aKT`W6&0k+_K_1rnNzRQ8M<9=x!%dYX-#7f>v&ZMniLkzHT^VNvl7w;F!mA@uCG~z?Z6Z&j=kuI}+URZiWc)!})+=?iq~~%P*L&S7)u6 zDQ>n*X20!&W}ex=lVD>w>zmv|T%9&8)0<&12cC~VweGIm{8W`VxXSRi7qnI#H`bar zQ)SVylTLEu;Hr!W!}%@S%bQkub9b8phG#gIo=;~i&U@F)x>58qbYyczcI%Gr=oA_Z zC*uZ(nBmodG7J3}64)oAN^pDzS7R8!pn_MClF=fgUB+34&;ajv8EFM!j52)og8W+L zv8l{Ly*=MB9_ocW508Gxw4FuW*)p6d{>eMUi4RSL(8+p(j&Ii9-mxtT%46lic)4(~T$rF}l(l#0F#hWQwk9|P8mK*+mG?jbYa~m55qrC>x}^Dl*K#j2U59adl0c9`51SKUuO&2XVM3xWq}mOFJCy5qBd= z6b#s)jBm#@|gC$QzvKsca7rRisa1SZxn0fBTC}* zJmnUNavv3UO14}OOgbj_qQpyI%NzV=)*WM(L!B7IOV}}NAjf04$q+AwP%>Cw*FBve zrS07i<)n-kDv4`C1Q#i*WLu)F~;Fdbp?1kGFZHw)oX6e$}H$atmpj zsOE!ZUdvBEmOBsk#-&kqZBA=YrEY07M0J?zh}JGkYD0I67S^~V%F(FSOQl^E4fubc$ z9ItEQ_}7?7knC2Q+Ch+=b#Fr)>FLtrKXYGP$)o zEH|mK<+yLwk+NBBA*HbJNZG2Y%Y9$txd1S(#-9GJ;T-?Ebf1CJNZZR94#fihmL1tK zJlC@wV`Nj$Zn?Ha)UJpDuWfk@$>oCOncGIj+BIF1IC}Ny%|K6u6?4PV`74I*MgO3+ zE|`|FRM=iKoV%RUJa4zNdVW=ROfCn?3)Q%#ET&?C<`s{Oql-J3rmWZnCu`g^IdHo# z+%VP(8?*0w1|>#(7hM7LYK_4dqrey@-iM*__X#=Wha~YjO0~ux3pF~*!)ex!s9(aF zs_~TYmio?B^tB=m89agiG0jX9Dt!Y)Qh!9#?*-IPsN@R+F?=XWF@U6IlFH4BLnW|U zptfqD<`aQB&`IaM+M;ANP)i*k-vM1!mYuH)*jo+QdMw~e6@ZNAW`Tvjq%B9t6&HuJ zSH8f|ur^HPh&DoHS6F+Es?=kQrH1y=lp5YgTWVw<$y8T(AH9E|X%dPa?n0ATe!_iWR(KbsSyErKu8^$|nmhojiHE^tsC?3;xubT%R*n>VgQ)91l{-lQ_?E z$UmIPc{)a%C;i9ri}pRZCGhZs+v zf_?1M8R4rea^!n|MdJa!|64@f38^pTNYz%Zde_$_>*#tbbe|I-!yc8Zke8y+ud=Tw z_OU2!Nuo0Q6?F#^^~8(qC@wu)4^3Z(5jcw1JO^4#4gCglLw|wv2-k)VA&ET=)4smI z<|Cx}c1UUyQZGqKl9EDdBdM39ULi%opNEdN&;aRQJbC8ii1JhVkQyQUj7kX~;OA6- zw6b{hj#7Q+DsPF0zmi(%DYkAZLp@_XH3LugFQEURQBn)aSl`(2*yQCgB{i$yBQoR@ zGH;8RnZJ)v2HWCi!7fTW8N3IFv~cf(x$sc9kMk~?UF^DuxM*D1-n2 diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/RequestMethod.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/RequestMethod.class deleted file mode 100644 index 682c76a806c3f9affc7d84c90e58d08bbd5d0dd0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1652 zcmbVNU31$+6g?~1(pphk#|`-?r5_N$PD!1Feo!1j+(d2My0M8I&v^3CQEW9;VoO0Q z=Q%UX@XCMSiASI_lz}PZ$s<3C>D9_G?f@^=X!p)Jx_kHDvv=)3|N89@0IRSWZU^CE zF*tF3=fsPGpeu^)uIKtu(es~&j)=m3JL-pSao7F2?~3TD8@&iRIvB%t^~gDOie1M) zELwiQw^kh|RB64$aN+GpI#LYkBdfu1cf6ns+Ll$d8Wuxp+bVA{=(T#IQrn@5)Ae#= zbDKWYYc}nm*7s=UYgD%HMe9W53r+H0XqKyc7Wv=XA3KM&VaS>Mh*owKdj4UlQfQjU z;gW$grYW1~g(nzh7hIC^neX)6XF*7B$Mc=;!ZJhd-y#0jeT9KlNP|YW zY_sbKQ5wl(sO)HJabr?q3-~D3`D2Eu>TwX!Q5UI`osJVZ)P73uRHggC;wek;KtjY& zB_)rE>X4*Q24|+B%qfPF%^C{N@bhok+~91L=TbRkd2qJO9_U;-|6WtF%8|lV8YvoS z8X66q2B(oZ|3Ne2kgJUL#B7q!(uo_1C9Y@rKn?Z+;_hQxa-JO2# zzzrMDL6?|ZHE28CrW1NG9+DZ`JM^9S=YhengMQd{A9}I({BGZmyq??igh%dW-wz@u z@&aFMtWYIs5|(ew$Atl8sU~Tu9BHW%X{iWlDSv4xbvmHSaZ6H!6s@~}izMMwLf;XJ zpKr4IYbdRj`a8|JyXq_4YrVvMyOol}=c$BPvs-CNe34FwFYT5li483w9@s5i5}SHL zSayp`;vr9nZM&6C)>N{?MNjOPxcZY!M2Rmq6q%ewy%cwozIgM>E4&jsDA=J{qwM3k zM)UQ=1v7D#^yrwyocyk19+zoFomhn`&fr~K8P+``JpkipT>S+f3~=p7xjI8V|KUGA ziu5va%Hprc51=GI>M){;uVmyZcFFFMZ-LHeaUW_0H|6^Ymi|V!Dkx%^Sgh=W3HlfL cbRQD}y1;FLO9Gkz7sv=0BIZqjNr5|W0H0WT`~Uy| diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ResponseExtensionsKt.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ResponseExtensionsKt.class deleted file mode 100644 index 71652625e7c3140ef3d737c263fb03fa1d1a4767..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1499 zcmbu8-EI>{6vzLwYkLs#HoaYWGkcq=}+Hdww8AXgnG2D6Wm_`lhRdw;^;V3blCf!iZ2y+Wul3Fos-{_qZ4E zaMycWZwjAOn_*n)YPb`rHaFzU1BQvETGZMzrgQTsR%Q7)!+b5iK~tEz;xg1855veL zr?j^one}cEROs}A*^_$VL{t|p!)z-ufegK7uT7UWLJ`iZhDK2|>1zjBhN8bG{MHk$ zcw3N1Rrez^EH2efCQunrHsdh6mF2BbjAAT{5uBxzPbT6Z$B^=)hG4LlmaC&E;9M4Y zoM$Kur_GR+dP6j%qHWtTkn2 zEjK+kkvrI*w$@nLTC?sv{P-r5nNGO}`#GDwq=r7E5>q7Mv z>XXldEv{tj(H9psx}lM6Q4M=iOVW=<=-z*0O6}Z?y2=+1WgNQHKeP4q#DF8N!$OKG z3VN52Muu#UET0N)(K=TyocSH&d3?$>%D-Xa=b5)~p1s4!%xgHQcSza4l9!D&dgo#P ziz!$R^3*8i++`FV6q3>7(w`eNu~an7ku^!{O?s%53=VBdC?3%pefoU4P>Sj7Wu9I8 zCVc6C@M8n`dAj5&`03N|KP33S^X%1k;S0y`GpFG%oQD4~#@m18+2`-V7mwj*hw&C} zQ41`r;wM^b)RK!d441ZHS236T=CN>SU9RE^7OPmo@-~=88CSRAYD{Zf)0ouAXrwiY J8W%KHz5vj1H?IHy diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ResponseType.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ResponseType.class deleted file mode 100644 index 93cb48a774a39821733b5672b41cad8d20bfa6a2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1580 zcmbVMQEwYX5dL;;-<>bl#xbQyN(u!6*eR)#l$3%)NNU_-Fht4~OI9SR%Xt&dIp0~g z=SaNei66ofk3c1gKp-oR{3yiio{Nlt7oTo-^nIS4o%wFYfBgB&?*O*&DZ|}3IjzM* z5qZNPjpI<({4fwvS_`6+#FJ?<^3zcwYKKA&<4B6fUk`-|#_*`!_s+dq=tZZsW;7b? zv}cG^->oxT{bwK(c?Q!R`M!{nVSA>y3|CswNt_J4G>9WFWSBb?y&w_3!h{;S%4U+p z2_aV`=OURPYlkF=f^?T5SE+U=nbppI`-`T_aPMfwY>b^r#OswQ-P|+@qSJb-+Hp|A zf{g;o4Egk{fC^t+6(sAE$Qy_!aYAn|ph8wR7|Q<+@xShy46MaqoO|I&P}KXC>TESQ zxQh8AI9@U_&rtBgI1&ukD%GiM4vzbzaNWVnc*Vv|+#>Px%?Bq8t^X*!I-{Q3)3F+% zCuMyqjft+)nW+|~yk5hqQuz&rh4xvT(s!>M=MXOK+B+I zUVdj-D%2LEyRew$u|5>3OyfkX_dWki#*qcXCb`QF446vzdloDQRtDa)P;^ktz>Wpm zft`U5EzCKX%fJJMmHlBrvoJNx&u970SxVj3h5<Bt}96S4>7`xePvIYO?5s(#mS`#E~M ig>~E^7PTWVi4ANXp(tTWY)LFg7!sCLj4d%IarZ9_sC&%- diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Serializer.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Serializer.class deleted file mode 100644 index a43232fb4d33396e295eb12519b78e2695bf35c4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2066 zcmb7FUr!rH5dZCA?DNGK2T}s$A8kluL-Fw^rKF~5fsoe5m=+_e5f9b*ydh_w@2tBu zB7Nei{T_X&`q(B?5(TM3^sOJGAEfH+`CL$Cia7grcE&TaGryS~|M~a3-vP{Hn_>ut!kZ{ zB8EPO;kscqeAnrSHjP$`dkiy0({1X{$QkzznzkM)=`}+bRm-V`9y;ndhPy=>Q=N;d zXIPG}8;;`&Ls%~DORgxjZJV_2^f+tsj4DH4I#Xd7DK=bTTaI4eZ|a5pW?8y2$-&4T z7lmH&>gmj-B2J(m(Kr+gFhrLv#}bbc7(`q{1Sy7ycy9R&3qe+wLYjh9^QH36N@;DK zw#!r*>73zeH>XW53<)D?D$V^qDk_r;ovKs=7LujPum*{0a}3+Zhu1V^RMC{w@u8-u zw2_P&QUCZs89hFnS7zC2OjS;PiYh5(`(~M#QTtQMctnk+ zVkf^uRq1)2(b2fxfqJIJg)dx>&xAG72%J;`*Dx$$nq-*m-4RW<*0#AG7Hs`MaL1Qr z-=OyTP{N$ha35)gY;SuBg?Q28dcD?I(hIa~1|DOW(l9Myxp%%{(28CC8HVW#RL?ef z3_3&7<9n8D@{SXRO8TNc>S*RJ+i!E2*D#9(h6m>d*#W}$7UpL40^QaftI50ReXL|be;2#X}4>9GNdsqF=(Z&(swJX<@M4I!{Rx4{=c7G0-qum$3rYLjQL!2 zXH0O{gTrL?8TffPUf}<-us*`)64oyWmmb3}&9p)uIdySQ+Lu+r5e}$wxuoGvNG6Ch32tI=$O@?$J zlnzjqNn|K~1>caqf&wHSTjXVgV7Q?-<6r+>Jch-6AP&?}GWbgNa?leGL0} T-dhCS)CwG-;qTKrXm7Bn1~$iu$mafh;z=*3KF! zeW>y)D)qHbedt456{X5Ug?Q|bs(NO3fyF?IQpuW`bM{=m`R2?S|NYOqzW_|(YlbPu z-7=gex6P*IIZi_uwT8uQ&#>%G*A$-Hs(CG!8>`&i#k|p!Z2;y@l4MmAjWd5(JN+*>*f)LR%o9V(3kk{wWRi9z*V zS%Ts2MX87|OS#l_XXEurxFNT+8^ST~e?AE!G)SWxx&+ZfkOl3dB^I0w+B+*Vbdv9C zL>DWJm($4MvUKRD*sr*`!CeC09c-`VSq)>!Y!aqtCp9yt_a8B+Si(EQV%9&^;r9{l zc#`vw@5MtnnM1xKfXeNvdcaf{(nq}mzoUG$Db<4mVf z!tD+im|}QP_@EGSH+kGmA&z?tn^6YB<`7{ZNDM7UK6#$6Yer zI(Pl@(2pBtkS2)-639r3D)1pg<}la!+`U%O|(ZT3t9c!_{*=Z`D19!IhTnSv$OJ?^?p5S7h$^Wnt)8wYF?(&o1?5 zHE7Y@70c$!t(|r5R^_WBUjV0OHr7nnl5(ibx5quY&?gdfQm3!gsVRkSsa2=t*7#FP z2JR1IterxJ+f;^eDl8RQ`JfR46_OG(Ycyx&`*KQ0Pl*4G`Y3rX(OSW^Bfsmue+C_p zCB96OK@o^t#EX9*{i|>O+&7ZSJYLY44h+zVE|Q`UGRP2&(}8;11C9JgAUa$0QJQu{ z1HVv41;>a+&j`eD14DEJ+ntBoQH-7895D3J(Y7Q*^iKpMVZiSwy*z__znUHU6O+Z? zapx^QDNgJmUA(!6-r}`A3>5p-Jq-VL1Xi+}#4w#x!OwX&h!IjKi4D$EuH-2yGJ|~n z{YH|PuOOXzfNd0C(bt?xu;j4^qnrsUb)Y=%(^~F*m69ZBF683s_dh~o`}nkyi^pjl zXG^(wQZAI);>68s{pwpx2XI%&BaT>F(|nq{2tks9_7DSCF-lT^B1YlmQGAIi&AXIx zhTJ}TiC7u4{_k@ffo^}y`QxBJl5#{K WBajuiAuuG+A?VK&t_buAeDNYx15PkOMt4nCME%b|TD9|Fc+xCEjiV!qyrAR4AZHbV2K+e`Jn{4dJb|Q`u z2Yv`AuAGoKpeRRv6k>Km;lc%wEYG|*^X&1AzkUDm6~HF$Gd$JiEYw}8L^pO?CpL_d zSSlCB>eLA9OfPahBf~>!`qJ#ajbzuwS}j#|rz;eBMKFe-CHf*vggOgfG+Q!qMR*K_ z$FYjt69#X2rBOy61s^#S8FKDTY#Fxe|9kls!^U#Gtz8nUu+{HS)lM2El5j_!ieBQX zT8-bJ&Au>gX|`4xK6qNh%u@6___~ut8P@*pG=`~j!M=3jL^we;@lM~P2D5Yv2sSf_ z6jEDQo2ZiwhU#!I?elr=^I$mec`0=!{NbQ9dhg8-2b+AIZ5K;?^r655elQt$i+nxz zYV__XWhig-v5-%X+GKPW0xL}{l7=*v#`3bZ!!S4Q%xYIU>$H)pEfKY?RtyjSt@A}( zW0?3gd-8XU(Z;T|9Zj{WPb5R79xM60*J(;~B$^2^({&wDVS>sd{F5x#l#-^J2x}$% z1^-a@OeFW>RIqT+Q!ehvMr>nJJX127Sn{|)Oe%gvmXl4ziF;)Ch_6s?a15`8sccPS<{VwB;WB24#oRHN#XJ^{QLykW7H#TW$(*Y{0Mo1I AwI=n$0e!bCeVfei9>q%fKr;Yv~h!U$f;06EulQEovpd}yl3sM zEuK*R4PJTTffocQ5=bcO6XK6T%$}VOg+8EI=i8aN+273kX6EmIe*Y7|2I>s=W7YBF zzL2~hnmCTM-;P2djUUQaiff|=Z8K29-xq2q)b6)!(Klf%b6^bBBR=GQ#AU~SF_0$g ziA͌yXJ40Js{6bvk2nCJ+zf610wS`LcHAe)DSJVV-i6KaMBjq4?~#gN?&WoRBV z%q%r7vfDQ*l%1_$xyi7YfFB9dQaqH}=TgR$64j*r=YuHXtw<2i^c(IkH;b4+$wL}b z47r}rns=zQ@_$1y?7jgY2pZkkM4|MLhCO1~2qk&sKNGL`ATo7IA>lh#dt7ye+OqkU zu9lI*j7?+GBhD%e#9@-wwAF8uzZNRwQBx>QHN6a;5%phWsNM8qe=)e*)Zh_E`Fh;z zb4hLtJJ;lV@f?Fln>s6RPZ)m44JVt^8>Vb%`zn#zN>o^tMuc_AbhysYIz6s zm(Fe@L=}cQ9+KBsqgA9Hc8Xh#`3#8} z=TU8C?gX==pr4UX8crd19zIJb7O6T$nkF1uY`(@)S$2XsdlAIN-E)^pk|`Da2R6SZ zm;1lq!N@CxC*OSpOGj5PDt! diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Success.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Success.class deleted file mode 100644 index 7cc9b5cc5355daa9d27d2bf8878f19804c8a28d3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2686 zcmbtWOK;mo5dM~WQH*5MjGc$;0o#t zm;GS7Ev>B{-kut<+Cx+BE zmrJ41c)l>mERipeVFpR0($J8hpz^sR7|O%u8qr3Z8A95!BkuWIoPkvtvb1}xM;FT% zsu`FVQ(KJ_y64>9;sNb8+Qrt9j$2x_+Z610g$*6Y7*02R={jC%XSYRNA$j20 zZmH@io`ut(mN?6Byz!hjnosP&ZgH}xiikUgivytdBoiH1VIza{xM1KME;3vlvH=bn zr~abNQz%f)MD@mSeb@@^jX|Y8gG*@?G0Si>|DQsrOwOQWAb~PNeL(ho=R@Z;h~Opu z%Ez z8&p;|8O9DaT;o_kLNoUF!keaR zhGy!aXwnmNg#Ocprl(Kr?-k?v{+`LM=vLg)9#{S{+^}lni4-VH zKHlBy@B`Bvd-G$`QmI{`9O-Rvci1C;?+hm@LG92zpV>B-Liz!p-LV@@;d=~I@AbUg zlnm*bv+dEG3}{GBu6I1?w0PCqb%e9&^2L8=6HVgoBpqFGJigXxZStUQlZ_hqe#3S* z?7&fSq&(Lj>uswZ3Yw*X+-OqaL~cgS?*t8g-%)|byTTIR>})T8Eje|+%IIVidgC3C zs8GEnR0Y9O?+_y9bCNXZB-5a$wWX#VX}bCoctpA+*`1_&f-KTdHM>GmiL}Hm62;$; z{h1aTR_UsYfh^YOn&}!~1fwK%LmnZWg`;%s4>Iu+8TAGk84!dahe^WU?|ix+!RP?z zE`q5;Nio%jQ9y^bj}wSfv)0G2kuUy=%db!=&b&mnIQ0?}#o3oQ{mWaFiisp8nIi5~ zy2Y+@lrDvdI94mguBJkV{Kg_OKEh+t9Z^lKs+35kRzE`@LS1&2DPW48oSBFxzWE*r z?e;`GMGGT#Bl#MitQBXbW?$jcE}|!77>Ab5hR2|=r3i^h)W@UUV)%k=G*q!p_it;f zi%*OXRlo5le9sug+VsKdzA-ahnf{>Dkgtm9#b6XyjLO-{rEBF|6{EOpphnPIl>aR% zx4EZ?RWTp_Ze!s<`mBmOSR^g(J_QrFhoz@DDljUrEO1{SDPRgb5I7cIX+ghffwZ8n Q9;5_v0+RxkP+kxJ0o97DTmS$7 diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/ApiResponse.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/ApiResponse.class deleted file mode 100644 index 5a17f40b3b3190462914368be00629c352dd9c8b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3611 zcmbtW+fx%)82`@ZN)qDcW)Q2Q&`Lrufb^o^1@A#X3yMX0aS1CdB)jRJ4O3oPpX`6o z8DBf?v=2VCGZi{@rbBh65B;NRe`j|SmP@7B893+rzCGvn-M^E+{{HQEA{wA&MtQ?r zC>k|YS8AGN7!_VDS2R_(idAD?1vgUDCRJWDbgqVoF_M>*6{T2F^o8QBxh1u1g~-Rq zU&d)hsjf`<|-pY{g-5ynqfOteM_)bY~no)7AY*dR66>h2K z7u8B}NhvRLL-&NQI12u@3I9!N6+Q%3lu8|D`MPt{F>0f?BIKtdjI=j3qcpZ`SQSk# zF0E9H8WL*iN~L&3eW=tc$d%45vtG6gb6hc(k!oReVn+ppsAEgnI8KM?gfQ_?1TpOr z)GtZdX)yXKwvF#4{0 zKT14Ru%A*XdG0wKIkYd|V$?$g5&J$yVasr`!zjC%M@Mw2u2tq$GeoB&G$^Vn;Ta9x zqW{l@={*#`Qo}TvXVmLWje`Np{snd@Mjy}_fqZt`&8APUyE!awoU=VVrQS%tJH|e8p6+3LHi!cY*Q5q6r+MTXZ`@6Z9bh+~~e>)l%jaOF@N6)fFE` zHxr8tcFtx=uo%M(16`W$XKZ-mQAb2-lOmG5@hE~nNe(+(JR*hhFGsQa!!I6(+cq8z zNPX;5E*S~?WU1ZX#`=6V?YHTGO$QzN#kWC84vork+&OpSH z19GBW>VqPW3Y&IS*tDwx*O?8O98Jk7TuTpx<%|u+ZoK@)H`*c}gwzL`fzE;s2zoNp zFdnxf@G#Qu4~ONJ$&|clya)osQ8@;&s~pE&ajP7A@nf(}#1P|#Fi;I^Q8m#FPO^Jz zs>Lzx)LwTMGm3kf;MB6k=y(A}V_d1Z*pVrtZkE++n$Uh| zt0E6R^1QaGNYn2?~>VKg+mP#8|gD&PBzvOnXy*V8r|H*beG?RrZ18R3LkP$IYzZl%SK3ut%<`h*XmX~+Lz zj+0F?zDcHO0q0WUoXC-9#l*lv3yCoG9ux<$7czeTmrp3nHt6_R#vgF$&hd;t)SxHw zJ%!$NdfRbf5w`;5i$$Y$-r}$<1d~#91mGQj$4?JeN!HD3G|w25Lu{Q+3JgNzyPNgU ziNjm!0q;7Fysidv&D41>+cmKF<@~Of?Y!@O8LuS*CjxjKK@hDGeNNJh6CY7J4uq4| zXfv(RW?G}ov_{>uHp;sfxBqvFTj-SCV8X)7+fpq0t&w8TsYZ%HXYCZPQNQDYC&f&> zm~O*e#4a*5_?!l3*6H2k`)f2LP}k^u@}fhhuq7`!bXL$;u&mKF0leAD!dE69T&%*> zuTew-`HVoD`IB1KX!HjP-1EuD7KN!^(E~@8-6DHx0}8u`DL4_L<0I@9Mg@j|}mdpgte2T4z8uxEp$abaZv|G(1Y6FM#o1edb8 z6u2z7tjz`dPko!F`ANbfF4{9BN?x?5M4G)Sw1oXDNT*OLcV@{~qPzCrG~H`(AC+i^ z?n6qmv&1;Y%_p;Th*K-4PcaVcHEyqIF63cOEu4a!GMo~eWKP|ja-8yt0-LwyX M#_2kz0ZtG80e)!lZvX%Q diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Category.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Category.class deleted file mode 100644 index 630089b53ed2fe8e5c9966dd698684875ef7b912..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3046 zcmb7FTTk3Z6#mA0GiCwrZU}^gBu#)U3&cRuD@mJ#+?MW=6jD+`FENV)hFzQ5UQ}MH zJVojssFc@ARr`>KR%)PXq>3g|ANr%3o@1NE&|HXQ&zv(e=R0S-^1Vte3Et#%BzYn^PfC)Kn={19ZBe2t+WBS3R$m^s(ePEa0a6uZaXk*V=f#f;U zGQAH4dh-z^f0GeCH0+-d&`K4%rrpzB&v3q}RkdZkvf|oSgaB=V^qUTC!|~RcgEhTc zr%+@0{+Tompi@B{hXiiz!(*|uVtZB7(w5h1nrV?wORs8|jeB~%>WvfGo>Q-Qwo}%f z6~h_h09$wGDupAvavN+Vg`*rwyFx4+XX!9YCj=DQ-KuR-k&Hx@Q6juzudWM}_Yw7* zK}0T8u0SDt~PM8%U!Mrtiy#OY%_Xcnp*HKh(4HE*H?Nd@V zJbgj;bgCGswics%P;jG?I`6Asm990hLPHB9LZr6t=M||_QY3ZjzCxd*HU(X)BFW99 z(l7J0%)R{df!w)ue^eS4m%6ix98;yPc&8YS`EuNs6Hk9gN@{XKRnx)T^=A)a{+K+` zthNMecx<9iZS9hV2`&QU%OMag624*EL{3#{X=YSbvp#^h{_OkMM3b7M(E}t4lG{m6 zusqei9Tr(Dyrr(VoKoefoVpXDOxvVkMQwiibMhe5L5Cc4UD@7};ZO+&c^g_aJeO`5 zV<^1o1e&)?_wbtw+ z-#&yaw$NSbPK4sIa$#U_6K@59>9i~ksaf&q<102v^kr~_py&||0o#4|KvO}8q}aqs zHU=&0X(Z$%E!~w6@fz+j=xrn+YV0TB^~UrdP~g1VbJR2O$`eSl{?<5+0YbpD(%@NX z@T`P9Z`VbhY~GafCiJ5aQgmiF=UkQ{=OpHs^9>9Jf$eZkZ%KoLv&20Un12Fob`!(d z(G9%AFdKM3I~K?}>aypl*}zAPwNus{zTgKV3}=?YVYFUGnEe|~8yNoyiQ6&t*b)a6 z9lHC-H|DTTAU>Hw_eJrXj)+K6ND{Tjo)cE6ah5OR3e7P0*QjUiM+yT!VqoAeNDt9B zum!2ieh2CQ9UnhLj$M+L^R-0$QEbO0Ro{^CD>}v4T+tHd{q_zj)UVTMiSkySL#&8N z|GR;k+uA2ZOktWvacd63#iy8=;{(&;;x-){zisu~b{DdXCKpK;s*8+^9v8hX`dplH QaoJz*zH_vH|MUA_0G99-!<^$DYEGNm zM%(lq$MUp>WpdlsT27ObwCy&zo38kV-|=E#43G39qiblEVIOKmyVF|HM~JZeaG4=_ zF+dDqhIzf=w6v#&=X3X)mZcpTjbqQTHN&RXL69Tv*ImQ3y>rxi+Lq&Qbu5d#)QlK$3ZshOn;iCNAEobg-K@$c^=RKf?r^C9m4Cp{<;rz@nzNBdwN9^%nHu6W{E^~AK$deg(ShZzrwhcOT1 H9t!^gBIfhd diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Order.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Order.class deleted file mode 100644 index 4f0ee8cafa6bb73a1f79b4b0fe21e243db310fbb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5914 zcmd5=>r))Z5%1Z19|zh6Avh2c(jmkh;L|Hk1Xg4{EO7{sEEH@>j^pKS1q*k(=bb%b z=i$hCC{E%e&P!GLnyOUt!5@;UAf@7}M3JlVA%9H%fmFr$&FtRYf({@06j89--81u> z?w;=HUjFspzy6JgPS9@{jo8jg-mV&!UNv3YF7te`Y#NrEuh=C6+*PM!I5A?3)HQuW z&zE&;C4Y5!%_zDt3Ncd55{BlQV{^8(G7a200la3o%Z_eZJg-}p?dq;+gI=hW%ldNJ zz_iGU;TC|(@HQjPe z_gzLkflUjRYpfU!R(D|4tBpCmTU4vhN>MlU2<`R(kguB6i@Iwt8t?#Jvts10-nqjK zSIBRG^>G&)Q}@?#TTM<;KcxlyenwFa$JJo|Lj)TBiGDMjwp@4nRiE z=kRsc@9g4dvM{hyUB~Pa95n}P^LKRa8qPbFa(+!Ou5;T81aN*9{51z*=(z8~`pAY} zuE95xyIXn5b}G6n*6~%nighQSW!=c4ScKKl#T(ZP3zr$is=5nZEgVj%G&w&%`7VBj zS68Phl_`#>35{i!Qk0`pNea^!82$bE@_Auy-FC~Sm0#PaS#k zUKY+BPa?9<3+ju4y2vOglE$`hl^zc=CxXn$Aag3n;GCKOFX93$+Ev_Fo6pzT?e0oJ zux4at?obVER}=)yN(m!JO5V{k`uEtb@_9Ot$p8N(5tBOD7BNp z81nIg#dizbbc$}#ZGrg4wv`Rzc2GpFd{eCa8tj=EmK7PQ=%}v~!}SsjK~W0oB@_Z& ziHV6}ujqk=53rzKf*>#%v22{yQ?y7o#0C{?u&VRb3usy7eOE}4O;vH z(p?=Vs8lvW=)#zIpes?9B};-uU&YoTDjjFap~rVmC6#_9si=?dCh@DNiKG%2d|a{^ z5>o%Ac3^N2gI!`${K>s||KqzSlw)j)WzWxdC*vVi83^~YVeG??@n;>c51VA&Xa%Q$i9RYOeL|i>0w`DV* z-VeOeT&rS5^;cPvnaya#ek?S|afFd*M6<-WGQ zybtqx)qU4{R9|z*#R)^)ucjgPjcAGo)WIizh~`9~psWx&3fo;Z9MK#29b=yt+LK5= zjv8uA`rQlyTHX#Xth_X@)t))iG8Sr;Wy854dUv$! zb9PZLFX@gccwczf$6E4`uIY|mLF4FbfgIVsVe4s~u%fs=uUCESRKcXUdy^cPF@@x*F|i38ZZY z8g2`;mwH=h)VCcd(-vre23r6PZ3h}_3p7lJS^#CX15LCA8l|HxfU?_x@@;^aXzXwy zi&Og$fFfQ-bC2l7-1sJSkImuvko-L5&8(gM+C62^>d#nS!i}KM|kHx<|pueqc;|Q?*YZxV>&(8 z8;jKG`QBK}r>7TsV`>~s0+Y^6g~6#lcXlcQZrJC}O+|C#6O-w1I+Bh)q6?l+e}P@% z6isz>bar;i#2J7;Vo01G8itoLuyBl~@SKsEhVLF<#{p<4QmiY-ZRA^UvCOyji?1|t zEVx+aSo_83bP?Gia@KL0BG$A|NVyq2Zjr1Wke4=EBW<)s+Gvfm(Hd!^HPS|Fq>bjM zP5mZa0QU2cLJ7J`*I=b^#KyK164jxeLZG#J3W4rxq!5^)W(tAJG*bv%Hkd*W>AL6B zttrGr7mZ6o=upC2g#PQF(9+FE^ji1LhxAq8bUdWDx|cm#6LiU=`viT*qlW~&>d_fN zuX%J<&}GmM$rAfF>zOzOCK`3m15CrUCw8xi9dG`V5)aAwJw;v%sRvgf(t@J5JXv20 z*-#5vriCoKMfR~&M!4q3lv;?<>2vHeQi;Xj5(UrGpFuaD!-!U=V>G?v$eA5S&h9vJ zE;xcMIl2DfypOl|I52bLzoX*#KS+5%Z;n4EWnTDe0)Ky@Z#>oBg#4RG)NkFUP=UTJf8V3;)VaF_dY`@vDShuYF;3s7AKa#KPMw_Yp`6KQ z7pHDX^m9scI>6~5rx7W^%u!B9IUV8n?<*xZ{z*!EIPK-s%c+Oc0H;At!<-Iry2R-+ frx{KKPP3e@aGK*Z&xv#TAt#&DqQv}w(~tfKX)f>E diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Pet$Status.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Pet$Status.class deleted file mode 100644 index 280b4167bab08ed0ed10f22b766c63fa92a5fbe6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2093 zcmb7ETXWk)6#iDe$*Su(qRp*=($;|OG?A0GK%2CUb1N>Y6Qaam!c34IHB}-@8Lgaw zx4iK`c;XQ#PzDCZlSh6O!&%8>l5rTC8ELiW?74jBJ4gH1-@p9{U6g_`e^A0T6 zJg@`LbGX)WY|9O_wzp%Ev}Of)BQS#wPk}K!)c4FoQ*%srS6g;F?K%Cm{bwJ|GGx!X zrx0hD)LUL#dv5Z;^1o_3+Me0k=bo#XuIo`|o3>9$Uh(|48BmM_e_r-?n=F`EwUQ)|n$ zrE2X7?TG&!+udb|8>{*feYofBFvxS%4A%}GF~kbRIvM8c6@7ErV7R??A;jvbz8Qf} zxd_y)FvOk}G=0-{`6_Nzo`SI;pO`k{05)nYw^w{Sy20yi0k^A?TbwrjSnZO^BNxHO%7`9Dvl8CaEI zhD{;7Q-$J1=*-|MhD6216o#m`Eyr`IpJ&-wZSGmEU^au>m{c%PDfaDOwMP|;q{bC{H=thj2Xe&9fm=D-wSBGv}aae?wEl|y_VXCF}fL;SaKvb zLlHuZ5oi0P+9C3`yGN=bjYx`=%PHL>`eYSJPRYmLu#xW3jI730soXs(vxNa!Qj7OmF)5yQCu0%rL@%;Rxg8ffew;^R3C=Xj6oS{27{4YW4QVMS5^vZG#=5tM;p2Xr}hJe z(e;iS*lnwBbDMtQ%E<*qGjy$YR&@{0IgKyUb;>ZH+pbmXw40W{5nTeR?zK#(Zu+*6 zd&;z7@49s7`s9+Sx~}Di9kwWqVt5_DWv$qbH9t-DCa5)u`B70m(X~O6_-5$6%#o!7 z;-UW_M+Zbm|ACqt6T?kmRPkGr!6xmK^c@k2Ama^OA*oJM6KPt3h2$TQ8jaZRw5kg+ zb@3IJ8!z$1Xv9O+M{%_psXjIuiBP2{)Mt@u)p&{04-|#rQ(Ch$Ygs(N4b0*$<_P2{ z#;8n@Pa_)|3M5KDVf=gANTG`W2i(VJw2Ha~%r~hvoPjQhQRxNRpd@i&U78qwg{4q5qA4a+6e|y7WF2LdsO`U zTZmQhLHK-#`~ON0s>JCWY4LCijN=g=Z{ZRb&pa2?LhE&oQI0VVg=2tYkfZVsL^$gD diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Pet.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Pet.class deleted file mode 100644 index e16b319a5abfe1249d3f6da5f77c8a96da207858..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6141 zcmdT|>r)%o6+c(cl@NF(z#w6483P7MSeQK8+OcaJ$3Yl~iyx^=>ShsZSP&A~yCQL$ zCQcu2lD^WHTlev$GoAKBJ~T7M_B1mY*O}>ue(oR8|D!Wae`j|kEg)O|)@BCn-gE9b zzkAQ~-sKFC;3@K>P#(n&j0UX&_saTcEW(g{t3%ij8 z#jx~+hEVs&XcMs*bobqGOYt?l&a#^^AO z@Zwo4{+v-ZtdoL19Pvcd&E6)7;1RMz)@sXj_dbzZTA_K27`-AWKU1u%=dWwh(#_Y` zOZio;xF#!QPmSfLL0>RYCZ=_RlW$WiRdt1eg7&XftdddAuWqjAjWQ6*S}9*BbKOd# zD8n=%sHeE17uPOmCQ1_$1?g5S2ioHarxhIca9jtDUWw7u^h}hVqGuKA5ab_W));*u zN&z}1=wDu#&w$qpGtInqR==)QOV%WMnq^jtR>hpv%r)IS&Oz#EG)2ysFr9$+T9imF zYr^!!Fb$vsw2*J)MVQX8e~(0w-e(0xksuqDGCKKDFM-fDW}fmAPkV`Hyu`C;3&qL? z`q4i>V?k@#1K~c@MvSc+TykP5MBB&{RAZBz|9@^81y6~(Mf*g~iO~$ra!Osm!DLmO zLPdLMq_)F4Q#DFUx*4X6QM$zS9f4~{_;zqYA=E-h+rS+Ihu>I}6xx06yKp!yzD!pc z@hgZ@E?qy;0s3<7PExguQvS4QYB$iju5p9%2BL24&K(1Lo?eO4*GNNm%%zPbfEIUb z@R8cy4eGqX>o|dP>7sic18N1QV=m3dDTq}#B$sxMJCG$oVpO3rZz00k8}ROmCRZkL z>9TueAx0)i?v<9Hy-h8$MK;-h*J`e?uV+p`!gM1{d*FEe)vCsKpl+|@Yj(k{ie~E1 zvrNm@URR3IoAeg9_M3v@wZ1s3TiTLlX{aaP`lcWEOTiBnVXC-b8MNOX;n=-=yhIVx=lUktYT~KRR_H5)aCX;?vS&d zEq6^F#A>ig!PabJCORe1>?k7A34UBn%*UNgH-x*??)jv5 z|E@wW6!xk;z;C$Q#ZRiK`M&LOah3X^)Ti!y_@~eq=MxS#dV+5Q=h_;qSSz}T;;3CC zdz{04Y(uvs4sm_Vy-+~}eeB2@im-3KTDFXJy-?mXq=6g#>BjdA4oIhR_ske&eXhE` zsGFDg*3X|tm7-RD^;_opEGzf$?fZUmZPKS@c|TQh!XtC1z-NmrqIRkPViUIE*`#FJiNWO96lv> z@o?kc#luB>2d|Ujq!8cEe-5NPW)V^fX8uBLf5yN^zrd3>Ms$E~;~8@V@NNg?-EN#z zfb9nA+zB+$5~zoIn*gPD0u4O|h#eEBe%jvzD7_PCq$SWH8f*eIyb~zf5@?h%O@MMc zf$}YYaAeXEGvTGLcOjy-%OZB|eX5<{ll-WVfg-liQ-s%-9yCGReRer8CLk z77b^Tp)JaN2(3nlV{jLTc*;R@L(KoOaB`DJoRL0Wi@%-i!)1a$WbG`T;IB-`@+@as zh<=IjBxesN*0{u6eb~_$b~T25jp4z@@Gwjy8e$-}v-ac=17t=Twnb*{-72%2V~q z@haPu^EhRvS_<`Q@haQZ(pq`CULjs(yFywkpRZSiSJ|$L*2=gnBMKbv*U-z@iT&P6 z_=tR0y@BLXb3mO$@2@9%e?8Ir>xtf9PxStJqW9Mmz28lAZy)?$Bz=VD=tVc_H{GOv zxjP)-q~~5f(;W`F%pj_fX|^ul}7Pcd7bE3clo553GRI$*lYIy3KmU;ibG{ zE-&4LH{3)ww@vN?EG&o}^d80L!u0ji;!~WDA`Hj)@chQ7n06`5#B1X)oqXiXsYlM7 ze&o!gcLqzoLEm&k^fuo7abRS!f1qOaZ{)i}*Rl`DH_QIY;dh_jzC-8PRiF?pP$xj8 zK&5Od4=N2RZBqw94TD0!AlV5j2P$V%!N3RphD$=^`#0fc#9cki{gK;`pMH&J6x1Yk z_Wr3P{RXs;eoDW^`(yCGh4TFN0{IK{9sBRQbgM>vuR!n6yWrA$3nV0cpMJ1FM71k&Buz;wNSc;(Ueb)DSxIl$_&=6p+JkvX?@Rj0e*r9zRTBUJ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Tag.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Tag.class deleted file mode 100644 index 7b2a6a300d7119002c713acd069c79884d48a57e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3011 zcmb7FTT>KQ5dO~WZ5S4q-4#KUXb^B&zyUN@G*R)wk_8PA43dk(GQz;_44Ijw;!EO_ zKOt4VrYe;@_>fdZNX4oY(W*S;N5yo{49h@NNY%_a-RJV1?yvjw`TL*W{{S$8C4ny6 zS=Q`z!_wDH&$cVBR<4+a?sH^&hu2pnvS-ZKoYLvYcVgiy$5Nc_6 zu4G%wqXOL}hFvwhMMpO+SJN%a_H@s*NuH`zD*9r@pk;|=!z&U(Hs7}&BaH--4UnJ+ z#Jv^M-2r{Qtppmk^r}Ia5yTnKF@3vIbl{XfePqv(;es@p(ZYvj1(Fv`%k(}F=*dTr zeE%YPxUp|eKr5B)s&-FzJ;V9BTG3YZ@|tT~5#O~5(r-EBf#cn0_c!!PjZBT@`{vR( zf_4RQ921y5#EHeyn(b9gOIzKjYNkbJT6#shYTVOn6>p4q_MBSTvznbHn4eb zm{K^gC#-=hDZIg^v?|2HDVC12)Fq&hck8xAsWBW?Mu_mTy?$R{{18_6`FU|*2v5H* zeQb|2i0Di6x!p^F%L3o#4+9>F-78{Qj4TOKee_Ufr_qZuOjf^u?AZaG0&Tmj2SZnC zW@X86QaGzX<8Y_wj^)jzi!zAWq`pps>*fj3^3twoFPrE8Ym6s{A#?ikk?N8rp$U?RTPfzudAQNayN2xN9{#H8WrOS-31 zib&Os7*#sKjY{gGuYy&oUSf@gmWG8$Z9m8>QoE!`>h=SLK1po|x@JX^8%d>K=4qLG z`PoCcefz%nOj<}ps<>{QdYobhU(y*d7KKm(olvv6UIS=9G==CZB$6??DlK4AT{kQ-aVd zz;6(du|OL4DeANQMC=<&BLf-yZhS^7G@2z2ktqC%#-B-$@Hw>%035>?)TV<4)Hjh9 zh0j1Gu>S((_5+x-_pIKSA=9XWsJ}h)OU8qzj*{%Y@@T( znFz&`lZF0)ExZ{Rrqi-Gq(;T3j|*#(=*!>)LD5?o0=D|c0}TZsl41*|c{6BPcRe7d zY3ZJThy%FGpr;;$=w?3%2XCflfDC7EFHq0KD^DTK`>t^q1B8HQrOvZb=UEAP-pPwR z?fJi)H=qxNkfL*YIp?$tIVUm4oNrhS|h> z+0j7GQJ1|)%_cr%tlhL`^98>Zp*izp4x{xj!u(%o*u>b6NZgL8Cs){@=+NEA{$@6- z3-PHGIxmYCbVWppOp>TQ`GT-QjiY=O*Jy^hzd=27KV0bl0sZ}dLVASW{%uH;eC`1K zzu}`t$nlY+<$Ns>e;nIAlCp15_!*sIY|dy2i++0tW$N$KXo=!Bxqw&^Q~q}ow|2CT zijz6+W}q*=0eqtk$qX5{Lz}EUZ=#D~gbn=x%`l$&!sj z*_M-7iJiM2T%`xUq$-s>=pm^JC>2+^B)KXN`7!wesfzNQp4pw*W#iRTN)$|=?@agC zeNK0O-NQfs^Y<@_XqrA%C|$0u=gSqNq*qL+7RX+3{sWz$%-!sJ)TXRhJZy!&pxTv|V+(8xUVZW`7~RX0l_ua`UD;wn!V&e8!*^JSM{qlK* zq8#&eq_~DeB|K5jmMml4s3I-hXvbmKYbBckuh)xFhQ>MaNrgf$nkCcvwnCp~JdARR zJ=jUv|HV@u<@l09`T5myF@F=8HmdIw3;9ibbxV{>p0$>r1HM|tim6(+c)4xsg&H#G z&x|j{=qOD`DL~&)=+Uzl-t7EV*(#W&{N{EsZ(;_qRtxzH#!bCeu+C!>S=HLARjw}R z)h)~|XQQWi4~FTRO?%d!q%eI;p}1SqNoSa5I34*Yru{{>jf5w_){uQ`s?JbY_Z~D`NcTOku`f375Z1^ zsn|XH>RH%%v!3zT2f?YQ%TkOk(=4y61xT1xwil#AeeP&t8^Wjq*riSK_+wF#bP(bNd5=gsTjRROHBBBOUp(KU)OS(TYeAHJUPTV%LfNW z^9H7La;R}S!1DuHrG6B^@g{~pIV6Q2XhpuRD?J-R-{+QU0h{Q9(rUGzkKY6wt8nL^oxGN3-btM)&ngK zLAyTtfDSdG!%b+g2@N%&BOat_!xF_B{q)b3wDbYrF$C-hRoYId(sn|XwiBwfolvFi zgeq+(RB1b*qDw`FHZqscM$zT-)2cQmhofBn>NEdbM9aX7p?#*n9)}%d`&vSCdO>Ry z6L%n>_GtUyb_V6THMo=Y>4H0oIZdE?TpbQWO=;B$88f{B7)=D(hktj(m`#OtD4k7(cW5k|Qg4h`$Tvd&x-P z{d=S;59!2wG7@y`lMBg6xNa{dBbo{jL8X&30U)h`fGmJUZ#2Ef>VYq-XscqX4gdlcA_o{u=^UK05IT+0?^=0Lll70GYwGy8k=!N z0WjAp3cIvuPfe>RDEy)294fa_@(!+iL9Z-7pliLa?$UR`*0oDFdcSYm2^76QwCz5& zb=w|bd)2lF**0uD&Gx!&kFjmqc8)o>VDD0qN9JBocuE!i#

            B6me4Us6OYBEdPTd zyY$u{Dfqfy8{B{^;dQ-f`}*4W2HN-r+xXILd}D2VxhCIzIcQGqm!vI*>BL#(2`*Vm z7%BDPdGZNja1h?a>-Mwo=9G7A7-p4(vmic4$=|FWWheeXA51(V-#vPF;vxAKcrGUK z_cywAkJfn_fD#fd1N8y*N%S(%0MLL$r-2561|`Y^rGe5C9RV5x8j~milmp616b#(= zyD1Kl@89&HB9H4ZA3A(o`{=jw`E&Xm${l#$h2s3^2Ki^{w)}mM-mjw%X6X)n2rvEk z1}OrX_R||QA*fr>N4QnUXODdD7t}B4pr9c^BZ4y0nHO|OP+U+_kSZu5C?qH)=!l?E uL0Q36KPuzlNJSxv5{k#nCU&(jYEEjnNW?4lflE zG)Uwk!5jTLFZP0yyKoNN`<#28b1&!qdY8kjEDF&UM{bdnHl(JdSVWcO9={cbj)tI(&m0)9x$O_oVa-oTsFVXPBAZ25_}6^(RnEONlX@WTe^?gr?!c;@_)g ech3np0Vm)DoPZN>0#3jQH~}Z%1f0M+5cmT(yir?p$K@b!~5idTIY3+)xS1$p3 zYD+u(@+DuAM|YT!vzsBGVF}DZ{EVX8W2zXM1|;ay5%D}H@R;40Ay(+d3FCwo?9q|l zLJETlBQglF%h04+zx8#%C@!I7eT{BTQinJ=0YA@rYG&^m2(f?fh^y6MLR5eKAL5iD z3opDZ^ppv5fI3_tZ_ee?0DnUzYBUE>De#pY;I=Z15NrKqw}(=spu{%@H13Eett~#8 z-wiOY8BxJ^epquKbE240Q}ARjoP9i9V3u8!8I>A>q1K|6ufX^AG#@b&XJx-Oz}{K5 zZHk|ceKvsn+p)#5PEzpgSZ{T=>(e2{X=o?vt${rBE5Hy0E8?Y6zZjritDdc;V8IN_ zqJ$)7c7r0NI{0ppRox%#>8|Z&*lp5^|7s6^wH1uc1!L~}&Ygicdef@>s}M8+ZwA2E deEZD++gM|zO~}f~?Nc!3vTHXR|JNTY@Bx`AznuU8 diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab.keystream.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab.keystream.len deleted file mode 100644 index b92ca80caa0659b9a68734e5c7672abddf481663..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz00F*r007bey#N3J diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab.len deleted file mode 100644 index 8fe89d82d540f0f9c8b866f249f77e7623cde7a1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz00Bk?001fgA^-pY diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab.values.at b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab.values.at deleted file mode 100644 index 4fa36e1334df1f2ec8e7b6dca4eca0953e92cdb6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11858 zcmds7%T5$Q6s^SA$+%+cjzw>wqkk|NArLbTVNjN)=)Tia(ofT=)o}1W^e= zjR^_y6HMH>Fy85xlScO3T1+yJN==oh7%o$Y z1{&m0jK|v+ciqZGmf#|8 zEiNv9j3!*jNSU0QMQyM9Fp?; zs{4Sa4~LGs+#|8_V~(AX;-Z!9tNgedgZ`KCNoSQ7qOhkXn#-n|Ag{aMz z56$AU4tql?L=-KiX_vBTXV4lz%%0!VZpQH)c23HsT4@I@tGk6WB3|fB`>-l&etLx| zOkl+G%=PglijiJVNz`u+OnA?qV%igpgWQaSN8_=hfbElVr%EOCxPw%gJ%1eJ@D}r- zj`?$&y`*7KU9B?_7q=qn%;Ez9mvihp4FclwPRZ4zUy8H;6lJuAu-5@AW7bzcNNNe^ zOV3b+rICjB{Yf+z0sBUorMmyWw2OD)EVgVKVc0NN_@}BUnX(fx(N*Wej*vF_IPM_ihCB E7d8J4W&i*H diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab_i b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab_i deleted file mode 100644 index dd1f4b65dd53913193b6ec9d909a4f4977a35db1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32768 zcmeI%u`7ge9LMnog-mpm#Udt)46<0vN)p{An@u4ji@L>VFv!9r${_Wt_q9BAmvv@MnGXR11PBlyK!5-N0t5&UAV7dX%?WHqaba+B zD)sQY2pk+O45Z$v??+%gzWQe?BRmKYAV7cs0RjXFq$qG7QOzs+Hz~GhB0zuu0RjXF z)RRDKLzYdywT;))&2A+?fB*pk^&+qlhn`Iq7wYBSRPOwUkdvOip;UTw5FkK+009C7 z2oNAZfIz+i-SNBoSh=*E@2WKd`3k(nTw!AAGv8Hf1PBlyK!5-N0t5&UAV7csf&2va zV(RqasX4zzOMfYF5#vWQ2VZ~LV4DB|0t5&U_+5eRc-;Hq*3R!f)zgv{i2vy?S9j-< z?Gr|T0D*rla1i%Z*NTm)pV=Poi|XD>IrUC`wJGoz+3T0LtF>9Lng9U;1PBlyPBJke@ Fz5zm>FuVW& diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab_i.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab_i.len deleted file mode 100644 index 131e265740f37d77b7c4a3676d2a7704ca3e4a29..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz0D%Su009U9fdBvi diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab deleted file mode 100644 index 9a71d23556cac4de8c63cc41ad133aea73b83225..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmeIuKTASU7{~F)(k(1-2$G;7XzB&D1Pv}$L!-1tw1k6eLqm&;bKnvUO@cHvL@%Kr zq9LTQrOe9I?2mr^9qfWrYs>S%y`OXMxm-Bk^4fXQG_&Cr&D3zQ6EoY_5>0qB`i-_M zT+xKRrQe6q_tE}eUg`hy`d~(80!m2Uk3A^Ua>Y%_6^73;4zU0W)JcBhE9>}}zF zCX*+_42Ww*9!`53iJG8HW8tDo|3SSV-g|qvHB&}nq}0LI)N25z(AlPtbraSha%*DC zP$^n;ecbE{sDh?mJ4^0Th>j3Exq$J^LkXF(H3lJE3FA+0LOj(mb)}mNAv8i|8D#`t_6vNniI`G_ zv}V!}Eyw1lCt9TWsEKDAH_W2skSp+MPq8kf%BW)-_It8v{T=s5gvG|X9`qEOFUh_9 XWdqqjHjoWu1KB_}kPT!5|7YMErB5)* diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len deleted file mode 100644 index 55d7e48d140bf665ee6f630c52b8eb4041d3a716..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz00GvC005%^mjD0& diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len deleted file mode 100644 index fa432244558c364281f5897ea3a81444683a68a6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz00G7f0043TY5)KL diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at deleted file mode 100644 index 173b53e8670138e83cdc4aae3e46b49d98a620ef..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5659 zcmeHLOHRWu5Vh2c^a9{BpaOygYSr>tkDMVjO+04oAi=5l3j_iLD_Fpln3NXrS+PLi zD!asTChyIA{>*5#f{-D%`)G)>_A+t1ha7B(=;8{5;Trf&C@LI8V#x7W9qElAGxQL7 z4>Mr4(G1Dy9#hUxmJqGHZ4r-x2ZKR(8C;IK>(LFUVuPCG5xkwt(IJBb)&WXi$Xruc z`LFgEgAAh{Q7o*R+W|8Q5;d^VC0I8Z*TnfWSR^Xmzn9=a_b@JaJ3or2>LeA+b(ZlB z^@%!81$AwRH_*50CIQgaZ8L<(m5G&@OrUqhz7ww`PvE7co|BYd^^+)l44zy-k)&bt zN4x0vWzuN$-%h$lqyK*!`GH1HE%lh-(i3KhnYfms zK|ie%ey`~Gvdm{B_YW;~pPupixLaX}9dg??7yl>CVh!VvGGTGoQn%@8F+jFZ*aKvt zaH%d5U{F$q(oK-U@IxJPuFled-jOpnC*GHor_o55q`b@0jY<{tkvdGrA<`a`JU5Vk WsRcRl^E%YWPa0j*3FNw<63nkn{G^@$ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i deleted file mode 100644 index a17670a8ff12ba23078adc25157efdd57ee3f00c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32768 zcmeI)PbhvIf+t)LJq@)16nO{KvR-Z^5>#V z?cm_(X36B}KrOZS%E>|7>gjp*+wZ;0+Ouch@Avb1+S70A=`kt{hrt5@1Q0*~0R$`+ zsLC>omV@SMOPkUR0R+-oU|psQIih`OJtV^+fPm5h1G4_`x|_U8htP2NMmcV=r|o0i zqB|vbm%lYvx7_4K00DgjTymZ}>O36MCoxG8K)`MRkDPa+ZTudv`#8`a0R;3Bc$26% z<>MiJ5|b1G1Q0*~0R#~E6*!Tn>?@xi4+Id%9D%SznVWVmr+cCY88CkNSeEW{G9Lm~ z2)s&@$<>t$D|*qx0s;AdztmR%${iN+5s$0thG|upl#zxWaV` zjLL`zAb>zh0{ybC?O3ZhPw7MKjKDtvyRyC8=NbIxZ8j$KM=omx{L(J8IpwsrE8SET__+|h z_+`Sa>ioLR{c|IUy_v6P-Exx`0Xqe*rFnhrLcX0dn9gxS1t|goWO0ZHe)1gDeEh0LWk*9` nGz3ONU^E0qLtr!nMnhmU1V%$(Gz3ONU^E0qLtr!n$PEDi_PYwp diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab.keystream b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab.keystream deleted file mode 100644 index c0e36ab9e46a26422cb0b690807dfcf4585bf523..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmeIu(FwpH3;@w?l&(-ZiAXE~F%skcg>F%}`@O$+dOYG&N12xHeM#-6BgICGvNCqf f9V*wf`x^%#fB*srAbUEvZxFQ-@7ISG|CHDH1n*rD%~4wtuic zC7?&f0u2&s{6N^%>{bTfGv@RdHwGj@{d~qZebk62TcZ-gkh2R+-EE0mcN5GhP|;O3 zD3iFvlF_2aX*o)~P4GTYOA;)qIC3NSLR7>Z(}Z!+D-v2(q+4(S-<85^l=$*0|C#hI mXzK+USDw?JgxS1t|goWO0ZHe)1gDeEh0LWk*9` nGz3ONU^E0qLtr!nMnhmU1V%$(Gz3ONU^E0qLtr!n$PEDi_PYwp diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab.keystream b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab.keystream deleted file mode 100644 index c0e36ab9e46a26422cb0b690807dfcf4585bf523..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmeIu(FwpH3;@w?l&(-ZiAXE~F%skcg>F%}`@O$+dOYG&N12xHeM#-6BgICGvNCqf f9V*wf`x^%#fB*srAb9z!NtXE^K7Fb7cUn<-CP~}ANUveXNkL; zpx>QBtv1rZ9G82Sd++;kFEJ9)so1D117p*uV{CLRw#q6eg-dibI@INf&THv8WA#v8 zmcVC`Gl7MmLJ5O{t6+ywiW_X;fYBvJa2zFCh|z7xRm{DB#x-Y*obLidMm<(qWMQYU z*^qUFKC1--W~;~c>H698c#Yb|LE9DT!0Nsf*??@QNQkSsW~?(DIrYax$@#^fIqp37 zIdL@4yp}q!)B*X^&jf#$7(P2ALzAN^t-+BYmiPKUirT@?-XE%e_CP&sy)O3`-tT#1 go#1QY=zA|`^=I16ygi)tSN!Hw``fEeZ!34VA8|&E;Q#;t diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab_i b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab_i deleted file mode 100644 index 28d0f1a654db9847fbf5e5eaf1f509e47abf970f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32768 zcmeIuQ4s(T6h*;nRFgp-*(gQ`UvKs_IGdIp5ghzsdMcgK64>Q+XPHE;d7Ev${kRJgMBH zB@2%71ZxAoHwmeY_qS?8v+R=-Uoa=vKVeH2Kj29A$cSFP@D5#a{|&}vi%iPl zS18Km5=5)aGA}SD>t#yzKf|G%d4h1Y+1ev?%j^Rrq{&s;c@J4RT7;&s*-`<9}{)4{M#|wA?FW?2dfEVxrUcd`@0WaVMyuiN-d;^2?o38)> diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream deleted file mode 100644 index 3e846733e62108a00ec1617239cf84d000f4a455..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmeH|O-sW-5QhCF9&|-iuvSGx5iHSzl%h0#oY!QUE~LBb>_n=+-ffy{o3eH+cuOFs zyzflrnVH>9gIUX1(9$Y0CU>olwYf?pDWkizz4STB6=-UCxobTDb*#DyX_OwIbc97h z1%eN(qS7p0hM;@WTBS306mrjHSTOATYKX}o_)Nzv)k0wLtL4c7`nYY5Xd&!*$gzy4 z^Xh5IWP;vx>1kb~NMRt0oO=FM&oVC{GWs2m07W~!-MZlaM%CWPjI7kYh-iJQ zn9i9vK4He_gR>qRJbqX>WP0KvNx->Nruzk! z6W`Oy&0DelYu=jeCogyW`tVkOBfrZ7mHpAw0~(r?+u7M9+>Qyfo1R9&gReI4zDy-^ z^$EBi>f^|yP+l}@mS}f{H1e~R8T<$y(N)NMOaTv81S>@%CP{_cTA}qf+}>&lGuWfd eg7;}vz~q+MXr6{ZL!cqh5NHTA1R4VWN#G0A+xd?G diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len deleted file mode 100644 index 167eee53012f56c4480c8c5d9c0ead1d76efc0ad..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz00H*N005}~n*aa+ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len deleted file mode 100644 index b67c22714fc81ab1e8e714908a8527742ca907c9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz00G7g006oGvH$=8 diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at deleted file mode 100644 index 7af9d581310d2bbff463ff0aa13722a403b8cd87..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7371 zcmeHM&2G~`5MIeIk{4+A8KSgRIaG-fe$LbN)Y-<~U1rw^c&h#)5Qw4{ROq3+663^; zC^>N`bRyqu%U*x;eKWH&vs&#U^UU-_t00yHT61W2OFrb_Gnha{smk{hmfes0H zVI83gCBJJ*%m38@Q{=~}XFiqIZ5)D`MP4Nlm8na4jz7kiHO4gX?!Xr8|Dvtf!!-3dTk$ u%NVk?ln;qdPo#oAR!4F?gpWp;=MM4%9htTM{1lpGD7{~FE5Uh(LB1;%{Q9P=rEkcV5yeSH5UF?vul!bK?WkF;Qdx-K6h#~$# zN|p*Txz`N1fHnu_Nj+2{i#k>1oA5o(S7Ri&*mTbtx7cn z5U@d@Uhglbqp2PnX5DMXF*)>>@I0`W5y$KinAYo|VWoPrP$$l)@zI%heWCVG--Ru( zp!PrYzrSO8iZ;DYGeh4-P1hkG0TTjs`u%M>w%KhWn@sltCAuzKp^ahp39R%&phefA zqkW*%i>zESzG(5*p_?yq$zUx42q1s}0znr@=)QY4I$`90+ys4goBKPe>%M)xYRYDV zAkH4rb%_q&o(*De^n?Hc2q1s}0tg_000IagfPifR(;E25a@|GS=JtEuu)ZHz&kXft z`-p3Q@paSF>^|FI3#8QE+U2{UV0TG(2q1s}0$vNG75M1;WZ3Imw|OJ_{7_L7x$1Vk z>2<$VV5%>&YP!yT^ULHFYbidr-}5;S0R+qoyj6)aok{*~(LA*$72YZ3#)-KuPr?X6 z009ILKmY**JQP?~R%|VK(8EZgauDd&^Y^XPwaFYJSc-tP0%MxI`O3XUYXJ-mKA`ud o=U*=^8Hy(s0R#}RP9Uy{my*X<{2qKz@9%>}pEvyOBj5G^0@Pb#rT_o{ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len deleted file mode 100644 index 131e265740f37d77b7c4a3676d2a7704ca3e4a29..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz0D%Su009U9fdBvi diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab deleted file mode 100644 index 9d08a3624d7371fad9176044c5e824a3f553dd31..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmbR3vzw0r2$(?x3A^zoiXg`t~Nih!9 z=4ml&TuZP@j`{MgjY%T0?7evOv&PwJM7(Tcmip~H$Ma_RBDWFH`VJERwG$2k5P$## VAOHafKmY;|fB*y_0D->>d;kTPI?ez9 diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab.keystream.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab.keystream.len deleted file mode 100644 index 9a568e9309b6c9894e7c66f76936239e410ea0c0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 LcmZQz0D~z20Gt4o diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab.len deleted file mode 100644 index a9f80ae0249093f1db8b14f71053acce35747e3d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 LcmZQz0D~C-0H6Sw diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab.values.at b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab.values.at deleted file mode 100644 index 33c7d6ca799638d1815cc94c15997eb434b7d667..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 58 zcmdOA@JLNeNi9+cN=?o$N>OmjFH#6dEh^3|E=kQR@klJr@J%cTOUx-v4KB$qN=#2> IWMG6K07@GY3IG5A diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab_i b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab_i deleted file mode 100644 index 94e43615882bac166535bc748a7451df99d21b80..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32768 zcmeIup$&jA5CzanIv@!W!vYL}L^23tum*uCswuXbR=soo#Q({Q6e$|qRyv2}cp6lz zBtU=w0RjXF5FkK+009C72oNAZpc2?io~QGw-XZ}41PBlyK%l$8`Yn$6?mldg009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N z0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+ Hzz+g1{dfpx diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab_i.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab_i.len deleted file mode 100644 index 131e265740f37d77b7c4a3676d2a7704ca3e4a29..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz0D%Su009U9fdBvi diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab deleted file mode 100644 index 25bef240969e4b5e4f87a124dfd74a3c4f5b4270..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmeIuze@sf7{~F)ehooUL*N#H?nV6pL7M~ytql#9nM&ICDuD-%Vms#osQnFQpLs@--XPJA1c(>W`JuJw2753%0EX)2o80j%f-a8NzfE|xr-iwI#%wl)g)vPysEWU z_2dA(=&DX6^$3L{EK({Ee2ud6;vYpiE7SGpgl~+?2Cg?Xv|=;1Li=>*OzQxg^~J$( zYN5^aBt@Ena~Dkcy&f4Hm$MS;jA>4(7yrTAN`U%0g-d3P3ezM7JKIZc-z&D|rg8IDtT)ZOVq50ruHOLO z3vd)0J(Br`rU#%`lW`}z*o5wcK)d-jf6APSZ&L~-KLL;G9AlF~dHUoc(LsYW_PdoE zoYtPTDr6rsz~hEsrKpvVpu+7oX#LGSY?d&C4Mkpi;j0E_mwCJWW=Ki>?EfniY=vJS U5C{YUfj}S-2m}Iwz`rH%1#KL0fdBvi diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab.keystream.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab.keystream.len deleted file mode 100644 index b1c61efb430c2edd7858c26c389d6ead81b91298..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz00A}=002k;I{*Lx diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab.len deleted file mode 100644 index b797c4d2ee86fd517925c6dfd186e4c359366499..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz00G7h005EziU0rr diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab.values.at b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab.values.at deleted file mode 100644 index 5ac90143bf1f50fa9817523e2b42678109ec2d51..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18862 zcmd^HO>7)TcCO*f^z`)nusK6g6h&FIL`jrniLgqjBG}}xKmz2F7!xZZ}#xlXn`e$ql#FuC_h5?kzj* z{ku-{fm1tl?|F@uv*&(CB!m#drX{Qad%zOohAqYiDv2Xw0QE_cI&i9Wlumuv@M_ii z^``5!@k{smV`uxrcBB6DJZ_4__3u~%V*~u5j*8ZRi7V<**7H?X)ehksWol3L_!eVg z7K1JhmP`}B!UU3E7z1`{wP>etVaytK2H)oDn4MME7QS<{rkx*8jU_6{)pK@X+$^O^ zXjLiB=Iudsm8=x0D;o`lA`MEN4T^S|#=uzIH^v@TW6814+an!gkIJzzi$OJu^Y$sU z8Pk2>&S}5RIG4^G853Bsv*O}fqqR5FXu5T$S@jx?T6<=@R>dyO;JQ7t;d%?r>b#hZ zZC0)Cww$)tI^6aSTkZ^6-{RlT3-giFb~hYv9|Mg{uRV4?a%O5yeQ)NT*Q(a{=C3>u zhO@JSAG-@y6tA8-gf6j2`g3gs*So+yX$%mMsh@Im-;En zXR0=4sN4Bi8To~Qr4ZtW6^VJmdqhU0tW2Sf#gOE}CRs`LCl$%nl5LI`8T(28->PJR z-W-saSCUh}bx~ap()SVMT!!%1!6-JF8i9wp}@Z#Cn`A`_C*7^v{=K_DSk8+B?!< zR)4!=uAWvpD-Ru}HIzj6S!8|_ci+@@(hl28vZ86AZBp7v zMjh#f3DzGMVXTW0b7+ijLg*#Lj7t7|$`p11*ec4paReU?tt=lL7p7w1YNr82DcKEJXCqRQLDK; z@NKtNJwVSbVF#6DwH#06y+$y3jGWjKX_^Gt)#QQG6dy#4>iVO{=yU$Kne8>7EAl6Y zUbQwuGC*rl2u229L`58c|5wsK^QKgpfG?>>0&YsyD1xVnUZfuM5cTHhn3z08^zUZk z)MBAzg!$ifXf3N`l)&+pvla8a0Z3=Z5(;v;Sqm_h3^1|$sku7MO0yVh2Bo>2oh4Su z>Jp6@)vGt4Cb?6;t)`M??$nmFO|>6hwVC{l>VcP2n?rh@602$3I5NhtRHvVbvcdEb zX}jO5p^F&KMx19+H5vxcj`2E?X}Q05=(atv7^?-3v&NMOj|_+p09R1`L3Vbld*aQ0 zd)<`NkUxV6F~!WO&K8Mpj;u94-1ofZ>ock?)y|8|cB4+7ipUO5!@fP;{l@Vn4zIeJi?F4pUpVykS$B|xW^XkPnob?cC02HR zNeoOR{@^uVb|eub>B&QiF5(;NpWP%aO?mS(%?dLn)F+&!&7z%zN>4rfbPLy(z%}_y z;cKJgnwUWNzS(h2K34cXnT+6i0tSJ6uGGWN;93<~Q|Ijh%ndlo=2-}u9>rLv=8T7*r?_ueq%jCu$~?-Ca>7%(82j*le@r^o5JKK?2E_lUgEo#?ZG2s8vAiYyxlL#L6D@!HRW$M zDbM6I`Bw|u+isI6Nr7kXPe;XdfT_5dbs)8C=s&5CCg;luP z!Das80elfHA2|m@wcA^b58b*bLPyZh`ntQGD7K@mVib;c?Eq)$R{D8ETJx~QfO(h~ zd2mL!fEz7$xB9Ud^xLY6%%j6xsnP5v@eC9~t~n7B%8 zHzC(z8Psy|bubAi#yP<;r4$rL8X=zn+ZdO`(e&x0S;K(eqvC4dth8AYt`pm?KS;SZ_I7roitMZY}VMbMvNJL9zYS5j*Kdb(q$q@x%} zt=_M0lKWPP+`Ob@ZZXoE_4h7Yv843oSer9b)e?v;35j&aZ$cX?wK?mEP;E$?_r0MZ zv-iR_RJv17mD>~PbasuR0{9a2_b+60^_N#WkN^h)`nwYkq{R_oJtn&g5iAfc(u@m( zals+Z5+#YGjSuVeT!n+Kd7wi5M5BUK^`*Gqg!Ui$`#7YA>=I<32M#qY+rv5%)i+c^ zr09h~C365z0BJsGp*~RaR+tAU9emuVcTpI`44xfDq;Br2c}8KV?Lc5Gdh>*Tk{aj7 z(yjKf<+H~yZ=~p|38W>>OFq^Hz#SRD&4lT@Q>)j223v+9D+vl~ET=0ej<2UVS_lXr zK$#}S06&Wqoh5#|-{)FrHfz;w_I42uX6Lf)#}P8{4cF`2F4Dy+Xx(ffXWa6tZX2O9 zXXk?!g2EfJ4sIwQkyoK_j(UsV3d^)o>wb*->3wDHsj=gX`~OLm{tsc5F4r>&!OCG> zb^MClHW}^3@+zgS7nF0B?6M89a!=7>&Iww~^y(DlE9T(is-RPH)?yV5BMSyEgsMbRWkWoM^^Y90BG5`THN}uwOT$937v)XH0dY(<3QtQXN z(&zp`o+H~AiOlHjdw@(p8=V7Z>5u3z2T~eAFj(7e6S5{Tkn#4b?M-(VK?(&FF|Of+ zm<=T(X5I}j^xZCyiErL5B5DG)a%dqIPSo4+=YWoh!{5KANRY+vj7dqBVFCmNNa>SW zPjhY|D{~9k#WM^q1QY4N2=fK@*9m9_w70sD{yb7oM}~#Yb7HPv3@EPmF$Mk*0+|;R zp{LnAtb5f1cPY3VvdvKsY&5)L+UdeFbW?JD#F>A}i!@h?sym!85Kjpv|3C(lj|@_l zM*o3`jy32K8MP7isyej?bSkM)zrS)D1N@q7uwrPz7XAiqaK{=v=LUZ@NZ?HT`5Qhs zA-fSdMw%PaJPBzg7m;j=3;|N+@H2ReB;1SdfUohXF?`EN-!Mn|WFkT)w9}Ogd;6yH z4br~HnD*m;t64rhkzD>Vi6R{bOH*;gPg?k0QS}+*1f`$R(HGrZ=S&6+7be0};}TD9 zw(I0(DL5H3x#cett7UbxOdlyrEPqXt9LFTjEPtIqaf0XjbplBiLnT@K`D$N>f>j-v zOBtz(Xg~6FF2qencQs_=6wz61-z)uxvpN!kP%X%`?>BZ%+yjnc;b%xKHsvw55DiTu z1e@GBqc>+U0wxqqLZ z+}cL&u~A2o>02Tw&xXpchstk=)OMr!L>S1~IyDLjryJfrvNh(u)81E6BhzchrHED4 z|0eSjx5N2~>`C$yj}f-T2h>ZN-IFGpH6n15BgTFv-&xuc#_grGrL85AT3%YXEi&sH zTPy4D-4p4Jg{@o5BDJx8Z%ZUM?r+6D=>H`7$ZTEG3@9Y_EYs&lR*AoP4(l=~i~4BiY1*#|dhRd9ijJ0S*H1OZOtm z-70&Bx~N-@L)kXA4r1dQo`*brdM2g51~#*A$VV>$FmiKYhkhVy2xNSUwL6uFgPw%j-7wtZCe#aA!Sg;R@Awy5V3GJ$#Dn1D z^U_ZMz@$H+ybAIl&M43Y9>mSWmBqU;I7@Q9PBV~d%rLxgfBiCS)Pl^6D|wD zrnJ% zR8yXWxDZ<`ssE{Zn5+GS40Un})g$&O+B?H)^f|0@t2$rdD<2(CKW}6_zmk4?r;cBitSlUD}ZfXAeG<1O&xbWQw^_Q;Y5HAx`q_71e7r{K;L6?%gYj891+Twi# zw-YkzR4SsB@?Uif`v*Ag0t3ORk4hFfkR(zq7N6P85qaXfl3L*f5qKhqFuel3&%v=_ zm??SeFv*?+H8=$mCGAy4nWz#hm^4~hvS6dISD^t^qX{&+z-FO9jeeJn55>*Mzo9pr ziYSGifK8TkLNZ)dPcVDz3HYvh0%hDT!nlzgyA0zt9X4)PPpctJC;j@NqW7}x<{+x}@6 zIqdSzXh<@pk?f(;eVWSP8S3y`VOD|dS zHOYl!SvtzHj8Lo3>3ok}Mk&rnmpnw-WZXhUhh@k@UC3yKx{!eibs>qLx{#cYFKqQb zmX2DCt=7Tz;-eOHp2`nkb6Gtem(}BOSv?+?)#GtF8qJsj;k$_OE`jh}4immbC> zk6{KX{;u1O)5~fy=F#U%^IBwsH<0iu&~CNWmSI4%hHME31k*15;7cv^Hd7i5vQB?L zqwThopC`m0^&wy(s-{HlCDiDk0O%O`XG=W!?*17Or91u;pD1WS5r;LsLUa+l(M1=$ zKy)~VUgA<~bkcx^|Nd7%Z=R0=1^v7gqDgZq9PyKH+y?ei$Fx9CB|kw#BF@?VA^F&UbQXzCI^Igw+-@4S<CuVn`!- z?WAN9BAc=BSd929Hd9PpbKJvxXEWW$`ThUrGtIeorfF1~ic}gNGm=@>vgFkeO(X&c zdy24NFaa!0tg_000MRk^t?Av z@px``AJj(xf#3r1@;PE}A$vIZnVf+D0tg_0fIfjXxgL2FhY$2sAQ=G!5I_I{>jK$w zomzP)xVN6bNCXf-;0pm+Uy7Wb`Y(=#&F%(qXpH9bK-j$CO!Qj;hrA!M)>E#(J;~sM z8`4|vq$|_l7HRDt3k=EJE?Z9LbWbr=-lx8tc=m`M?5I_I{1Q0*~0R#|0009IL_zi(*`Mz?` z*VXh{t46kG_w(02w|PbY0R#|0009Jo36#tILqfWvHQ0G}9rsA#u_nj1UG)R&dSypn zX;f|Cezp-nz&?QmDP3IUHuiUmJ+jXFj}M>h6Edsvvb58mH(hO3S9F5_0tg_000Iao zH7*E!yY3h)%n->3wfB*srghs$6G4t-+_0XhQ SPbro4y))wK!g|8r9Qg*C%2)UR diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab_i.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab_i.len deleted file mode 100644 index 131e265740f37d77b7c4a3676d2a7704ca3e4a29..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz0D%Su009U9fdBvi diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab deleted file mode 100644 index 539c1455905e8f168b5784d09602e3235e9b259c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmeH@s|o@^6o!BAcQF`Di((M=0mN(;j5d=f;!9ZUf>AKpMXP3uut|J|&4TyK@n6;j z({|w;nE7VTnK{gS)5barM&6mc$hnJR02p#93@7t@h9x+|3#V53ZhrG#-H#UguXtca zc6hl)7J`8F7TJ+qavTD-FOg=Le2N$mp#BiC$>m*S9t9RRkzNewlV%(!lSlG!W&Z>) zAqPpIMV3;4LGH=TMP!r)+GI5Yn50df&hEec-mWz@pa#@{8c+jjKny3Y`64<4kYRXmTIX}TuaU1uj^d@8F5f}kLZc=4H>q_L=HF9YV3 zU6SSZee)-iwK+~m$*hnrFb5*Xb``vtQ78!N8raF|Bv6?mSWIS0;0rX_}#YoJA+Zw_1o7U6eM=H(Hpx^xYu8C_r|8NsyQt%Z(I-fM=(&1lyHa zl3aOIDPr6gy5N7P#6S2El{uy;!9bDou2IgmS?*(n1u%Ab^`KA5geXwQ{;ZFEj^_;~ z9tXd4g=z_h$g7Zxgg1>**i`c5lF_H3!#?TLu|RTAxho`z!@UCjI^-zxn|$8BHPbsi z;A82UMW9yf)-VVSc26nqGvr#2(J~{8$BKZDpljzE{y~PM=;mV~epQeYzlP(zmN6rO QHp?M$uVUx_`eO$^0otX%od5s; diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len deleted file mode 100644 index b92ca80caa0659b9a68734e5c7672abddf481663..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz00F*r007bey#N3J diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.len deleted file mode 100644 index 8fe89d82d540f0f9c8b866f249f77e7623cde7a1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz00Bk?001fgA^-pY diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at deleted file mode 100644 index 4611327238bd07e1b3d51da0669532d540815aa2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2331 zcmbtW(QXql5VTZ@NB9F2fe`|v98D3RA|#?~QBf4N%C+!<1m|vzK?^IrG0G)FYn9A}mqw5L&HiWOmDC?*rl=JZ?Cx59t|XBsgm=ji_@R}L zBWn1&DQG&4mAZ0)%9P#P$S^-Vkj@~gYLimQ_(qNs2S`HOF-4nnez50l6jGNcoX0x% zH3GRWho9)H$mauaBY$#TATOX4wen;7$Y$uN(O&^QAm0ugKi^_6<8{(z;(ztqI`Z}Q z7UqGe>tb7pk|MLdhiDaFCvoshuKC{q|#AJ1zgL6+J%irkI;H|clIKh@$!Y*0|k}v z;NnBEj^!EnL!Co#po=Z`H1b4CCr@**^J^PxO#tJU5s%efj^nDj0qnPK;J_Y>jqC)z z)Zje5Fr}>imt_ooYKnkm6djLMzV=UP>$$}%8juZH>ysW_E3!%oCBFd%6uazUTR3P} zLbFKa>L>yB8N1(sO)1lr!LtDPv3*}HMGuko|Dz7}rif==_&VIZ@7bLWFzxsU-6j8K aA9S)Gi!eSr?f*HJJVFv!9r${aBi~hP1PBlyK!5-N0t5&UAV7csf&2v4 zW9s<+v5?=QrN0z7i}8cWz0bdFuuXsf0RjXF{I0-SJnnUVW9xUH>S?J8+(p>=^7c%s zeYyw`An@M>4&%W0m8tsF?>znP+<7ji-l?xT1uBufdVaH9o%N~-5FkK+009D3C=man z&^mB2n`-%Ogf))rU#8lpivR%v1kx7RjJ%_#u9vhc)e#_&r$9%%|CZYOJM!GLMc}^+ Fd;#pyFuVW& diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len deleted file mode 100644 index 131e265740f37d77b7c4a3676d2a7704ca3e4a29..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz0D%Su009U9fdBvi diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab deleted file mode 100644 index b9ad114a5e961e577ebc41e55426c167cca38762..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmbR3vzw0r2v|V`3003+N8dd-R diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream deleted file mode 100644 index 718f8d66e4678a6ab09c220c3273852eea8996a3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmeIuF$w}f3SrQ-ypI!rPdSWQ8>q z3A0>j$if;Vdht}l+Yrr}c18A|U^{=|@OPr;T1+diuIZjACmpG88ZvSB7`TL(E^iiD xlsawG`qvkKf9D}wspoV)xdb1-v*!W@0SG_<0uX=z1Rwwb2tWV=5P-lOffpYDN@D;3 diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len deleted file mode 100644 index 47c1102697649603a57d748104b04c9ace30fce6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 LcmZQz0E4{%0L1{l diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.len deleted file mode 100644 index ec8f944c8acd49bcace4e4c78d4306ebd9e28078..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 LcmZQz0D~0(0I&e5 diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.values.at b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.values.at deleted file mode 100644 index 96d372e9e9242d9ea6e6a3c14002e84144ab0daa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 793 zcma))!AiqG5QYQ3NI^YFVFeZMrB&*ov?S_%+5Alx(w%i?BKmYbncybGi;%j>VqEJJY|<=d z2VF#ed6MZ@AyF46sTTn!==-cNQ=AWbwxZlQ?HH!&oP)?+CjJ!m#7C>1f^Bayr4qGg zxL(Rtmcx4Cse~pP@bh0t9vfLu}SpJ?=g%2oNAZfB*pk1PBlyK!Cu3z#op-4dMU* diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab_i.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab_i.len deleted file mode 100644 index 131e265740f37d77b7c4a3676d2a7704ca3e4a29..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz0D%Su009U9fdBvi diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab deleted file mode 100644 index 826a296d7622d7bdfb51d3b580f2ac289576016c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmeIup$)=77>4011_$_B5+=ZO0TO~jlj??qV3Bp5psEJK2CZZV1d0JV1P1=T7r3OV z3-J9(`}FRb6K}P-O&l}zuQ0Rk#|v^EWBgA4pNO@8!uYe*Z_(cm=R@APf6fmTt}(+S zF7b*Bd|>-A8*}*u6HM`dF`n`HHfyoQc;sA(TRdTbdu(urT&Gb16;J^cPyrQC0ToaI N6;J^cP=UWG&;jO+LN5RS diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream deleted file mode 100644 index 3aeb44950ad90adce547f0fdfd6809374909ec2f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmeH_!Ab)$5Qcph^&mnHD&9-=;6W-IeSnbtTLWn(&diFwz3H+&w&npQx4`#>$;Vt0 z?;KT>P?Hj6aWN+pb?q+h4Z5o7`Yhv>7>&9*OMM8qLHDPiRJI&Md5StQ+yJRm1n<8U zuG8^Tj1YO~#9zvmcpo%T3Hh#58ZahCJV?FDdhYqmOx&w@@Hco?)}4c`YRxImzj;E& zE-1u#=%z$GcD}Jp`V&zPAMDkZX^&cO{{deUL|>twG~S*XaZe-KQf_zzJFh_}x%r1} fOS_O4cC3IEumV=V3RnRvUp&gZ6K@rg zX|63R`ZCh|0z5`CcB5ahKf~w?W$KJOup(q k=SRtKb={pN?qv^u-~({$tIS3RTpVkRM#6(&zr3O83>V@BX#fBK diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i deleted file mode 100644 index 33f1fc37d8058ea99b64ae51b7355883c8c3a9b7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32768 zcmeI)FG~Y)7zgmfSxhTpGKxW8fb2H8sZ5M7@@#Z%xWDrPDeP>C;|k=EYOSj2j^$cV~#OCCxMU1*=Y9va*7i} zfB*pk1PEjhXvf{1wcb*OM_eU9fIuk(exv2e#X|a8$RR+0009C72oNAZfB*pk1PBZz zkbW@My17~(>at4&2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5Fk)lflh2T_r2e! z?1B|rEd7zh-O=E)VryB4z(fl?M!V(3_RK_=RE_`v0worBjqcN(-R%;upgI8p1WGB; PkJk0(@oXu}XDIy-tPdtW diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i.len deleted file mode 100644 index 131e265740f37d77b7c4a3676d2a7704ca3e4a29..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz0D%Su009U9fdBvi diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/counters.tab b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/counters.tab deleted file mode 100644 index 8efbaaa2df5c..000000000000 --- a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/counters.tab +++ /dev/null @@ -1,2 +0,0 @@ -19 -0 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab deleted file mode 100644 index 1b617c8bee657b3d7f04b4de48a4ab52d04ec5bb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmeIutqQ_W9ES1N?{5(-OM=x4(3=pv2N4tmlgVV!WDt`en3hbkV9{g}1d|tG_6GDh z=wQh%{10ruvz@cCJ)8EiEJoFx!cqB5yqGj)`eL{{(LF559pP|mt?xzjez^Y28}AR; zaKRoApV5m;C%obTmkDW)oustGT1xWqfm`&`(i;02X@!lfw7@6MG05>RILu2EtQVv) r-f@JpqBOu}N$TRS@3l26Uy3bH*4<4kYRXmTIX}TuaS!XArK9yAjK~NAuy!cE`+E^<10t3w{ zyClo+`{qw3D|eQWvs)rxV*$)T{F0)ZGL;NX0}^y~PF&>#9kVVqOT9v$f| zq%bHkB7+dS3{9%_SziZ?;u1>MZFCh$9pc~;e3kXo%-%H+V!!W*%iqI$Vt$^fz2k=+z!n1T{NS|OfyQQ9y+SYhtccZ2+406D}3Ll$nmv|11fKD^K+_^!;d z=E|!{5u60Ds zk#^0J_*U(W{Nun6_=R!n diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab.keystream.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab.keystream.len deleted file mode 100644 index bc1721ad72a1f49a7d7b438e2237f366381e833f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz00G_?009aB_5c6? diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab.len deleted file mode 100644 index 14f7c061cc4bef2fdb72d8ebd5cc8c9a23a22d1b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz00Bk`001HY8UO$Q diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab.values.at b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab.values.at deleted file mode 100644 index dbc6bf90fdef9c972ed7287004893d199a230471..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 163 zcmW;6TMB|e6o6q(%S%^X!R)|Yh%Z4D^nS>L3gN_=Y5&pxJ$zj%F;~ xT3ABVH4YNyt9+jF{^}!olS%XBk5k@o#yM|!#|4*Mam{-^@R3h^<_kC6{s7lI68iuE diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab_i b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab_i deleted file mode 100644 index 3bee32461ba7012d1c138fd7f1420a942392a00c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32768 zcmeI)F-u!f7zW^LT|_z*9NZo1E`=@~1ec17IJ7v4(4lrq8W015ORS6FA}w_3){YSe z-Rw{rQ3OGRf(W4?C@zAFgM(jxz#Rff%(;E;c+biC-uJnXA&{F5W&N3};{wn6vh3rp z^H&`oWB>sI$p~CV($lvGGsy%NlmLNTfj_bGX}Msv)M-(m9{XpnKiszX zG200cXoJ9yIAiQ$YP}6dIf4KI0t5&UD5$_q^lCnTc~#JQY7rnnfB*pk1PBlyP#}SU z_`k}Vt(~I+RZ@ij0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF z5FkK+0D(jWRwDQI@Zjr2akejYR*dA0`P6#JOMn1@ WZVNPHVD0)iEdoxV{ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab_i.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab_i.len deleted file mode 100644 index 131e265740f37d77b7c4a3676d2a7704ca3e4a29..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz0D%Su009U9fdBvi diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab deleted file mode 100644 index 6843312afb2220972b906c00a787235613655d82..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmeH@%L&3j7=+jN`;8!;1WT|13lQwWn-?p{QETvG3El-u@RCk^Yt(UmVuB|NkQvx~ zlig(D|CXao)iEu5M5%|RlW@*s1!Ftk-|z@rahh!X&s((b#izf^j`!O?T{1~dUO(xH%`x4F^Rg;3AOkWW12P~3G9UvoAOkWW12XUz2Hp_bO9}u0 diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.keystream b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.keystream deleted file mode 100644 index 54555db390322005a3d6c3030f581ae72805c531..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmeIuff0ZZ002NzAqwq3Yb*1`HT5V8DO@0|pHI GYv2R8Spcj6 diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.keystream.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.keystream.len deleted file mode 100644 index 2b895e774deea3bb925caf1a5567bf65555bbe6b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 LcmZQz00UtF02=@l diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.len deleted file mode 100644 index 14f7c061cc4bef2fdb72d8ebd5cc8c9a23a22d1b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz00Bk`001HY8UO$Q diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.values.at b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.values.at deleted file mode 100644 index 9acac0d4af7a0a3a7231b2734a204d8a6502d5a5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3654 zcmdUyT}~S@5XUX;MRI}EXNW=&eL#s4+CC57VPmrEF=KDla;oyts#Ou77R1K`T#4Bv zL~w+8TU*}Q-+#V#Y|RcriQJo_BQAT}#Jve}@+o7;JCNqP5I;lR;w%$Gg{S7keoAt} z&XK=j3CupbIR!gmsu-FEvX|8t;zf$!FxfFfsL+lhh8eZ&(2_ht^!*A0GKgWDpoz7d zb+wo8+K4&HHrfT{+K2ujxJ44HiJfi0hxNWCu3n90qI&cGAjaCeCCP_H*1;?eNp^yH z5WO&;n==J|UNU!?fh+1WbE<{9OX3yuZDDQ{Q2TJekTSO}w^A9xKG>HfxUSxkq|BAM zR4HS)ta%aeT$m@73O>FI%@k9Vh@dEXEX;#OMVs!qg*8@?vCFRu^H-mi5i@Z||GzN* z^x;qOsKu0r6b^i)UBxcuIhCT~zA$$hW3j61(Knfm(z@wh7v@Tzlo_&z+8-lJH2#?1 z3KTR{q6~QQ+k4Yrf0>_p(1+4TE8_3savgKh+T~-G3xYtOm>+taErYZ+T9{t|3I~zv diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab_i b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab_i deleted file mode 100644 index 41018a93c6b30454cefa6b650cadc18598d5f17c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32768 zcmeIut4>2f6hP72Ck6WcY9tbgL{=h^NMvOtvJ%O@u3u2KPO@_*lSw97!*Q4mH}leY zQm-|ww;CV3*StPzQKwqgXFb$ct?IiT>!+UTT+el>b^X?+uC=Yd+ST~!zO`x}+WYo# zyf*|05FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U tAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAVA;_0{@WQ3>*Le diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab_i.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab_i.len deleted file mode 100644 index 131e265740f37d77b7c4a3676d2a7704ca3e4a29..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz0D%Su009U9fdBvi diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab deleted file mode 100644 index 6a1c931aff7b65bd925f5b37369c83eb965476b5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16384 zcmeI$ai~-MUkC7$J=uCPTV}S*Y?;}zn~jUeLF6(-WQfQRk%L@hh{zC;AtFOWhKLLi z86q-FWQaT*L}ZA_Fp(kha1gO&X3NZ$nXQ}IGJm$ro?kB`i2m!J{`0{0;@rD?@Av)Q zIiGXx{$T4LE(~n{@l#)(|9dMi9|U!LdHmRh|Mi-mu>a-pWt;Eu<>!C&3qkPyoB#Rx ze|_`+@buX4PkG%frg?)Io@bV)nPZ)n6&z*A!z}P1i>$E3J&ZWZGIz4V606+88aJ`d z88#TQ$!WGY#Wq(lW|kc;WtWTD<3c7(vCnxN@beEp{_&9SIpSN6`Gyk?`K83?Oz|nx ze9R0JW_gD>-eR6N7&2yoS6F0=C7xr%Gc5BID?G+3kFdrn>)g)<_p-^|Y%yY+TNpEB zhpX6SmOU|z8SYwrkSmOcKxtk3}Y;rYQT*)?;yMPS|DelR~hQ=Uoqhe_W6th_BrH3j@aXvH#p%{2Ij?O zrdVZ~`V~$su z=VgX$vA}aI@(fEn#fWv5d6X3%W|jL`W0`eMv%x7gxr!}j*ybX}OtHiF6Z!d;J-%VW z0sDNy0UvS5?>SUoFvlkIJk5|NS>SONS!0QZ81Vqh z+{X&bta2A?+`&4xvB4sn+{hL;u+4RhnP-Qq+2u<1xSR>o>~kIm{QR%-^CL$bbIdtT z_?p2_n-@%Rz%-vQ!$-{Wd*;|@v$9moni3_Bo#e1|0I!2l@Gd zW6p8H*9^XO{4>P?(|p1V6J~jzIo@TSHyN_Y0*|uDGE3aWh&x#3Hda_s&#T<_@&m#<3Wr6!y)5pXBF=b-rSQPub*SwwSQZ z`;2*)9o}Y_9rk#Q39qux%N(%9ARm|>Y&?qZHRnCCWz z+{6NBSY*f&rx`KFGFPy|Wvp@$O=knojIqDKex38#V8A9nz0(8Vvd!m=nXtqA?D8&q zyupMq`@F&dFLB7T9I?(Z4|2i^zpP~sQ=Da*JDFjTS#D&G8<^)hhRn0T)hu!)OI*%~ z8J4+-6)s?v^I7BMALZwJHu!)|-eZehwt0;)ud>67?D8agJkEqQ_PL(}?&XlXIby^y zw{ya+419L7nJE^S=6YthmRYW0jydMJf+3f&z$Gj)%@V(5#LsW#=SNmJW|ecS@ipsw z&IX^d$;WIlVVn0Dv&#-|vdfq~USYyZ?DGN#Y;wpG9I?tVcXPss!6JPy#Z63eh8c#; za+*1=WS&bH@*5WT!#~K+2}^v>h;LcuOIA2wl}}jXBi8vn8|<;kJ8bb5+q}V;F+04% zE-$givrO1vpSw8V4i34EBNjO3dQO;U@QbcXOmQ*OT*wRqX8CDOetuw{?-+8#0$;Jn z7cB7^BlcP5Lss~JRo-KbUDkP%4PIxH-?7Cu+q}q_XV~E>c3EeSN15<2``pg~_j1VH z95LdU+c{y8!D8n(Q{2Ebr~I&m+`%5VF=3H?ZsdR)IOIBxnCF%&4v(_S!|ZV%6YgN28#&+x z4!Mpa<~ZgGPPmN0FPmpfF~u}Ly^)_IX8DRazF?lu7_!d-@3Y9eEb%rYc39>$R(O?F zUS^Fg)_IN%o?(-x*kYY+9%9S`>~Mx%hU{^g30Jbu!QBzUPFm8Dt#K zOmV<8pD@Em%<_BY*khh|81fbiyul)4mUx8`FR{!Etgy){PqW68tn&yPtg^}dY;iB! z+|8If*x@#IS!9nJnJ{FZ(;RS$L$2V6%Q)r|PMBu!E3Vf}@$+l>ImZkK%<>6ye8fEO zF=Uqo-ei&2S>k0zY_iPbtgyx^53$ArtaBe5jM(IMwz!pTZf48^J6z8$*RsboOqgSz zD>&dX4!MLQra0z2PWbe1rWWo~r+`<7jamX2t7;?;MPB_J2nLe3fmT4|!hKrfyLgtua zp7R*;^Iyx)k1TS`66YB4HOqX-3ZJsd$E-17o%h+`T{d}}Eq2)EHO9Qk4llFI7JEF$ zglE|2DGpfYkViSsjKd4UZ!+2kp_PB)!H?hwd4j6LCX^uF>F;{WI zEQ96VZ>G4IX)a`jDP}p3Iez{t`T3C{$1HG;MZRWcX z$Q(B?&vgu$XMw9(-_Xm5B$I;-?7CJ+kC~C zFWBKTcG+i-51H@*`@F{iyBzW+N4(B4zvF~$ep%B+rg)xdo@Is&W_f}+9%G(I7_!O& z_p`{oEO9p@Ml5qXE8NN|H?zh9>s-$U*RshqY%#|+S1{%>cDRIHrrG1SO!y7^{NXR< z=Y&JP=ZJ4P<{M5pWbhm2K2vDoeb~h-X;lQC7H@ zRqkeu5$oK}2Dh@wb!>4Z+g#3=8FsjcT`pjc^O$h*LVmvEfFln1iX*<@n9n$2pTP>} zB~$D&&6~_HW|kM2V}p5~V8|K^Jj5brS>i@U%(Ki@tT4?gfA|aeIboe|*kGSce$N(r zZ1WCd-eQM0*k#NfuQ1^y_IZH=HaX;Jj(Cz|9_NHL2ES?jOz{BI+{X-OndMIAxRrTs zX2=2yT+brcvcxrvm}8mCSz(4%E@F)fSm%5;7_iBY&*kTsZO$>~Yj*gOT@Kje6DEAb zKJReATO9HRM~pe<1y0yxuu?xv@g&nc#0>W`%iYW|VxHR>aw`km%pwacaXllhWtnSO z;YwDyoHeFd=MR4_KPPPRJzIRsHs3JjkR3i}mkE2k&4eBHd4&UB;*h5~;xUf7pA$w5 ze#`oqVu5K+GsBh4auIV}z&z(OWWWMH4dmwsmiUelhb;3sD}2f-AG5}Ub>3%#ciH4^ zw%B2t*BJ9EJG{&;TkP>16P{t8r#N7pLmuUbhdJg!PFP{E%6$-1oMoCjnPG`pZefm_ znCA>bhAeQJMNYBARg9QrnM+yWVph43HKthSJU00G&*bMvwm4>+bBy_#9lm6j1NQik z2_LY}dmOOKA#ZZTm}6exgiQv&?f77dCzK32AsbAw$$4z?^E3JRkuk^YaE@KRW{)qKaKJtva=-^1@*YR*a?G2Y z@H&H>`vIodW||k7;dy3xmN_<<=Lv>9#sZJ9$SOFlO*O<^@wc&os|6!#cA( z${Y_f&w~tEVS#&Cwz-rs7qi28?DF$d z`8mggui58I4%p|A_c`KSj(M9Cb{MQSUzp-mrg@newwUEP=6HsAo?^&43p~mq53|IB zj96irdsyKttK7*NORRGX8{EVuXV_xMHdiy|N_M!MU1r$hA|_nGKIe15fJ1)z6Z!dp zW4_~rFBtr;`yr;7FwOhS@Gi5w%^W+-^BO~5Wr3GjWQ!%9W5hEo^Aszrv&y5a@i6N= z$ObEHat~XaWt-a=v&arNvdazZaUB!p+2?8wxROII=ZG1Oxrh@kU@)aGrWi2IPfz6M z2WI(>IgXg;D~5c*0-v$SK1+Pah!0riZC2P}l~-8fdDeNB4K~>13AT8QZ60CF3On4x zE@#=}P9`j|&n+Bq6NjAPh#|+E=7duWe$V;F6thfoDKlKmEEh7z6!V@0`IWM>n!m*Mr^api>&ZGt31mZ z>#XxA8$8S=53d_33K^UmN(^z}E)8Ht@B9uMK={;A;b4 T8~ED5*9N{e@U?;e*9QI*St!Jp diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.keystream b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.keystream deleted file mode 100644 index f63557d8cf674d326eb75d17cceeb04fe9e4345d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmZwNdz_AS-oWvDa>_beRFdP+)H*cSacC-5#6GDf5o&rF$)bnB8qAssiH5awz*@A6 zOv;c$YK>GX3Zt}X)@enaJf00{wMj(J@BO={|DIm2UhmiMntSG+>$*PQ>%QFgXITZ{WrP8Dn#vuEa)w|1(M z*Q;H#;@{q$H^1|=F>lr{&FB7|7tU~Rxt!{JV0dvUJ#O&ctJixRJ&qnnkK=}h=ceSG z&1mECn>wsL;_>u&dOSUzHJS{(_ryKdkGT0C!}15@k1JZZeC55@e>yuq(PYGu=Vsjg z+eZiAaNFbO`Yr4>yVJ|;wDtH*=FVQ0R&r&F&W9`49LRFViU+X&(#*qb(P+mC-r3<| zJ2tM~;6>g&y3bAgwpNuI>_2|xM!wvtUI+R;==WlNIKFgz`Nhay_1OB(OLLh>>G&h} zAN+DQS3EUqG>5Ib@fqf2qOq$>Yfd3|K7-<>_7M4EqP$Z@&D#G zr}sq@i9}!PL|X5-KaX9}>v`*%2)9Y9#64m4RIaxLRob~Ruj}>!E`r!raKf2&_+@6#B9BcKhaUU1d>obyf ze4h3tk3C+P%|uG0J>~n2$WNqpUPAj3*J1ngtz(L8r|n#GXlhPLl@r$_8V~uXr0SD* z>Co2_DJi>IZs!x7s7ns3Q~t{M^~RMZP@mK%^+|nFpVTKu*SfxAnepf9)mpFg`%|~n zEpOF1`y;JYhJM~Vz z({*&p{>6h_M|p73=0$6ol&d-~W8 zFSs%_+j`ZCnjQGjt0hZW>+8A4`1z@NtLXgG`KS4=`ue#{^Gx$g^Gowf^Gowf^Gowe z^Gb6{b4qhcb4qhcb4v3_uQN10^YG>0^YG>0^YG>0^YG=DUAG=>W7Xy9e0{Lnmd|1YB+8Wa~BPBM{}247iQ7i(cID8 zQKvL_GWn&z>(Ci>Mx9Y-)ERX~ol$4h8FfaTQDWn(0&Zsl$j5?#v;`Y!Pbw-_0XVh8T9y+7Ws59z}I^)@o6IJW9ELpg$ zX;w?VR?w$K()*%SZyD0%V3W?_tZUgPkqyMl=`N=sc-6=`li0AZ|a-+roO3f>N~DO-_$qt zO?^|})Hn4_eN*4mH}y?@msv`EQ{U7#^-XYMte zzNv5OoBEF1L*LXl^-X*B_)Dd+=9Z^Tr5p_fzQAgAfbwnLeN7NB@L>*B_aUD9Mj;JH*h&rNE|>WDg`j;N!!J#-We9Z^Tgbzv5DL>*B_)Dd+=9Z^TrQQRInqK>E| z>WDgu+e1gx5p_fzQAgC#lmi**B_)Dd+=9Z^Tr5p_fzQAgAfbwnLe zN7NB@L>*B_)Dd+=9Z^Tr5p@*Tp(E;uI--uKBkG7cqK>E|>WDg`j>;^hj;JH*h&rN< zs3Yo#I*QvvN72v`b(CBeW>H7f5p_fzQAgAfbwnM-?V%&;h&rN)D?9_T~SwY9lD~fs4MDZ;6A>WaFeuBa>O zin^k%sH?a=bQKLOin@y1Ls!%lbwyoK zSNyEighuP<_UzBqJq{h1_F0?LXK&2;xZ}nTy71zZ1$hH%G$^?^we~{V?`XS8zi*n} zeYqYl?9FbjN9vJ!q#mh9>XCY+9;rv_kUFFesYB|JI;0M%L+X$^qzX1654yi-x zkUFFesl&Jq9a4wXA$3R{Qis$bbx0jjhtwf;SY|18NF7p#)FE|9=Yu+=4&(OFVKj6| z9VXX>S=1qQNF7p#)FE|99a4vJd+3llqzM(8(9a4wXA$3R{Qb&vKIebA!)Dd+= z9Z^Tr5p_fzQAgAfbwnLeN7NB@L>*B_)Dd+=9Z^Tr5p_fzQAgAfbwnLeM{ylGqK>E| z>WDg`j;JH*h&rNGexIJ_f4INQO$#r2CbwnLeN7NB@ zL>*B_)KT0XI--uKBkG7cirYg+)Dd+=9Z^TjUB2rdtM9-4Zk=#VueB@rU8R(Ube`$F za^+XU*YnIXd4oATZfGJUZ&}*(`DdMn=;HUIj<R*%4ga2{fA5xALO-v;8+X6Z{QbcVKl|B|53J8`?0#jl%qvbYJ!9t~j=OZZMf+d& zo&Wv%w(rvOM#J;c^F+h*(DA!C{$DfvoZ3y^z0Gm^Q?>b*{QRspmwYtpn;i{VA$;)}+c?pB&1nw1uj^sHF#b>n zJ~-?2n>^B{##Q`l`(uA#n_;78aOp47$MM34xAf-n+`qJ7zjZ4gX2+9>O5Ctx^4ov- zVfC?HrP;M;&IhI}uIqCGnj`9)iFOr=sb}geZV#Wo)UQ-?n(Gq1&qeQVaZb;Ti|Kkn z*9*E{(Di|jw0rGO^!)Vs1YIBKb2z#_@cwc2+R*ulUk~$2b4tHA%_Get%^!W9Me`L6 z^F(tLzaIAM#vNULGph9H19bhR{iOY5x6YFuru~iE!*QhjrTwM-rRyT?H|;N77iqs~ zziGc|zghIlujBLDZ)+V!Lx<5VkHp6vnp>$`T$kj;^}rGNab0&v-MByA|Mzw8|I_>Z z^nMb(pG5EPmwkOKy}v~7FVXw>^tm%#H|adk@u%ZY$3J@4+4wxpgSGPz4d;Q*1AV^t z#gCI#IR13}>A2HzXZbmQY)!|VjyoN9I_`Ab>A2Hzr{hk?osK&lch0yp>qR=QbUf)e z(s88YK>JVoP5T`U`%U}R`*^u+_KWt5x}yD~{iFS&{i6M%{i6M%{i6M%{i6M%{i6L! zt_Pi@o~Wm2=!xEcr1u|b|7rhe|7rhe|7rhe4(T}1afpWFK=(OU9lWWUUqtss^f@lQuTS?$be}}`M|6Kg z_eXS|l6GDa4e#sId86}2udj6fM6a`SKIweY`K0?NIHdk%FP&dHzjQxE=aufC z=>CcBpXmOH&NtmZ(d!W1H}O>S5tZrnyv+DKT{Hgk18etDbRR{pJ9IxquRnBOMXy7A z?5^yKbe~1n3%bvuZsPWEpA`-FS=3Q-U6@7J73zxauaaNi@(|ru(R~%&572!S-4Aeg zxZcp~FWom$muVB{Z__39NUsOfA@xW7QGfJzG}Iw=NF7p#)FJgneNkW0&=qw>T~Swb z-J{oU>Wn(0`#I{3dZYWgXy}f*qwc6X>WzA%-l#XauEce?u26r;^`Mi~A$3TvU(wJb z^+-KZhdkA?;4|ux@xC%?eE!YznO9k7w-x4VSUbjrHDPyiZLUpWo-}w)=dYUJvMVcKV#1jazq%`_nXW^LN%h zcTd_U>h(9d9ubeP&)t*jQE~0_cWa-!)93E=xjTLCPM^2a=j`-3JAKYhpR?2F>oliy zeWrP(d8K)!d8N6ed5r5YkI^uXG>0^Ybe)fe>pX9Na_isNZ)VnoF8XnoE8Y=91=;<}w=Qk>-)+ zkmitH4`}{q{%HPK?Y%RLY5r*b%8bur&aBNDeO^iPMDtT-{C<56-8A1c z-!$Je-!$Je-!$Je-!$KG9p*b4=9}i5=9}i5=9}i5=9uOzUcet`&i*p>;3fothoA_vGj8ay5~J=KcZnjlIvEP zv>&t|aeMgpKkW~zZ++=UdcR=XmRO|~E9(LS{wXZaavX>oh=rF=ny=Z|^U@#{~Xj5?my?px`+4jukddB-Ul z_CL99l}X2m_MhH&q4P=S^V_36|HJo3!+E3g_0#sN=3T1neA4sN*W>o^eG8v@;|k{| z8qN z3%gp=`jzL8owuf+d-dzD&a<6s7JWY_4P5l{rqsDN`#yR+ef_8H+3DTm-)Pd~3ePv(?&}Qm{{Q~>f3b%7 diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.values.at b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.values.at deleted file mode 100644 index 79e307948f7c756df989b3a040787718564bcffb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12507 zcmeHN%WmXE6wRX_3F%Cd5epV9`U8;IvSfv3gM>h0-(p&Tgb3<{|EKOb_Di+aLG8JRUx7zk57vf7lr!MD)Zn~K7;C|xW|RtVh?PoxCN#@Zp1Hi2p5SGeS%Lbh z%>yf{*QgBTrLgOEX_{bVA?t-5GOxBOym5Z!Ip)UVs|1!7r+ag6I}J!Fjc+?76etE332{*l0=~~004g)r) zn|tc#Yskqof0HiqR&TjK#43%@vd?SJyH1j%6tww#!ga1UNgcunNNu|*S&gcxb77*_a%6jR7$IuC&L~kWMO%y z(G=M&8LE@Q5r23!FhA>E`N6?d2?H zl+F+?VqEoQeGebXG*;%seA}9)_Sfp)*S-UH80hRcGj}t(L-8a+{R-rCQB(5cDgx(krV10z{44=dxFBugCZNq8GX;P=(2~f!snCtltTG&%=JL79>vpZ zXJXY*4#vW&QgX=Xcv6{jygNbX2*QJwd*~_f@Tc|cGiMq)LmE(B>3`u7sf_;2GIvw> zOnn1*xSJM!Ejvr#lyUtWIiEba|IjZ*k8b%+=KpW+b2M9WCcPrxZs5szC!MoyxW6$^ zZsI8k`BTZs*8D4Sb(B4R>AJ6+-Ep@ zz)!(%;Uh+DWGr{2@~(f=QJF`rmGjf@z}YxlOs5&b#D07HX6C%4AP&Z(l?op7|5F$l zzv-Hsia(w6bj%BQ`K?D<`Z6i{*6zOx^DUh@+rMGPGivpFCEw<8C(!55n>u#jTKx6_ z(LU~IYwv9{D4g zQge({ai%7%MLnid z=ebwO?VvN`aQ>3W23~59=C8uU(HVu6Lj|5@|DawKt`R?aBhHYjtxRCt(b?0I@h?hSisOoHmF z@UY%I+y8GR;8}x9kPPwk;>S_9nk_@r{M5}6GzRB;uI8nLY!fZ=ooR_ zGIW8k9?zsNoPiec%-)>w6D2W5eCSqG`arn`Jt`6Ad=s}Rze2%ttDW+0v6=wFTEq^=h*3g~ zaFp1wqgIOYy!-3-if`|V_Bg-ic|F%3=gKuc>zbe3x%DuqxpFc9S1E=W6y)DN?Q

            hQJP`a4(}Mp<{L{gjO5L=2sYmazK>t)kHps& zV3;R)yGV)V3mK+RYNv3bojis)VH@0wXu>uw!`NzFeMK}I8_O`vL!Z*sIG8_tqW>yg zF@_Pe4uG}Nfma#ho8LQT%*`-2mM6v%UxjfYc}itkkK}~an0Hld@+hJSyI|jT>f}>y zx(dVee6z9x(QGX7Wte2mXaf&^TOAbv>!*XR0>gB9<~xN0|F!y9Wv9Lx!{jb;Zjhxs z!<;$t{h^^8!@Ol0_qD@6Uv>;QXoP>bYY)w&@&6V(3Nwtom)C}@=F!5RbtM%74A`Hf z?1KJmeJS=OSlj(CB`iN=NbES0OA0YeqfHxI5UmbknB~V4GTB{@DEAq)d_CzAc9dY4 zHS1jsIKXGW?CEY3FwB+MwQntD8D{dkX5OUd2}_~3-yXJ<FZsI zFU-d<-M6WltKo-t59*yJz6|>p7f6{!w4*q~B>G3_H1M~6>70Ya|6Qy^eDUhs%ruV) z_PAZ8mq?9$Z5-jsV?Z2Nl(gj;rQxp%7&)#)HZ{?ypm>k!dg)PYx`!&8VRtbsk& z9p4;6G#e|BZ~k}oA7k^Ch|_xUbI!8)MBB07=sAIN`H1uPr6YLKK!)iZaQrVd>{M&# zuoa~DyI6yKh<*S(SciHr`~6*a-61_S`ar>Ax7~Gx_$u&sziz7_ny?FT5P3qfSAhLAzBc12@jYQ% zE{5T3t+`&3n_=!bO1bxMLB8}^(0iw+aXk2~^P|K2*m5!INlNtV4{W{*_72^Ww4crA z@)^e5wlJ)m5je=limi%Ycc3nOui7Znd>OTWP*T(}@wf)AADr}0GVJ%+%BaI^KGAx_ z*_t{v-2Fh0y0mWCiC1RSm1(_WR*{|w^!R;=FEsE-&7Q`K#3#(n!7w|Yjc~`0H9zuo z{AqVyDo_{JFLnl65T6fkOlrwNURJ!*<*OZW7?D&VQ{7W@80JDr-_uE$8AKyZ!gF*$gi&Z(hVd zkniod&D&+I$sMnK7QH6aUSrNRzit(jmO+Li8px@j(5%QU6!eaPCGpB_?h(4qZ zUwq4fafddoTtsp<=0jh4by<5hUkCrp=e`=t=9{oz&MNLZCF(_^52DR7+@I<{A7nG5 zPS-xZE5?XA99BCiQ-0DsW}N4y|EC*7v#|{Ek~7-N9T%KR=vTZ0seGK{)SPkd`o|u} zrX}#}`nByZvH3*X@u9x=v#qu=4D&edel6mA!p4fQXUG*lE#h?TpkpIE=@H+8dN%TP zmr$ZJVZ_xc?q~P968PcmfSSuQ>9H6(&_5=z1v+%&!{!-ja4Q0O0Cp8!Bf3(5D zIz+Rvh|e(RCVv{oMcu3K8#jP0&n~S(KKgFE>Gl(QoCAN)3dCX9BC2)NdWpN)o zFt-bPoC5Xbh5o6I_&g!*fhD`hi56g8+4zLEL_5nt&aqYD1J4c_eM}Djyl&c1MshZ` zp-wcmrv@va_pIK~rViA*{!8nN*m|C59qMiA2dxnG*#igS@YM4QTs!<0xj}!J!MWeR z7ca>%OxnBziUnHyBH zwhQ-}a{+{q|AyXKwmGA6(#n>3ko%`DY-@kNd#AZLQd&(zQ>C=L?v{h(M&xVI zn{IXNu;hW_0q*z`!+*_RKA&yH`D#4->k}7!x%w6TWf9_Pa>M;CXgpyq;<4=Un=wQa zHex?>1{EJpG+`d<*Xlb(b`VY24tty)P)R|w1$ic|E}W>vKCX4F^NIL8toQQ$Yj`sw zSiv_Z57K1hf`|S85&pi33U&`Wmx!$TXTXI=x7ALx*kQRY4gT7~9<6}AW+*0}CcYi< z6I9JKm}oYZU>~gtFKMm==69LgR|dacjY=6L%L{(UkNxX#?sxxnZYA^*1_~lLs9Vv) z;$G>BGR(L?h6x0?7jOg0)Mu|_Lfx$Enh?(BvuPtLYn@B-gL>RYR-8#{!~^#BIq&u} z7ja#r_4&Wls0SYt8+5i|y~^j4+;K+p8NrvY`4O)?*y~)oo?SIK$5F2q{Yj5759esr zw(2*c*;tQz$c)<;(5^Ptwbp8h{$Iz46D8`H5_O^>H|#adZ$>-^ zoO$WXz;7KZ*SjM{oPXy9>q+hjYhVw{G-;;iou2gBd?D@uiGK{}%;u|MPxZP1>o?jV-v?&0u{n zpiUKgesiG;`{PIqlUU+RqyqhBwqQbEwm^z=$1FIBsLcpGRQPUO#$DgI(CBw?N}K?B z#V|R-TsUvn5`T54QD)Q&1#`gHg!@GDZpKD@HWub$7-zU^w*hf@ZPdzhY&p>;e}=hJ zzD*sX37b$)3Uu84ifBIk5K`|ps>{zofPD8;+$+bHs;e=~VJAn&=If!Uzb`$*<`Zp4 zT`ySV{#&9M^viY^iyyVXA1BBE{Xf=m%l}8mJ5H6* zyHZ6NOIjAh?dGYxZdDpn>ewcp=5yfu>k8yq#g=nn`HA@lU1al#b|6osSGH%pU-Y{h zl`4y99AP2sKYmmMx^?y-?P3uyGvri*+WNAcgEgE%Mdn-iwb{J9kG3E+gex7N3^J6 z)$pBcxhL8Rzqau@AEZJ(k2%OsQNd5={ygT7UFRz!0~u!BGC%PO}$q{#D*4GTpI(BD=)+Lp(Gdvuey@E95P!~59qf(7;VT;*}c zHSkx@*7v4ooXs<(L_giNxm6vZ7sD*dxv{w&b}Opxag9Afg8pP|Q@H>Ke%dGH9MvHH z{ZGVpVe9=Z!PLr>$ZVIh_6SzIPs=y3egPm-ac@CTQ|-6;PAnH zWK)=##dee2G-$xa@QG$)mjL&mA*aU(5wFR^`i*1D z<*>)RVSgM^B2I(Lgim72*|Y+72~a%^a=;Egt?zCoxfwTwBtudwq6u4Ze^s8Zlb3^g zURz6@7R2|2CCF1l%-I7f#OZ>VA$Qq&JjBa`z#W_Us58wz-*Ai5Ea1vFd! z&h#K=tgwVBvY$I{WqjOk*Iyh?`exXn&g=7Ah;~8$#iR=Pi6*Q=q@KTB6IS|XU=GH; zBFC34V$|J^M=$PYk2d38kzeumWH$eIX&K_`K(N#Q2Ar7fWdzVIJbB!J(LzM6Bic~x-x9g=5-O*p5a(%n|1XGGkD)a(u~r2`l7RA|`_odcXx zIrpq4K4Ga3&iQ^fs(w0X;2+J|me_4N$PwQ&-nVoTP1uBfJNoGhG0|+y%LV&~Ea4O1 zfqXsXt^b?otgsFGamfSJ4E*%HsyI^~IWR#;-|d<5UkCrp?0u*|dwwnKI(N;;kzB-W zl~*N`)WA7~dB0c?XNJPxcbVbunngoxeAKCasiQiw$Nw&E!p=iRRBJ-x#qd|@Z^uUn z_*idaggb6HsPkV3J@c_t#y!5o`4rOEL4Ru5-C;x%mLu<)wF!(gz~5)59BV`Ttgr#= z1hrU}oRuD1ZsX(mZJ)N!iEl20=LNOe^ds66Hlm+Y+9h|1QBV4%JS!oFe`e+A6bP3UHEJcP!?<@9__-fRn4ucavYl`E&hFse)YesOwpZn|2bjLqQMexJ)stdmn zon351e)$zW8X_0E6TC?o@gWXZNFRmf(f|V-JnoUdM?z#4h8n6h4(MPjJ#M7 zuF!Z=a-i<6F5CsXOb0&dK#SVDbVNH5@Ah4)L>2h08eB~vK4CHL1!3`W#)e8Ts5f^6 z@$JZ?>$j5*5^V!ry1;pNzm~%zQOW-6NbW*B`z^~+LIyvEckup7{H(A6_l{oeE{jRe z!NK>>sl{dy&BhAk?S--@eXQsghGx0k{f2{aore#7ZNxe1?c80L#!1jOl(wcZJlMN@ z=|7GVUzZ>Gbh=f98T`GglggW6hYj+P3rU_8mcXvH?j8P^m7WxO!8f1V1+dTgE2V6t zZ--xp?2VW}G+`q?c#Yn5g6OQU36Xg>e^nnXDtm0>QLs)rsQ7q~re6zKB^?}~&x~yz zPBaI0dD&0w$G zU)X%6DEh$l5JXw_K#RQg-&7A?N(XHY^nuO25l!i!LHwWGS?M0pp0Eje4c-ly=Sfa{ zYeCpOzH|qo*;rBl&&wxA$rXsGl1X=bh3MNe%D3)sLc|sMkh_2!ZHeo-ww>3I!cF*AyVW! zCx%@r44(1cg?-0XzS)`dJYhQ@-#P7o-?;=4E(tiXM;bwMflAyA%1#2suJf(kN8^HD^xxB z8quDx3-i7nJT=*q+!J4q^L!i0X-o370$BFu=CUI6Bb~X9yMK_JFdy-iBc|F;qIs~_ z$u&U|GyGQRY}-A=&o1WT9#Ob+o{6L{&x5|&vHJxs{Bt?P>8>}TK-81N^%ikaPv$F6 zoF#o8)=dfbODoSAfQLR(_36e~A?#hz5S>CogE!unO3pRFQ4RGVEZ_$5b%>W%qNX0> zm-PNER%2g5N9(Aiu$yt^#%ApKq}WHZ>0WP$uf~20zRTzCkHoj|aZkOqFo9?@;{Vd+ zt%sOOcrLIl`HUL(trh$B;`G@Afft@57L0Lu(iWjYc5X6E$f=C)qrrYdoUmWO%>(e# z?*Sk6;`|9qPA>NSw0pq^62#T>ybFd}5zia@#|YT7O3_!$r@F_o`JQNJE`0x+wRf5) zIh)VPf%>svZhjl$@kVIP^$h$Z-O+F_={b-u!%9}IL9`Ix3x?*-nd#mvhh0w9P7NhJ zIqVt|acCjY{}x+tuC2DmP95@8zJB-M77 zIk)|li1#|Z|44HB;5lyIC1%nSl}G<=)_F3~|65oIe?5BZ*Ug3R$>rj@_hZk?!+oH} zrkP`jZ-IV`qTlKgofS4APR7M=dn-hoJbKbRDl2_8;_LAqMJONV-7;~lz=}NGH?nBS ztj4kB8stabx;rxE2V2h*t;dQprw=T}M_ox-)=9+H)8RgrCsZ+?&1chkKJIzlYqli5 zwgT?Ey(>>8`ggG$@%7}^^CLE#bLoRzsS^0fcwlEP2K@Z*Ie*c-0@RNMJ@=(`-Cu$l z@s{6v=ZIe_L8yjZayus$;-k)OEY{?+4&w|d^IS5-anh9YC$bu!N$!jHrH{>g%ST*o z(Vso6g`JK>RZ6b{x?0ziElwX+hS&~BHD&})1z$8k3?(XSHI`Ui-;yH z@WXTAlEK@F_JmD==*LIPefA{x#FwM~94_7p-ugKRvG1*TpNTEip>DK$HFq_eudj^0 zckM=91Nzv^mN{U>j39@9Qm*=BdCyir@BR6Za~Vg&hL|^D{NqOk)VnTks?KMSpC$5F zyTH~X+E4(`>6LSy=nyBpd)N=?(6=UCmzhcK39FH*h3?9@7SxLhjt;B%W$<3YvW^b6 zz5sq}!<;vZFn@z(@&vVWe*g=s82HspEF?n`753AdN2Gt zfkl^*4L=77>e|vk?t!06(YtYJ&l(k|A*D_MpZ}$2kiA>%8>6w zd&1g+_?_N2*k*x3r=EXK5F-w)*Lue*@}OQ7Fu7=)0OzfEd3YhKxFNxRuoHEy>9*~`2H+0^OCDs284>EKaBIFydB)Zg1mRv8@OmekZ$N!( zU*^asCGukTm52dsIh!`aF0b!RkB}ihT~TAKY`F+=SH1o_H(LqMB;4h@&#QzV9&t}~ zGaw=wtuJty6#3u}s~X!=*Z{ zCX<|lb?y0!v~bgivv!GjR77VNOW^0;qy6e?5ND02%vdGleOJPK5X+pS+5 zBEB80GT z1S>e217R2RsEeUdS6Y!&k9r{&-%=AzSPnnsocnPl(OF@2CB%2H8L0m0poKlo4|(pU z4cM1`+h%mzbP&N$_SQ>V672~)xOk45gTF>r0Pp`d&*!!`>2u+){T&CKRO5WDSI>14 z-xF3qpQq}i_aqm>KH7I9XLynmUk$rOb)No6gLCKa{o~vuXJZHAYt+{o-T4^z;ZWTu zww#A}@TvNA74e0|@IKhtP7PJ?!=v&wW|@#Ly=!@YA~_p#pttpKbbI34VBe4 ztb-qd`gz|cny>)*_0+W$-8vmas6V~e=5&v@f!@_;>_n1#!Umkfd-}jmB$sh9&y?$# z>MzL+s24B0y*#Ez9bHqS-#Y^$W|r5mz9eU34f@5|cG0j-Iw(<>com@n_Xc$t3h}dxt?)zMp$`+CxCeZXD7D>y{aIhs98Keeh~rYPfBZXK8T_%Q z`WO+(Jz+Wawc>uzR3q-gUC!)46lDY_;&$cgHHF29&%Ld_X);Q)rp)Mz$&+dxAx#tV zr!JqrS&ldxe>2}yQw6+-6qphyfc?)@SybJM`{d0HW8&qgG_lpzp%>Sz8LX;e_x!~h)6T^o{ntJ2x9c5 zi;504iL1xCb3f)8iIyWz&e^^O6Rm(fy-$tEpqKQdeX0m?dar+u+oaEf+@`JEiGe*71Eo*os4u+b+?4|4 zXYQ6MpDoz;`-Qb3O$R&99X4b5I-&)*hxV#c{{qp3g_t)WpHyu?{vFbu{z7~k@@Yau zvE4jA`Zd>jM}!D!b2VSq{-g>1gE@$^3MKD{vDl0jb*90)D%e#z@ImLyIb5R1jo(Yl z_pQl=9f}{DW0qAz90ZurdyG6zh)#Fu0Lx%g8>D)1#&ZeVmem|>^z z3#)3&5l`WNzOSdpI&YpoyU)kGjX$T}BR#@q>}Y;7mA4Kv?CG}E#|8Zk{LA#6I>{pWA}wk-~3dH|$%h zMx8v6_mi3Up0ES^JwNVqe@}85;<|feBL4eputFU9WcPKwANqdqJ&*cQ__J2%z%=#$ z0ZkzM>l&6S!+uNoq#_zKf)xEUF;DlM#C0KGaxHjP)dj}J36hP(x1!(t{bhlZXeP~r zGt-_%rh@=>D&N-EOf+G8DSRK&3ODGnuL*un7ZX1#Z1#u0QfIpRqooq&G3{N>9;bz$ z-xnJ@g!pFM3(rj5sU}(iOBJ(LgV!>G81t1l*g7&J7w<|U-#hy){-1wonQ)}(Cbpc1 znY^nx*0A|R>yfXCMGMU&ng_cuZ}f##utTNw!Dos8yV!uZJh?pftsMJbI-;t-6z47W z-giuP=i?&&H4{Fr)FCeRzPZsxjtu>qJJFKWcr)_4#-lO?oVcGa*x&heR{Cr?2OZpd z_?_Mc_|^O3;{haBA}@tKL&AtQq8>Po)mveN-uJ%>cObqLe)QcmDuie@Ho?C0Ld{3n ze4>Te_q%J{i#o*N#$quSiT_Wr8g(p6zd0`t^ZDJ%<@ToodFlLP$qDv+hWz+@6Z$DF z9LS%XZ!cTrxYu}J=e8w1OA++fg+JcIBR*j(`e5F^{2F@n8_mf}yNJ(6T{%6;ew}Cr z^XBZ@wm;EMD6Gm`!;V{(pjqeA!?_VO^=Z!(p z!K9~wKV|be;FKA`jPpm8v29=wC!tHOXi2I@9DX}mw;j=9iMh#I-e+?GwGuO9fS^@6C9ojDK{%dXg_6dLIziGThdMd=l zjsAmb5KUN#eVqGCp(HvJMjsj%lyWQ+KMRHv`PCs;ugrGMVjPKOuy5qTY0ZdcV^cNM z;rrv|_PN7#z|IMZtd zte6fW=#6jpVX78+wB`Mf3+A$TzPh4EHerdHIzn>FdgL56xKFCWn8%xm-^sZek zRk#3DUc6ZRcAPyCVO4E)kz=8#5i zn)N|}I4-*2*<~B{(NL9d3ro!C_{i_4-$sa$|0#8Iw<5U_c0StYl9^~WHlqH-*e17N z^Vzf(>kfHe^ah)6!g)$9)RlC>{=p?aH72y8rf(c^n+s2z5FwM(*%^syN*qV?#dpblY)+!MH^& zhs>vO7Q}hP=0PJAu+!FNfwhUB6;`0a98I2v=>0iJkPp0S5BvOFir=`ZBCi@Pc8@o~ zZuK@z4RMwMf8zwJ5OrnHmce13#>?^jBu^P{M149aG2Zt@n8!Nf)v@8qmLU4Xp$5LL@U{On={_8Ztm>&{0mEG20b(@GADyR;#=#ixT2@f6kf zLKq+QeQeataYgZ{IJUNAiD)Ias&xoB8ek z={Pa+XxY26C;#a<(w89KnX|c7a>UEAw`p(nrh^FmE~(#1cfS_neEz8gWj5%a9$C_* z#642kbzdn5EZ07EVIK?p8C9k>pT=hwOEI7Kj$Av8n7@;#NFFol(zY=ve`PgZg`F0X z`J7|xxlpItPW$m59?8@GQbb7i*%gUqV?Fjiu4tr^%_rK7xLde;`3j;5>(la%pVXCT zCG^g$+30Z{(#tN^;GV3AOMCkuBk16tlWSY9BcTyVLP(MFQVv@9|W2Sqv`)AbpL8+miEK0sa96jt2JK@ts zHTvmYrcO=bv$05k_m7SZ?8}4yZBv>ql%lU)=|64}4|PGu$!&Aue38YXBG}`ImiQt5 zZWQRkL4U1YCqKNM5d`1_C#*4NQ~bHKmTyR!dLKKxd#1f zNOW^pCml4{_c?RVF+}sq;`gS7P2!0*z#bb)H-+qzfLA;iq z7g67nocLL`b}f$hvP(h!b-%?suo4hX>o5lwd+}D72>6ds-Kvx z??k_dOT5~E_%ifCbDmQ=G1e(}UOJligthR$*V*{*MC*O<_ij2B`2N>#Wd4vT54B$SU1vtrz@Lx$!R2DT@Bj5a(ho`c zC!;U^y;5UsCpMpGBkZx*5O4fj$`>`{VhO19`Y`m& zUx{%Kf+u*aGXmUydIvGRNZ%9I!vD|q7wn}%etFlN)`YERK>R1v|CFhp^H4W8?C|01 z(YO37mJGB(ujTYwcwpFD7|*u^x*0+E;P=%?OG> zJYU&YzD-8%4@wI=E}HbZA948bPp2JSx)7aRtcQJ4AA0_~s2t??)+>(?{9)6 zhY3HIX67nkC*K11d-0LEi^rUF*EOwQ+Iw4$nVCnVa|Gq^cOAa_o+%T~HS}YtOwT(R#BZTLcewAtM#NcsiQF4J&14M1@6<=1f3joTu{i}% z9e)m1oV!Th(RD~_MPJ=htKvZ^?0<0L8+Y83+!I!yKKt1|#afW3y9!MUVe3f|=ef^E z?$IKD!d`{d6r+CRZ}_!3Th9)^)#?%;BEA`Q=v&i{pSXzo>z`kow!_}Tqn2JFxf< zr>|}!nvL!7r{S~W0-MjKMOfGS;oojMu;oMxkZJL8gIf|UMjsn;kq z*gv)K`7G;z5Psa$^K&c*^O%BSZqRrh)@hRGVJ8LhyhUI2RpJxYAWmwx^UgzbR+wKH zzk@$5_(YFL__pY}OH(23-kJh$X9NN2ZPRGcWG>?3S)L?2Nd?%4BO%#scj6nc|G&#! zyv@VB``@fZwEa6UA*0ux9bdsv7QYwgcvD}Ab-SlJU(&2*tTV2)X{*d1`Tf*>Q-u4` z@MTkwZNCRP_^D4^)fOTz^l#ylbL?4!SU=CDay}?ww@SqRMEV&xe9s@*X%(xPX{GVs87DtmuSLT*vq+o zTqZw~oG>5fxH2J!*ok>7Utaov_@1zfk9=OWuenHwyl6B;OnM^R`zDl~-j|0ww9Ccl zG8sVu|BQdzWLZWo{!KC}WORM6!VK(fVm{sEqptFAjJm{w-3NZok5i|E2z6oU$|7qx zxF-s{FMqNj&i{Bg(S6^u;k*fjE{`C67czj?RJ(&{!d!2}Yf@O|I{F_4J>sjwj&Im) zIw(*g_w*=od3<2W?@`L$nn8N}9C2v>o}&yYw|s%g6KZfu~I*mlem~ z**P%08PWf*u^sWXz4Lg16@HAu|Nq2^{RUUbB~*iNRj$YsFP`=%LgcqPYrfBxyWm%? zxKSH6-xF;_T^%*8<8wzDJXib{mhJT|@KjvuyGd@qL%q%exeBr z3gErW2|wP$GxG88`=^GSCOKg~{69J|OesZ1bdxV{PJ9LI`C(D$2}8Yp}^noDg#UGQzz+-+wa?38=NquVsz z9*FmA)^187T7o|575g<<0>66Cj_OK$!gkcDk*$knI={0L-p@PsKtg(4Xw=j!1|-UbW|!J_bu+*6^X<{l|S=P#%5YYsz4f3!p!2 zey6Ki#C?D~`YZ9X!b;4mzHfgfL_ZFmG2KG?@?40|oI*R%{}gMH$I}WXwb$ePZ-%xT z!5*)H{TuAR)SQn#@@zufKDJzo{7_!#d0LCQKToTDNpd^%rq{qe@_^aQS0?UZ6M?I)r)Vo*#iLw?<;SuGKaKe-btUZ z$RBY=5*LS+&z8}h9kA#_1Go7C!!1v|2o6p$u@eAO4 z+r^ku#McDjep!FFyU!4xum<<9dzQxoL z&Sdk6mf-$SV$r&FMB8z`;K*j5b+BK2gKv){s6%b-?bec.main") - val inventory = StoreApi().getInventory() - println("Inventory : $inventory") - val pet = Pet(name = "Elliot", photoUrls = listOf("https://jameshooverstudios.com/wp-content/uploads/2015/04/Majestic-Dog-Photography-Elliot-Nov-5-2014.jpg", "https://express-images.franklymedia.com/6616/sites/981/2020/01/22105725/Elliott.jpg"), id = 123456453, category = Category(id = 13259476, name = "dog"), tags = listOf(Tag(id = 194093, name = "Elliot")), status = Pet.Status.AVAILABLE) - PetApi().addPet(pet) - val elliot = PetApi().getPetById(123456453) - println("Elliot : $elliot") - assert(pet == elliot) - println(".main") - -} diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 4d9d2e534dee..2c33cebc9cbb 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -25,7 +25,6 @@ import java.time.LocalDateTime import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime -import java.util.Date import java.util.Locale import com.fasterxml.jackson.core.type.TypeReference @@ -247,7 +246,7 @@ open class ApiClient(val baseUrl: String) { null -> "" is Array<*> -> toMultiValue(value, "csv").toString() is Iterable<*> -> toMultiValue(value, "csv").toString() - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2c0..000000000000 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index d939e3d5a43e..000000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,494 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun addPet(body: Pet) : Unit { - val localVariableConfig = addPetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation addPet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun addPetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Deletes a pet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deletePet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return RequestConfig - */ - fun deletePetRequestConfig(petId: kotlin.Long, apiKey: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByTags - * - * @param tags Tags to filter by - * @return RequestConfig - */ - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("tags", toMultiValue(tags.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByTags", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Get all pets - * - * @param lastUpdated When this endpoint was hit last to help indentify if the client already has the latest copy. (optional) - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getAllPets(lastUpdated: java.time.OffsetDateTime?) : kotlin.collections.List { - val localVariableConfig = getAllPetsRequestConfig(lastUpdated = lastUpdated) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getAllPets - * - * @param lastUpdated When this endpoint was hit last to help indentify if the client already has the latest copy. (optional) - * @return RequestConfig - */ - fun getAllPetsRequestConfig(lastUpdated: java.time.OffsetDateTime?) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - if (lastUpdated != null) { - put("lastUpdated", listOf(parseDateToQueryString(lastUpdated))) - } - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/getAll", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getPetById(petId: kotlin.Long) : Pet { - val localVariableConfig = getPetByIdRequestConfig(petId = petId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Pet - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getPetById - * - * @param petId ID of pet to return - * @return RequestConfig - */ - fun getPetByIdRequestConfig(petId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePet(body: Pet) : Unit { - val localVariableConfig = updatePetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun updatePetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePetWithForm - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return RequestConfig - */ - fun updatePetWithFormRequestConfig(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("name" to name, "status" to status) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * uploads an image - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return ApiResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation uploadFile - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return RequestConfig - */ - fun uploadFileRequestConfig(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "file" to file) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index 215ed63420c9..000000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,253 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Order - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteOrder - * - * @param orderId ID of the order that needs to be deleted - * @return RequestConfig - */ - fun deleteOrderRequestConfig(orderId: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return kotlin.collections.Map - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getInventory() : kotlin.collections.Map { - val localVariableConfig = getInventoryRequestConfig() - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getInventory - * - * @return RequestConfig - */ - fun getInventoryRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/inventory", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getOrderById - * - * @param orderId ID of pet that needs to be fetched - * @return RequestConfig - */ - fun getOrderByIdRequestConfig(orderId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun placeOrder(body: Order) : Order { - val localVariableConfig = placeOrderRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation placeOrder - * - * @param body order placed for purchasing the pet - * @return RequestConfig - */ - fun placeOrderRequestConfig(body: Order) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/store/order", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 53748b934636..000000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,476 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.User - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUser(body: User) : Unit { - val localVariableConfig = createUserRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUser - * - * @param body Created user object - * @return RequestConfig - */ - fun createUserRequestConfig(body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithArrayInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithArrayInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithArray", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithListInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithListInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithListInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithList", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteUser(username: kotlin.String) : Unit { - val localVariableConfig = deleteUserRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteUser - * - * @param username The name that needs to be deleted - * @return RequestConfig - */ - fun deleteUserRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return User - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getUserByName(username: kotlin.String) : User { - val localVariableConfig = getUserByNameRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as User - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getUserByName - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return RequestConfig - */ - fun getUserByNameRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs user into the system - * - * @param username The user name for login - * @param password The password for login in clear text - * @return kotlin.String - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableConfig = loginUserRequestConfig(username = username, password = password) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation loginUser - * - * @param username The user name for login - * @param password The password for login in clear text - * @return RequestConfig - */ - fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("username", listOf(username.toString())) - put("password", listOf(password.toString())) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/login", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs out current logged in user session - * - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun logoutUser() : Unit { - val localVariableConfig = logoutUserRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation logoutUser - * - * @return RequestConfig - */ - fun logoutUserRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/logout", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param body Updated user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableConfig = updateUserRequestConfig(username = username, body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updateUser - * - * @param username name that need to be deleted - * @param body Updated user object - * @return RequestConfig - */ - fun updateUserRequestConfig(username: kotlin.String, body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt deleted file mode 100644 index ef7a8f1e1a62..000000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -typealias MultiValueMap = MutableMap> - -fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { - "csv" -> "," - "tsv" -> "\t" - "pipe" -> "|" - "space" -> " " - else -> "" -} - -val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } - -fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) - = toMultiValue(items.asIterable(), collectionFormat, map) - -fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { - return when(collectionFormat) { - "multi" -> items.map(map) - else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index e1d5bc9c412c..000000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,245 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Credentials -import okhttp3.OkHttpClient -import okhttp3.RequestBody -import okhttp3.RequestBody.Companion.asRequestBody -import okhttp3.RequestBody.Companion.toRequestBody -import okhttp3.FormBody -import okhttp3.HttpUrl.Companion.toHttpUrlOrNull -import okhttp3.ResponseBody -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.Request -import okhttp3.Headers -import okhttp3.MultipartBody -import java.io.File -import java.net.URLConnection -import java.util.Date -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.LocalTime -import java.time.OffsetDateTime -import java.time.OffsetTime - -open class ApiClient(val baseUrl: String) { - companion object { - protected const val ContentType = "Content-Type" - protected const val Accept = "Accept" - protected const val Authorization = "Authorization" - protected const val JsonMediaType = "application/json" - protected const val FormDataMediaType = "multipart/form-data" - protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" - protected const val XmlMediaType = "application/xml" - - val apiKey: MutableMap = mutableMapOf() - val apiKeyPrefix: MutableMap = mutableMapOf() - var username: String? = null - var password: String? = null - var accessToken: String? = null - - @JvmStatic - val client: OkHttpClient by lazy { - builder.build() - } - - @JvmStatic - val builder: OkHttpClient.Builder = OkHttpClient.Builder() - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - protected fun guessContentTypeFromFile(file: File): String { - val contentType = URLConnection.guessContentTypeFromName(file.name) - return contentType ?: "application/octet-stream" - } - - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> content.asRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == FormDataMediaType -> { - MultipartBody.Builder() - .setType(MultipartBody.FORM) - .apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - if (value is File) { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"; filename=\"${value.name}\"" - ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) - } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) - addPart( - partHeaders, - parameterToString(value).toRequestBody(null) - ) - } - } - }.build() - } - mediaType == FormUrlEncMediaType -> { - FormBody.Builder().apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) - } - }.build() - } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { - if(body == null) { - return null - } - val bodyContent = body.string() - if (bodyContent.isEmpty()) { - return null - } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") - } - } - - protected fun updateAuthParams(requestConfig: RequestConfig) { - if (requestConfig.headers["api_key"].isNullOrEmpty()) { - if (apiKey["api_key"] != null) { - if (apiKeyPrefix["api_key"] != null) { - requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! - } else { - requestConfig.headers["api_key"] = apiKey["api_key"]!! - } - } - } - if (requestConfig.headers[Authorization].isNullOrEmpty()) { - accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer $accessToken " - } - } - } - - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { - val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") - - // take authMethod from operation - updateAuthParams(requestConfig) - - val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - .apply { - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - addQueryParameter(query.key, queryValue) - } - } - }.build() - - // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { - requestConfig.headers[ContentType] = JsonMediaType - } - if (requestConfig.headers[Accept].isNullOrEmpty()) { - requestConfig.headers[Accept] = JsonMediaType - } - val headers = requestConfig.headers - - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Accept header. This is required.") - } - - // TODO: support multiple contentType options here. - val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - - val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) - RequestMethod.GET -> Request.Builder().url(url) - RequestMethod.HEAD -> Request.Builder().url(url).head() - RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(requestConfig.body, contentType)) - RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(requestConfig.body, contentType)) - RequestMethod.POST -> Request.Builder().url(url).post(requestBody(requestConfig.body, contentType)) - RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - }.apply { - headers.forEach { header -> addHeader(header.key, header.value) } - }.build() - - val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() - - // TODO: handle specific mapping types. e.g. Map> - when { - response.isRedirect -> return Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> return Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> return Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> return ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> return ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - } - } - - protected fun parameterToString(value: Any?): String { - when (value) { - null -> { - return "" - } - is Array<*> -> { - return toMultiValue(value, "csv").toString() - } - is Iterable<*> -> { - return toMultiValue(value, "csv").toString() - } - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { - return parseDateToQueryString(value) - } - else -> { - return value.toString() - } - } - } - - protected inline fun parseDateToQueryString(value : T): String { - return value.toString() - } -} diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbfaa..000000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2c0..000000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index ff5e2a81ee8c..000000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,12 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson - -class ByteArrayAdapter { - @ToJson - fun toJson(data: ByteArray): String = String(data) - - @FromJson - fun fromJson(data: String): ByteArray = data.toByteArray() -} diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/Errors.kt deleted file mode 100644 index b5310e71f13c..000000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/Errors.kt +++ /dev/null @@ -1,18 +0,0 @@ -@file:Suppress("unused") -package org.openapitools.client.infrastructure - -import java.lang.RuntimeException - -open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 123L - } -} - -open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 456L - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index b2e1654479a0..000000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDate -import java.time.format.DateTimeFormatter - -class LocalDateAdapter { - @ToJson - fun toJson(value: LocalDate): String { - return DateTimeFormatter.ISO_LOCAL_DATE.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDate { - return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE) - } - -} diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index e082db94811d..000000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter - -class LocalDateTimeAdapter { - @ToJson - fun toJson(value: LocalDateTime): String { - return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDateTime { - return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index 87437871a31e..000000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.OffsetDateTime -import java.time.format.DateTimeFormatter - -class OffsetDateTimeAdapter { - @ToJson - fun toJson(value: OffsetDateTime): String { - return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): OffsetDateTime { - return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt deleted file mode 100644 index 0f2790f370e2..000000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt +++ /dev/null @@ -1,17 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Defines a config object for a given request. - * NOTE: This object doesn't include 'body' because it - * allows for caching of the constructed object - * for many request definitions. - * NOTE: Headers is a Map because rfc2616 defines - * multi-valued headers as csv-only. - */ -data class RequestConfig( - val method: RequestMethod, - val path: String, - val headers: MutableMap = mutableMapOf(), - val query: MutableMap> = mutableMapOf(), - val body: kotlin.Any? = null -) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt deleted file mode 100644 index 931b12b8bd7a..000000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Provides enumerated HTTP verbs - */ -enum class RequestMethod { - GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt deleted file mode 100644 index 9bd2790dc144..000000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Response - -/** - * Provides an extension to evaluation whether the response is a 1xx code - */ -val Response.isInformational : Boolean get() = this.code in 100..199 - -/** - * Provides an extension to evaluation whether the response is a 3xx code - */ -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") -val Response.isRedirect : Boolean get() = this.code in 300..399 - -/** - * Provides an extension to evaluation whether the response is a 4xx code - */ -val Response.isClientError : Boolean get() = this.code in 400..499 - -/** - * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code - */ -val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 9a45b67d9b1a..000000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,21 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.Moshi -import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory -import java.util.Date - -object Serializer { - @JvmStatic - val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(OffsetDateTimeAdapter()) - .add(LocalDateTimeAdapter()) - .add(LocalDateAdapter()) - .add(UUIDAdapter()) - .add(ByteArrayAdapter()) - .add(KotlinJsonAdapterFactory()) - - @JvmStatic - val moshi: Moshi by lazy { - moshiBuilder.build() - } -} diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt deleted file mode 100644 index a4a44cc18b73..000000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.util.UUID - -class UUIDAdapter { - @ToJson - fun toJson(uuid: UUID) = uuid.toString() - - @FromJson - fun fromJson(s: String) = UUID.fromString(s) -} diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index fafca8738f66..000000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,32 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * Describes the result of uploading an image resource - * @param code - * @param type - * @param message - */ - -data class ApiResponse ( - @Json(name = "code") - val code: kotlin.Int? = null, - @Json(name = "type") - val type: kotlin.String? = null, - @Json(name = "message") - val message: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index a4c17c3b49dd..000000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A category for a pet - * @param id - * @param name - */ - -data class Category ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index a66c335904e7..000000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * An order for a pets from the pet store - * @param id - * @param petId - * @param quantity - * @param shipDate - * @param status Order Status - * @param complete - */ - -data class Order ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "petId") - val petId: kotlin.Long? = null, - @Json(name = "quantity") - val quantity: kotlin.Int? = null, - @Json(name = "shipDate") - val shipDate: java.time.OffsetDateTime? = null, - /* Order Status */ - @Json(name = "status") - val status: Order.Status? = null, - @Json(name = "complete") - val complete: kotlin.Boolean? = null -) { - - /** - * Order Status - * Values: placed,approved,delivered - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "placed") placed("placed"), - @Json(name = "approved") approved("approved"), - @Json(name = "delivered") delivered("delivered"); - } -} - diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index a3df06cb6eb3..000000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,56 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.Category -import org.openapitools.client.models.Tag - -import com.squareup.moshi.Json - -/** - * A pet for sale in the pet store - * @param name - * @param photoUrls - * @param id - * @param category - * @param tags - * @param status pet status in the store - */ - -data class Pet ( - @Json(name = "name") - val name: kotlin.String, - @Json(name = "photoUrls") - val photoUrls: kotlin.collections.List, - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "category") - val category: Category? = null, - @Json(name = "tags") - val tags: kotlin.collections.List? = null, - /* pet status in the store */ - @Json(name = "status") - val status: Pet.Status? = null -) { - - /** - * pet status in the store - * Values: available,pending,sold - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "available") available("available"), - @Json(name = "pending") pending("pending"), - @Json(name = "sold") sold("sold"); - } -} - diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index 6e619023a5c9..000000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A tag for a pet - * @param id - * @param name - */ - -data class Tag ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index af1e270325de..000000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,48 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A User who is purchasing from the pet store - * @param id - * @param username - * @param firstName - * @param lastName - * @param email - * @param password - * @param phone - * @param userStatus User Status - */ - -data class User ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "username") - val username: kotlin.String? = null, - @Json(name = "firstName") - val firstName: kotlin.String? = null, - @Json(name = "lastName") - val lastName: kotlin.String? = null, - @Json(name = "email") - val email: kotlin.String? = null, - @Json(name = "password") - val password: kotlin.String? = null, - @Json(name = "phone") - val phone: kotlin.String? = null, - /* User Status */ - @Json(name = "userStatus") - val userStatus: kotlin.Int? = null -) - diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index c344dff4af62..2e95b6cbadca 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -26,7 +26,6 @@ import java.time.LocalDateTime import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime -import java.util.Date import java.util.Locale import com.squareup.moshi.adapter @@ -254,7 +253,7 @@ open class ApiClient(val baseUrl: String) { null -> "" is Array<*> -> toMultiValue(value, "csv").toString() is Iterable<*> -> toMultiValue(value, "csv").toString() - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2c0..000000000000 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/FILES b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/FILES index d1f6eddcef2d..4bfcf9fb54e9 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/FILES @@ -21,7 +21,6 @@ src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt -src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index 78223583f645..000000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,492 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun addPet(body: Pet) : Unit { - val localVariableConfig = addPetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation addPet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun addPetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Deletes a pet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deletePet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return RequestConfig - */ - fun deletePetRequestConfig(petId: kotlin.Long, apiKey: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByStatusRequestConfig(status = status) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByStatus - * - * @param status Status values that need to be considered for filter - * @return RequestConfig - */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("status", toMultiValue(status.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByStatus", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - @Deprecated(message = "This operation is deprecated.") - suspend fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByTags - * - * @param tags Tags to filter by - * @return RequestConfig - */ - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("tags", toMultiValue(tags.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByTags", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun getPetById(petId: kotlin.Long) : Pet { - val localVariableConfig = getPetByIdRequestConfig(petId = petId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Pet - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getPetById - * - * @param petId ID of pet to return - * @return RequestConfig - */ - fun getPetByIdRequestConfig(petId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun updatePet(body: Pet) : Unit { - val localVariableConfig = updatePetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun updatePetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePetWithForm - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return RequestConfig - */ - fun updatePetWithFormRequestConfig(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("name" to name, "status" to status) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * uploads an image - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return ApiResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation uploadFile - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return RequestConfig - */ - fun uploadFileRequestConfig(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "file" to file) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index 4ab794d66081..000000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,253 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Order - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteOrder - * - * @param orderId ID of the order that needs to be deleted - * @return RequestConfig - */ - fun deleteOrderRequestConfig(orderId: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return kotlin.collections.Map - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun getInventory() : kotlin.collections.Map { - val localVariableConfig = getInventoryRequestConfig() - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getInventory - * - * @return RequestConfig - */ - fun getInventoryRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/inventory", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getOrderById - * - * @param orderId ID of pet that needs to be fetched - * @return RequestConfig - */ - fun getOrderByIdRequestConfig(orderId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun placeOrder(body: Order) : Order { - val localVariableConfig = placeOrderRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation placeOrder - * - * @param body order placed for purchasing the pet - * @return RequestConfig - */ - fun placeOrderRequestConfig(body: Order) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/store/order", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 911bbee5b6b3..000000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,476 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.User - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun createUser(body: User) : Unit { - val localVariableConfig = createUserRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUser - * - * @param body Created user object - * @return RequestConfig - */ - fun createUserRequestConfig(body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithArrayInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithArrayInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithArray", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithListInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithListInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithListInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithList", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun deleteUser(username: kotlin.String) : Unit { - val localVariableConfig = deleteUserRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteUser - * - * @param username The name that needs to be deleted - * @return RequestConfig - */ - fun deleteUserRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return User - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun getUserByName(username: kotlin.String) : User { - val localVariableConfig = getUserByNameRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as User - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getUserByName - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return RequestConfig - */ - fun getUserByNameRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs user into the system - * - * @param username The user name for login - * @param password The password for login in clear text - * @return kotlin.String - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableConfig = loginUserRequestConfig(username = username, password = password) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation loginUser - * - * @param username The user name for login - * @param password The password for login in clear text - * @return RequestConfig - */ - fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("username", listOf(username.toString())) - put("password", listOf(password.toString())) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/login", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs out current logged in user session - * - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun logoutUser() : Unit { - val localVariableConfig = logoutUserRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation logoutUser - * - * @return RequestConfig - */ - fun logoutUserRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/logout", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param body Updated user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableConfig = updateUserRequestConfig(username = username, body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updateUser - * - * @param username name that need to be deleted - * @param body Updated user object - * @return RequestConfig - */ - fun updateUserRequestConfig(username: kotlin.String, body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt deleted file mode 100644 index ef7a8f1e1a62..000000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -typealias MultiValueMap = MutableMap> - -fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { - "csv" -> "," - "tsv" -> "\t" - "pipe" -> "|" - "space" -> " " - else -> "" -} - -val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } - -fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) - = toMultiValue(items.asIterable(), collectionFormat, map) - -fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { - return when(collectionFormat) { - "multi" -> items.map(map) - else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index bcbb1cf86273..000000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,251 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Credentials -import okhttp3.OkHttpClient -import okhttp3.RequestBody -import okhttp3.RequestBody.Companion.asRequestBody -import okhttp3.RequestBody.Companion.toRequestBody -import okhttp3.FormBody -import okhttp3.HttpUrl.Companion.toHttpUrlOrNull -import okhttp3.ResponseBody -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.Request -import okhttp3.Headers -import okhttp3.MultipartBody -import java.io.File -import java.net.URLConnection -import java.util.Date -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.LocalTime -import java.time.OffsetDateTime -import java.time.OffsetTime - -open class ApiClient(val baseUrl: String) { - companion object { - protected const val ContentType = "Content-Type" - protected const val Accept = "Accept" - protected const val Authorization = "Authorization" - protected const val JsonMediaType = "application/json" - protected const val FormDataMediaType = "multipart/form-data" - protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" - protected const val XmlMediaType = "application/xml" - - val apiKey: MutableMap = mutableMapOf() - val apiKeyPrefix: MutableMap = mutableMapOf() - var username: String? = null - var password: String? = null - var accessToken: String? = null - - @JvmStatic - val client: OkHttpClient by lazy { - builder.build() - } - - @JvmStatic - val builder: OkHttpClient.Builder = OkHttpClient.Builder() - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - protected fun guessContentTypeFromFile(file: File): String { - val contentType = URLConnection.guessContentTypeFromName(file.name) - return contentType ?: "application/octet-stream" - } - - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> content.asRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == FormDataMediaType -> { - MultipartBody.Builder() - .setType(MultipartBody.FORM) - .apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - if (value is File) { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"; filename=\"${value.name}\"" - ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) - } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) - addPart( - partHeaders, - parameterToString(value).toRequestBody(null) - ) - } - } - }.build() - } - mediaType == FormUrlEncMediaType -> { - FormBody.Builder().apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) - } - }.build() - } - mediaType == JsonMediaType -> Serializer.gson.toJson(content, T::class.java).toRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { - if(body == null) { - return null - } - val bodyContent = body.string() - if (bodyContent.isEmpty()) { - return null - } - return when(mediaType) { - JsonMediaType -> Serializer.gson.fromJson(bodyContent, T::class.java) - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") - } - } - - protected fun updateAuthParams(requestConfig: RequestConfig) { - if (requestConfig.headers["api_key"].isNullOrEmpty()) { - if (apiKey["api_key"] != null) { - if (apiKeyPrefix["api_key"] != null) { - requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! - } else { - requestConfig.headers["api_key"] = apiKey["api_key"]!! - } - } - } - if (requestConfig.headers[Authorization].isNullOrEmpty()) { - accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer $accessToken " - } - } - } - - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { - val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") - - // take authMethod from operation - updateAuthParams(requestConfig) - - val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - .apply { - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - addQueryParameter(query.key, queryValue) - } - } - }.build() - - // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { - requestConfig.headers[ContentType] = JsonMediaType - } - if (requestConfig.headers[Accept].isNullOrEmpty()) { - requestConfig.headers[Accept] = JsonMediaType - } - val headers = requestConfig.headers - - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Accept header. This is required.") - } - - // TODO: support multiple contentType options here. - val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - - val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) - RequestMethod.GET -> Request.Builder().url(url) - RequestMethod.HEAD -> Request.Builder().url(url).head() - RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(requestConfig.body, contentType)) - RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(requestConfig.body, contentType)) - RequestMethod.POST -> Request.Builder().url(url).post(requestBody(requestConfig.body, contentType)) - RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - }.apply { - headers.forEach { header -> addHeader(header.key, header.value) } - }.build() - - val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() - - // TODO: handle specific mapping types. e.g. Map> - when { - response.isRedirect -> return Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> return Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> return Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> return ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> return ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - } - } - - protected fun parameterToString(value: Any?): String { - when (value) { - null -> { - return "" - } - is Array<*> -> { - return toMultiValue(value, "csv").toString() - } - is Iterable<*> -> { - return toMultiValue(value, "csv").toString() - } - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { - return parseDateToQueryString(value) - } - else -> { - return value.toString() - } - } - } - - protected inline fun parseDateToQueryString(value : T): String { - /* - .replace("\"", "") converts the json object string to an actual string for the query parameter. - The moshi or gson adapter allows a more generic solution instead of trying to use a native - formatter. It also easily allows to provide a simple way to define a custom date format pattern - inside a gson/moshi adapter. - */ - return Serializer.gson.toJson(value, T::class.java).replace("\"", "") - } -} diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbfaa..000000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2c0..000000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index 6120b081929d..000000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,33 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException - -class ByteArrayAdapter : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: ByteArray?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(String(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): ByteArray? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return out.nextString().toByteArray() - } - } - } -} diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/DateAdapter.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/DateAdapter.kt deleted file mode 100644 index c5d330ac0757..000000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/DateAdapter.kt +++ /dev/null @@ -1,37 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException -import java.text.DateFormat -import java.text.SimpleDateFormat -import java.util.Date -import java.util.Locale - -class DateAdapter(val formatter: DateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.getDefault())) : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: Date?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(formatter.format(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): Date? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return formatter.parse(out.nextString()) - } - } - } -} diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/Errors.kt deleted file mode 100644 index b5310e71f13c..000000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/Errors.kt +++ /dev/null @@ -1,18 +0,0 @@ -@file:Suppress("unused") -package org.openapitools.client.infrastructure - -import java.lang.RuntimeException - -open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 123L - } -} - -open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 456L - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index 30ef6697183a..000000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,35 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException -import java.time.LocalDate -import java.time.format.DateTimeFormatter - -class LocalDateAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE) : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: LocalDate?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(formatter.format(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): LocalDate? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return LocalDate.parse(out.nextString(), formatter) - } - } - } -} diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index 3ad781c66ca1..000000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,35 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter - -class LocalDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME) : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: LocalDateTime?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(formatter.format(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): LocalDateTime? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return LocalDateTime.parse(out.nextString(), formatter) - } - } - } -} diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index e615135c9cc0..000000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,35 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException -import java.time.OffsetDateTime -import java.time.format.DateTimeFormatter - -class OffsetDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME) : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: OffsetDateTime?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(formatter.format(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): OffsetDateTime? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return OffsetDateTime.parse(out.nextString(), formatter) - } - } - } -} diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt deleted file mode 100644 index 0f2790f370e2..000000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt +++ /dev/null @@ -1,17 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Defines a config object for a given request. - * NOTE: This object doesn't include 'body' because it - * allows for caching of the constructed object - * for many request definitions. - * NOTE: Headers is a Map because rfc2616 defines - * multi-valued headers as csv-only. - */ -data class RequestConfig( - val method: RequestMethod, - val path: String, - val headers: MutableMap = mutableMapOf(), - val query: MutableMap> = mutableMapOf(), - val body: kotlin.Any? = null -) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt deleted file mode 100644 index 931b12b8bd7a..000000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Provides enumerated HTTP verbs - */ -enum class RequestMethod { - GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt deleted file mode 100644 index 9bd2790dc144..000000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Response - -/** - * Provides an extension to evaluation whether the response is a 1xx code - */ -val Response.isInformational : Boolean get() = this.code in 100..199 - -/** - * Provides an extension to evaluation whether the response is a 3xx code - */ -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") -val Response.isRedirect : Boolean get() = this.code in 300..399 - -/** - * Provides an extension to evaluation whether the response is a 4xx code - */ -val Response.isClientError : Boolean get() = this.code in 400..499 - -/** - * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code - */ -val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index b80e0390de2d..000000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.Gson -import com.google.gson.GsonBuilder -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.OffsetDateTime -import java.util.UUID -import java.util.Date - -object Serializer { - @JvmStatic - val gsonBuilder: GsonBuilder = GsonBuilder() - .registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter()) - .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) - .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) - .registerTypeAdapter(ByteArray::class.java, ByteArrayAdapter()) - - @JvmStatic - val gson: Gson by lazy { - gsonBuilder.create() - } -} diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index fc89bf34e7fc..000000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,38 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable - -/** - * Describes the result of uploading an image resource - * @param code - * @param type - * @param message - */ - -data class ApiResponse ( - @SerializedName("code") - val code: kotlin.Int? = null, - @SerializedName("type") - val type: kotlin.String? = null, - @SerializedName("message") - val message: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index b483bee69b3e..000000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,35 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable - -/** - * A category for a pet - * @param id - * @param name - */ - -data class Category ( - @SerializedName("id") - val id: kotlin.Long? = null, - @SerializedName("name") - val name: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index d6bacf867c47..000000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,58 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable - -/** - * An order for a pets from the pet store - * @param id - * @param petId - * @param quantity - * @param shipDate - * @param status Order Status - * @param complete - */ - -data class Order ( - @SerializedName("id") - val id: kotlin.Long? = null, - @SerializedName("petId") - val petId: kotlin.Long? = null, - @SerializedName("quantity") - val quantity: kotlin.Int? = null, - @SerializedName("shipDate") - val shipDate: java.time.OffsetDateTime? = null, - /* Order Status */ - @SerializedName("status") - val status: Order.Status? = null, - @SerializedName("complete") - val complete: kotlin.Boolean? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - - /** - * Order Status - * Values: placed,approved,delivered - */ - - enum class Status(val value: kotlin.String){ - @SerializedName(value = "placed") placed("placed"), - @SerializedName(value = "approved") approved("approved"), - @SerializedName(value = "delivered") delivered("delivered"); - } -} - diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index afa65785d387..000000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,60 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.Category -import org.openapitools.client.models.Tag - -import com.google.gson.annotations.SerializedName -import java.io.Serializable - -/** - * A pet for sale in the pet store - * @param name - * @param photoUrls - * @param id - * @param category - * @param tags - * @param status pet status in the store - */ - -data class Pet ( - @SerializedName("name") - val name: kotlin.String, - @SerializedName("photoUrls") - val photoUrls: kotlin.collections.List, - @SerializedName("id") - val id: kotlin.Long? = null, - @SerializedName("category") - val category: Category? = null, - @SerializedName("tags") - val tags: kotlin.collections.List? = null, - /* pet status in the store */ - @SerializedName("status") - val status: Pet.Status? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - - /** - * pet status in the store - * Values: available,pending,sold - */ - - enum class Status(val value: kotlin.String){ - @SerializedName(value = "available") available("available"), - @SerializedName(value = "pending") pending("pending"), - @SerializedName(value = "sold") sold("sold"); - } -} - diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index a1a282cb38df..000000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,35 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable - -/** - * A tag for a pet - * @param id - * @param name - */ - -data class Tag ( - @SerializedName("id") - val id: kotlin.Long? = null, - @SerializedName("name") - val name: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index 59ba0254f603..000000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable - -/** - * A User who is purchasing from the pet store - * @param id - * @param username - * @param firstName - * @param lastName - * @param email - * @param password - * @param phone - * @param userStatus User Status - */ - -data class User ( - @SerializedName("id") - val id: kotlin.Long? = null, - @SerializedName("username") - val username: kotlin.String? = null, - @SerializedName("firstName") - val firstName: kotlin.String? = null, - @SerializedName("lastName") - val lastName: kotlin.String? = null, - @SerializedName("email") - val email: kotlin.String? = null, - @SerializedName("password") - val password: kotlin.String? = null, - @SerializedName("phone") - val phone: kotlin.String? = null, - /* User Status */ - @SerializedName("userStatus") - val userStatus: kotlin.Int? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 43f89e88cbdb..8ed9955f6448 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -25,7 +25,6 @@ import java.time.LocalDateTime import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime -import java.util.Date import java.util.Locale import kotlin.coroutines.resume import kotlin.coroutines.resumeWithException @@ -261,7 +260,7 @@ open class ApiClient(val baseUrl: String) { null -> "" is Array<*> -> toMultiValue(value, "csv").toString() is Iterable<*> -> toMultiValue(value, "csv").toString() - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2c0..000000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt deleted file mode 100644 index c5d330ac0757..000000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt +++ /dev/null @@ -1,37 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException -import java.text.DateFormat -import java.text.SimpleDateFormat -import java.util.Date -import java.util.Locale - -class DateAdapter(val formatter: DateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.getDefault())) : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: Date?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(formatter.format(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): Date? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return formatter.parse(out.nextString()) - } - } - } -} diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index c8b93b33bf6f..000000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,492 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun addPet(body: Pet) : Unit { - val localVariableConfig = addPetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation addPet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun addPetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Deletes a pet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deletePet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return RequestConfig - */ - fun deletePetRequestConfig(petId: kotlin.Long, apiKey: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByStatusRequestConfig(status = status) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByStatus - * - * @param status Status values that need to be considered for filter - * @return RequestConfig - */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("status", toMultiValue(status.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByStatus", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByTags - * - * @param tags Tags to filter by - * @return RequestConfig - */ - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("tags", toMultiValue(tags.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByTags", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getPetById(petId: kotlin.Long) : Pet { - val localVariableConfig = getPetByIdRequestConfig(petId = petId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Pet - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getPetById - * - * @param petId ID of pet to return - * @return RequestConfig - */ - fun getPetByIdRequestConfig(petId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePet(body: Pet) : Unit { - val localVariableConfig = updatePetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun updatePetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePetWithForm - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return RequestConfig - */ - fun updatePetWithFormRequestConfig(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("name" to name, "status" to status) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * uploads an image - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return ApiResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation uploadFile - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return RequestConfig - */ - fun uploadFileRequestConfig(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "file" to file) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index 215ed63420c9..000000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,253 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Order - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteOrder - * - * @param orderId ID of the order that needs to be deleted - * @return RequestConfig - */ - fun deleteOrderRequestConfig(orderId: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return kotlin.collections.Map - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getInventory() : kotlin.collections.Map { - val localVariableConfig = getInventoryRequestConfig() - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getInventory - * - * @return RequestConfig - */ - fun getInventoryRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/inventory", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getOrderById - * - * @param orderId ID of pet that needs to be fetched - * @return RequestConfig - */ - fun getOrderByIdRequestConfig(orderId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun placeOrder(body: Order) : Order { - val localVariableConfig = placeOrderRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation placeOrder - * - * @param body order placed for purchasing the pet - * @return RequestConfig - */ - fun placeOrderRequestConfig(body: Order) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/store/order", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 53748b934636..000000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,476 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.User - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUser(body: User) : Unit { - val localVariableConfig = createUserRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUser - * - * @param body Created user object - * @return RequestConfig - */ - fun createUserRequestConfig(body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithArrayInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithArrayInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithArray", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithListInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithListInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithListInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithList", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteUser(username: kotlin.String) : Unit { - val localVariableConfig = deleteUserRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteUser - * - * @param username The name that needs to be deleted - * @return RequestConfig - */ - fun deleteUserRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return User - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getUserByName(username: kotlin.String) : User { - val localVariableConfig = getUserByNameRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as User - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getUserByName - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return RequestConfig - */ - fun getUserByNameRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs user into the system - * - * @param username The user name for login - * @param password The password for login in clear text - * @return kotlin.String - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableConfig = loginUserRequestConfig(username = username, password = password) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation loginUser - * - * @param username The user name for login - * @param password The password for login in clear text - * @return RequestConfig - */ - fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("username", listOf(username.toString())) - put("password", listOf(password.toString())) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/login", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs out current logged in user session - * - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun logoutUser() : Unit { - val localVariableConfig = logoutUserRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation logoutUser - * - * @return RequestConfig - */ - fun logoutUserRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/logout", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param body Updated user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableConfig = updateUserRequestConfig(username = username, body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updateUser - * - * @param username name that need to be deleted - * @param body Updated user object - * @return RequestConfig - */ - fun updateUserRequestConfig(username: kotlin.String, body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt deleted file mode 100644 index ef7a8f1e1a62..000000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -typealias MultiValueMap = MutableMap> - -fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { - "csv" -> "," - "tsv" -> "\t" - "pipe" -> "|" - "space" -> " " - else -> "" -} - -val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } - -fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) - = toMultiValue(items.asIterable(), collectionFormat, map) - -fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { - return when(collectionFormat) { - "multi" -> items.map(map) - else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index 7a8dcc91cd4b..000000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,251 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Credentials -import okhttp3.OkHttpClient -import okhttp3.RequestBody -import okhttp3.RequestBody.Companion.asRequestBody -import okhttp3.RequestBody.Companion.toRequestBody -import okhttp3.FormBody -import okhttp3.HttpUrl.Companion.toHttpUrlOrNull -import okhttp3.ResponseBody -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.Request -import okhttp3.Headers -import okhttp3.MultipartBody -import java.io.File -import java.net.URLConnection -import java.util.Date -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.LocalTime -import java.time.OffsetDateTime -import java.time.OffsetTime - -open class ApiClient(val baseUrl: String) { - companion object { - protected const val ContentType = "Content-Type" - protected const val Accept = "Accept" - protected const val Authorization = "Authorization" - protected const val JsonMediaType = "application/json" - protected const val FormDataMediaType = "multipart/form-data" - protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" - protected const val XmlMediaType = "application/xml" - - val apiKey: MutableMap = mutableMapOf() - val apiKeyPrefix: MutableMap = mutableMapOf() - var username: String? = null - var password: String? = null - var accessToken: String? = null - - @JvmStatic - val client: OkHttpClient by lazy { - builder.build() - } - - @JvmStatic - val builder: OkHttpClient.Builder = OkHttpClient.Builder() - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - protected fun guessContentTypeFromFile(file: File): String { - val contentType = URLConnection.guessContentTypeFromName(file.name) - return contentType ?: "application/octet-stream" - } - - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> content.asRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == FormDataMediaType -> { - MultipartBody.Builder() - .setType(MultipartBody.FORM) - .apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - if (value is File) { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"; filename=\"${value.name}\"" - ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) - } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) - addPart( - partHeaders, - parameterToString(value).toRequestBody(null) - ) - } - } - }.build() - } - mediaType == FormUrlEncMediaType -> { - FormBody.Builder().apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) - } - }.build() - } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { - if(body == null) { - return null - } - val bodyContent = body.string() - if (bodyContent.isEmpty()) { - return null - } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") - } - } - - protected fun updateAuthParams(requestConfig: RequestConfig) { - if (requestConfig.headers["api_key"].isNullOrEmpty()) { - if (apiKey["api_key"] != null) { - if (apiKeyPrefix["api_key"] != null) { - requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! - } else { - requestConfig.headers["api_key"] = apiKey["api_key"]!! - } - } - } - if (requestConfig.headers[Authorization].isNullOrEmpty()) { - accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer $accessToken " - } - } - } - - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { - val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") - - // take authMethod from operation - updateAuthParams(requestConfig) - - val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - .apply { - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - addQueryParameter(query.key, queryValue) - } - } - }.build() - - // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { - requestConfig.headers[ContentType] = JsonMediaType - } - if (requestConfig.headers[Accept].isNullOrEmpty()) { - requestConfig.headers[Accept] = JsonMediaType - } - val headers = requestConfig.headers - - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Accept header. This is required.") - } - - // TODO: support multiple contentType options here. - val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - - val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) - RequestMethod.GET -> Request.Builder().url(url) - RequestMethod.HEAD -> Request.Builder().url(url).head() - RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(requestConfig.body, contentType)) - RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(requestConfig.body, contentType)) - RequestMethod.POST -> Request.Builder().url(url).post(requestBody(requestConfig.body, contentType)) - RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - }.apply { - headers.forEach { header -> addHeader(header.key, header.value) } - }.build() - - val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() - - // TODO: handle specific mapping types. e.g. Map> - when { - response.isRedirect -> return Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> return Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> return Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> return ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> return ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - } - } - - protected fun parameterToString(value: Any?): String { - when (value) { - null -> { - return "" - } - is Array<*> -> { - return toMultiValue(value, "csv").toString() - } - is Iterable<*> -> { - return toMultiValue(value, "csv").toString() - } - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { - return parseDateToQueryString(value) - } - else -> { - return value.toString() - } - } - } - - protected inline fun parseDateToQueryString(value : T): String { - /* - .replace("\"", "") converts the json object string to an actual string for the query parameter. - The moshi or gson adapter allows a more generic solution instead of trying to use a native - formatter. It also easily allows to provide a simple way to define a custom date format pattern - inside a gson/moshi adapter. - */ - return Serializer.moshi.adapter(T::class.java).toJson(value).replace("\"", "") - } -} diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbfaa..000000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2c0..000000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index ff5e2a81ee8c..000000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,12 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson - -class ByteArrayAdapter { - @ToJson - fun toJson(data: ByteArray): String = String(data) - - @FromJson - fun fromJson(data: String): ByteArray = data.toByteArray() -} diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/Errors.kt deleted file mode 100644 index b5310e71f13c..000000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/Errors.kt +++ /dev/null @@ -1,18 +0,0 @@ -@file:Suppress("unused") -package org.openapitools.client.infrastructure - -import java.lang.RuntimeException - -open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 123L - } -} - -open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 456L - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index b2e1654479a0..000000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDate -import java.time.format.DateTimeFormatter - -class LocalDateAdapter { - @ToJson - fun toJson(value: LocalDate): String { - return DateTimeFormatter.ISO_LOCAL_DATE.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDate { - return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE) - } - -} diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index e082db94811d..000000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter - -class LocalDateTimeAdapter { - @ToJson - fun toJson(value: LocalDateTime): String { - return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDateTime { - return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index 87437871a31e..000000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.OffsetDateTime -import java.time.format.DateTimeFormatter - -class OffsetDateTimeAdapter { - @ToJson - fun toJson(value: OffsetDateTime): String { - return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): OffsetDateTime { - return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt deleted file mode 100644 index 0f2790f370e2..000000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt +++ /dev/null @@ -1,17 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Defines a config object for a given request. - * NOTE: This object doesn't include 'body' because it - * allows for caching of the constructed object - * for many request definitions. - * NOTE: Headers is a Map because rfc2616 defines - * multi-valued headers as csv-only. - */ -data class RequestConfig( - val method: RequestMethod, - val path: String, - val headers: MutableMap = mutableMapOf(), - val query: MutableMap> = mutableMapOf(), - val body: kotlin.Any? = null -) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt deleted file mode 100644 index 931b12b8bd7a..000000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Provides enumerated HTTP verbs - */ -enum class RequestMethod { - GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt deleted file mode 100644 index 9bd2790dc144..000000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Response - -/** - * Provides an extension to evaluation whether the response is a 1xx code - */ -val Response.isInformational : Boolean get() = this.code in 100..199 - -/** - * Provides an extension to evaluation whether the response is a 3xx code - */ -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") -val Response.isRedirect : Boolean get() = this.code in 300..399 - -/** - * Provides an extension to evaluation whether the response is a 4xx code - */ -val Response.isClientError : Boolean get() = this.code in 400..499 - -/** - * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code - */ -val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 25447c818e66..000000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.Moshi -import java.util.Date - -object Serializer { - @JvmStatic - val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(OffsetDateTimeAdapter()) - .add(LocalDateTimeAdapter()) - .add(LocalDateAdapter()) - .add(UUIDAdapter()) - .add(ByteArrayAdapter()) - - @JvmStatic - val moshi: Moshi by lazy { - moshiBuilder.build() - } -} diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt deleted file mode 100644 index a4a44cc18b73..000000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.util.UUID - -class UUIDAdapter { - @ToJson - fun toJson(uuid: UUID) = uuid.toString() - - @FromJson - fun fromJson(s: String) = UUID.fromString(s) -} diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index 18d2ce3dbbe7..000000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,33 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import com.squareup.moshi.JsonClass - -/** - * Describes the result of uploading an image resource - * @param code - * @param type - * @param message - */ -@JsonClass(generateAdapter = true) -data class ApiResponse ( - @Json(name = "code") - val code: kotlin.Int? = null, - @Json(name = "type") - val type: kotlin.String? = null, - @Json(name = "message") - val message: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index 8396fa423574..000000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,30 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import com.squareup.moshi.JsonClass - -/** - * A category for a pet - * @param id - * @param name - */ -@JsonClass(generateAdapter = true) -data class Category ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index d7091dd4c0c2..000000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,55 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import com.squareup.moshi.JsonClass - -/** - * An order for a pets from the pet store - * @param id - * @param petId - * @param quantity - * @param shipDate - * @param status Order Status - * @param complete - */ -@JsonClass(generateAdapter = true) -data class Order ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "petId") - val petId: kotlin.Long? = null, - @Json(name = "quantity") - val quantity: kotlin.Int? = null, - @Json(name = "shipDate") - val shipDate: java.time.OffsetDateTime? = null, - /* Order Status */ - @Json(name = "status") - val status: Order.Status? = null, - @Json(name = "complete") - val complete: kotlin.Boolean? = null -) { - - /** - * Order Status - * Values: placed,approved,delivered - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "placed") placed("placed"), - @Json(name = "approved") approved("approved"), - @Json(name = "delivered") delivered("delivered"); - } -} - diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index 8b4e6b44d4cc..000000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,57 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.Category -import org.openapitools.client.models.Tag - -import com.squareup.moshi.Json -import com.squareup.moshi.JsonClass - -/** - * A pet for sale in the pet store - * @param name - * @param photoUrls - * @param id - * @param category - * @param tags - * @param status pet status in the store - */ -@JsonClass(generateAdapter = true) -data class Pet ( - @Json(name = "name") - val name: kotlin.String, - @Json(name = "photoUrls") - val photoUrls: kotlin.collections.List, - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "category") - val category: Category? = null, - @Json(name = "tags") - val tags: kotlin.collections.List? = null, - /* pet status in the store */ - @Json(name = "status") - val status: Pet.Status? = null -) { - - /** - * pet status in the store - * Values: available,pending,sold - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "available") available("available"), - @Json(name = "pending") pending("pending"), - @Json(name = "sold") sold("sold"); - } -} - diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index e7cdab2bb5df..000000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,30 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import com.squareup.moshi.JsonClass - -/** - * A tag for a pet - * @param id - * @param name - */ -@JsonClass(generateAdapter = true) -data class Tag ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index 1bfad8449046..000000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,49 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import com.squareup.moshi.JsonClass - -/** - * A User who is purchasing from the pet store - * @param id - * @param username - * @param firstName - * @param lastName - * @param email - * @param password - * @param phone - * @param userStatus User Status - */ -@JsonClass(generateAdapter = true) -data class User ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "username") - val username: kotlin.String? = null, - @Json(name = "firstName") - val firstName: kotlin.String? = null, - @Json(name = "lastName") - val lastName: kotlin.String? = null, - @Json(name = "email") - val email: kotlin.String? = null, - @Json(name = "password") - val password: kotlin.String? = null, - @Json(name = "phone") - val phone: kotlin.String? = null, - /* User Status */ - @Json(name = "userStatus") - val userStatus: kotlin.Int? = null -) - diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 7282e53200b6..2abf02f23b42 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -25,7 +25,6 @@ import java.time.LocalDateTime import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime -import java.util.Date import java.util.Locale import com.squareup.moshi.adapter @@ -248,7 +247,7 @@ open class ApiClient(val baseUrl: String) { null -> "" is Array<*> -> toMultiValue(value, "csv").toString() is Iterable<*> -> toMultiValue(value, "csv").toString() - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2c0..000000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index b6b38fa42f34..000000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,492 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun addPet(body: Pet) : Unit { - val localVariableConfig = addPetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation addPet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun addPetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Deletes a pet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deletePet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return RequestConfig - */ - fun deletePetRequestConfig(petId: kotlin.Long, apiKey: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByStatusRequestConfig(status = status) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByStatus - * - * @param status Status values that need to be considered for filter - * @return RequestConfig - */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("status", toMultiValue(status.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByStatus", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByTags - * - * @param tags Tags to filter by - * @return RequestConfig - */ - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("tags", toMultiValue(tags.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByTags", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getPetById(petId: kotlin.Long) : Pet { - val localVariableConfig = getPetByIdRequestConfig(petId = petId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Pet - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getPetById - * - * @param petId ID of pet to return - * @return RequestConfig - */ - fun getPetByIdRequestConfig(petId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePet(body: Pet) : Unit { - val localVariableConfig = updatePetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun updatePetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePetWithForm - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return RequestConfig - */ - fun updatePetWithFormRequestConfig(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("name" to name, "status" to status) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * uploads an image - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return ApiResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation uploadFile - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return RequestConfig - */ - fun uploadFileRequestConfig(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "file" to file) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index 19b7acdbd31e..000000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,253 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Order - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteOrder - * - * @param orderId ID of the order that needs to be deleted - * @return RequestConfig - */ - fun deleteOrderRequestConfig(orderId: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return kotlin.collections.Map - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getInventory() : kotlin.collections.Map { - val localVariableConfig = getInventoryRequestConfig() - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getInventory - * - * @return RequestConfig - */ - fun getInventoryRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/inventory", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getOrderById - * - * @param orderId ID of pet that needs to be fetched - * @return RequestConfig - */ - fun getOrderByIdRequestConfig(orderId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun placeOrder(body: Order) : Order { - val localVariableConfig = placeOrderRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation placeOrder - * - * @param body order placed for purchasing the pet - * @return RequestConfig - */ - fun placeOrderRequestConfig(body: Order) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/store/order", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 979bb1b81f86..000000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,476 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.User - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUser(body: User) : Unit { - val localVariableConfig = createUserRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUser - * - * @param body Created user object - * @return RequestConfig - */ - fun createUserRequestConfig(body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithArrayInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithArrayInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithArray", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithListInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithListInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithListInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithList", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteUser(username: kotlin.String) : Unit { - val localVariableConfig = deleteUserRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteUser - * - * @param username The name that needs to be deleted - * @return RequestConfig - */ - fun deleteUserRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return User - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getUserByName(username: kotlin.String) : User { - val localVariableConfig = getUserByNameRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as User - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getUserByName - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return RequestConfig - */ - fun getUserByNameRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs user into the system - * - * @param username The user name for login - * @param password The password for login in clear text - * @return kotlin.String - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableConfig = loginUserRequestConfig(username = username, password = password) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation loginUser - * - * @param username The user name for login - * @param password The password for login in clear text - * @return RequestConfig - */ - fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("username", listOf(username.toString())) - put("password", listOf(password.toString())) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/login", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs out current logged in user session - * - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun logoutUser() : Unit { - val localVariableConfig = logoutUserRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation logoutUser - * - * @return RequestConfig - */ - fun logoutUserRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/logout", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param body Updated user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableConfig = updateUserRequestConfig(username = username, body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updateUser - * - * @param username name that need to be deleted - * @param body Updated user object - * @return RequestConfig - */ - fun updateUserRequestConfig(username: kotlin.String, body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt deleted file mode 100644 index d26cda9091ca..000000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -internal typealias MultiValueMap = MutableMap> - -internal fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { - "csv" -> "," - "tsv" -> "\t" - "pipe" -> "|" - "space" -> " " - else -> "" -} - -internal val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } - -internal fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) - = toMultiValue(items.asIterable(), collectionFormat, map) - -internal fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { - return when(collectionFormat) { - "multi" -> items.map(map) - else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index c4da8e3989b8..000000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,251 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Credentials -import okhttp3.OkHttpClient -import okhttp3.RequestBody -import okhttp3.RequestBody.Companion.asRequestBody -import okhttp3.RequestBody.Companion.toRequestBody -import okhttp3.FormBody -import okhttp3.HttpUrl.Companion.toHttpUrlOrNull -import okhttp3.ResponseBody -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.Request -import okhttp3.Headers -import okhttp3.MultipartBody -import java.io.File -import java.net.URLConnection -import java.util.Date -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.LocalTime -import java.time.OffsetDateTime -import java.time.OffsetTime - -internal open class ApiClient(val baseUrl: String) { - internal companion object { - protected const val ContentType = "Content-Type" - protected const val Accept = "Accept" - protected const val Authorization = "Authorization" - protected const val JsonMediaType = "application/json" - protected const val FormDataMediaType = "multipart/form-data" - protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" - protected const val XmlMediaType = "application/xml" - - val apiKey: MutableMap = mutableMapOf() - val apiKeyPrefix: MutableMap = mutableMapOf() - var username: String? = null - var password: String? = null - var accessToken: String? = null - - @JvmStatic - val client: OkHttpClient by lazy { - builder.build() - } - - @JvmStatic - val builder: OkHttpClient.Builder = OkHttpClient.Builder() - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - protected fun guessContentTypeFromFile(file: File): String { - val contentType = URLConnection.guessContentTypeFromName(file.name) - return contentType ?: "application/octet-stream" - } - - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> content.asRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == FormDataMediaType -> { - MultipartBody.Builder() - .setType(MultipartBody.FORM) - .apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - if (value is File) { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"; filename=\"${value.name}\"" - ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) - } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) - addPart( - partHeaders, - parameterToString(value).toRequestBody(null) - ) - } - } - }.build() - } - mediaType == FormUrlEncMediaType -> { - FormBody.Builder().apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) - } - }.build() - } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { - if(body == null) { - return null - } - val bodyContent = body.string() - if (bodyContent.isEmpty()) { - return null - } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") - } - } - - protected fun updateAuthParams(requestConfig: RequestConfig) { - if (requestConfig.headers["api_key"].isNullOrEmpty()) { - if (apiKey["api_key"] != null) { - if (apiKeyPrefix["api_key"] != null) { - requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! - } else { - requestConfig.headers["api_key"] = apiKey["api_key"]!! - } - } - } - if (requestConfig.headers[Authorization].isNullOrEmpty()) { - accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer $accessToken " - } - } - } - - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { - val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") - - // take authMethod from operation - updateAuthParams(requestConfig) - - val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - .apply { - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - addQueryParameter(query.key, queryValue) - } - } - }.build() - - // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { - requestConfig.headers[ContentType] = JsonMediaType - } - if (requestConfig.headers[Accept].isNullOrEmpty()) { - requestConfig.headers[Accept] = JsonMediaType - } - val headers = requestConfig.headers - - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Accept header. This is required.") - } - - // TODO: support multiple contentType options here. - val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - - val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) - RequestMethod.GET -> Request.Builder().url(url) - RequestMethod.HEAD -> Request.Builder().url(url).head() - RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(requestConfig.body, contentType)) - RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(requestConfig.body, contentType)) - RequestMethod.POST -> Request.Builder().url(url).post(requestBody(requestConfig.body, contentType)) - RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - }.apply { - headers.forEach { header -> addHeader(header.key, header.value) } - }.build() - - val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() - - // TODO: handle specific mapping types. e.g. Map> - when { - response.isRedirect -> return Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> return Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> return Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> return ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> return ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - } - } - - protected fun parameterToString(value: Any?): String { - when (value) { - null -> { - return "" - } - is Array<*> -> { - return toMultiValue(value, "csv").toString() - } - is Iterable<*> -> { - return toMultiValue(value, "csv").toString() - } - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { - return parseDateToQueryString(value) - } - else -> { - return value.toString() - } - } - } - - protected inline fun parseDateToQueryString(value : T): String { - /* - .replace("\"", "") converts the json object string to an actual string for the query parameter. - The moshi or gson adapter allows a more generic solution instead of trying to use a native - formatter. It also easily allows to provide a simple way to define a custom date format pattern - inside a gson/moshi adapter. - */ - return Serializer.moshi.adapter(T::class.java).toJson(value).replace("\"", "") - } -} diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index c618544573e4..000000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -internal enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -internal interface Response - -internal abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -internal class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -internal class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -internal class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -internal class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -internal class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index d7f9079c0d54..000000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -internal object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index 86bcb51fba6f..000000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,12 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson - -internal class ByteArrayAdapter { - @ToJson - fun toJson(data: ByteArray): String = String(data) - - @FromJson - fun fromJson(data: String): ByteArray = data.toByteArray() -} diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/Errors.kt deleted file mode 100644 index 204b69dcb08e..000000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/Errors.kt +++ /dev/null @@ -1,18 +0,0 @@ -@file:Suppress("unused") -package org.openapitools.client.infrastructure - -import java.lang.RuntimeException - -internal open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - internal companion object { - private const val serialVersionUID: Long = 123L - } -} - -internal open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - internal companion object { - private const val serialVersionUID: Long = 456L - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index e86215d5717d..000000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDate -import java.time.format.DateTimeFormatter - -internal class LocalDateAdapter { - @ToJson - fun toJson(value: LocalDate): String { - return DateTimeFormatter.ISO_LOCAL_DATE.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDate { - return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE) - } - -} diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index fe7069904ca3..000000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter - -internal class LocalDateTimeAdapter { - @ToJson - fun toJson(value: LocalDateTime): String { - return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDateTime { - return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index be7703c103d2..000000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.OffsetDateTime -import java.time.format.DateTimeFormatter - -internal class OffsetDateTimeAdapter { - @ToJson - fun toJson(value: OffsetDateTime): String { - return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): OffsetDateTime { - return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt deleted file mode 100644 index 68f41c5497dd..000000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt +++ /dev/null @@ -1,17 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Defines a config object for a given request. - * NOTE: This object doesn't include 'body' because it - * allows for caching of the constructed object - * for many request definitions. - * NOTE: Headers is a Map because rfc2616 defines - * multi-valued headers as csv-only. - */ -internal data class RequestConfig( - val method: RequestMethod, - val path: String, - val headers: MutableMap = mutableMapOf(), - val query: MutableMap> = mutableMapOf(), - val body: kotlin.Any? = null -) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt deleted file mode 100644 index e0fbb1e6526c..000000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Provides enumerated HTTP verbs - */ -internal enum class RequestMethod { - GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt deleted file mode 100644 index 858d1b7339b4..000000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Response - -/** - * Provides an extension to evaluation whether the response is a 1xx code - */ -internal val Response.isInformational : Boolean get() = this.code in 100..199 - -/** - * Provides an extension to evaluation whether the response is a 3xx code - */ -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") -internal val Response.isRedirect : Boolean get() = this.code in 300..399 - -/** - * Provides an extension to evaluation whether the response is a 4xx code - */ -internal val Response.isClientError : Boolean get() = this.code in 400..499 - -/** - * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code - */ -internal val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 7265f7591428..000000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,21 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.Moshi -import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory -import java.util.Date - -internal object Serializer { - @JvmStatic - val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(OffsetDateTimeAdapter()) - .add(LocalDateTimeAdapter()) - .add(LocalDateAdapter()) - .add(UUIDAdapter()) - .add(ByteArrayAdapter()) - .add(KotlinJsonAdapterFactory()) - - @JvmStatic - val moshi: Moshi by lazy { - moshiBuilder.build() - } -} diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt deleted file mode 100644 index 02fa692b57dc..000000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.util.UUID - -internal class UUIDAdapter { - @ToJson - fun toJson(uuid: UUID) = uuid.toString() - - @FromJson - fun fromJson(s: String) = UUID.fromString(s) -} diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index a695278dfa3c..000000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,32 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * Describes the result of uploading an image resource - * @param code - * @param type - * @param message - */ - -internal data class ApiResponse ( - @Json(name = "code") - val code: kotlin.Int? = null, - @Json(name = "type") - val type: kotlin.String? = null, - @Json(name = "message") - val message: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index 376994a9b250..000000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A category for a pet - * @param id - * @param name - */ - -internal data class Category ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index a943b97c1ea3..000000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * An order for a pets from the pet store - * @param id - * @param petId - * @param quantity - * @param shipDate - * @param status Order Status - * @param complete - */ - -internal data class Order ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "petId") - val petId: kotlin.Long? = null, - @Json(name = "quantity") - val quantity: kotlin.Int? = null, - @Json(name = "shipDate") - val shipDate: java.time.OffsetDateTime? = null, - /* Order Status */ - @Json(name = "status") - val status: Order.Status? = null, - @Json(name = "complete") - val complete: kotlin.Boolean? = null -) { - - /** - * Order Status - * Values: placed,approved,delivered - */ - - internal enum class Status(val value: kotlin.String){ - @Json(name = "placed") placed("placed"), - @Json(name = "approved") approved("approved"), - @Json(name = "delivered") delivered("delivered"); - } -} - diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index 544fab20f5a7..000000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,56 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.Category -import org.openapitools.client.models.Tag - -import com.squareup.moshi.Json - -/** - * A pet for sale in the pet store - * @param name - * @param photoUrls - * @param id - * @param category - * @param tags - * @param status pet status in the store - */ - -internal data class Pet ( - @Json(name = "name") - val name: kotlin.String, - @Json(name = "photoUrls") - val photoUrls: kotlin.collections.List, - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "category") - val category: Category? = null, - @Json(name = "tags") - val tags: kotlin.collections.List? = null, - /* pet status in the store */ - @Json(name = "status") - val status: Pet.Status? = null -) { - - /** - * pet status in the store - * Values: available,pending,sold - */ - - internal enum class Status(val value: kotlin.String){ - @Json(name = "available") available("available"), - @Json(name = "pending") pending("pending"), - @Json(name = "sold") sold("sold"); - } -} - diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index d9b84e93eafd..000000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A tag for a pet - * @param id - * @param name - */ - -internal data class Tag ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index e0e821cd7e38..000000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,48 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A User who is purchasing from the pet store - * @param id - * @param username - * @param firstName - * @param lastName - * @param email - * @param password - * @param phone - * @param userStatus User Status - */ - -internal data class User ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "username") - val username: kotlin.String? = null, - @Json(name = "firstName") - val firstName: kotlin.String? = null, - @Json(name = "lastName") - val lastName: kotlin.String? = null, - @Json(name = "email") - val email: kotlin.String? = null, - @Json(name = "password") - val password: kotlin.String? = null, - @Json(name = "phone") - val phone: kotlin.String? = null, - /* User Status */ - @Json(name = "userStatus") - val userStatus: kotlin.Int? = null -) - diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 6ef92322fb16..90c872b1e36a 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -25,7 +25,6 @@ import java.time.LocalDateTime import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime -import java.util.Date import java.util.Locale import com.squareup.moshi.adapter @@ -248,7 +247,7 @@ internal open class ApiClient(val baseUrl: String) { null -> "" is Array<*> -> toMultiValue(value, "csv").toString() is Iterable<*> -> toMultiValue(value, "csv").toString() - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index d7f9079c0d54..000000000000 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -internal object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index 95f695cb9f48..000000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,492 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun addPet(body: Pet) : Unit { - val localVariableConfig = addPetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation addPet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun addPetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Deletes a pet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deletePet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return RequestConfig - */ - fun deletePetRequestConfig(petId: kotlin.Long, apiKey: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter - * @return kotlin.collections.List or null - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List? { - val localVariableConfig = findPetsByStatusRequestConfig(status = status) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List? - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByStatus - * - * @param status Status values that need to be considered for filter - * @return RequestConfig - */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("status", toMultiValue(status.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByStatus", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by - * @return kotlin.collections.List or null - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List? { - val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List? - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByTags - * - * @param tags Tags to filter by - * @return RequestConfig - */ - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("tags", toMultiValue(tags.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByTags", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet or null - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getPetById(petId: kotlin.Long) : Pet? { - val localVariableConfig = getPetByIdRequestConfig(petId = petId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Pet? - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getPetById - * - * @param petId ID of pet to return - * @return RequestConfig - */ - fun getPetByIdRequestConfig(petId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePet(body: Pet) : Unit { - val localVariableConfig = updatePetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun updatePetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePetWithForm - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return RequestConfig - */ - fun updatePetWithFormRequestConfig(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("name" to name, "status" to status) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * uploads an image - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return ApiResponse or null - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse? { - val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse? - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation uploadFile - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return RequestConfig - */ - fun uploadFileRequestConfig(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "file" to file) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index c442f8661003..000000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,253 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Order - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteOrder - * - * @param orderId ID of the order that needs to be deleted - * @return RequestConfig - */ - fun deleteOrderRequestConfig(orderId: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return kotlin.collections.Map or null - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getInventory() : kotlin.collections.Map? { - val localVariableConfig = getInventoryRequestConfig() - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map? - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getInventory - * - * @return RequestConfig - */ - fun getInventoryRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/inventory", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched - * @return Order or null - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getOrderById(orderId: kotlin.Long) : Order? { - val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order? - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getOrderById - * - * @param orderId ID of pet that needs to be fetched - * @return RequestConfig - */ - fun getOrderByIdRequestConfig(orderId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet - * @return Order or null - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun placeOrder(body: Order) : Order? { - val localVariableConfig = placeOrderRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order? - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation placeOrder - * - * @param body order placed for purchasing the pet - * @return RequestConfig - */ - fun placeOrderRequestConfig(body: Order) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/store/order", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 6e6c329144cc..000000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,476 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.User - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUser(body: User) : Unit { - val localVariableConfig = createUserRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUser - * - * @param body Created user object - * @return RequestConfig - */ - fun createUserRequestConfig(body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithArrayInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithArrayInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithArray", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithListInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithListInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithListInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithList", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteUser(username: kotlin.String) : Unit { - val localVariableConfig = deleteUserRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteUser - * - * @param username The name that needs to be deleted - * @return RequestConfig - */ - fun deleteUserRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return User or null - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getUserByName(username: kotlin.String) : User? { - val localVariableConfig = getUserByNameRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as User? - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getUserByName - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return RequestConfig - */ - fun getUserByNameRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs user into the system - * - * @param username The user name for login - * @param password The password for login in clear text - * @return kotlin.String or null - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String? { - val localVariableConfig = loginUserRequestConfig(username = username, password = password) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String? - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation loginUser - * - * @param username The user name for login - * @param password The password for login in clear text - * @return RequestConfig - */ - fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("username", listOf(username.toString())) - put("password", listOf(password.toString())) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/login", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs out current logged in user session - * - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun logoutUser() : Unit { - val localVariableConfig = logoutUserRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation logoutUser - * - * @return RequestConfig - */ - fun logoutUserRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/logout", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param body Updated user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableConfig = updateUserRequestConfig(username = username, body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updateUser - * - * @param username name that need to be deleted - * @param body Updated user object - * @return RequestConfig - */ - fun updateUserRequestConfig(username: kotlin.String, body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt deleted file mode 100644 index ef7a8f1e1a62..000000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -typealias MultiValueMap = MutableMap> - -fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { - "csv" -> "," - "tsv" -> "\t" - "pipe" -> "|" - "space" -> " " - else -> "" -} - -val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } - -fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) - = toMultiValue(items.asIterable(), collectionFormat, map) - -fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { - return when(collectionFormat) { - "multi" -> items.map(map) - else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index 7a8dcc91cd4b..000000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,251 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Credentials -import okhttp3.OkHttpClient -import okhttp3.RequestBody -import okhttp3.RequestBody.Companion.asRequestBody -import okhttp3.RequestBody.Companion.toRequestBody -import okhttp3.FormBody -import okhttp3.HttpUrl.Companion.toHttpUrlOrNull -import okhttp3.ResponseBody -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.Request -import okhttp3.Headers -import okhttp3.MultipartBody -import java.io.File -import java.net.URLConnection -import java.util.Date -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.LocalTime -import java.time.OffsetDateTime -import java.time.OffsetTime - -open class ApiClient(val baseUrl: String) { - companion object { - protected const val ContentType = "Content-Type" - protected const val Accept = "Accept" - protected const val Authorization = "Authorization" - protected const val JsonMediaType = "application/json" - protected const val FormDataMediaType = "multipart/form-data" - protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" - protected const val XmlMediaType = "application/xml" - - val apiKey: MutableMap = mutableMapOf() - val apiKeyPrefix: MutableMap = mutableMapOf() - var username: String? = null - var password: String? = null - var accessToken: String? = null - - @JvmStatic - val client: OkHttpClient by lazy { - builder.build() - } - - @JvmStatic - val builder: OkHttpClient.Builder = OkHttpClient.Builder() - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - protected fun guessContentTypeFromFile(file: File): String { - val contentType = URLConnection.guessContentTypeFromName(file.name) - return contentType ?: "application/octet-stream" - } - - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> content.asRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == FormDataMediaType -> { - MultipartBody.Builder() - .setType(MultipartBody.FORM) - .apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - if (value is File) { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"; filename=\"${value.name}\"" - ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) - } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) - addPart( - partHeaders, - parameterToString(value).toRequestBody(null) - ) - } - } - }.build() - } - mediaType == FormUrlEncMediaType -> { - FormBody.Builder().apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) - } - }.build() - } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { - if(body == null) { - return null - } - val bodyContent = body.string() - if (bodyContent.isEmpty()) { - return null - } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") - } - } - - protected fun updateAuthParams(requestConfig: RequestConfig) { - if (requestConfig.headers["api_key"].isNullOrEmpty()) { - if (apiKey["api_key"] != null) { - if (apiKeyPrefix["api_key"] != null) { - requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! - } else { - requestConfig.headers["api_key"] = apiKey["api_key"]!! - } - } - } - if (requestConfig.headers[Authorization].isNullOrEmpty()) { - accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer $accessToken " - } - } - } - - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { - val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") - - // take authMethod from operation - updateAuthParams(requestConfig) - - val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - .apply { - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - addQueryParameter(query.key, queryValue) - } - } - }.build() - - // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { - requestConfig.headers[ContentType] = JsonMediaType - } - if (requestConfig.headers[Accept].isNullOrEmpty()) { - requestConfig.headers[Accept] = JsonMediaType - } - val headers = requestConfig.headers - - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Accept header. This is required.") - } - - // TODO: support multiple contentType options here. - val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - - val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) - RequestMethod.GET -> Request.Builder().url(url) - RequestMethod.HEAD -> Request.Builder().url(url).head() - RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(requestConfig.body, contentType)) - RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(requestConfig.body, contentType)) - RequestMethod.POST -> Request.Builder().url(url).post(requestBody(requestConfig.body, contentType)) - RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - }.apply { - headers.forEach { header -> addHeader(header.key, header.value) } - }.build() - - val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() - - // TODO: handle specific mapping types. e.g. Map> - when { - response.isRedirect -> return Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> return Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> return Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> return ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> return ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - } - } - - protected fun parameterToString(value: Any?): String { - when (value) { - null -> { - return "" - } - is Array<*> -> { - return toMultiValue(value, "csv").toString() - } - is Iterable<*> -> { - return toMultiValue(value, "csv").toString() - } - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { - return parseDateToQueryString(value) - } - else -> { - return value.toString() - } - } - } - - protected inline fun parseDateToQueryString(value : T): String { - /* - .replace("\"", "") converts the json object string to an actual string for the query parameter. - The moshi or gson adapter allows a more generic solution instead of trying to use a native - formatter. It also easily allows to provide a simple way to define a custom date format pattern - inside a gson/moshi adapter. - */ - return Serializer.moshi.adapter(T::class.java).toJson(value).replace("\"", "") - } -} diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 77066de4e559..000000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T?, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2c0..000000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index ff5e2a81ee8c..000000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,12 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson - -class ByteArrayAdapter { - @ToJson - fun toJson(data: ByteArray): String = String(data) - - @FromJson - fun fromJson(data: String): ByteArray = data.toByteArray() -} diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/Errors.kt deleted file mode 100644 index b5310e71f13c..000000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/Errors.kt +++ /dev/null @@ -1,18 +0,0 @@ -@file:Suppress("unused") -package org.openapitools.client.infrastructure - -import java.lang.RuntimeException - -open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 123L - } -} - -open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 456L - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index b2e1654479a0..000000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDate -import java.time.format.DateTimeFormatter - -class LocalDateAdapter { - @ToJson - fun toJson(value: LocalDate): String { - return DateTimeFormatter.ISO_LOCAL_DATE.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDate { - return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE) - } - -} diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index e082db94811d..000000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter - -class LocalDateTimeAdapter { - @ToJson - fun toJson(value: LocalDateTime): String { - return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDateTime { - return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index 87437871a31e..000000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.OffsetDateTime -import java.time.format.DateTimeFormatter - -class OffsetDateTimeAdapter { - @ToJson - fun toJson(value: OffsetDateTime): String { - return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): OffsetDateTime { - return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt deleted file mode 100644 index 0f2790f370e2..000000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt +++ /dev/null @@ -1,17 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Defines a config object for a given request. - * NOTE: This object doesn't include 'body' because it - * allows for caching of the constructed object - * for many request definitions. - * NOTE: Headers is a Map because rfc2616 defines - * multi-valued headers as csv-only. - */ -data class RequestConfig( - val method: RequestMethod, - val path: String, - val headers: MutableMap = mutableMapOf(), - val query: MutableMap> = mutableMapOf(), - val body: kotlin.Any? = null -) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt deleted file mode 100644 index 931b12b8bd7a..000000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Provides enumerated HTTP verbs - */ -enum class RequestMethod { - GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt deleted file mode 100644 index 9bd2790dc144..000000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Response - -/** - * Provides an extension to evaluation whether the response is a 1xx code - */ -val Response.isInformational : Boolean get() = this.code in 100..199 - -/** - * Provides an extension to evaluation whether the response is a 3xx code - */ -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") -val Response.isRedirect : Boolean get() = this.code in 300..399 - -/** - * Provides an extension to evaluation whether the response is a 4xx code - */ -val Response.isClientError : Boolean get() = this.code in 400..499 - -/** - * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code - */ -val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 9a45b67d9b1a..000000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,21 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.Moshi -import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory -import java.util.Date - -object Serializer { - @JvmStatic - val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(OffsetDateTimeAdapter()) - .add(LocalDateTimeAdapter()) - .add(LocalDateAdapter()) - .add(UUIDAdapter()) - .add(ByteArrayAdapter()) - .add(KotlinJsonAdapterFactory()) - - @JvmStatic - val moshi: Moshi by lazy { - moshiBuilder.build() - } -} diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt deleted file mode 100644 index a4a44cc18b73..000000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.util.UUID - -class UUIDAdapter { - @ToJson - fun toJson(uuid: UUID) = uuid.toString() - - @FromJson - fun fromJson(s: String) = UUID.fromString(s) -} diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index 7d40c8efbc2f..000000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,38 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * Describes the result of uploading an image resource - * @param code - * @param type - * @param message - */ - -data class ApiResponse ( - @Json(name = "code") - val code: kotlin.Int? = null, - @Json(name = "type") - val type: kotlin.String? = null, - @Json(name = "message") - val message: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index ceb0fbc8fe60..000000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,35 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * A category for a pet - * @param id - * @param name - */ - -data class Category ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index ed8f8b13a43b..000000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,58 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * An order for a pets from the pet store - * @param id - * @param petId - * @param quantity - * @param shipDate - * @param status Order Status - * @param complete - */ - -data class Order ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "petId") - val petId: kotlin.Long? = null, - @Json(name = "quantity") - val quantity: kotlin.Int? = null, - @Json(name = "shipDate") - val shipDate: java.time.OffsetDateTime? = null, - /* Order Status */ - @Json(name = "status") - val status: Order.Status? = null, - @Json(name = "complete") - val complete: kotlin.Boolean? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - - /** - * Order Status - * Values: placed,approved,delivered - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "placed") placed("placed"), - @Json(name = "approved") approved("approved"), - @Json(name = "delivered") delivered("delivered"); - } -} - diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index 105f485f021d..000000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,60 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.Category -import org.openapitools.client.models.Tag - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * A pet for sale in the pet store - * @param name - * @param photoUrls - * @param id - * @param category - * @param tags - * @param status pet status in the store - */ - -data class Pet ( - @Json(name = "name") - val name: kotlin.String, - @Json(name = "photoUrls") - val photoUrls: kotlin.collections.List, - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "category") - val category: Category? = null, - @Json(name = "tags") - val tags: kotlin.collections.List? = null, - /* pet status in the store */ - @Json(name = "status") - val status: Pet.Status? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - - /** - * pet status in the store - * Values: available,pending,sold - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "available") available("available"), - @Json(name = "pending") pending("pending"), - @Json(name = "sold") sold("sold"); - } -} - diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index 944b1cd0a141..000000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,35 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * A tag for a pet - * @param id - * @param name - */ - -data class Tag ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index 9697f07d5bf8..000000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * A User who is purchasing from the pet store - * @param id - * @param username - * @param firstName - * @param lastName - * @param email - * @param password - * @param phone - * @param userStatus User Status - */ - -data class User ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "username") - val username: kotlin.String? = null, - @Json(name = "firstName") - val firstName: kotlin.String? = null, - @Json(name = "lastName") - val lastName: kotlin.String? = null, - @Json(name = "email") - val email: kotlin.String? = null, - @Json(name = "password") - val password: kotlin.String? = null, - @Json(name = "phone") - val phone: kotlin.String? = null, - /* User Status */ - @Json(name = "userStatus") - val userStatus: kotlin.Int? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 7282e53200b6..2abf02f23b42 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -25,7 +25,6 @@ import java.time.LocalDateTime import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime -import java.util.Date import java.util.Locale import com.squareup.moshi.adapter @@ -248,7 +247,7 @@ open class ApiClient(val baseUrl: String) { null -> "" is Array<*> -> toMultiValue(value, "csv").toString() is Iterable<*> -> toMultiValue(value, "csv").toString() - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2c0..000000000000 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index c8b93b33bf6f..000000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,492 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun addPet(body: Pet) : Unit { - val localVariableConfig = addPetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation addPet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun addPetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Deletes a pet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deletePet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return RequestConfig - */ - fun deletePetRequestConfig(petId: kotlin.Long, apiKey: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByStatusRequestConfig(status = status) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByStatus - * - * @param status Status values that need to be considered for filter - * @return RequestConfig - */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("status", toMultiValue(status.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByStatus", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByTags - * - * @param tags Tags to filter by - * @return RequestConfig - */ - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("tags", toMultiValue(tags.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByTags", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getPetById(petId: kotlin.Long) : Pet { - val localVariableConfig = getPetByIdRequestConfig(petId = petId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Pet - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getPetById - * - * @param petId ID of pet to return - * @return RequestConfig - */ - fun getPetByIdRequestConfig(petId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePet(body: Pet) : Unit { - val localVariableConfig = updatePetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun updatePetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePetWithForm - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return RequestConfig - */ - fun updatePetWithFormRequestConfig(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("name" to name, "status" to status) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * uploads an image - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return ApiResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation uploadFile - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return RequestConfig - */ - fun uploadFileRequestConfig(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "file" to file) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index 215ed63420c9..000000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,253 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Order - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteOrder - * - * @param orderId ID of the order that needs to be deleted - * @return RequestConfig - */ - fun deleteOrderRequestConfig(orderId: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return kotlin.collections.Map - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getInventory() : kotlin.collections.Map { - val localVariableConfig = getInventoryRequestConfig() - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getInventory - * - * @return RequestConfig - */ - fun getInventoryRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/inventory", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getOrderById - * - * @param orderId ID of pet that needs to be fetched - * @return RequestConfig - */ - fun getOrderByIdRequestConfig(orderId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun placeOrder(body: Order) : Order { - val localVariableConfig = placeOrderRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation placeOrder - * - * @param body order placed for purchasing the pet - * @return RequestConfig - */ - fun placeOrderRequestConfig(body: Order) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/store/order", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 53748b934636..000000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,476 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.User - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUser(body: User) : Unit { - val localVariableConfig = createUserRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUser - * - * @param body Created user object - * @return RequestConfig - */ - fun createUserRequestConfig(body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithArrayInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithArrayInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithArray", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithListInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithListInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithListInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithList", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteUser(username: kotlin.String) : Unit { - val localVariableConfig = deleteUserRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteUser - * - * @param username The name that needs to be deleted - * @return RequestConfig - */ - fun deleteUserRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return User - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getUserByName(username: kotlin.String) : User { - val localVariableConfig = getUserByNameRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as User - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getUserByName - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return RequestConfig - */ - fun getUserByNameRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs user into the system - * - * @param username The user name for login - * @param password The password for login in clear text - * @return kotlin.String - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableConfig = loginUserRequestConfig(username = username, password = password) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation loginUser - * - * @param username The user name for login - * @param password The password for login in clear text - * @return RequestConfig - */ - fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("username", listOf(username.toString())) - put("password", listOf(password.toString())) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/login", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs out current logged in user session - * - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun logoutUser() : Unit { - val localVariableConfig = logoutUserRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation logoutUser - * - * @return RequestConfig - */ - fun logoutUserRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/logout", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param body Updated user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableConfig = updateUserRequestConfig(username = username, body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updateUser - * - * @param username name that need to be deleted - * @param body Updated user object - * @return RequestConfig - */ - fun updateUserRequestConfig(username: kotlin.String, body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt deleted file mode 100644 index ef7a8f1e1a62..000000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -typealias MultiValueMap = MutableMap> - -fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { - "csv" -> "," - "tsv" -> "\t" - "pipe" -> "|" - "space" -> " " - else -> "" -} - -val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } - -fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) - = toMultiValue(items.asIterable(), collectionFormat, map) - -fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { - return when(collectionFormat) { - "multi" -> items.map(map) - else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index 9d526273d7ac..000000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,249 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Credentials -import okhttp3.OkHttpClient -import okhttp3.RequestBody -import okhttp3.MediaType -import okhttp3.FormBody -import okhttp3.HttpUrl -import okhttp3.ResponseBody -import okhttp3.Request -import okhttp3.Headers -import okhttp3.MultipartBody -import java.io.File -import java.net.URLConnection -import java.util.Date -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.LocalTime -import java.time.OffsetDateTime -import java.time.OffsetTime - -open class ApiClient(val baseUrl: String) { - companion object { - protected const val ContentType = "Content-Type" - protected const val Accept = "Accept" - protected const val Authorization = "Authorization" - protected const val JsonMediaType = "application/json" - protected const val FormDataMediaType = "multipart/form-data" - protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" - protected const val XmlMediaType = "application/xml" - - val apiKey: MutableMap = mutableMapOf() - val apiKeyPrefix: MutableMap = mutableMapOf() - var username: String? = null - var password: String? = null - var accessToken: String? = null - - @JvmStatic - val client: OkHttpClient by lazy { - builder.build() - } - - @JvmStatic - val builder: OkHttpClient.Builder = OkHttpClient.Builder() - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - protected fun guessContentTypeFromFile(file: File): String { - val contentType = URLConnection.guessContentTypeFromName(file.name) - return contentType ?: "application/octet-stream" - } - - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> RequestBody.create( - MediaType.parse(mediaType), content - ) - mediaType == FormDataMediaType -> { - MultipartBody.Builder() - .setType(MultipartBody.FORM) - .apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - if (value is File) { - val partHeaders = Headers.of( - "Content-Disposition", - "form-data; name=\"$key\"; filename=\"${value.name}\"" - ) - val fileMediaType = MediaType.parse(guessContentTypeFromFile(value)) - addPart(partHeaders, RequestBody.create(fileMediaType, value)) - } else { - val partHeaders = Headers.of( - "Content-Disposition", - "form-data; name=\"$key\"" - ) - addPart( - partHeaders, - RequestBody.create(null, parameterToString(value)) - ) - } - } - }.build() - } - mediaType == FormUrlEncMediaType -> { - FormBody.Builder().apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) - } - }.build() - } - mediaType == JsonMediaType -> RequestBody.create( - MediaType.parse(mediaType), Serializer.moshi.adapter(T::class.java).toJson(content) - ) - mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { - if(body == null) { - return null - } - val bodyContent = body.string() - if (bodyContent.isEmpty()) { - return null - } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") - } - } - - protected fun updateAuthParams(requestConfig: RequestConfig) { - if (requestConfig.headers["api_key"].isNullOrEmpty()) { - if (apiKey["api_key"] != null) { - if (apiKeyPrefix["api_key"] != null) { - requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! - } else { - requestConfig.headers["api_key"] = apiKey["api_key"]!! - } - } - } - if (requestConfig.headers[Authorization].isNullOrEmpty()) { - accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer $accessToken " - } - } - } - - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { - val httpUrl = HttpUrl.parse(baseUrl) ?: throw IllegalStateException("baseUrl is invalid.") - - // take authMethod from operation - updateAuthParams(requestConfig) - - val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - .apply { - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - addQueryParameter(query.key, queryValue) - } - } - }.build() - - // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { - requestConfig.headers[ContentType] = JsonMediaType - } - if (requestConfig.headers[Accept].isNullOrEmpty()) { - requestConfig.headers[Accept] = JsonMediaType - } - val headers = requestConfig.headers - - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Accept header. This is required.") - } - - // TODO: support multiple contentType options here. - val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - - val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) - RequestMethod.GET -> Request.Builder().url(url) - RequestMethod.HEAD -> Request.Builder().url(url).head() - RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(requestConfig.body, contentType)) - RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(requestConfig.body, contentType)) - RequestMethod.POST -> Request.Builder().url(url).post(requestBody(requestConfig.body, contentType)) - RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - }.apply { - headers.forEach { header -> addHeader(header.key, header.value) } - }.build() - - val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() - - // TODO: handle specific mapping types. e.g. Map> - when { - response.isRedirect -> return Redirection( - response.code(), - response.headers().toMultimap() - ) - response.isInformational -> return Informational( - response.message(), - response.code(), - response.headers().toMultimap() - ) - response.isSuccessful -> return Success( - responseBody(response.body(), accept), - response.code(), - response.headers().toMultimap() - ) - response.isClientError -> return ClientError( - response.message(), - response.body()?.string(), - response.code(), - response.headers().toMultimap() - ) - else -> return ServerError( - response.message(), - response.body()?.string(), - response.code(), - response.headers().toMultimap() - ) - } - } - - protected fun parameterToString(value: Any?): String { - when (value) { - null -> { - return "" - } - is Array<*> -> { - return toMultiValue(value, "csv").toString() - } - is Iterable<*> -> { - return toMultiValue(value, "csv").toString() - } - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { - return parseDateToQueryString(value) - } - else -> { - return value.toString() - } - } - } - - protected inline fun parseDateToQueryString(value : T): String { - /* - .replace("\"", "") converts the json object string to an actual string for the query parameter. - The moshi or gson adapter allows a more generic solution instead of trying to use a native - formatter. It also easily allows to provide a simple way to define a custom date format pattern - inside a gson/moshi adapter. - */ - return Serializer.moshi.adapter(T::class.java).toJson(value).replace("\"", "") - } -} diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbfaa..000000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2c0..000000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index ff5e2a81ee8c..000000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,12 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson - -class ByteArrayAdapter { - @ToJson - fun toJson(data: ByteArray): String = String(data) - - @FromJson - fun fromJson(data: String): ByteArray = data.toByteArray() -} diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/Errors.kt deleted file mode 100644 index b5310e71f13c..000000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/Errors.kt +++ /dev/null @@ -1,18 +0,0 @@ -@file:Suppress("unused") -package org.openapitools.client.infrastructure - -import java.lang.RuntimeException - -open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 123L - } -} - -open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 456L - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index b2e1654479a0..000000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDate -import java.time.format.DateTimeFormatter - -class LocalDateAdapter { - @ToJson - fun toJson(value: LocalDate): String { - return DateTimeFormatter.ISO_LOCAL_DATE.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDate { - return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE) - } - -} diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index e082db94811d..000000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter - -class LocalDateTimeAdapter { - @ToJson - fun toJson(value: LocalDateTime): String { - return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDateTime { - return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index 87437871a31e..000000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.OffsetDateTime -import java.time.format.DateTimeFormatter - -class OffsetDateTimeAdapter { - @ToJson - fun toJson(value: OffsetDateTime): String { - return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): OffsetDateTime { - return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt deleted file mode 100644 index 0f2790f370e2..000000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt +++ /dev/null @@ -1,17 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Defines a config object for a given request. - * NOTE: This object doesn't include 'body' because it - * allows for caching of the constructed object - * for many request definitions. - * NOTE: Headers is a Map because rfc2616 defines - * multi-valued headers as csv-only. - */ -data class RequestConfig( - val method: RequestMethod, - val path: String, - val headers: MutableMap = mutableMapOf(), - val query: MutableMap> = mutableMapOf(), - val body: kotlin.Any? = null -) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt deleted file mode 100644 index 931b12b8bd7a..000000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Provides enumerated HTTP verbs - */ -enum class RequestMethod { - GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt deleted file mode 100644 index 037fedbd18bd..000000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Response - -/** - * Provides an extension to evaluation whether the response is a 1xx code - */ -val Response.isInformational : Boolean get() = this.code() in 100..199 - -/** - * Provides an extension to evaluation whether the response is a 3xx code - */ -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") -val Response.isRedirect : Boolean get() = this.code() in 300..399 - -/** - * Provides an extension to evaluation whether the response is a 4xx code - */ -val Response.isClientError : Boolean get() = this.code() in 400..499 - -/** - * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code - */ -val Response.isServerError : Boolean get() = this.code() in 500..999 diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 9a45b67d9b1a..000000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,21 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.Moshi -import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory -import java.util.Date - -object Serializer { - @JvmStatic - val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(OffsetDateTimeAdapter()) - .add(LocalDateTimeAdapter()) - .add(LocalDateAdapter()) - .add(UUIDAdapter()) - .add(ByteArrayAdapter()) - .add(KotlinJsonAdapterFactory()) - - @JvmStatic - val moshi: Moshi by lazy { - moshiBuilder.build() - } -} diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt deleted file mode 100644 index a4a44cc18b73..000000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.util.UUID - -class UUIDAdapter { - @ToJson - fun toJson(uuid: UUID) = uuid.toString() - - @FromJson - fun fromJson(s: String) = UUID.fromString(s) -} diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index fafca8738f66..000000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,32 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * Describes the result of uploading an image resource - * @param code - * @param type - * @param message - */ - -data class ApiResponse ( - @Json(name = "code") - val code: kotlin.Int? = null, - @Json(name = "type") - val type: kotlin.String? = null, - @Json(name = "message") - val message: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index a4c17c3b49dd..000000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A category for a pet - * @param id - * @param name - */ - -data class Category ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index a66c335904e7..000000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * An order for a pets from the pet store - * @param id - * @param petId - * @param quantity - * @param shipDate - * @param status Order Status - * @param complete - */ - -data class Order ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "petId") - val petId: kotlin.Long? = null, - @Json(name = "quantity") - val quantity: kotlin.Int? = null, - @Json(name = "shipDate") - val shipDate: java.time.OffsetDateTime? = null, - /* Order Status */ - @Json(name = "status") - val status: Order.Status? = null, - @Json(name = "complete") - val complete: kotlin.Boolean? = null -) { - - /** - * Order Status - * Values: placed,approved,delivered - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "placed") placed("placed"), - @Json(name = "approved") approved("approved"), - @Json(name = "delivered") delivered("delivered"); - } -} - diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index a3df06cb6eb3..000000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,56 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.Category -import org.openapitools.client.models.Tag - -import com.squareup.moshi.Json - -/** - * A pet for sale in the pet store - * @param name - * @param photoUrls - * @param id - * @param category - * @param tags - * @param status pet status in the store - */ - -data class Pet ( - @Json(name = "name") - val name: kotlin.String, - @Json(name = "photoUrls") - val photoUrls: kotlin.collections.List, - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "category") - val category: Category? = null, - @Json(name = "tags") - val tags: kotlin.collections.List? = null, - /* pet status in the store */ - @Json(name = "status") - val status: Pet.Status? = null -) { - - /** - * pet status in the store - * Values: available,pending,sold - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "available") available("available"), - @Json(name = "pending") pending("pending"), - @Json(name = "sold") sold("sold"); - } -} - diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index 6e619023a5c9..000000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A tag for a pet - * @param id - * @param name - */ - -data class Tag ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index af1e270325de..000000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,48 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A User who is purchasing from the pet store - * @param id - * @param username - * @param firstName - * @param lastName - * @param email - * @param password - * @param phone - * @param userStatus User Status - */ - -data class User ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "username") - val username: kotlin.String? = null, - @Json(name = "firstName") - val firstName: kotlin.String? = null, - @Json(name = "lastName") - val lastName: kotlin.String? = null, - @Json(name = "email") - val email: kotlin.String? = null, - @Json(name = "password") - val password: kotlin.String? = null, - @Json(name = "phone") - val phone: kotlin.String? = null, - /* User Status */ - @Json(name = "userStatus") - val userStatus: kotlin.Int? = null -) - diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 17646c1df125..08053e0e04bc 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -23,7 +23,6 @@ import java.time.LocalDateTime import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime -import java.util.Date import java.util.Locale import com.squareup.moshi.adapter @@ -245,7 +244,7 @@ open class ApiClient(val baseUrl: String) { null -> "" is Array<*> -> toMultiValue(value, "csv").toString() is Iterable<*> -> toMultiValue(value, "csv").toString() - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2c0..000000000000 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/FILES b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/FILES index 247ff9a72382..fd9029f08874 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/FILES @@ -30,7 +30,6 @@ src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt -src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt deleted file mode 100644 index 0c8a4fa54d2b..000000000000 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt +++ /dev/null @@ -1,28 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlinx.serialization.KSerializer -import kotlinx.serialization.Serializer -import kotlinx.serialization.encoding.Decoder -import kotlinx.serialization.encoding.Encoder -import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor -import kotlinx.serialization.descriptors.PrimitiveKind -import kotlinx.serialization.descriptors.SerialDescriptor -import java.text.DateFormat -import java.text.SimpleDateFormat -import java.util.Date -import java.util.Locale - -@Serializer(forClass = Date::class) -object DateAdapter : KSerializer { - private val df: DateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.getDefault()) - - override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("Date", PrimitiveKind.STRING) - - override fun serialize(encoder: Encoder, value: Date) { - encoder.encodeString(df.format(value)) - } - - override fun deserialize(decoder: Decoder): Date { - return df.parse(decoder.decodeString())!! - } -} diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt index e769dec78ea3..bbb13638034c 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -1,6 +1,5 @@ package org.openapitools.client.infrastructure -import java.util.Date import java.math.BigDecimal import java.math.BigInteger import java.time.LocalDate @@ -20,7 +19,6 @@ object Serializer { val kotlinSerializationAdapters = SerializersModule { contextual(BigDecimal::class, BigDecimalAdapter) contextual(BigInteger::class, BigIntegerAdapter) - contextual(Date::class, DateAdapter) contextual(LocalDate::class, LocalDateAdapter) contextual(LocalDateTime::class, LocalDateTimeAdapter) contextual(OffsetDateTime::class, OffsetDateTimeAdapter) diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index 90e791f37afa..000000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,125 +0,0 @@ -package org.openapitools.client.apis - -import org.openapitools.client.infrastructure.CollectionFormats.* -import retrofit2.http.* -import okhttp3.RequestBody -import io.reactivex.rxjava3.core.Single; -import io.reactivex.rxjava3.core.Completable; - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import okhttp3.MultipartBody - -interface PetApi { - /** - * Add a new pet to the store - * - * Responses: - * - 405: Invalid input - * - * @param body Pet object that needs to be added to the store - * @return [Call]<[Unit]> - */ - @POST("pet") - fun addPet(@Body body: Pet): Completable - - /** - * Deletes a pet - * - * Responses: - * - 400: Invalid pet value - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return [Call]<[Unit]> - */ - @DELETE("pet/{petId}") - fun deletePet(@Path("petId") petId: kotlin.Long, @Header("api_key") apiKey: kotlin.String): Completable - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Responses: - * - 200: successful operation - * - 400: Invalid status value - * - * @param status Status values that need to be considered for filter - * @return [Call]<[kotlin.collections.List]> - */ - @GET("pet/findByStatus") - fun findPetsByStatus(@Query("status") status: CSVParams): Single> - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Responses: - * - 200: successful operation - * - 400: Invalid tag value - * - * @param tags Tags to filter by - * @return [Call]<[kotlin.collections.List]> - */ - @Deprecated("This api was deprecated") - @GET("pet/findByTags") - fun findPetsByTags(@Query("tags") tags: CSVParams): Single> - - /** - * Find pet by ID - * Returns a single pet - * Responses: - * - 200: successful operation - * - 400: Invalid ID supplied - * - 404: Pet not found - * - * @param petId ID of pet to return - * @return [Call]<[Pet]> - */ - @GET("pet/{petId}") - fun getPetById(@Path("petId") petId: kotlin.Long): Single - - /** - * Update an existing pet - * - * Responses: - * - 400: Invalid ID supplied - * - 404: Pet not found - * - 405: Validation exception - * - * @param body Pet object that needs to be added to the store - * @return [Call]<[Unit]> - */ - @PUT("pet") - fun updatePet(@Body body: Pet): Completable - - /** - * Updates a pet in the store with form data - * - * Responses: - * - 405: Invalid input - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return [Call]<[Unit]> - */ - @FormUrlEncoded - @POST("pet/{petId}") - fun updatePetWithForm(@Path("petId") petId: kotlin.Long, @Field("name") name: kotlin.String, @Field("status") status: kotlin.String): Completable - - /** - * uploads an image - * - * Responses: - * - 200: successful operation - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return [Call]<[ApiResponse]> - */ - @Multipart - @POST("pet/{petId}/uploadImage") - fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String, @Part file: MultipartBody.Part): Single - -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index 11acb2eb8b70..000000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapitools.client.apis - -import org.openapitools.client.infrastructure.CollectionFormats.* -import retrofit2.http.* -import okhttp3.RequestBody -import io.reactivex.rxjava3.core.Single; -import io.reactivex.rxjava3.core.Completable; - -import org.openapitools.client.models.Order - -interface StoreApi { - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Responses: - * - 400: Invalid ID supplied - * - 404: Order not found - * - * @param orderId ID of the order that needs to be deleted - * @return [Call]<[Unit]> - */ - @DELETE("store/order/{orderId}") - fun deleteOrder(@Path("orderId") orderId: kotlin.String): Completable - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Responses: - * - 200: successful operation - * - * @return [Call]<[kotlin.collections.Map]> - */ - @GET("store/inventory") - fun getInventory(): Single> - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Responses: - * - 200: successful operation - * - 400: Invalid ID supplied - * - 404: Order not found - * - * @param orderId ID of pet that needs to be fetched - * @return [Call]<[Order]> - */ - @GET("store/order/{orderId}") - fun getOrderById(@Path("orderId") orderId: kotlin.Long): Single - - /** - * Place an order for a pet - * - * Responses: - * - 200: successful operation - * - 400: Invalid Order - * - * @param body order placed for purchasing the pet - * @return [Call]<[Order]> - */ - @POST("store/order") - fun placeOrder(@Body body: Order): Single - -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index d6fad78e88f3..000000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,114 +0,0 @@ -package org.openapitools.client.apis - -import org.openapitools.client.infrastructure.CollectionFormats.* -import retrofit2.http.* -import okhttp3.RequestBody -import io.reactivex.rxjava3.core.Single; -import io.reactivex.rxjava3.core.Completable; - -import org.openapitools.client.models.User - -interface UserApi { - /** - * Create user - * This can only be done by the logged in user. - * Responses: - * - 0: successful operation - * - * @param body Created user object - * @return [Call]<[Unit]> - */ - @POST("user") - fun createUser(@Body body: User): Completable - - /** - * Creates list of users with given input array - * - * Responses: - * - 0: successful operation - * - * @param body List of user object - * @return [Call]<[Unit]> - */ - @POST("user/createWithArray") - fun createUsersWithArrayInput(@Body body: kotlin.collections.List): Completable - - /** - * Creates list of users with given input array - * - * Responses: - * - 0: successful operation - * - * @param body List of user object - * @return [Call]<[Unit]> - */ - @POST("user/createWithList") - fun createUsersWithListInput(@Body body: kotlin.collections.List): Completable - - /** - * Delete user - * This can only be done by the logged in user. - * Responses: - * - 400: Invalid username supplied - * - 404: User not found - * - * @param username The name that needs to be deleted - * @return [Call]<[Unit]> - */ - @DELETE("user/{username}") - fun deleteUser(@Path("username") username: kotlin.String): Completable - - /** - * Get user by user name - * - * Responses: - * - 200: successful operation - * - 400: Invalid username supplied - * - 404: User not found - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return [Call]<[User]> - */ - @GET("user/{username}") - fun getUserByName(@Path("username") username: kotlin.String): Single - - /** - * Logs user into the system - * - * Responses: - * - 200: successful operation - * - 400: Invalid username/password supplied - * - * @param username The user name for login - * @param password The password for login in clear text - * @return [Call]<[kotlin.String]> - */ - @GET("user/login") - fun loginUser(@Query("username") username: kotlin.String, @Query("password") password: kotlin.String): Single - - /** - * Logs out current logged in user session - * - * Responses: - * - 0: successful operation - * - * @return [Call]<[Unit]> - */ - @GET("user/logout") - fun logoutUser(): Completable - - /** - * Updated user - * This can only be done by the logged in user. - * Responses: - * - 400: Invalid user supplied - * - 404: User not found - * - * @param username name that need to be deleted - * @param body Updated user object - * @return [Call]<[Unit]> - */ - @PUT("user/{username}") - fun updateUser(@Path("username") username: kotlin.String, @Body body: User): Completable - -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/ApiKeyAuth.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/ApiKeyAuth.kt deleted file mode 100644 index 524d5190ef88..000000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/ApiKeyAuth.kt +++ /dev/null @@ -1,50 +0,0 @@ -package org.openapitools.client.auth - -import java.io.IOException -import java.net.URI -import java.net.URISyntaxException - -import okhttp3.Interceptor -import okhttp3.Response - -class ApiKeyAuth( - private val location: String = "", - private val paramName: String = "", - private var apiKey: String = "" -) : Interceptor { - - @Throws(IOException::class) - override fun intercept(chain: Interceptor.Chain): Response { - var request = chain.request() - - if ("query" == location) { - var newQuery = request.url.toUri().query - val paramValue = "$paramName=$apiKey" - if (newQuery == null) { - newQuery = paramValue - } else { - newQuery += "&$paramValue" - } - - val newUri: URI - try { - val oldUri = request.url.toUri() - newUri = URI(oldUri.scheme, oldUri.authority, - oldUri.path, newQuery, oldUri.fragment) - } catch (e: URISyntaxException) { - throw IOException(e) - } - - request = request.newBuilder().url(newUri.toURL()).build() - } else if ("header" == location) { - request = request.newBuilder() - .addHeader(paramName, apiKey) - .build() - } else if ("cookie" == location) { - request = request.newBuilder() - .addHeader("Cookie", "$paramName=$apiKey") - .build() - } - return chain.proceed(request) - } -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/OAuth.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/OAuth.kt deleted file mode 100644 index 311a8f439794..000000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/OAuth.kt +++ /dev/null @@ -1,151 +0,0 @@ -package org.openapitools.client.auth - -import java.net.HttpURLConnection.HTTP_UNAUTHORIZED -import java.net.HttpURLConnection.HTTP_FORBIDDEN - -import java.io.IOException - -import org.apache.oltu.oauth2.client.OAuthClient -import org.apache.oltu.oauth2.client.request.OAuthBearerClientRequest -import org.apache.oltu.oauth2.client.request.OAuthClientRequest -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder -import org.apache.oltu.oauth2.common.exception.OAuthProblemException -import org.apache.oltu.oauth2.common.exception.OAuthSystemException -import org.apache.oltu.oauth2.common.message.types.GrantType -import org.apache.oltu.oauth2.common.token.BasicOAuthToken - -import okhttp3.Interceptor -import okhttp3.OkHttpClient -import okhttp3.Response - -class OAuth( - client: OkHttpClient, - var tokenRequestBuilder: TokenRequestBuilder -) : Interceptor { - - interface AccessTokenListener { - fun notify(token: BasicOAuthToken) - } - - private var oauthClient: OAuthClient = OAuthClient(OAuthOkHttpClient(client)) - - @Volatile - private var accessToken: String? = null - var authenticationRequestBuilder: AuthenticationRequestBuilder? = null - private var accessTokenListener: AccessTokenListener? = null - - constructor( - requestBuilder: TokenRequestBuilder - ) : this( - OkHttpClient(), - requestBuilder - ) - - constructor( - flow: OAuthFlow, - authorizationUrl: String, - tokenUrl: String, - scopes: String - ) : this( - OAuthClientRequest.tokenLocation(tokenUrl).setScope(scopes) - ) { - setFlow(flow); - authenticationRequestBuilder = OAuthClientRequest.authorizationLocation(authorizationUrl); - } - - fun setFlow(flow: OAuthFlow) { - when (flow) { - OAuthFlow.accessCode, OAuthFlow.implicit -> - tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE) - OAuthFlow.password -> - tokenRequestBuilder.setGrantType(GrantType.PASSWORD) - OAuthFlow.application -> - tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS) - } - } - - @Throws(IOException::class) - override fun intercept(chain: Interceptor.Chain): Response { - return retryingIntercept(chain, true) - } - - @Throws(IOException::class) - private fun retryingIntercept(chain: Interceptor.Chain, updateTokenAndRetryOnAuthorizationFailure: Boolean): Response { - var request = chain.request() - - // If the request already have an authorization (eg. Basic auth), do nothing - if (request.header("Authorization") != null) { - return chain.proceed(request) - } - - // If first time, get the token - val oAuthRequest: OAuthClientRequest - if (accessToken == null) { - updateAccessToken(null) - } - - if (accessToken != null) { - // Build the request - val rb = request.newBuilder() - - val requestAccessToken = accessToken - try { - oAuthRequest = OAuthBearerClientRequest(request.url.toString()) - .setAccessToken(requestAccessToken) - .buildHeaderMessage() - } catch (e: OAuthSystemException) { - throw IOException(e) - } - - oAuthRequest.headers.entries.forEach { header -> - rb.addHeader(header.key, header.value) - } - rb.url(oAuthRequest.locationUri) - - //Execute the request - val response = chain.proceed(rb.build()) - - // 401/403 most likely indicates that access token has expired. Unless it happens two times in a row. - if ((response.code == HTTP_UNAUTHORIZED || response.code == HTTP_FORBIDDEN) && updateTokenAndRetryOnAuthorizationFailure) { - try { - if (updateAccessToken(requestAccessToken)) { - response.body?.close() - return retryingIntercept(chain, false) - } - } catch (e: Exception) { - response.body?.close() - throw e - } - } - return response - } else { - return chain.proceed(chain.request()) - } - } - - /** - * Returns true if the access token has been updated - */ - @Throws(IOException::class) - @Synchronized - fun updateAccessToken(requestAccessToken: String?): Boolean { - if (accessToken == null || accessToken.equals(requestAccessToken)) { - return try { - val accessTokenResponse = oauthClient.accessToken(this.tokenRequestBuilder.buildBodyMessage()) - if (accessTokenResponse != null && accessTokenResponse.accessToken != null) { - accessToken = accessTokenResponse.accessToken - accessTokenListener?.notify(accessTokenResponse.oAuthToken as BasicOAuthToken) - !accessToken.equals(requestAccessToken) - } else { - false - } - } catch (e: OAuthSystemException) { - throw IOException(e) - } catch (e: OAuthProblemException) { - throw IOException(e) - } - } - return true; - } -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/OAuthFlow.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/OAuthFlow.kt deleted file mode 100644 index bcada9b7a6a2..000000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/OAuthFlow.kt +++ /dev/null @@ -1,5 +0,0 @@ -package org.openapitools.client.auth - -enum class OAuthFlow { - accessCode, implicit, password, application -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/OAuthOkHttpClient.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/OAuthOkHttpClient.kt deleted file mode 100644 index 93adbda3fc98..000000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/OAuthOkHttpClient.kt +++ /dev/null @@ -1,61 +0,0 @@ -package org.openapitools.client.auth - -import java.io.IOException - -import org.apache.oltu.oauth2.client.HttpClient -import org.apache.oltu.oauth2.client.request.OAuthClientRequest -import org.apache.oltu.oauth2.client.response.OAuthClientResponse -import org.apache.oltu.oauth2.client.response.OAuthClientResponseFactory -import org.apache.oltu.oauth2.common.exception.OAuthProblemException -import org.apache.oltu.oauth2.common.exception.OAuthSystemException - -import okhttp3.OkHttpClient -import okhttp3.Request -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.RequestBody - - -class OAuthOkHttpClient( - private var client: OkHttpClient -) : HttpClient { - - constructor() : this(OkHttpClient()) - - @Throws(OAuthSystemException::class, OAuthProblemException::class) - override fun execute( - request: OAuthClientRequest, - headers: Map?, - requestMethod: String, - responseClass: Class?): T { - - var mediaType = "application/json".toMediaTypeOrNull() - val requestBuilder = Request.Builder().url(request.locationUri) - - headers?.forEach { entry -> - if (entry.key.equals("Content-Type", true)) { - mediaType = entry.value.toMediaTypeOrNull() - } else { - requestBuilder.addHeader(entry.key, entry.value) - } - } - - val body: RequestBody? = if (request.body != null) RequestBody.create(mediaType, request.body) else null - requestBuilder.method(requestMethod, body) - - try { - val response = client.newCall(requestBuilder.build()).execute() - return OAuthClientResponseFactory.createCustomResponse( - response.body?.string(), - response.body?.contentType()?.toString(), - response.code, - responseClass) - } catch (e: IOException) { - throw OAuthSystemException(e) - } - } - - override fun shutdown() { - // Nothing to do here - } - -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index 30f649932fc3..000000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,203 +0,0 @@ -package org.openapitools.client.infrastructure - -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder -import org.openapitools.client.auth.ApiKeyAuth -import org.openapitools.client.auth.OAuth -import org.openapitools.client.auth.OAuth.AccessTokenListener -import org.openapitools.client.auth.OAuthFlow - -import okhttp3.Interceptor -import okhttp3.OkHttpClient -import retrofit2.Retrofit -import okhttp3.logging.HttpLoggingInterceptor -import retrofit2.converter.scalars.ScalarsConverterFactory -import retrofit2.adapter.rxjava3.RxJava3CallAdapterFactory -import com.squareup.moshi.Moshi -import retrofit2.converter.moshi.MoshiConverterFactory - -class ApiClient( - private var baseUrl: String = defaultBasePath, - private val okHttpClientBuilder: OkHttpClient.Builder? = null, - private val serializerBuilder: Moshi.Builder = Serializer.moshiBuilder, - private val okHttpClient : OkHttpClient? = null -) { - private val apiAuthorizations = mutableMapOf() - var logger: ((String) -> Unit)? = null - - private val retrofitBuilder: Retrofit.Builder by lazy { - Retrofit.Builder() - .baseUrl(baseUrl) - .addConverterFactory(ScalarsConverterFactory.create()) - - .addCallAdapterFactory(RxJava3CallAdapterFactory.create()) - .addConverterFactory(MoshiConverterFactory.create(serializerBuilder.build())) - } - - private val clientBuilder: OkHttpClient.Builder by lazy { - okHttpClientBuilder ?: defaultClientBuilder - } - - private val defaultClientBuilder: OkHttpClient.Builder by lazy { - OkHttpClient() - .newBuilder() - .addInterceptor(HttpLoggingInterceptor(object : HttpLoggingInterceptor.Logger { - override fun log(message: String) { - logger?.invoke(message) - } - }).apply { - level = HttpLoggingInterceptor.Level.BODY - }) - } - - init { - normalizeBaseUrl() - } - - constructor( - baseUrl: String = defaultBasePath, - okHttpClientBuilder: OkHttpClient.Builder? = null, - serializerBuilder: Moshi.Builder = Serializer.moshiBuilder, - authNames: Array - ) : this(baseUrl, okHttpClientBuilder, serializerBuilder) { - authNames.forEach { authName -> - val auth = when (authName) { - "api_key" -> ApiKeyAuth("header", "api_key")"petstore_auth" -> OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets") - else -> throw RuntimeException("auth name $authName not found in available auth names") - } - addAuthorization(authName, auth); - } - } - - constructor( - baseUrl: String = defaultBasePath, - okHttpClientBuilder: OkHttpClient.Builder? = null, - serializerBuilder: Moshi.Builder = Serializer.moshiBuilder, - authName: String, - clientId: String, - secret: String, - username: String, - password: String - ) : this(baseUrl, okHttpClientBuilder, serializerBuilder, arrayOf(authName)) { - getTokenEndPoint() - ?.setClientId(clientId) - ?.setClientSecret(secret) - ?.setUsername(username) - ?.setPassword(password) - } - - /** - * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Token request builder - */ - fun getTokenEndPoint(): TokenRequestBuilder? { - var result: TokenRequestBuilder? = null - apiAuthorizations.values.runOnFirst { - result = tokenRequestBuilder - } - return result - } - - /** - * Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Authentication request builder - */ - fun getAuthorizationEndPoint(): AuthenticationRequestBuilder? { - var result: AuthenticationRequestBuilder? = null - apiAuthorizations.values.runOnFirst { - result = authenticationRequestBuilder - } - return result - } - - /** - * Helper method to pre-set the oauth access token of the first oauth found in the apiAuthorizations (there should be only one) - * @param accessToken Access token - * @return ApiClient - */ - fun setAccessToken(accessToken: String): ApiClient { - apiAuthorizations.values.runOnFirst { - setAccessToken(accessToken) - } - return this - } - - /** - * Helper method to configure the oauth accessCode/implicit flow parameters - * @param clientId Client ID - * @param clientSecret Client secret - * @param redirectURI Redirect URI - * @return ApiClient - */ - fun configureAuthorizationFlow(clientId: String, clientSecret: String, redirectURI: String): ApiClient { - apiAuthorizations.values.runOnFirst { - tokenRequestBuilder - .setClientId(clientId) - .setClientSecret(clientSecret) - .setRedirectURI(redirectURI) - authenticationRequestBuilder - ?.setClientId(clientId) - ?.setRedirectURI(redirectURI) - } - return this; - } - - /** - * Configures a listener which is notified when a new access token is received. - * @param accessTokenListener Access token listener - * @return ApiClient - */ - fun registerAccessTokenListener(accessTokenListener: AccessTokenListener): ApiClient { - apiAuthorizations.values.runOnFirst { - registerAccessTokenListener(accessTokenListener) - } - return this; - } - - /** - * Adds an authorization to be used by the client - * @param authName Authentication name - * @param authorization Authorization interceptor - * @return ApiClient - */ - fun addAuthorization(authName: String, authorization: Interceptor): ApiClient { - if (apiAuthorizations.containsKey(authName)) { - throw RuntimeException("auth name $authName already in api authorizations") - } - apiAuthorizations[authName] = authorization - clientBuilder.addInterceptor(authorization) - return this - } - - fun setLogger(logger: (String) -> Unit): ApiClient { - this.logger = logger - return this - } - - fun createService(serviceClass: Class): S { - val usedClient = this.okHttpClient ?: clientBuilder.build() - return retrofitBuilder.client(usedClient).build().create(serviceClass) - } - - private fun normalizeBaseUrl() { - if (!baseUrl.endsWith("/")) { - baseUrl += "/" - } - } - - private inline fun Iterable.runOnFirst(callback: U.() -> Unit) { - for (element in this) { - if (element is U) { - callback.invoke(element) - break - } - } - } - - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index ff5e2a81ee8c..000000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,12 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson - -class ByteArrayAdapter { - @ToJson - fun toJson(data: ByteArray): String = String(data) - - @FromJson - fun fromJson(data: String): ByteArray = data.toByteArray() -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/CollectionFormats.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/CollectionFormats.kt deleted file mode 100644 index 001e99325d2e..000000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/CollectionFormats.kt +++ /dev/null @@ -1,56 +0,0 @@ -package org.openapitools.client.infrastructure - -class CollectionFormats { - - open class CSVParams { - - var params: List - - constructor(params: List) { - this.params = params - } - - constructor(vararg params: String) { - this.params = listOf(*params) - } - - override fun toString(): String { - return params.joinToString(",") - } - } - - open class SSVParams : CSVParams { - - constructor(params: List) : super(params) - - constructor(vararg params: String) : super(*params) - - override fun toString(): String { - return params.joinToString(" ") - } - } - - class TSVParams : CSVParams { - - constructor(params: List) : super(params) - - constructor(vararg params: String) : super(*params) - - override fun toString(): String { - return params.joinToString("\t") - } - } - - class PIPESParams : CSVParams { - - constructor(params: List) : super(params) - - constructor(vararg params: String) : super(*params) - - override fun toString(): String { - return params.joinToString("|") - } - } - - class SPACEParams : SSVParams() -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index b2e1654479a0..000000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDate -import java.time.format.DateTimeFormatter - -class LocalDateAdapter { - @ToJson - fun toJson(value: LocalDate): String { - return DateTimeFormatter.ISO_LOCAL_DATE.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDate { - return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE) - } - -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index e082db94811d..000000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter - -class LocalDateTimeAdapter { - @ToJson - fun toJson(value: LocalDateTime): String { - return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDateTime { - return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index 87437871a31e..000000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.OffsetDateTime -import java.time.format.DateTimeFormatter - -class OffsetDateTimeAdapter { - @ToJson - fun toJson(value: OffsetDateTime): String { - return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): OffsetDateTime { - return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/ResponseExt.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/ResponseExt.kt deleted file mode 100644 index 1804d1ae2bbd..000000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/ResponseExt.kt +++ /dev/null @@ -1,16 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.JsonDataException -import com.squareup.moshi.Moshi -import retrofit2.Response - -@Throws(JsonDataException::class) -inline fun Response<*>.getErrorResponse(serializerBuilder: Moshi.Builder = Serializer.moshiBuilder): T? { - val serializer = serializerBuilder.build() - val parser = serializer.adapter(T::class.java) - val response = errorBody()?.string() - if(response != null) { - return parser.fromJson(response) - } - return null -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 9a45b67d9b1a..000000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,21 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.Moshi -import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory -import java.util.Date - -object Serializer { - @JvmStatic - val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(OffsetDateTimeAdapter()) - .add(LocalDateTimeAdapter()) - .add(LocalDateAdapter()) - .add(UUIDAdapter()) - .add(ByteArrayAdapter()) - .add(KotlinJsonAdapterFactory()) - - @JvmStatic - val moshi: Moshi by lazy { - moshiBuilder.build() - } -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt deleted file mode 100644 index a4a44cc18b73..000000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.util.UUID - -class UUIDAdapter { - @ToJson - fun toJson(uuid: UUID) = uuid.toString() - - @FromJson - fun fromJson(s: String) = UUID.fromString(s) -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index fafca8738f66..000000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,32 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * Describes the result of uploading an image resource - * @param code - * @param type - * @param message - */ - -data class ApiResponse ( - @Json(name = "code") - val code: kotlin.Int? = null, - @Json(name = "type") - val type: kotlin.String? = null, - @Json(name = "message") - val message: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index a4c17c3b49dd..000000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A category for a pet - * @param id - * @param name - */ - -data class Category ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index a66c335904e7..000000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * An order for a pets from the pet store - * @param id - * @param petId - * @param quantity - * @param shipDate - * @param status Order Status - * @param complete - */ - -data class Order ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "petId") - val petId: kotlin.Long? = null, - @Json(name = "quantity") - val quantity: kotlin.Int? = null, - @Json(name = "shipDate") - val shipDate: java.time.OffsetDateTime? = null, - /* Order Status */ - @Json(name = "status") - val status: Order.Status? = null, - @Json(name = "complete") - val complete: kotlin.Boolean? = null -) { - - /** - * Order Status - * Values: placed,approved,delivered - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "placed") placed("placed"), - @Json(name = "approved") approved("approved"), - @Json(name = "delivered") delivered("delivered"); - } -} - diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index a3df06cb6eb3..000000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,56 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.Category -import org.openapitools.client.models.Tag - -import com.squareup.moshi.Json - -/** - * A pet for sale in the pet store - * @param name - * @param photoUrls - * @param id - * @param category - * @param tags - * @param status pet status in the store - */ - -data class Pet ( - @Json(name = "name") - val name: kotlin.String, - @Json(name = "photoUrls") - val photoUrls: kotlin.collections.List, - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "category") - val category: Category? = null, - @Json(name = "tags") - val tags: kotlin.collections.List? = null, - /* pet status in the store */ - @Json(name = "status") - val status: Pet.Status? = null -) { - - /** - * pet status in the store - * Values: available,pending,sold - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "available") available("available"), - @Json(name = "pending") pending("pending"), - @Json(name = "sold") sold("sold"); - } -} - diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index 6e619023a5c9..000000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A tag for a pet - * @param id - * @param name - */ - -data class Tag ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index af1e270325de..000000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,48 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A User who is purchasing from the pet store - * @param id - * @param username - * @param firstName - * @param lastName - * @param email - * @param password - * @param phone - * @param userStatus User Status - */ - -data class User ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "username") - val username: kotlin.String? = null, - @Json(name = "firstName") - val firstName: kotlin.String? = null, - @Json(name = "lastName") - val lastName: kotlin.String? = null, - @Json(name = "email") - val email: kotlin.String? = null, - @Json(name = "password") - val password: kotlin.String? = null, - @Json(name = "phone") - val phone: kotlin.String? = null, - /* User Status */ - @Json(name = "userStatus") - val userStatus: kotlin.Int? = null -) - diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index e8b980bc8727..000000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,124 +0,0 @@ -package org.openapitools.client.apis - -import org.openapitools.client.infrastructure.CollectionFormats.* -import retrofit2.http.* -import retrofit2.Call -import okhttp3.RequestBody - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import okhttp3.MultipartBody - -interface PetApi { - /** - * Add a new pet to the store - * - * Responses: - * - 405: Invalid input - * - * @param body Pet object that needs to be added to the store - * @return [Call]<[Unit]> - */ - @POST("pet") - fun addPet(@Body body: Pet): Call - - /** - * Deletes a pet - * - * Responses: - * - 400: Invalid pet value - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return [Call]<[Unit]> - */ - @DELETE("pet/{petId}") - fun deletePet(@Path("petId") petId: kotlin.Long, @Header("api_key") apiKey: kotlin.String): Call - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Responses: - * - 200: successful operation - * - 400: Invalid status value - * - * @param status Status values that need to be considered for filter - * @return [Call]<[kotlin.collections.List]> - */ - @GET("pet/findByStatus") - fun findPetsByStatus(@Query("status") status: CSVParams): Call> - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Responses: - * - 200: successful operation - * - 400: Invalid tag value - * - * @param tags Tags to filter by - * @return [Call]<[kotlin.collections.List]> - */ - @Deprecated("This api was deprecated") - @GET("pet/findByTags") - fun findPetsByTags(@Query("tags") tags: CSVParams): Call> - - /** - * Find pet by ID - * Returns a single pet - * Responses: - * - 200: successful operation - * - 400: Invalid ID supplied - * - 404: Pet not found - * - * @param petId ID of pet to return - * @return [Call]<[Pet]> - */ - @GET("pet/{petId}") - fun getPetById(@Path("petId") petId: kotlin.Long): Call - - /** - * Update an existing pet - * - * Responses: - * - 400: Invalid ID supplied - * - 404: Pet not found - * - 405: Validation exception - * - * @param body Pet object that needs to be added to the store - * @return [Call]<[Unit]> - */ - @PUT("pet") - fun updatePet(@Body body: Pet): Call - - /** - * Updates a pet in the store with form data - * - * Responses: - * - 405: Invalid input - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return [Call]<[Unit]> - */ - @FormUrlEncoded - @POST("pet/{petId}") - fun updatePetWithForm(@Path("petId") petId: kotlin.Long, @Field("name") name: kotlin.String, @Field("status") status: kotlin.String): Call - - /** - * uploads an image - * - * Responses: - * - 200: successful operation - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return [Call]<[ApiResponse]> - */ - @Multipart - @POST("pet/{petId}/uploadImage") - fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String, @Part file: MultipartBody.Part): Call - -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index be05f2bb6968..000000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,62 +0,0 @@ -package org.openapitools.client.apis - -import org.openapitools.client.infrastructure.CollectionFormats.* -import retrofit2.http.* -import retrofit2.Call -import okhttp3.RequestBody - -import org.openapitools.client.models.Order - -interface StoreApi { - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Responses: - * - 400: Invalid ID supplied - * - 404: Order not found - * - * @param orderId ID of the order that needs to be deleted - * @return [Call]<[Unit]> - */ - @DELETE("store/order/{orderId}") - fun deleteOrder(@Path("orderId") orderId: kotlin.String): Call - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Responses: - * - 200: successful operation - * - * @return [Call]<[kotlin.collections.Map]> - */ - @GET("store/inventory") - fun getInventory(): Call> - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Responses: - * - 200: successful operation - * - 400: Invalid ID supplied - * - 404: Order not found - * - * @param orderId ID of pet that needs to be fetched - * @return [Call]<[Order]> - */ - @GET("store/order/{orderId}") - fun getOrderById(@Path("orderId") orderId: kotlin.Long): Call - - /** - * Place an order for a pet - * - * Responses: - * - 200: successful operation - * - 400: Invalid Order - * - * @param body order placed for purchasing the pet - * @return [Call]<[Order]> - */ - @POST("store/order") - fun placeOrder(@Body body: Order): Call - -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 66c1e7fbd264..000000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,113 +0,0 @@ -package org.openapitools.client.apis - -import org.openapitools.client.infrastructure.CollectionFormats.* -import retrofit2.http.* -import retrofit2.Call -import okhttp3.RequestBody - -import org.openapitools.client.models.User - -interface UserApi { - /** - * Create user - * This can only be done by the logged in user. - * Responses: - * - 0: successful operation - * - * @param body Created user object - * @return [Call]<[Unit]> - */ - @POST("user") - fun createUser(@Body body: User): Call - - /** - * Creates list of users with given input array - * - * Responses: - * - 0: successful operation - * - * @param body List of user object - * @return [Call]<[Unit]> - */ - @POST("user/createWithArray") - fun createUsersWithArrayInput(@Body body: kotlin.collections.List): Call - - /** - * Creates list of users with given input array - * - * Responses: - * - 0: successful operation - * - * @param body List of user object - * @return [Call]<[Unit]> - */ - @POST("user/createWithList") - fun createUsersWithListInput(@Body body: kotlin.collections.List): Call - - /** - * Delete user - * This can only be done by the logged in user. - * Responses: - * - 400: Invalid username supplied - * - 404: User not found - * - * @param username The name that needs to be deleted - * @return [Call]<[Unit]> - */ - @DELETE("user/{username}") - fun deleteUser(@Path("username") username: kotlin.String): Call - - /** - * Get user by user name - * - * Responses: - * - 200: successful operation - * - 400: Invalid username supplied - * - 404: User not found - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return [Call]<[User]> - */ - @GET("user/{username}") - fun getUserByName(@Path("username") username: kotlin.String): Call - - /** - * Logs user into the system - * - * Responses: - * - 200: successful operation - * - 400: Invalid username/password supplied - * - * @param username The user name for login - * @param password The password for login in clear text - * @return [Call]<[kotlin.String]> - */ - @GET("user/login") - fun loginUser(@Query("username") username: kotlin.String, @Query("password") password: kotlin.String): Call - - /** - * Logs out current logged in user session - * - * Responses: - * - 0: successful operation - * - * @return [Call]<[Unit]> - */ - @GET("user/logout") - fun logoutUser(): Call - - /** - * Updated user - * This can only be done by the logged in user. - * Responses: - * - 400: Invalid user supplied - * - 404: User not found - * - * @param username name that need to be deleted - * @param body Updated user object - * @return [Call]<[Unit]> - */ - @PUT("user/{username}") - fun updateUser(@Path("username") username: kotlin.String, @Body body: User): Call - -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/ApiKeyAuth.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/ApiKeyAuth.kt deleted file mode 100644 index 524d5190ef88..000000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/ApiKeyAuth.kt +++ /dev/null @@ -1,50 +0,0 @@ -package org.openapitools.client.auth - -import java.io.IOException -import java.net.URI -import java.net.URISyntaxException - -import okhttp3.Interceptor -import okhttp3.Response - -class ApiKeyAuth( - private val location: String = "", - private val paramName: String = "", - private var apiKey: String = "" -) : Interceptor { - - @Throws(IOException::class) - override fun intercept(chain: Interceptor.Chain): Response { - var request = chain.request() - - if ("query" == location) { - var newQuery = request.url.toUri().query - val paramValue = "$paramName=$apiKey" - if (newQuery == null) { - newQuery = paramValue - } else { - newQuery += "&$paramValue" - } - - val newUri: URI - try { - val oldUri = request.url.toUri() - newUri = URI(oldUri.scheme, oldUri.authority, - oldUri.path, newQuery, oldUri.fragment) - } catch (e: URISyntaxException) { - throw IOException(e) - } - - request = request.newBuilder().url(newUri.toURL()).build() - } else if ("header" == location) { - request = request.newBuilder() - .addHeader(paramName, apiKey) - .build() - } else if ("cookie" == location) { - request = request.newBuilder() - .addHeader("Cookie", "$paramName=$apiKey") - .build() - } - return chain.proceed(request) - } -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/OAuth.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/OAuth.kt deleted file mode 100644 index 311a8f439794..000000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/OAuth.kt +++ /dev/null @@ -1,151 +0,0 @@ -package org.openapitools.client.auth - -import java.net.HttpURLConnection.HTTP_UNAUTHORIZED -import java.net.HttpURLConnection.HTTP_FORBIDDEN - -import java.io.IOException - -import org.apache.oltu.oauth2.client.OAuthClient -import org.apache.oltu.oauth2.client.request.OAuthBearerClientRequest -import org.apache.oltu.oauth2.client.request.OAuthClientRequest -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder -import org.apache.oltu.oauth2.common.exception.OAuthProblemException -import org.apache.oltu.oauth2.common.exception.OAuthSystemException -import org.apache.oltu.oauth2.common.message.types.GrantType -import org.apache.oltu.oauth2.common.token.BasicOAuthToken - -import okhttp3.Interceptor -import okhttp3.OkHttpClient -import okhttp3.Response - -class OAuth( - client: OkHttpClient, - var tokenRequestBuilder: TokenRequestBuilder -) : Interceptor { - - interface AccessTokenListener { - fun notify(token: BasicOAuthToken) - } - - private var oauthClient: OAuthClient = OAuthClient(OAuthOkHttpClient(client)) - - @Volatile - private var accessToken: String? = null - var authenticationRequestBuilder: AuthenticationRequestBuilder? = null - private var accessTokenListener: AccessTokenListener? = null - - constructor( - requestBuilder: TokenRequestBuilder - ) : this( - OkHttpClient(), - requestBuilder - ) - - constructor( - flow: OAuthFlow, - authorizationUrl: String, - tokenUrl: String, - scopes: String - ) : this( - OAuthClientRequest.tokenLocation(tokenUrl).setScope(scopes) - ) { - setFlow(flow); - authenticationRequestBuilder = OAuthClientRequest.authorizationLocation(authorizationUrl); - } - - fun setFlow(flow: OAuthFlow) { - when (flow) { - OAuthFlow.accessCode, OAuthFlow.implicit -> - tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE) - OAuthFlow.password -> - tokenRequestBuilder.setGrantType(GrantType.PASSWORD) - OAuthFlow.application -> - tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS) - } - } - - @Throws(IOException::class) - override fun intercept(chain: Interceptor.Chain): Response { - return retryingIntercept(chain, true) - } - - @Throws(IOException::class) - private fun retryingIntercept(chain: Interceptor.Chain, updateTokenAndRetryOnAuthorizationFailure: Boolean): Response { - var request = chain.request() - - // If the request already have an authorization (eg. Basic auth), do nothing - if (request.header("Authorization") != null) { - return chain.proceed(request) - } - - // If first time, get the token - val oAuthRequest: OAuthClientRequest - if (accessToken == null) { - updateAccessToken(null) - } - - if (accessToken != null) { - // Build the request - val rb = request.newBuilder() - - val requestAccessToken = accessToken - try { - oAuthRequest = OAuthBearerClientRequest(request.url.toString()) - .setAccessToken(requestAccessToken) - .buildHeaderMessage() - } catch (e: OAuthSystemException) { - throw IOException(e) - } - - oAuthRequest.headers.entries.forEach { header -> - rb.addHeader(header.key, header.value) - } - rb.url(oAuthRequest.locationUri) - - //Execute the request - val response = chain.proceed(rb.build()) - - // 401/403 most likely indicates that access token has expired. Unless it happens two times in a row. - if ((response.code == HTTP_UNAUTHORIZED || response.code == HTTP_FORBIDDEN) && updateTokenAndRetryOnAuthorizationFailure) { - try { - if (updateAccessToken(requestAccessToken)) { - response.body?.close() - return retryingIntercept(chain, false) - } - } catch (e: Exception) { - response.body?.close() - throw e - } - } - return response - } else { - return chain.proceed(chain.request()) - } - } - - /** - * Returns true if the access token has been updated - */ - @Throws(IOException::class) - @Synchronized - fun updateAccessToken(requestAccessToken: String?): Boolean { - if (accessToken == null || accessToken.equals(requestAccessToken)) { - return try { - val accessTokenResponse = oauthClient.accessToken(this.tokenRequestBuilder.buildBodyMessage()) - if (accessTokenResponse != null && accessTokenResponse.accessToken != null) { - accessToken = accessTokenResponse.accessToken - accessTokenListener?.notify(accessTokenResponse.oAuthToken as BasicOAuthToken) - !accessToken.equals(requestAccessToken) - } else { - false - } - } catch (e: OAuthSystemException) { - throw IOException(e) - } catch (e: OAuthProblemException) { - throw IOException(e) - } - } - return true; - } -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/OAuthFlow.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/OAuthFlow.kt deleted file mode 100644 index bcada9b7a6a2..000000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/OAuthFlow.kt +++ /dev/null @@ -1,5 +0,0 @@ -package org.openapitools.client.auth - -enum class OAuthFlow { - accessCode, implicit, password, application -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/OAuthOkHttpClient.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/OAuthOkHttpClient.kt deleted file mode 100644 index 93adbda3fc98..000000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/OAuthOkHttpClient.kt +++ /dev/null @@ -1,61 +0,0 @@ -package org.openapitools.client.auth - -import java.io.IOException - -import org.apache.oltu.oauth2.client.HttpClient -import org.apache.oltu.oauth2.client.request.OAuthClientRequest -import org.apache.oltu.oauth2.client.response.OAuthClientResponse -import org.apache.oltu.oauth2.client.response.OAuthClientResponseFactory -import org.apache.oltu.oauth2.common.exception.OAuthProblemException -import org.apache.oltu.oauth2.common.exception.OAuthSystemException - -import okhttp3.OkHttpClient -import okhttp3.Request -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.RequestBody - - -class OAuthOkHttpClient( - private var client: OkHttpClient -) : HttpClient { - - constructor() : this(OkHttpClient()) - - @Throws(OAuthSystemException::class, OAuthProblemException::class) - override fun execute( - request: OAuthClientRequest, - headers: Map?, - requestMethod: String, - responseClass: Class?): T { - - var mediaType = "application/json".toMediaTypeOrNull() - val requestBuilder = Request.Builder().url(request.locationUri) - - headers?.forEach { entry -> - if (entry.key.equals("Content-Type", true)) { - mediaType = entry.value.toMediaTypeOrNull() - } else { - requestBuilder.addHeader(entry.key, entry.value) - } - } - - val body: RequestBody? = if (request.body != null) RequestBody.create(mediaType, request.body) else null - requestBuilder.method(requestMethod, body) - - try { - val response = client.newCall(requestBuilder.build()).execute() - return OAuthClientResponseFactory.createCustomResponse( - response.body?.string(), - response.body?.contentType()?.toString(), - response.code, - responseClass) - } catch (e: IOException) { - throw OAuthSystemException(e) - } - } - - override fun shutdown() { - // Nothing to do here - } - -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index f19c5861dd70..000000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,200 +0,0 @@ -package org.openapitools.client.infrastructure - -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder -import org.openapitools.client.auth.ApiKeyAuth -import org.openapitools.client.auth.OAuth -import org.openapitools.client.auth.OAuth.AccessTokenListener -import org.openapitools.client.auth.OAuthFlow - -import okhttp3.Interceptor -import okhttp3.OkHttpClient -import retrofit2.Retrofit -import okhttp3.logging.HttpLoggingInterceptor -import retrofit2.converter.scalars.ScalarsConverterFactory -import com.squareup.moshi.Moshi -import retrofit2.converter.moshi.MoshiConverterFactory - -class ApiClient( - private var baseUrl: String = defaultBasePath, - private val okHttpClientBuilder: OkHttpClient.Builder? = null, - private val serializerBuilder: Moshi.Builder = Serializer.moshiBuilder, - private val okHttpClient : OkHttpClient? = null -) { - private val apiAuthorizations = mutableMapOf() - var logger: ((String) -> Unit)? = null - - private val retrofitBuilder: Retrofit.Builder by lazy { - Retrofit.Builder() - .baseUrl(baseUrl) - .addConverterFactory(ScalarsConverterFactory.create()) - .addConverterFactory(MoshiConverterFactory.create(serializerBuilder.build())) - } - - private val clientBuilder: OkHttpClient.Builder by lazy { - okHttpClientBuilder ?: defaultClientBuilder - } - - private val defaultClientBuilder: OkHttpClient.Builder by lazy { - OkHttpClient() - .newBuilder() - .addInterceptor(HttpLoggingInterceptor(object : HttpLoggingInterceptor.Logger { - override fun log(message: String) { - logger?.invoke(message) - } - }).apply { - level = HttpLoggingInterceptor.Level.BODY - }) - } - - init { - normalizeBaseUrl() - } - - constructor( - baseUrl: String = defaultBasePath, - okHttpClientBuilder: OkHttpClient.Builder? = null, - serializerBuilder: Moshi.Builder = Serializer.moshiBuilder, - authNames: Array - ) : this(baseUrl, okHttpClientBuilder, serializerBuilder) { - authNames.forEach { authName -> - val auth = when (authName) { - "api_key" -> ApiKeyAuth("header", "api_key")"petstore_auth" -> OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets") - else -> throw RuntimeException("auth name $authName not found in available auth names") - } - addAuthorization(authName, auth); - } - } - - constructor( - baseUrl: String = defaultBasePath, - okHttpClientBuilder: OkHttpClient.Builder? = null, - serializerBuilder: Moshi.Builder = Serializer.moshiBuilder, - authName: String, - clientId: String, - secret: String, - username: String, - password: String - ) : this(baseUrl, okHttpClientBuilder, serializerBuilder, arrayOf(authName)) { - getTokenEndPoint() - ?.setClientId(clientId) - ?.setClientSecret(secret) - ?.setUsername(username) - ?.setPassword(password) - } - - /** - * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Token request builder - */ - fun getTokenEndPoint(): TokenRequestBuilder? { - var result: TokenRequestBuilder? = null - apiAuthorizations.values.runOnFirst { - result = tokenRequestBuilder - } - return result - } - - /** - * Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Authentication request builder - */ - fun getAuthorizationEndPoint(): AuthenticationRequestBuilder? { - var result: AuthenticationRequestBuilder? = null - apiAuthorizations.values.runOnFirst { - result = authenticationRequestBuilder - } - return result - } - - /** - * Helper method to pre-set the oauth access token of the first oauth found in the apiAuthorizations (there should be only one) - * @param accessToken Access token - * @return ApiClient - */ - fun setAccessToken(accessToken: String): ApiClient { - apiAuthorizations.values.runOnFirst { - setAccessToken(accessToken) - } - return this - } - - /** - * Helper method to configure the oauth accessCode/implicit flow parameters - * @param clientId Client ID - * @param clientSecret Client secret - * @param redirectURI Redirect URI - * @return ApiClient - */ - fun configureAuthorizationFlow(clientId: String, clientSecret: String, redirectURI: String): ApiClient { - apiAuthorizations.values.runOnFirst { - tokenRequestBuilder - .setClientId(clientId) - .setClientSecret(clientSecret) - .setRedirectURI(redirectURI) - authenticationRequestBuilder - ?.setClientId(clientId) - ?.setRedirectURI(redirectURI) - } - return this; - } - - /** - * Configures a listener which is notified when a new access token is received. - * @param accessTokenListener Access token listener - * @return ApiClient - */ - fun registerAccessTokenListener(accessTokenListener: AccessTokenListener): ApiClient { - apiAuthorizations.values.runOnFirst { - registerAccessTokenListener(accessTokenListener) - } - return this; - } - - /** - * Adds an authorization to be used by the client - * @param authName Authentication name - * @param authorization Authorization interceptor - * @return ApiClient - */ - fun addAuthorization(authName: String, authorization: Interceptor): ApiClient { - if (apiAuthorizations.containsKey(authName)) { - throw RuntimeException("auth name $authName already in api authorizations") - } - apiAuthorizations[authName] = authorization - clientBuilder.addInterceptor(authorization) - return this - } - - fun setLogger(logger: (String) -> Unit): ApiClient { - this.logger = logger - return this - } - - fun createService(serviceClass: Class): S { - val usedClient = this.okHttpClient ?: clientBuilder.build() - return retrofitBuilder.client(usedClient).build().create(serviceClass) - } - - private fun normalizeBaseUrl() { - if (!baseUrl.endsWith("/")) { - baseUrl += "/" - } - } - - private inline fun Iterable.runOnFirst(callback: U.() -> Unit) { - for (element in this) { - if (element is U) { - callback.invoke(element) - break - } - } - } - - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index ff5e2a81ee8c..000000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,12 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson - -class ByteArrayAdapter { - @ToJson - fun toJson(data: ByteArray): String = String(data) - - @FromJson - fun fromJson(data: String): ByteArray = data.toByteArray() -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/CollectionFormats.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/CollectionFormats.kt deleted file mode 100644 index 001e99325d2e..000000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/CollectionFormats.kt +++ /dev/null @@ -1,56 +0,0 @@ -package org.openapitools.client.infrastructure - -class CollectionFormats { - - open class CSVParams { - - var params: List - - constructor(params: List) { - this.params = params - } - - constructor(vararg params: String) { - this.params = listOf(*params) - } - - override fun toString(): String { - return params.joinToString(",") - } - } - - open class SSVParams : CSVParams { - - constructor(params: List) : super(params) - - constructor(vararg params: String) : super(*params) - - override fun toString(): String { - return params.joinToString(" ") - } - } - - class TSVParams : CSVParams { - - constructor(params: List) : super(params) - - constructor(vararg params: String) : super(*params) - - override fun toString(): String { - return params.joinToString("\t") - } - } - - class PIPESParams : CSVParams { - - constructor(params: List) : super(params) - - constructor(vararg params: String) : super(*params) - - override fun toString(): String { - return params.joinToString("|") - } - } - - class SPACEParams : SSVParams() -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index b2e1654479a0..000000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDate -import java.time.format.DateTimeFormatter - -class LocalDateAdapter { - @ToJson - fun toJson(value: LocalDate): String { - return DateTimeFormatter.ISO_LOCAL_DATE.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDate { - return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE) - } - -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index e082db94811d..000000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter - -class LocalDateTimeAdapter { - @ToJson - fun toJson(value: LocalDateTime): String { - return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDateTime { - return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index 87437871a31e..000000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.OffsetDateTime -import java.time.format.DateTimeFormatter - -class OffsetDateTimeAdapter { - @ToJson - fun toJson(value: OffsetDateTime): String { - return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): OffsetDateTime { - return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/ResponseExt.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/ResponseExt.kt deleted file mode 100644 index 1804d1ae2bbd..000000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/ResponseExt.kt +++ /dev/null @@ -1,16 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.JsonDataException -import com.squareup.moshi.Moshi -import retrofit2.Response - -@Throws(JsonDataException::class) -inline fun Response<*>.getErrorResponse(serializerBuilder: Moshi.Builder = Serializer.moshiBuilder): T? { - val serializer = serializerBuilder.build() - val parser = serializer.adapter(T::class.java) - val response = errorBody()?.string() - if(response != null) { - return parser.fromJson(response) - } - return null -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 9a45b67d9b1a..000000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,21 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.Moshi -import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory -import java.util.Date - -object Serializer { - @JvmStatic - val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(OffsetDateTimeAdapter()) - .add(LocalDateTimeAdapter()) - .add(LocalDateAdapter()) - .add(UUIDAdapter()) - .add(ByteArrayAdapter()) - .add(KotlinJsonAdapterFactory()) - - @JvmStatic - val moshi: Moshi by lazy { - moshiBuilder.build() - } -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt deleted file mode 100644 index a4a44cc18b73..000000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.util.UUID - -class UUIDAdapter { - @ToJson - fun toJson(uuid: UUID) = uuid.toString() - - @FromJson - fun fromJson(s: String) = UUID.fromString(s) -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index fafca8738f66..000000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,32 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * Describes the result of uploading an image resource - * @param code - * @param type - * @param message - */ - -data class ApiResponse ( - @Json(name = "code") - val code: kotlin.Int? = null, - @Json(name = "type") - val type: kotlin.String? = null, - @Json(name = "message") - val message: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index a4c17c3b49dd..000000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A category for a pet - * @param id - * @param name - */ - -data class Category ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index a66c335904e7..000000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * An order for a pets from the pet store - * @param id - * @param petId - * @param quantity - * @param shipDate - * @param status Order Status - * @param complete - */ - -data class Order ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "petId") - val petId: kotlin.Long? = null, - @Json(name = "quantity") - val quantity: kotlin.Int? = null, - @Json(name = "shipDate") - val shipDate: java.time.OffsetDateTime? = null, - /* Order Status */ - @Json(name = "status") - val status: Order.Status? = null, - @Json(name = "complete") - val complete: kotlin.Boolean? = null -) { - - /** - * Order Status - * Values: placed,approved,delivered - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "placed") placed("placed"), - @Json(name = "approved") approved("approved"), - @Json(name = "delivered") delivered("delivered"); - } -} - diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index a3df06cb6eb3..000000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,56 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.Category -import org.openapitools.client.models.Tag - -import com.squareup.moshi.Json - -/** - * A pet for sale in the pet store - * @param name - * @param photoUrls - * @param id - * @param category - * @param tags - * @param status pet status in the store - */ - -data class Pet ( - @Json(name = "name") - val name: kotlin.String, - @Json(name = "photoUrls") - val photoUrls: kotlin.collections.List, - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "category") - val category: Category? = null, - @Json(name = "tags") - val tags: kotlin.collections.List? = null, - /* pet status in the store */ - @Json(name = "status") - val status: Pet.Status? = null -) { - - /** - * pet status in the store - * Values: available,pending,sold - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "available") available("available"), - @Json(name = "pending") pending("pending"), - @Json(name = "sold") sold("sold"); - } -} - diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index 6e619023a5c9..000000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A tag for a pet - * @param id - * @param name - */ - -data class Tag ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index af1e270325de..000000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,48 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A User who is purchasing from the pet store - * @param id - * @param username - * @param firstName - * @param lastName - * @param email - * @param password - * @param phone - * @param userStatus User Status - */ - -data class User ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "username") - val username: kotlin.String? = null, - @Json(name = "firstName") - val firstName: kotlin.String? = null, - @Json(name = "lastName") - val lastName: kotlin.String? = null, - @Json(name = "email") - val email: kotlin.String? = null, - @Json(name = "password") - val password: kotlin.String? = null, - @Json(name = "phone") - val phone: kotlin.String? = null, - /* User Status */ - @Json(name = "userStatus") - val userStatus: kotlin.Int? = null -) - diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index 4fbeccdbc00a..000000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,492 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun addPet(body: Pet) : Unit { - val localVariableConfig = addPetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation addPet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun addPetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Deletes a pet - * - * @param apiKey (optional) - * @param petId Pet id to delete - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deletePet(apiKey: kotlin.String?, petId: kotlin.Long) : Unit { - val localVariableConfig = deletePetRequestConfig(apiKey = apiKey, petId = petId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deletePet - * - * @param apiKey (optional) - * @param petId Pet id to delete - * @return RequestConfig - */ - fun deletePetRequestConfig(apiKey: kotlin.String?, petId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByStatusRequestConfig(status = status) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByStatus - * - * @param status Status values that need to be considered for filter - * @return RequestConfig - */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("status", toMultiValue(status.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByStatus", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByTags - * - * @param tags Tags to filter by - * @return RequestConfig - */ - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("tags", toMultiValue(tags.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByTags", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getPetById(petId: kotlin.Long) : Pet { - val localVariableConfig = getPetByIdRequestConfig(petId = petId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Pet - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getPetById - * - * @param petId ID of pet to return - * @return RequestConfig - */ - fun getPetByIdRequestConfig(petId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePet(body: Pet) : Unit { - val localVariableConfig = updatePetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun updatePetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePetWithForm - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return RequestConfig - */ - fun updatePetWithFormRequestConfig(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("name" to name, "status" to status) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * uploads an image - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return ApiResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation uploadFile - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return RequestConfig - */ - fun uploadFileRequestConfig(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "file" to file) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index 215ed63420c9..000000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,253 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Order - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteOrder - * - * @param orderId ID of the order that needs to be deleted - * @return RequestConfig - */ - fun deleteOrderRequestConfig(orderId: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return kotlin.collections.Map - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getInventory() : kotlin.collections.Map { - val localVariableConfig = getInventoryRequestConfig() - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getInventory - * - * @return RequestConfig - */ - fun getInventoryRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/inventory", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getOrderById - * - * @param orderId ID of pet that needs to be fetched - * @return RequestConfig - */ - fun getOrderByIdRequestConfig(orderId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun placeOrder(body: Order) : Order { - val localVariableConfig = placeOrderRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation placeOrder - * - * @param body order placed for purchasing the pet - * @return RequestConfig - */ - fun placeOrderRequestConfig(body: Order) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/store/order", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 53748b934636..000000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,476 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.User - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUser(body: User) : Unit { - val localVariableConfig = createUserRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUser - * - * @param body Created user object - * @return RequestConfig - */ - fun createUserRequestConfig(body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithArrayInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithArrayInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithArray", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithListInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithListInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithListInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithList", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteUser(username: kotlin.String) : Unit { - val localVariableConfig = deleteUserRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteUser - * - * @param username The name that needs to be deleted - * @return RequestConfig - */ - fun deleteUserRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return User - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getUserByName(username: kotlin.String) : User { - val localVariableConfig = getUserByNameRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as User - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getUserByName - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return RequestConfig - */ - fun getUserByNameRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs user into the system - * - * @param username The user name for login - * @param password The password for login in clear text - * @return kotlin.String - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableConfig = loginUserRequestConfig(username = username, password = password) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation loginUser - * - * @param username The user name for login - * @param password The password for login in clear text - * @return RequestConfig - */ - fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("username", listOf(username.toString())) - put("password", listOf(password.toString())) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/login", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs out current logged in user session - * - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun logoutUser() : Unit { - val localVariableConfig = logoutUserRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation logoutUser - * - * @return RequestConfig - */ - fun logoutUserRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/logout", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param body Updated user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableConfig = updateUserRequestConfig(username = username, body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updateUser - * - * @param username name that need to be deleted - * @param body Updated user object - * @return RequestConfig - */ - fun updateUserRequestConfig(username: kotlin.String, body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt deleted file mode 100644 index ef7a8f1e1a62..000000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -typealias MultiValueMap = MutableMap> - -fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { - "csv" -> "," - "tsv" -> "\t" - "pipe" -> "|" - "space" -> " " - else -> "" -} - -val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } - -fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) - = toMultiValue(items.asIterable(), collectionFormat, map) - -fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { - return when(collectionFormat) { - "multi" -> items.map(map) - else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index 7a8dcc91cd4b..000000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,251 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Credentials -import okhttp3.OkHttpClient -import okhttp3.RequestBody -import okhttp3.RequestBody.Companion.asRequestBody -import okhttp3.RequestBody.Companion.toRequestBody -import okhttp3.FormBody -import okhttp3.HttpUrl.Companion.toHttpUrlOrNull -import okhttp3.ResponseBody -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.Request -import okhttp3.Headers -import okhttp3.MultipartBody -import java.io.File -import java.net.URLConnection -import java.util.Date -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.LocalTime -import java.time.OffsetDateTime -import java.time.OffsetTime - -open class ApiClient(val baseUrl: String) { - companion object { - protected const val ContentType = "Content-Type" - protected const val Accept = "Accept" - protected const val Authorization = "Authorization" - protected const val JsonMediaType = "application/json" - protected const val FormDataMediaType = "multipart/form-data" - protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" - protected const val XmlMediaType = "application/xml" - - val apiKey: MutableMap = mutableMapOf() - val apiKeyPrefix: MutableMap = mutableMapOf() - var username: String? = null - var password: String? = null - var accessToken: String? = null - - @JvmStatic - val client: OkHttpClient by lazy { - builder.build() - } - - @JvmStatic - val builder: OkHttpClient.Builder = OkHttpClient.Builder() - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - protected fun guessContentTypeFromFile(file: File): String { - val contentType = URLConnection.guessContentTypeFromName(file.name) - return contentType ?: "application/octet-stream" - } - - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> content.asRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == FormDataMediaType -> { - MultipartBody.Builder() - .setType(MultipartBody.FORM) - .apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - if (value is File) { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"; filename=\"${value.name}\"" - ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) - } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) - addPart( - partHeaders, - parameterToString(value).toRequestBody(null) - ) - } - } - }.build() - } - mediaType == FormUrlEncMediaType -> { - FormBody.Builder().apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) - } - }.build() - } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { - if(body == null) { - return null - } - val bodyContent = body.string() - if (bodyContent.isEmpty()) { - return null - } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") - } - } - - protected fun updateAuthParams(requestConfig: RequestConfig) { - if (requestConfig.headers["api_key"].isNullOrEmpty()) { - if (apiKey["api_key"] != null) { - if (apiKeyPrefix["api_key"] != null) { - requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! - } else { - requestConfig.headers["api_key"] = apiKey["api_key"]!! - } - } - } - if (requestConfig.headers[Authorization].isNullOrEmpty()) { - accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer $accessToken " - } - } - } - - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { - val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") - - // take authMethod from operation - updateAuthParams(requestConfig) - - val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - .apply { - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - addQueryParameter(query.key, queryValue) - } - } - }.build() - - // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { - requestConfig.headers[ContentType] = JsonMediaType - } - if (requestConfig.headers[Accept].isNullOrEmpty()) { - requestConfig.headers[Accept] = JsonMediaType - } - val headers = requestConfig.headers - - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Accept header. This is required.") - } - - // TODO: support multiple contentType options here. - val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - - val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) - RequestMethod.GET -> Request.Builder().url(url) - RequestMethod.HEAD -> Request.Builder().url(url).head() - RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(requestConfig.body, contentType)) - RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(requestConfig.body, contentType)) - RequestMethod.POST -> Request.Builder().url(url).post(requestBody(requestConfig.body, contentType)) - RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - }.apply { - headers.forEach { header -> addHeader(header.key, header.value) } - }.build() - - val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() - - // TODO: handle specific mapping types. e.g. Map> - when { - response.isRedirect -> return Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> return Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> return Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> return ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> return ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - } - } - - protected fun parameterToString(value: Any?): String { - when (value) { - null -> { - return "" - } - is Array<*> -> { - return toMultiValue(value, "csv").toString() - } - is Iterable<*> -> { - return toMultiValue(value, "csv").toString() - } - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { - return parseDateToQueryString(value) - } - else -> { - return value.toString() - } - } - } - - protected inline fun parseDateToQueryString(value : T): String { - /* - .replace("\"", "") converts the json object string to an actual string for the query parameter. - The moshi or gson adapter allows a more generic solution instead of trying to use a native - formatter. It also easily allows to provide a simple way to define a custom date format pattern - inside a gson/moshi adapter. - */ - return Serializer.moshi.adapter(T::class.java).toJson(value).replace("\"", "") - } -} diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbfaa..000000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2c0..000000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index ff5e2a81ee8c..000000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,12 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson - -class ByteArrayAdapter { - @ToJson - fun toJson(data: ByteArray): String = String(data) - - @FromJson - fun fromJson(data: String): ByteArray = data.toByteArray() -} diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/Errors.kt deleted file mode 100644 index b5310e71f13c..000000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/Errors.kt +++ /dev/null @@ -1,18 +0,0 @@ -@file:Suppress("unused") -package org.openapitools.client.infrastructure - -import java.lang.RuntimeException - -open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 123L - } -} - -open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 456L - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index b2e1654479a0..000000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDate -import java.time.format.DateTimeFormatter - -class LocalDateAdapter { - @ToJson - fun toJson(value: LocalDate): String { - return DateTimeFormatter.ISO_LOCAL_DATE.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDate { - return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE) - } - -} diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index e082db94811d..000000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter - -class LocalDateTimeAdapter { - @ToJson - fun toJson(value: LocalDateTime): String { - return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDateTime { - return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index 87437871a31e..000000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.OffsetDateTime -import java.time.format.DateTimeFormatter - -class OffsetDateTimeAdapter { - @ToJson - fun toJson(value: OffsetDateTime): String { - return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): OffsetDateTime { - return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt deleted file mode 100644 index 0f2790f370e2..000000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt +++ /dev/null @@ -1,17 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Defines a config object for a given request. - * NOTE: This object doesn't include 'body' because it - * allows for caching of the constructed object - * for many request definitions. - * NOTE: Headers is a Map because rfc2616 defines - * multi-valued headers as csv-only. - */ -data class RequestConfig( - val method: RequestMethod, - val path: String, - val headers: MutableMap = mutableMapOf(), - val query: MutableMap> = mutableMapOf(), - val body: kotlin.Any? = null -) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt deleted file mode 100644 index 931b12b8bd7a..000000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Provides enumerated HTTP verbs - */ -enum class RequestMethod { - GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt deleted file mode 100644 index 9bd2790dc144..000000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Response - -/** - * Provides an extension to evaluation whether the response is a 1xx code - */ -val Response.isInformational : Boolean get() = this.code in 100..199 - -/** - * Provides an extension to evaluation whether the response is a 3xx code - */ -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") -val Response.isRedirect : Boolean get() = this.code in 300..399 - -/** - * Provides an extension to evaluation whether the response is a 4xx code - */ -val Response.isClientError : Boolean get() = this.code in 400..499 - -/** - * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code - */ -val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 9a45b67d9b1a..000000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,21 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.Moshi -import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory -import java.util.Date - -object Serializer { - @JvmStatic - val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(OffsetDateTimeAdapter()) - .add(LocalDateTimeAdapter()) - .add(LocalDateAdapter()) - .add(UUIDAdapter()) - .add(ByteArrayAdapter()) - .add(KotlinJsonAdapterFactory()) - - @JvmStatic - val moshi: Moshi by lazy { - moshiBuilder.build() - } -} diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt deleted file mode 100644 index a4a44cc18b73..000000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.util.UUID - -class UUIDAdapter { - @ToJson - fun toJson(uuid: UUID) = uuid.toString() - - @FromJson - fun fromJson(s: String) = UUID.fromString(s) -} diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index 7d40c8efbc2f..000000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,38 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * Describes the result of uploading an image resource - * @param code - * @param type - * @param message - */ - -data class ApiResponse ( - @Json(name = "code") - val code: kotlin.Int? = null, - @Json(name = "type") - val type: kotlin.String? = null, - @Json(name = "message") - val message: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index ceb0fbc8fe60..000000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,35 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * A category for a pet - * @param id - * @param name - */ - -data class Category ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index ec768d1acefd..000000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,58 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * An order for a pets from the pet store - * @param id - * @param petId - * @param quantity - * @param shipDate - * @param status Order Status - * @param complete - */ - -data class Order ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "petId") - val petId: kotlin.Long? = null, - @Json(name = "quantity") - val quantity: kotlin.Int? = null, - @Json(name = "shipDate") - val shipDate: kotlin.String? = null, - /* Order Status */ - @Json(name = "status") - val status: Order.Status? = null, - @Json(name = "complete") - val complete: kotlin.Boolean? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - - /** - * Order Status - * Values: placed,approved,delivered - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "placed") placed("placed"), - @Json(name = "approved") approved("approved"), - @Json(name = "delivered") delivered("delivered"); - } -} - diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index 66667bf07cd1..000000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,60 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.Category -import org.openapitools.client.models.Tag - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * A pet for sale in the pet store - * @param id - * @param category - * @param name - * @param photoUrls - * @param tags - * @param status pet status in the store - */ - -data class Pet ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "category") - val category: Category? = null, - @Json(name = "name") - val name: kotlin.String, - @Json(name = "photoUrls") - val photoUrls: kotlin.collections.List, - @Json(name = "tags") - val tags: kotlin.collections.List? = null, - /* pet status in the store */ - @Json(name = "status") - val status: Pet.Status? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - - /** - * pet status in the store - * Values: available,pending,sold - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "available") available("available"), - @Json(name = "pending") pending("pending"), - @Json(name = "sold") sold("sold"); - } -} - diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index 944b1cd0a141..000000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,35 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * A tag for a pet - * @param id - * @param name - */ - -data class Tag ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index 9697f07d5bf8..000000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * A User who is purchasing from the pet store - * @param id - * @param username - * @param firstName - * @param lastName - * @param email - * @param password - * @param phone - * @param userStatus User Status - */ - -data class User ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "username") - val username: kotlin.String? = null, - @Json(name = "firstName") - val firstName: kotlin.String? = null, - @Json(name = "lastName") - val lastName: kotlin.String? = null, - @Json(name = "email") - val email: kotlin.String? = null, - @Json(name = "password") - val password: kotlin.String? = null, - @Json(name = "phone") - val phone: kotlin.String? = null, - /* User Status */ - @Json(name = "userStatus") - val userStatus: kotlin.Int? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 7282e53200b6..2abf02f23b42 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -25,7 +25,6 @@ import java.time.LocalDateTime import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime -import java.util.Date import java.util.Locale import com.squareup.moshi.adapter @@ -248,7 +247,7 @@ open class ApiClient(val baseUrl: String) { null -> "" is Array<*> -> toMultiValue(value, "csv").toString() is Iterable<*> -> toMultiValue(value, "csv").toString() - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2c0..000000000000 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index c8b93b33bf6f..000000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,492 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun addPet(body: Pet) : Unit { - val localVariableConfig = addPetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation addPet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun addPetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Deletes a pet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deletePet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return RequestConfig - */ - fun deletePetRequestConfig(petId: kotlin.Long, apiKey: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByStatusRequestConfig(status = status) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByStatus - * - * @param status Status values that need to be considered for filter - * @return RequestConfig - */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("status", toMultiValue(status.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByStatus", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByTags - * - * @param tags Tags to filter by - * @return RequestConfig - */ - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("tags", toMultiValue(tags.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByTags", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getPetById(petId: kotlin.Long) : Pet { - val localVariableConfig = getPetByIdRequestConfig(petId = petId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Pet - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getPetById - * - * @param petId ID of pet to return - * @return RequestConfig - */ - fun getPetByIdRequestConfig(petId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePet(body: Pet) : Unit { - val localVariableConfig = updatePetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun updatePetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePetWithForm - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return RequestConfig - */ - fun updatePetWithFormRequestConfig(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("name" to name, "status" to status) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * uploads an image - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return ApiResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation uploadFile - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return RequestConfig - */ - fun uploadFileRequestConfig(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "file" to file) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index 215ed63420c9..000000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,253 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Order - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteOrder - * - * @param orderId ID of the order that needs to be deleted - * @return RequestConfig - */ - fun deleteOrderRequestConfig(orderId: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return kotlin.collections.Map - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getInventory() : kotlin.collections.Map { - val localVariableConfig = getInventoryRequestConfig() - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getInventory - * - * @return RequestConfig - */ - fun getInventoryRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/inventory", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getOrderById - * - * @param orderId ID of pet that needs to be fetched - * @return RequestConfig - */ - fun getOrderByIdRequestConfig(orderId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun placeOrder(body: Order) : Order { - val localVariableConfig = placeOrderRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation placeOrder - * - * @param body order placed for purchasing the pet - * @return RequestConfig - */ - fun placeOrderRequestConfig(body: Order) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/store/order", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 53748b934636..000000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,476 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.User - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUser(body: User) : Unit { - val localVariableConfig = createUserRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUser - * - * @param body Created user object - * @return RequestConfig - */ - fun createUserRequestConfig(body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithArrayInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithArrayInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithArray", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithListInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithListInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithListInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithList", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteUser(username: kotlin.String) : Unit { - val localVariableConfig = deleteUserRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteUser - * - * @param username The name that needs to be deleted - * @return RequestConfig - */ - fun deleteUserRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return User - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getUserByName(username: kotlin.String) : User { - val localVariableConfig = getUserByNameRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as User - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getUserByName - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return RequestConfig - */ - fun getUserByNameRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs user into the system - * - * @param username The user name for login - * @param password The password for login in clear text - * @return kotlin.String - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableConfig = loginUserRequestConfig(username = username, password = password) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation loginUser - * - * @param username The user name for login - * @param password The password for login in clear text - * @return RequestConfig - */ - fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("username", listOf(username.toString())) - put("password", listOf(password.toString())) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/login", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs out current logged in user session - * - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun logoutUser() : Unit { - val localVariableConfig = logoutUserRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation logoutUser - * - * @return RequestConfig - */ - fun logoutUserRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/logout", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param body Updated user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableConfig = updateUserRequestConfig(username = username, body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updateUser - * - * @param username name that need to be deleted - * @param body Updated user object - * @return RequestConfig - */ - fun updateUserRequestConfig(username: kotlin.String, body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt deleted file mode 100644 index ef7a8f1e1a62..000000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -typealias MultiValueMap = MutableMap> - -fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { - "csv" -> "," - "tsv" -> "\t" - "pipe" -> "|" - "space" -> " " - else -> "" -} - -val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } - -fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) - = toMultiValue(items.asIterable(), collectionFormat, map) - -fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { - return when(collectionFormat) { - "multi" -> items.map(map) - else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index 135bcdc790e1..000000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,251 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Credentials -import okhttp3.OkHttpClient -import okhttp3.RequestBody -import okhttp3.RequestBody.Companion.asRequestBody -import okhttp3.RequestBody.Companion.toRequestBody -import okhttp3.FormBody -import okhttp3.HttpUrl.Companion.toHttpUrlOrNull -import okhttp3.ResponseBody -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.Request -import okhttp3.Headers -import okhttp3.MultipartBody -import java.io.File -import java.net.URLConnection -import java.util.Date -import org.threeten.bp.LocalDate -import org.threeten.bp.LocalDateTime -import org.threeten.bp.LocalTime -import org.threeten.bp.OffsetDateTime -import org.threeten.bp.OffsetTime - -open class ApiClient(val baseUrl: String) { - companion object { - protected const val ContentType = "Content-Type" - protected const val Accept = "Accept" - protected const val Authorization = "Authorization" - protected const val JsonMediaType = "application/json" - protected const val FormDataMediaType = "multipart/form-data" - protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" - protected const val XmlMediaType = "application/xml" - - val apiKey: MutableMap = mutableMapOf() - val apiKeyPrefix: MutableMap = mutableMapOf() - var username: String? = null - var password: String? = null - var accessToken: String? = null - - @JvmStatic - val client: OkHttpClient by lazy { - builder.build() - } - - @JvmStatic - val builder: OkHttpClient.Builder = OkHttpClient.Builder() - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - protected fun guessContentTypeFromFile(file: File): String { - val contentType = URLConnection.guessContentTypeFromName(file.name) - return contentType ?: "application/octet-stream" - } - - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> content.asRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == FormDataMediaType -> { - MultipartBody.Builder() - .setType(MultipartBody.FORM) - .apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - if (value is File) { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"; filename=\"${value.name}\"" - ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) - } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) - addPart( - partHeaders, - parameterToString(value).toRequestBody(null) - ) - } - } - }.build() - } - mediaType == FormUrlEncMediaType -> { - FormBody.Builder().apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) - } - }.build() - } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { - if(body == null) { - return null - } - val bodyContent = body.string() - if (bodyContent.isEmpty()) { - return null - } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") - } - } - - protected fun updateAuthParams(requestConfig: RequestConfig) { - if (requestConfig.headers["api_key"].isNullOrEmpty()) { - if (apiKey["api_key"] != null) { - if (apiKeyPrefix["api_key"] != null) { - requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! - } else { - requestConfig.headers["api_key"] = apiKey["api_key"]!! - } - } - } - if (requestConfig.headers[Authorization].isNullOrEmpty()) { - accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer $accessToken " - } - } - } - - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { - val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") - - // take authMethod from operation - updateAuthParams(requestConfig) - - val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - .apply { - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - addQueryParameter(query.key, queryValue) - } - } - }.build() - - // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { - requestConfig.headers[ContentType] = JsonMediaType - } - if (requestConfig.headers[Accept].isNullOrEmpty()) { - requestConfig.headers[Accept] = JsonMediaType - } - val headers = requestConfig.headers - - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Accept header. This is required.") - } - - // TODO: support multiple contentType options here. - val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - - val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) - RequestMethod.GET -> Request.Builder().url(url) - RequestMethod.HEAD -> Request.Builder().url(url).head() - RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(requestConfig.body, contentType)) - RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(requestConfig.body, contentType)) - RequestMethod.POST -> Request.Builder().url(url).post(requestBody(requestConfig.body, contentType)) - RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - }.apply { - headers.forEach { header -> addHeader(header.key, header.value) } - }.build() - - val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() - - // TODO: handle specific mapping types. e.g. Map> - when { - response.isRedirect -> return Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> return Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> return Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> return ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> return ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - } - } - - protected fun parameterToString(value: Any?): String { - when (value) { - null -> { - return "" - } - is Array<*> -> { - return toMultiValue(value, "csv").toString() - } - is Iterable<*> -> { - return toMultiValue(value, "csv").toString() - } - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { - return parseDateToQueryString(value) - } - else -> { - return value.toString() - } - } - } - - protected inline fun parseDateToQueryString(value : T): String { - /* - .replace("\"", "") converts the json object string to an actual string for the query parameter. - The moshi or gson adapter allows a more generic solution instead of trying to use a native - formatter. It also easily allows to provide a simple way to define a custom date format pattern - inside a gson/moshi adapter. - */ - return Serializer.moshi.adapter(T::class.java).toJson(value).replace("\"", "") - } -} diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbfaa..000000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2c0..000000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index ff5e2a81ee8c..000000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,12 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson - -class ByteArrayAdapter { - @ToJson - fun toJson(data: ByteArray): String = String(data) - - @FromJson - fun fromJson(data: String): ByteArray = data.toByteArray() -} diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/Errors.kt deleted file mode 100644 index b5310e71f13c..000000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/Errors.kt +++ /dev/null @@ -1,18 +0,0 @@ -@file:Suppress("unused") -package org.openapitools.client.infrastructure - -import java.lang.RuntimeException - -open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 123L - } -} - -open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 456L - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index ff5439aeb42f..000000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import org.threeten.bp.LocalDate -import org.threeten.bp.format.DateTimeFormatter - -class LocalDateAdapter { - @ToJson - fun toJson(value: LocalDate): String { - return DateTimeFormatter.ISO_LOCAL_DATE.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDate { - return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE) - } - -} diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index 710a9cc13178..000000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import org.threeten.bp.LocalDateTime -import org.threeten.bp.format.DateTimeFormatter - -class LocalDateTimeAdapter { - @ToJson - fun toJson(value: LocalDateTime): String { - return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDateTime { - return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index 28b3eb3cd70a..000000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import org.threeten.bp.OffsetDateTime -import org.threeten.bp.format.DateTimeFormatter - -class OffsetDateTimeAdapter { - @ToJson - fun toJson(value: OffsetDateTime): String { - return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): OffsetDateTime { - return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt deleted file mode 100644 index 0f2790f370e2..000000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt +++ /dev/null @@ -1,17 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Defines a config object for a given request. - * NOTE: This object doesn't include 'body' because it - * allows for caching of the constructed object - * for many request definitions. - * NOTE: Headers is a Map because rfc2616 defines - * multi-valued headers as csv-only. - */ -data class RequestConfig( - val method: RequestMethod, - val path: String, - val headers: MutableMap = mutableMapOf(), - val query: MutableMap> = mutableMapOf(), - val body: kotlin.Any? = null -) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt deleted file mode 100644 index 931b12b8bd7a..000000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Provides enumerated HTTP verbs - */ -enum class RequestMethod { - GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt deleted file mode 100644 index 9bd2790dc144..000000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Response - -/** - * Provides an extension to evaluation whether the response is a 1xx code - */ -val Response.isInformational : Boolean get() = this.code in 100..199 - -/** - * Provides an extension to evaluation whether the response is a 3xx code - */ -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") -val Response.isRedirect : Boolean get() = this.code in 300..399 - -/** - * Provides an extension to evaluation whether the response is a 4xx code - */ -val Response.isClientError : Boolean get() = this.code in 400..499 - -/** - * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code - */ -val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 9a45b67d9b1a..000000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,21 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.Moshi -import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory -import java.util.Date - -object Serializer { - @JvmStatic - val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(OffsetDateTimeAdapter()) - .add(LocalDateTimeAdapter()) - .add(LocalDateAdapter()) - .add(UUIDAdapter()) - .add(ByteArrayAdapter()) - .add(KotlinJsonAdapterFactory()) - - @JvmStatic - val moshi: Moshi by lazy { - moshiBuilder.build() - } -} diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt deleted file mode 100644 index a4a44cc18b73..000000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.util.UUID - -class UUIDAdapter { - @ToJson - fun toJson(uuid: UUID) = uuid.toString() - - @FromJson - fun fromJson(s: String) = UUID.fromString(s) -} diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index fafca8738f66..000000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,32 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * Describes the result of uploading an image resource - * @param code - * @param type - * @param message - */ - -data class ApiResponse ( - @Json(name = "code") - val code: kotlin.Int? = null, - @Json(name = "type") - val type: kotlin.String? = null, - @Json(name = "message") - val message: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index a4c17c3b49dd..000000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A category for a pet - * @param id - * @param name - */ - -data class Category ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index 300f94d8545f..000000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * An order for a pets from the pet store - * @param id - * @param petId - * @param quantity - * @param shipDate - * @param status Order Status - * @param complete - */ - -data class Order ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "petId") - val petId: kotlin.Long? = null, - @Json(name = "quantity") - val quantity: kotlin.Int? = null, - @Json(name = "shipDate") - val shipDate: org.threeten.bp.OffsetDateTime? = null, - /* Order Status */ - @Json(name = "status") - val status: Order.Status? = null, - @Json(name = "complete") - val complete: kotlin.Boolean? = null -) { - - /** - * Order Status - * Values: placed,approved,delivered - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "placed") placed("placed"), - @Json(name = "approved") approved("approved"), - @Json(name = "delivered") delivered("delivered"); - } -} - diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index a3df06cb6eb3..000000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,56 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.Category -import org.openapitools.client.models.Tag - -import com.squareup.moshi.Json - -/** - * A pet for sale in the pet store - * @param name - * @param photoUrls - * @param id - * @param category - * @param tags - * @param status pet status in the store - */ - -data class Pet ( - @Json(name = "name") - val name: kotlin.String, - @Json(name = "photoUrls") - val photoUrls: kotlin.collections.List, - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "category") - val category: Category? = null, - @Json(name = "tags") - val tags: kotlin.collections.List? = null, - /* pet status in the store */ - @Json(name = "status") - val status: Pet.Status? = null -) { - - /** - * pet status in the store - * Values: available,pending,sold - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "available") available("available"), - @Json(name = "pending") pending("pending"), - @Json(name = "sold") sold("sold"); - } -} - diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index 6e619023a5c9..000000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A tag for a pet - * @param id - * @param name - */ - -data class Tag ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index af1e270325de..000000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,48 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A User who is purchasing from the pet store - * @param id - * @param username - * @param firstName - * @param lastName - * @param email - * @param password - * @param phone - * @param userStatus User Status - */ - -data class User ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "username") - val username: kotlin.String? = null, - @Json(name = "firstName") - val firstName: kotlin.String? = null, - @Json(name = "lastName") - val lastName: kotlin.String? = null, - @Json(name = "email") - val email: kotlin.String? = null, - @Json(name = "password") - val password: kotlin.String? = null, - @Json(name = "phone") - val phone: kotlin.String? = null, - /* User Status */ - @Json(name = "userStatus") - val userStatus: kotlin.Int? = null -) - diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 8ae5de40f5d8..8467a2ab7da3 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -20,7 +20,6 @@ import java.io.File import java.io.FileWriter import java.io.IOException import java.net.URLConnection -import java.util.Date import java.util.Locale import org.threeten.bp.LocalDate import org.threeten.bp.LocalDateTime @@ -248,7 +247,7 @@ open class ApiClient(val baseUrl: String) { null -> "" is Array<*> -> toMultiValue(value, "csv").toString() is Iterable<*> -> toMultiValue(value, "csv").toString() - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2c0..000000000000 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/apis/EnumApi.kt b/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/apis/EnumApi.kt deleted file mode 100644 index e504c876ce65..000000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/apis/EnumApi.kt +++ /dev/null @@ -1,89 +0,0 @@ -/** -* OpenAPI Petstore -* Test for issue 4062 -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.PetEnum - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class EnumApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Get enums - * - * @return PetEnum - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getEnum() : PetEnum { - val localVariableConfig = getEnumRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as PetEnum - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getEnum - * - * @return RequestConfig - */ - fun getEnumRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/enum", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt deleted file mode 100644 index ef7a8f1e1a62..000000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -typealias MultiValueMap = MutableMap> - -fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { - "csv" -> "," - "tsv" -> "\t" - "pipe" -> "|" - "space" -> " " - else -> "" -} - -val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } - -fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) - = toMultiValue(items.asIterable(), collectionFormat, map) - -fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { - return when(collectionFormat) { - "multi" -> items.map(map) - else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index c34e9e42d08c..000000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,232 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Credentials -import okhttp3.OkHttpClient -import okhttp3.RequestBody -import okhttp3.RequestBody.Companion.asRequestBody -import okhttp3.RequestBody.Companion.toRequestBody -import okhttp3.FormBody -import okhttp3.HttpUrl.Companion.toHttpUrlOrNull -import okhttp3.ResponseBody -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.Request -import okhttp3.Headers -import okhttp3.MultipartBody -import java.io.File -import java.net.URLConnection -import java.util.Date -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.LocalTime -import java.time.OffsetDateTime -import java.time.OffsetTime - -open class ApiClient(val baseUrl: String) { - companion object { - protected const val ContentType = "Content-Type" - protected const val Accept = "Accept" - protected const val Authorization = "Authorization" - protected const val JsonMediaType = "application/json" - protected const val FormDataMediaType = "multipart/form-data" - protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" - protected const val XmlMediaType = "application/xml" - - val apiKey: MutableMap = mutableMapOf() - val apiKeyPrefix: MutableMap = mutableMapOf() - var username: String? = null - var password: String? = null - var accessToken: String? = null - - @JvmStatic - val client: OkHttpClient by lazy { - builder.build() - } - - @JvmStatic - val builder: OkHttpClient.Builder = OkHttpClient.Builder() - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - protected fun guessContentTypeFromFile(file: File): String { - val contentType = URLConnection.guessContentTypeFromName(file.name) - return contentType ?: "application/octet-stream" - } - - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> content.asRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == FormDataMediaType -> { - MultipartBody.Builder() - .setType(MultipartBody.FORM) - .apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - if (value is File) { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"; filename=\"${value.name}\"" - ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) - } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) - addPart( - partHeaders, - parameterToString(value).toRequestBody(null) - ) - } - } - }.build() - } - mediaType == FormUrlEncMediaType -> { - FormBody.Builder().apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) - } - }.build() - } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { - if(body == null) { - return null - } - val bodyContent = body.string() - if (bodyContent.isEmpty()) { - return null - } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") - } - } - - - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { - val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") - - val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - .apply { - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - addQueryParameter(query.key, queryValue) - } - } - }.build() - - // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { - requestConfig.headers[ContentType] = JsonMediaType - } - if (requestConfig.headers[Accept].isNullOrEmpty()) { - requestConfig.headers[Accept] = JsonMediaType - } - val headers = requestConfig.headers - - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Accept header. This is required.") - } - - // TODO: support multiple contentType options here. - val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - - val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) - RequestMethod.GET -> Request.Builder().url(url) - RequestMethod.HEAD -> Request.Builder().url(url).head() - RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(requestConfig.body, contentType)) - RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(requestConfig.body, contentType)) - RequestMethod.POST -> Request.Builder().url(url).post(requestBody(requestConfig.body, contentType)) - RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - }.apply { - headers.forEach { header -> addHeader(header.key, header.value) } - }.build() - - val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() - - // TODO: handle specific mapping types. e.g. Map> - when { - response.isRedirect -> return Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> return Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> return Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> return ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> return ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - } - } - - protected fun parameterToString(value: Any?): String { - when (value) { - null -> { - return "" - } - is Array<*> -> { - return toMultiValue(value, "csv").toString() - } - is Iterable<*> -> { - return toMultiValue(value, "csv").toString() - } - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { - return parseDateToQueryString(value) - } - else -> { - return value.toString() - } - } - } - - protected inline fun parseDateToQueryString(value : T): String { - /* - .replace("\"", "") converts the json object string to an actual string for the query parameter. - The moshi or gson adapter allows a more generic solution instead of trying to use a native - formatter. It also easily allows to provide a simple way to define a custom date format pattern - inside a gson/moshi adapter. - */ - return Serializer.moshi.adapter(T::class.java).toJson(value).replace("\"", "") - } -} diff --git a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbfaa..000000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2c0..000000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index ff5e2a81ee8c..000000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,12 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson - -class ByteArrayAdapter { - @ToJson - fun toJson(data: ByteArray): String = String(data) - - @FromJson - fun fromJson(data: String): ByteArray = data.toByteArray() -} diff --git a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/Errors.kt deleted file mode 100644 index b5310e71f13c..000000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/Errors.kt +++ /dev/null @@ -1,18 +0,0 @@ -@file:Suppress("unused") -package org.openapitools.client.infrastructure - -import java.lang.RuntimeException - -open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 123L - } -} - -open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 456L - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index b2e1654479a0..000000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDate -import java.time.format.DateTimeFormatter - -class LocalDateAdapter { - @ToJson - fun toJson(value: LocalDate): String { - return DateTimeFormatter.ISO_LOCAL_DATE.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDate { - return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE) - } - -} diff --git a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index e082db94811d..000000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter - -class LocalDateTimeAdapter { - @ToJson - fun toJson(value: LocalDateTime): String { - return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDateTime { - return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index 87437871a31e..000000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.OffsetDateTime -import java.time.format.DateTimeFormatter - -class OffsetDateTimeAdapter { - @ToJson - fun toJson(value: OffsetDateTime): String { - return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): OffsetDateTime { - return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt deleted file mode 100644 index 0f2790f370e2..000000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt +++ /dev/null @@ -1,17 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Defines a config object for a given request. - * NOTE: This object doesn't include 'body' because it - * allows for caching of the constructed object - * for many request definitions. - * NOTE: Headers is a Map because rfc2616 defines - * multi-valued headers as csv-only. - */ -data class RequestConfig( - val method: RequestMethod, - val path: String, - val headers: MutableMap = mutableMapOf(), - val query: MutableMap> = mutableMapOf(), - val body: kotlin.Any? = null -) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt deleted file mode 100644 index 931b12b8bd7a..000000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Provides enumerated HTTP verbs - */ -enum class RequestMethod { - GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt deleted file mode 100644 index 9bd2790dc144..000000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Response - -/** - * Provides an extension to evaluation whether the response is a 1xx code - */ -val Response.isInformational : Boolean get() = this.code in 100..199 - -/** - * Provides an extension to evaluation whether the response is a 3xx code - */ -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") -val Response.isRedirect : Boolean get() = this.code in 300..399 - -/** - * Provides an extension to evaluation whether the response is a 4xx code - */ -val Response.isClientError : Boolean get() = this.code in 400..499 - -/** - * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code - */ -val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 9a45b67d9b1a..000000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,21 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.Moshi -import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory -import java.util.Date - -object Serializer { - @JvmStatic - val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(OffsetDateTimeAdapter()) - .add(LocalDateTimeAdapter()) - .add(LocalDateAdapter()) - .add(UUIDAdapter()) - .add(ByteArrayAdapter()) - .add(KotlinJsonAdapterFactory()) - - @JvmStatic - val moshi: Moshi by lazy { - moshiBuilder.build() - } -} diff --git a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt deleted file mode 100644 index a4a44cc18b73..000000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.util.UUID - -class UUIDAdapter { - @ToJson - fun toJson(uuid: UUID) = uuid.toString() - - @FromJson - fun fromJson(s: String) = UUID.fromString(s) -} diff --git a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/models/PetEnum.kt b/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/models/PetEnum.kt deleted file mode 100644 index a447bf920529..000000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/models/PetEnum.kt +++ /dev/null @@ -1,43 +0,0 @@ -/** -* OpenAPI Petstore -* Test for issue 4062 -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** -* An enum with complex-ish naming -* Values: MY_FIRST_VALUE,MY_SECOND_VALUE -*/ - -enum class PetEnum(val value: kotlin.String){ - - - @Json(name = "myFirstValue") - MY_FIRST_VALUE("myFirstValue"), - - - @Json(name = "MY_SECOND_VALUE") - MY_SECOND_VALUE("MY_SECOND_VALUE"); - - - - /** - 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/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 09194ef92717..dc423d8a17df 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 @@ -25,7 +25,6 @@ import java.time.LocalDateTime import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime -import java.util.Date import java.util.Locale import com.squareup.moshi.adapter @@ -229,7 +228,7 @@ open class ApiClient(val baseUrl: String) { null -> "" is Array<*> -> toMultiValue(value, "csv").toString() is Iterable<*> -> toMultiValue(value, "csv").toString() - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2c0..000000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index c8b93b33bf6f..000000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,492 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun addPet(body: Pet) : Unit { - val localVariableConfig = addPetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation addPet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun addPetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Deletes a pet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deletePet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return RequestConfig - */ - fun deletePetRequestConfig(petId: kotlin.Long, apiKey: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByStatusRequestConfig(status = status) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByStatus - * - * @param status Status values that need to be considered for filter - * @return RequestConfig - */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("status", toMultiValue(status.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByStatus", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByTags - * - * @param tags Tags to filter by - * @return RequestConfig - */ - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("tags", toMultiValue(tags.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByTags", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getPetById(petId: kotlin.Long) : Pet { - val localVariableConfig = getPetByIdRequestConfig(petId = petId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Pet - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getPetById - * - * @param petId ID of pet to return - * @return RequestConfig - */ - fun getPetByIdRequestConfig(petId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePet(body: Pet) : Unit { - val localVariableConfig = updatePetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun updatePetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePetWithForm - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return RequestConfig - */ - fun updatePetWithFormRequestConfig(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("name" to name, "status" to status) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * uploads an image - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return ApiResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation uploadFile - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return RequestConfig - */ - fun uploadFileRequestConfig(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "file" to file) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index 215ed63420c9..000000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,253 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Order - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteOrder - * - * @param orderId ID of the order that needs to be deleted - * @return RequestConfig - */ - fun deleteOrderRequestConfig(orderId: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return kotlin.collections.Map - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getInventory() : kotlin.collections.Map { - val localVariableConfig = getInventoryRequestConfig() - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getInventory - * - * @return RequestConfig - */ - fun getInventoryRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/inventory", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getOrderById - * - * @param orderId ID of pet that needs to be fetched - * @return RequestConfig - */ - fun getOrderByIdRequestConfig(orderId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun placeOrder(body: Order) : Order { - val localVariableConfig = placeOrderRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation placeOrder - * - * @param body order placed for purchasing the pet - * @return RequestConfig - */ - fun placeOrderRequestConfig(body: Order) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/store/order", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 53748b934636..000000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,476 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.User - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUser(body: User) : Unit { - val localVariableConfig = createUserRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUser - * - * @param body Created user object - * @return RequestConfig - */ - fun createUserRequestConfig(body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithArrayInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithArrayInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithArray", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithListInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithListInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithListInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithList", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteUser(username: kotlin.String) : Unit { - val localVariableConfig = deleteUserRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteUser - * - * @param username The name that needs to be deleted - * @return RequestConfig - */ - fun deleteUserRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return User - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getUserByName(username: kotlin.String) : User { - val localVariableConfig = getUserByNameRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as User - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getUserByName - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return RequestConfig - */ - fun getUserByNameRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs user into the system - * - * @param username The user name for login - * @param password The password for login in clear text - * @return kotlin.String - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableConfig = loginUserRequestConfig(username = username, password = password) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation loginUser - * - * @param username The user name for login - * @param password The password for login in clear text - * @return RequestConfig - */ - fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("username", listOf(username.toString())) - put("password", listOf(password.toString())) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/login", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs out current logged in user session - * - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun logoutUser() : Unit { - val localVariableConfig = logoutUserRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation logoutUser - * - * @return RequestConfig - */ - fun logoutUserRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/logout", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param body Updated user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableConfig = updateUserRequestConfig(username = username, body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updateUser - * - * @param username name that need to be deleted - * @param body Updated user object - * @return RequestConfig - */ - fun updateUserRequestConfig(username: kotlin.String, body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt deleted file mode 100644 index ef7a8f1e1a62..000000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -typealias MultiValueMap = MutableMap> - -fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { - "csv" -> "," - "tsv" -> "\t" - "pipe" -> "|" - "space" -> " " - else -> "" -} - -val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } - -fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) - = toMultiValue(items.asIterable(), collectionFormat, map) - -fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { - return when(collectionFormat) { - "multi" -> items.map(map) - else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index 7a8dcc91cd4b..000000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,251 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Credentials -import okhttp3.OkHttpClient -import okhttp3.RequestBody -import okhttp3.RequestBody.Companion.asRequestBody -import okhttp3.RequestBody.Companion.toRequestBody -import okhttp3.FormBody -import okhttp3.HttpUrl.Companion.toHttpUrlOrNull -import okhttp3.ResponseBody -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.Request -import okhttp3.Headers -import okhttp3.MultipartBody -import java.io.File -import java.net.URLConnection -import java.util.Date -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.LocalTime -import java.time.OffsetDateTime -import java.time.OffsetTime - -open class ApiClient(val baseUrl: String) { - companion object { - protected const val ContentType = "Content-Type" - protected const val Accept = "Accept" - protected const val Authorization = "Authorization" - protected const val JsonMediaType = "application/json" - protected const val FormDataMediaType = "multipart/form-data" - protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" - protected const val XmlMediaType = "application/xml" - - val apiKey: MutableMap = mutableMapOf() - val apiKeyPrefix: MutableMap = mutableMapOf() - var username: String? = null - var password: String? = null - var accessToken: String? = null - - @JvmStatic - val client: OkHttpClient by lazy { - builder.build() - } - - @JvmStatic - val builder: OkHttpClient.Builder = OkHttpClient.Builder() - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - protected fun guessContentTypeFromFile(file: File): String { - val contentType = URLConnection.guessContentTypeFromName(file.name) - return contentType ?: "application/octet-stream" - } - - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> content.asRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == FormDataMediaType -> { - MultipartBody.Builder() - .setType(MultipartBody.FORM) - .apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - if (value is File) { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"; filename=\"${value.name}\"" - ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) - } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) - addPart( - partHeaders, - parameterToString(value).toRequestBody(null) - ) - } - } - }.build() - } - mediaType == FormUrlEncMediaType -> { - FormBody.Builder().apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) - } - }.build() - } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { - if(body == null) { - return null - } - val bodyContent = body.string() - if (bodyContent.isEmpty()) { - return null - } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") - } - } - - protected fun updateAuthParams(requestConfig: RequestConfig) { - if (requestConfig.headers["api_key"].isNullOrEmpty()) { - if (apiKey["api_key"] != null) { - if (apiKeyPrefix["api_key"] != null) { - requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! - } else { - requestConfig.headers["api_key"] = apiKey["api_key"]!! - } - } - } - if (requestConfig.headers[Authorization].isNullOrEmpty()) { - accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer $accessToken " - } - } - } - - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { - val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") - - // take authMethod from operation - updateAuthParams(requestConfig) - - val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - .apply { - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - addQueryParameter(query.key, queryValue) - } - } - }.build() - - // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { - requestConfig.headers[ContentType] = JsonMediaType - } - if (requestConfig.headers[Accept].isNullOrEmpty()) { - requestConfig.headers[Accept] = JsonMediaType - } - val headers = requestConfig.headers - - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Accept header. This is required.") - } - - // TODO: support multiple contentType options here. - val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - - val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) - RequestMethod.GET -> Request.Builder().url(url) - RequestMethod.HEAD -> Request.Builder().url(url).head() - RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(requestConfig.body, contentType)) - RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(requestConfig.body, contentType)) - RequestMethod.POST -> Request.Builder().url(url).post(requestBody(requestConfig.body, contentType)) - RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - }.apply { - headers.forEach { header -> addHeader(header.key, header.value) } - }.build() - - val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() - - // TODO: handle specific mapping types. e.g. Map> - when { - response.isRedirect -> return Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> return Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> return Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> return ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> return ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - } - } - - protected fun parameterToString(value: Any?): String { - when (value) { - null -> { - return "" - } - is Array<*> -> { - return toMultiValue(value, "csv").toString() - } - is Iterable<*> -> { - return toMultiValue(value, "csv").toString() - } - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { - return parseDateToQueryString(value) - } - else -> { - return value.toString() - } - } - } - - protected inline fun parseDateToQueryString(value : T): String { - /* - .replace("\"", "") converts the json object string to an actual string for the query parameter. - The moshi or gson adapter allows a more generic solution instead of trying to use a native - formatter. It also easily allows to provide a simple way to define a custom date format pattern - inside a gson/moshi adapter. - */ - return Serializer.moshi.adapter(T::class.java).toJson(value).replace("\"", "") - } -} diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbfaa..000000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2c0..000000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index ff5e2a81ee8c..000000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,12 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson - -class ByteArrayAdapter { - @ToJson - fun toJson(data: ByteArray): String = String(data) - - @FromJson - fun fromJson(data: String): ByteArray = data.toByteArray() -} diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/Errors.kt deleted file mode 100644 index b5310e71f13c..000000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/Errors.kt +++ /dev/null @@ -1,18 +0,0 @@ -@file:Suppress("unused") -package org.openapitools.client.infrastructure - -import java.lang.RuntimeException - -open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 123L - } -} - -open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 456L - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index b2e1654479a0..000000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDate -import java.time.format.DateTimeFormatter - -class LocalDateAdapter { - @ToJson - fun toJson(value: LocalDate): String { - return DateTimeFormatter.ISO_LOCAL_DATE.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDate { - return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE) - } - -} diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index e082db94811d..000000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter - -class LocalDateTimeAdapter { - @ToJson - fun toJson(value: LocalDateTime): String { - return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDateTime { - return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index 87437871a31e..000000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.OffsetDateTime -import java.time.format.DateTimeFormatter - -class OffsetDateTimeAdapter { - @ToJson - fun toJson(value: OffsetDateTime): String { - return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): OffsetDateTime { - return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt deleted file mode 100644 index 0f2790f370e2..000000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt +++ /dev/null @@ -1,17 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Defines a config object for a given request. - * NOTE: This object doesn't include 'body' because it - * allows for caching of the constructed object - * for many request definitions. - * NOTE: Headers is a Map because rfc2616 defines - * multi-valued headers as csv-only. - */ -data class RequestConfig( - val method: RequestMethod, - val path: String, - val headers: MutableMap = mutableMapOf(), - val query: MutableMap> = mutableMapOf(), - val body: kotlin.Any? = null -) \ No newline at end of file diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt deleted file mode 100644 index 931b12b8bd7a..000000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Provides enumerated HTTP verbs - */ -enum class RequestMethod { - GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt deleted file mode 100644 index 9bd2790dc144..000000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Response - -/** - * Provides an extension to evaluation whether the response is a 1xx code - */ -val Response.isInformational : Boolean get() = this.code in 100..199 - -/** - * Provides an extension to evaluation whether the response is a 3xx code - */ -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") -val Response.isRedirect : Boolean get() = this.code in 300..399 - -/** - * Provides an extension to evaluation whether the response is a 4xx code - */ -val Response.isClientError : Boolean get() = this.code in 400..499 - -/** - * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code - */ -val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 9a45b67d9b1a..000000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,21 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.Moshi -import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory -import java.util.Date - -object Serializer { - @JvmStatic - val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(OffsetDateTimeAdapter()) - .add(LocalDateTimeAdapter()) - .add(LocalDateAdapter()) - .add(UUIDAdapter()) - .add(ByteArrayAdapter()) - .add(KotlinJsonAdapterFactory()) - - @JvmStatic - val moshi: Moshi by lazy { - moshiBuilder.build() - } -} diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt deleted file mode 100644 index a4a44cc18b73..000000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.util.UUID - -class UUIDAdapter { - @ToJson - fun toJson(uuid: UUID) = uuid.toString() - - @FromJson - fun fromJson(s: String) = UUID.fromString(s) -} diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index 7d40c8efbc2f..000000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,38 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * Describes the result of uploading an image resource - * @param code - * @param type - * @param message - */ - -data class ApiResponse ( - @Json(name = "code") - val code: kotlin.Int? = null, - @Json(name = "type") - val type: kotlin.String? = null, - @Json(name = "message") - val message: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index ceb0fbc8fe60..000000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,35 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * A category for a pet - * @param id - * @param name - */ - -data class Category ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index ed8f8b13a43b..000000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,58 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * An order for a pets from the pet store - * @param id - * @param petId - * @param quantity - * @param shipDate - * @param status Order Status - * @param complete - */ - -data class Order ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "petId") - val petId: kotlin.Long? = null, - @Json(name = "quantity") - val quantity: kotlin.Int? = null, - @Json(name = "shipDate") - val shipDate: java.time.OffsetDateTime? = null, - /* Order Status */ - @Json(name = "status") - val status: Order.Status? = null, - @Json(name = "complete") - val complete: kotlin.Boolean? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - - /** - * Order Status - * Values: placed,approved,delivered - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "placed") placed("placed"), - @Json(name = "approved") approved("approved"), - @Json(name = "delivered") delivered("delivered"); - } -} - diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index 105f485f021d..000000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,60 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.Category -import org.openapitools.client.models.Tag - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * A pet for sale in the pet store - * @param name - * @param photoUrls - * @param id - * @param category - * @param tags - * @param status pet status in the store - */ - -data class Pet ( - @Json(name = "name") - val name: kotlin.String, - @Json(name = "photoUrls") - val photoUrls: kotlin.collections.List, - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "category") - val category: Category? = null, - @Json(name = "tags") - val tags: kotlin.collections.List? = null, - /* pet status in the store */ - @Json(name = "status") - val status: Pet.Status? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - - /** - * pet status in the store - * Values: available,pending,sold - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "available") available("available"), - @Json(name = "pending") pending("pending"), - @Json(name = "sold") sold("sold"); - } -} - diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index 944b1cd0a141..000000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,35 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * A tag for a pet - * @param id - * @param name - */ - -data class Tag ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index 9697f07d5bf8..000000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * A User who is purchasing from the pet store - * @param id - * @param username - * @param firstName - * @param lastName - * @param email - * @param password - * @param phone - * @param userStatus User Status - */ - -data class User ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "username") - val username: kotlin.String? = null, - @Json(name = "firstName") - val firstName: kotlin.String? = null, - @Json(name = "lastName") - val lastName: kotlin.String? = null, - @Json(name = "email") - val email: kotlin.String? = null, - @Json(name = "password") - val password: kotlin.String? = null, - @Json(name = "phone") - val phone: kotlin.String? = null, - /* User Status */ - @Json(name = "userStatus") - val userStatus: kotlin.Int? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 7282e53200b6..2abf02f23b42 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -25,7 +25,6 @@ import java.time.LocalDateTime import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime -import java.util.Date import java.util.Locale import com.squareup.moshi.adapter @@ -248,7 +247,7 @@ open class ApiClient(val baseUrl: String) { null -> "" is Array<*> -> toMultiValue(value, "csv").toString() is Iterable<*> -> toMultiValue(value, "csv").toString() - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2c0..000000000000 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/server/petstore/kotlin-server/ktor/.openapi-generator-ignore b/samples/server/petstore/kotlin-server/ktor/.openapi-generator-ignore index cabbe3494d4c..7484ee590a38 100644 --- a/samples/server/petstore/kotlin-server/ktor/.openapi-generator-ignore +++ b/samples/server/petstore/kotlin-server/ktor/.openapi-generator-ignore @@ -1,3 +1,23 @@ # OpenAPI Generator Ignore -pom.xml +# 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/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/InlineObject.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/InlineObject.kt deleted file mode 100644 index 257970fa6be3..000000000000 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/InlineObject.kt +++ /dev/null @@ -1,30 +0,0 @@ -package org.openapitools.model - -import java.util.Objects -import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size -import javax.validation.Valid -import io.swagger.annotations.ApiModelProperty - -/** - * - * @param name Updated name of the pet - * @param status Updated status of the pet - */ -data class InlineObject( - - @ApiModelProperty(example = "null", value = "Updated name of the pet") - @field:JsonProperty("name") val name: kotlin.String? = null, - - @ApiModelProperty(example = "null", value = "Updated status of the pet") - @field:JsonProperty("status") val status: kotlin.String? = null -) { - -} - diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/InlineObject1.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/InlineObject1.kt deleted file mode 100644 index 60e6e76df23c..000000000000 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/InlineObject1.kt +++ /dev/null @@ -1,31 +0,0 @@ -package org.openapitools.model - -import java.util.Objects -import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size -import javax.validation.Valid -import io.swagger.annotations.ApiModelProperty - -/** - * - * @param additionalMetadata Additional data to pass to server - * @param file file to upload - */ -data class InlineObject1( - - @ApiModelProperty(example = "null", value = "Additional data to pass to server") - @field:JsonProperty("additionalMetadata") val additionalMetadata: kotlin.String? = null, - - @field:Valid - @ApiModelProperty(example = "null", value = "file to upload") - @field:JsonProperty("file") val file: org.springframework.core.io.Resource? = null -) { - -} - diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/FILES b/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/FILES index 612ea14bbdb4..50a9d2bc75d2 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/FILES +++ b/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/FILES @@ -5,13 +5,13 @@ settings.gradle src/main/kotlin/org/openapitools/Application.kt src/main/kotlin/org/openapitools/api/ApiUtil.kt src/main/kotlin/org/openapitools/api/Exceptions.kt -src/main/kotlin/org/openapitools/api/PetApi.kt +src/main/kotlin/org/openapitools/api/PetApiController.kt src/main/kotlin/org/openapitools/api/PetApiService.kt src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt -src/main/kotlin/org/openapitools/api/StoreApi.kt +src/main/kotlin/org/openapitools/api/StoreApiController.kt src/main/kotlin/org/openapitools/api/StoreApiService.kt src/main/kotlin/org/openapitools/api/StoreApiServiceImpl.kt -src/main/kotlin/org/openapitools/api/UserApi.kt +src/main/kotlin/org/openapitools/api/UserApiController.kt src/main/kotlin/org/openapitools/api/UserApiService.kt src/main/kotlin/org/openapitools/api/UserApiServiceImpl.kt src/main/kotlin/org/openapitools/model/Category.kt diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/VERSION index 3fa3b389a57d..4077803655c0 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.1-SNAPSHOT \ No newline at end of file +5.3.1-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 2b99799bd532..ea7f93398da9 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/build.gradle.kts +++ b/samples/server/petstore/kotlin-springboot-modelMutable/build.gradle.kts @@ -30,7 +30,7 @@ plugins { } dependencies { - val kotlinxCoroutinesVersion="1.2.0" + val kotlinxCoroutinesVersion="1.2.0" compile("org.jetbrains.kotlin:kotlin-stdlib-jdk8") compile("org.jetbrains.kotlin:kotlin-reflect") compile("org.springframework.boot:spring-boot-starter-web") @@ -46,7 +46,7 @@ dependencies { } repositories { - maven { url = uri("https://repo1.maven.org/maven2") } - maven { url = uri("https://repo.spring.io/snapshot") } - maven { url = uri("https://repo.spring.io/milestone") } + 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/pom.xml b/samples/server/petstore/kotlin-springboot-modelMutable/pom.xml index 1bfa3bec6261..f7094ec0e103 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/pom.xml +++ b/samples/server/petstore/kotlin-springboot-modelMutable/pom.xml @@ -7,7 +7,7 @@ 1.0.0 1.3.30 - 1.2.0 + 1.2.0 1.3.5 @@ -111,8 +111,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api jakarta.annotation @@ -127,34 +127,34 @@ test - - - spring-snapshots - Spring Snapshots - https://repo.spring.io/snapshot - - true - - - - spring-milestones - Spring Milestones - https://repo.spring.io/milestone - - - - - spring-snapshots - Spring Snapshots - https://repo.spring.io/snapshot - - true - - - - spring-milestones - Spring Milestones - https://repo.spring.io/milestone - - + + + spring-snapshots + Spring Snapshots + https://repo.spring.io/snapshot + + true + + + + spring-milestones + Spring Milestones + https://repo.spring.io/milestone + + + + + spring-snapshots + Spring Snapshots + https://repo.spring.io/snapshot + + true + + + + spring-milestones + Spring Milestones + https://repo.spring.io/milestone + + diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/settings.gradle b/samples/server/petstore/kotlin-springboot-modelMutable/settings.gradle index e9bd5d32d7c2..14844905cd40 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/settings.gradle +++ b/samples/server/petstore/kotlin-springboot-modelMutable/settings.gradle @@ -1,15 +1,15 @@ pluginManagement { - repositories { - maven { url = uri("https://repo.spring.io/snapshot") } - maven { url = uri("https://repo.spring.io/milestone") } - gradlePluginPortal() - } - resolutionStrategy { - eachPlugin { - if (requested.id.id == "org.springframework.boot") { - useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") - } - } - } + repositories { + maven { url = uri("https://repo.spring.io/snapshot") } + maven { url = uri("https://repo.spring.io/milestone") } + gradlePluginPortal() + } + resolutionStrategy { + eachPlugin { + if (requested.id.id == "org.springframework.boot") { + useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") + } + } + } } -rootProject.name = "openapi-spring" \ No newline at end of file +rootProject.name = "openapi-spring" diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiController.kt similarity index 95% rename from samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApi.kt rename to samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiController.kt index 9de503175ac7..a26504324da6 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -43,7 +43,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 405, message = "Invalid input")]) - @PostMapping( + @RequestMapping( + method = [RequestMethod.POST], value = ["/pet"], consumes = ["application/json", "application/xml"] ) @@ -59,7 +60,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid pet value")]) - @DeleteMapping( + @RequestMapping( + method = [RequestMethod.DELETE], value = ["/pet/{petId}"] ) fun deletePet(@ApiParam(value = "Pet id to delete", required=true) @PathVariable("petId") petId: kotlin.Long @@ -77,7 +79,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid status value")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/pet/findByStatus"], produces = ["application/xml", "application/json"] ) @@ -95,7 +98,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid tag value")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/pet/findByTags"], produces = ["application/xml", "application/json"] ) @@ -112,7 +116,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "api_key")]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/pet/{petId}"], produces = ["application/xml", "application/json"] ) @@ -128,7 +133,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found"),ApiResponse(code = 405, message = "Validation exception")]) - @PutMapping( + @RequestMapping( + method = [RequestMethod.PUT], value = ["/pet"], consumes = ["application/json", "application/xml"] ) @@ -144,7 +150,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 405, message = "Invalid input")]) - @PostMapping( + @RequestMapping( + method = [RequestMethod.POST], value = ["/pet/{petId}"], consumes = ["application/x-www-form-urlencoded"] ) @@ -163,7 +170,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse::class)]) - @PostMapping( + @RequestMapping( + method = [RequestMethod.POST], value = ["/pet/{petId}/uploadImage"], produces = ["application/json"], consumes = ["multipart/form-data"] diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiService.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiService.kt index f3f2fd68b6c2..ee0e3bef83cc 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiService.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiService.kt @@ -2,21 +2,93 @@ package org.openapitools.api import org.openapitools.model.ModelApiResponse import org.openapitools.model.Pet + interface PetApiService { - fun addPet(body: Pet): Unit + /** + * POST /pet : Add a new pet to the store + * + * @param body Pet object that needs to be added to the store (required) + * @return Invalid input (status code 405) + * @see PetApi#addPet + */ + fun addPet(body: Pet): Unit - fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?): Unit + /** + * DELETE /pet/{petId} : Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return Invalid pet value (status code 400) + * @see PetApi#deletePet + */ + fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?): Unit - fun findPetsByStatus(status: kotlin.collections.List): List + /** + * GET /pet/findByStatus : Finds Pets by status + * Multiple status values can be provided with comma separated strings + * + * @param status Status values that need to be considered for filter (required) + * @return successful operation (status code 200) + * or Invalid status value (status code 400) + * @see PetApi#findPetsByStatus + */ + fun findPetsByStatus(status: kotlin.collections.List): List - fun findPetsByTags(tags: kotlin.collections.List): List + /** + * GET /pet/findByTags : Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @param tags Tags to filter by (required) + * @return successful operation (status code 200) + * or Invalid tag value (status code 400) + * @deprecated + * @see PetApi#findPetsByTags + */ + fun findPetsByTags(tags: kotlin.collections.List): List - fun getPetById(petId: kotlin.Long): Pet + /** + * GET /pet/{petId} : Find pet by ID + * Returns a single pet + * + * @param petId ID of pet to return (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * @see PetApi#getPetById + */ + fun getPetById(petId: kotlin.Long): Pet - fun updatePet(body: Pet): Unit + /** + * PUT /pet : Update an existing pet + * + * @param body Pet object that needs to be added to the store (required) + * @return Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * or Validation exception (status code 405) + * @see PetApi#updatePet + */ + fun updatePet(body: Pet): Unit - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): Unit + /** + * POST /pet/{petId} : Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return Invalid input (status code 405) + * @see PetApi#updatePetWithForm + */ + fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): Unit - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse + /** + * POST /pet/{petId}/uploadImage : uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return successful operation (status code 200) + * @see PetApi#uploadFile + */ + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse } diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApiController.kt similarity index 94% rename from samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApi.kt rename to samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApiController.kt index 3b82141c4df5..e2be73b4ec33 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApiController.kt @@ -41,7 +41,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors") @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) - @DeleteMapping( + @RequestMapping( + method = [RequestMethod.DELETE], value = ["/store/order/{orderId}"] ) fun deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required=true) @PathVariable("orderId") orderId: kotlin.String @@ -58,7 +59,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic authorizations = [Authorization(value = "api_key")]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.collections.Map::class, responseContainer = "Map")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/store/inventory"], produces = ["application/json"] ) @@ -73,7 +75,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic response = Order::class) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/store/order/{orderId}"], produces = ["application/xml", "application/json"] ) @@ -89,7 +92,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic response = Order::class) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid Order")]) - @PostMapping( + @RequestMapping( + method = [RequestMethod.POST], value = ["/store/order"], produces = ["application/xml", "application/json"] ) diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApiService.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApiService.kt index d4a4ef9507f2..6de3e6cc1def 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApiService.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApiService.kt @@ -1,13 +1,48 @@ package org.openapitools.api import org.openapitools.model.Order + interface StoreApiService { - fun deleteOrder(orderId: kotlin.String): Unit + /** + * DELETE /store/order/{orderId} : Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @param orderId ID of the order that needs to be deleted (required) + * @return Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#deleteOrder + */ + fun deleteOrder(orderId: kotlin.String): Unit - fun getInventory(): Map + /** + * GET /store/inventory : Returns pet inventories by status + * Returns a map of status codes to quantities + * + * @return successful operation (status code 200) + * @see StoreApi#getInventory + */ + fun getInventory(): Map - fun getOrderById(orderId: kotlin.Long): Order + /** + * GET /store/order/{orderId} : Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @param orderId ID of pet that needs to be fetched (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#getOrderById + */ + fun getOrderById(orderId: kotlin.Long): Order - fun placeOrder(body: Order): Order + /** + * POST /store/order : Place an order for a pet + * + * @param body order placed for purchasing the pet (required) + * @return successful operation (status code 200) + * or Invalid Order (status code 400) + * @see StoreApi#placeOrder + */ + fun placeOrder(body: Order): Order } diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApiController.kt similarity index 92% rename from samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApi.kt rename to samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApiController.kt index 7071afde110f..f7c4144fbdbe 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApiController.kt @@ -41,7 +41,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) notes = "This can only be done by the logged in user.") @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation")]) - @PostMapping( + @RequestMapping( + method = [RequestMethod.POST], value = ["/user"] ) fun createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody body: User @@ -55,7 +56,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) notes = "") @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation")]) - @PostMapping( + @RequestMapping( + method = [RequestMethod.POST], value = ["/user/createWithArray"] ) fun createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody body: kotlin.collections.List @@ -69,7 +71,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) notes = "") @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation")]) - @PostMapping( + @RequestMapping( + method = [RequestMethod.POST], value = ["/user/createWithList"] ) fun createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody body: kotlin.collections.List @@ -83,7 +86,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) notes = "This can only be done by the logged in user.") @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) - @DeleteMapping( + @RequestMapping( + method = [RequestMethod.DELETE], value = ["/user/{username}"] ) fun deleteUser(@ApiParam(value = "The name that needs to be deleted", required=true) @PathVariable("username") username: kotlin.String @@ -98,7 +102,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) response = User::class) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = User::class),ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/user/{username}"], produces = ["application/xml", "application/json"] ) @@ -114,7 +119,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) response = kotlin.String::class) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.String::class),ApiResponse(code = 400, message = "Invalid username/password supplied")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/user/login"], produces = ["application/xml", "application/json"] ) @@ -130,7 +136,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) notes = "") @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/user/logout"] ) fun logoutUser(): ResponseEntity { @@ -143,7 +150,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) notes = "This can only be done by the logged in user.") @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid user supplied"),ApiResponse(code = 404, message = "User not found")]) - @PutMapping( + @RequestMapping( + method = [RequestMethod.PUT], value = ["/user/{username}"] ) fun updateUser(@ApiParam(value = "name that need to be deleted", required=true) @PathVariable("username") username: kotlin.String diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApiService.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApiService.kt index 491705c3b509..a1bcf6be237c 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApiService.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApiService.kt @@ -1,21 +1,87 @@ package org.openapitools.api import org.openapitools.model.User + interface UserApiService { - fun createUser(body: User): Unit + /** + * POST /user : Create user + * This can only be done by the logged in user. + * + * @param body Created user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUser + */ + fun createUser(body: User): Unit - fun createUsersWithArrayInput(body: kotlin.collections.List): Unit + /** + * POST /user/createWithArray : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithArrayInput + */ + fun createUsersWithArrayInput(body: kotlin.collections.List): Unit - fun createUsersWithListInput(body: kotlin.collections.List): Unit + /** + * POST /user/createWithList : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithListInput + */ + fun createUsersWithListInput(body: kotlin.collections.List): Unit - fun deleteUser(username: kotlin.String): Unit + /** + * DELETE /user/{username} : Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#deleteUser + */ + fun deleteUser(username: kotlin.String): Unit - fun getUserByName(username: kotlin.String): User + /** + * GET /user/{username} : Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return successful operation (status code 200) + * or Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#getUserByName + */ + fun getUserByName(username: kotlin.String): User - fun loginUser(username: kotlin.String, password: kotlin.String): kotlin.String + /** + * GET /user/login : Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return successful operation (status code 200) + * or Invalid username/password supplied (status code 400) + * @see UserApi#loginUser + */ + fun loginUser(username: kotlin.String, password: kotlin.String): kotlin.String - fun logoutUser(): Unit + /** + * GET /user/logout : Logs out current logged in user session + * + * @return successful operation (status code 200) + * @see UserApi#logoutUser + */ + fun logoutUser(): Unit - fun updateUser(username: kotlin.String, body: User): Unit + /** + * PUT /user/{username} : Updated user + * This can only be done by the logged in user. + * + * @param username name that need to be deleted (required) + * @param body Updated user object (required) + * @return Invalid user supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#updateUser + */ + fun updateUser(username: kotlin.String, body: User): Unit } diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/test/kotlin/org/openapitools/api/PetApiTest.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/test/kotlin/org/openapitools/api/PetApiTest.kt index d621c1669665..0d3ccd3989f7 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/test/kotlin/org/openapitools/api/PetApiTest.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/test/kotlin/org/openapitools/api/PetApiTest.kt @@ -3,7 +3,6 @@ package org.openapitools.api import org.openapitools.model.ModelApiResponse import org.openapitools.model.Pet import org.junit.jupiter.api.Test - import org.springframework.http.ResponseEntity class PetApiTest { @@ -11,138 +10,121 @@ class PetApiTest { private val service: PetApiService = PetApiServiceImpl() private val api: PetApiController = PetApiController(service) - /** - * Add a new pet to the store - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.addPet + * + * @throws ApiException + * if the Api call fails + */ @Test fun addPetTest() { - val body:Pet? = null - val response: ResponseEntity = api.addPet(body!!) + val body:Pet = TODO() + val response: ResponseEntity = api.addPet(body) // TODO: test validations } - + /** - * Deletes a pet - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.deletePet + * + * @throws ApiException + * if the Api call fails + */ @Test fun deletePetTest() { - val petId:kotlin.Long? = null - val apiKey:kotlin.String? = null - val response: ResponseEntity = api.deletePet(petId!!, apiKey!!) + val petId:kotlin.Long = TODO() + val apiKey:kotlin.String? = TODO() + val response: ResponseEntity = api.deletePet(petId, apiKey) // TODO: test validations } - + /** - * Finds Pets by status - * - * Multiple status values can be provided with comma separated strings - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.findPetsByStatus + * + * @throws ApiException + * if the Api call fails + */ @Test fun findPetsByStatusTest() { - val status:kotlin.collections.List? = null - val response: ResponseEntity> = api.findPetsByStatus(status!!) + val status:kotlin.collections.List = TODO() + val response: ResponseEntity> = api.findPetsByStatus(status) // TODO: test validations } - + /** - * Finds Pets by tags - * - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.findPetsByTags + * + * @throws ApiException + * if the Api call fails + */ @Test fun findPetsByTagsTest() { - val tags:kotlin.collections.List? = null - val response: ResponseEntity> = api.findPetsByTags(tags!!) + val tags:kotlin.collections.List = TODO() + val response: ResponseEntity> = api.findPetsByTags(tags) // TODO: test validations } - + /** - * Find pet by ID - * - * Returns a single pet - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.getPetById + * + * @throws ApiException + * if the Api call fails + */ @Test fun getPetByIdTest() { - val petId:kotlin.Long? = null - val response: ResponseEntity = api.getPetById(petId!!) + val petId:kotlin.Long = TODO() + val response: ResponseEntity = api.getPetById(petId) // TODO: test validations } - + /** - * Update an existing pet - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.updatePet + * + * @throws ApiException + * if the Api call fails + */ @Test fun updatePetTest() { - val body:Pet? = null - val response: ResponseEntity = api.updatePet(body!!) + val body:Pet = TODO() + val response: ResponseEntity = api.updatePet(body) // TODO: test validations } - + /** - * Updates a pet in the store with form data - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.updatePetWithForm + * + * @throws ApiException + * if the Api call fails + */ @Test fun updatePetWithFormTest() { - val petId:kotlin.Long? = null - val name:kotlin.String? = null - val status:kotlin.String? = null - val response: ResponseEntity = api.updatePetWithForm(petId!!, name!!, status!!) + val petId:kotlin.Long = TODO() + val name:kotlin.String? = TODO() + val status:kotlin.String? = TODO() + val response: ResponseEntity = api.updatePetWithForm(petId, name, status) // TODO: test validations } - + /** - * uploads an image - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.uploadFile + * + * @throws ApiException + * if the Api call fails + */ @Test fun uploadFileTest() { - val petId:kotlin.Long? = null - val additionalMetadata:kotlin.String? = null - val file:org.springframework.core.io.Resource? = null - val response: ResponseEntity = api.uploadFile(petId!!, additionalMetadata!!, file!!) + val petId:kotlin.Long = TODO() + val additionalMetadata:kotlin.String? = TODO() + val file:org.springframework.core.io.Resource? = TODO() + val response: ResponseEntity = api.uploadFile(petId, additionalMetadata, file) // TODO: test validations } - + } diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/test/kotlin/org/openapitools/api/StoreApiTest.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/test/kotlin/org/openapitools/api/StoreApiTest.kt index 82b91cd652bd..fcb00e99e995 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/test/kotlin/org/openapitools/api/StoreApiTest.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/test/kotlin/org/openapitools/api/StoreApiTest.kt @@ -2,7 +2,6 @@ package org.openapitools.api import org.openapitools.model.Order import org.junit.jupiter.api.Test - import org.springframework.http.ResponseEntity class StoreApiTest { @@ -10,68 +9,59 @@ class StoreApiTest { private val service: StoreApiService = StoreApiServiceImpl() private val api: StoreApiController = StoreApiController(service) - /** - * Delete purchase order by ID - * - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @throws ApiException - * if the Api call fails - */ + * To test StoreApiController.deleteOrder + * + * @throws ApiException + * if the Api call fails + */ @Test fun deleteOrderTest() { - val orderId:kotlin.String? = null - val response: ResponseEntity = api.deleteOrder(orderId!!) + val orderId:kotlin.String = TODO() + val response: ResponseEntity = api.deleteOrder(orderId) // TODO: test validations } - + /** - * Returns pet inventories by status - * - * Returns a map of status codes to quantities - * - * @throws ApiException - * if the Api call fails - */ + * To test StoreApiController.getInventory + * + * @throws ApiException + * if the Api call fails + */ @Test fun getInventoryTest() { val response: ResponseEntity> = api.getInventory() // TODO: test validations } - + /** - * Find purchase order by ID - * - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * - * @throws ApiException - * if the Api call fails - */ + * To test StoreApiController.getOrderById + * + * @throws ApiException + * if the Api call fails + */ @Test fun getOrderByIdTest() { - val orderId:kotlin.Long? = null - val response: ResponseEntity = api.getOrderById(orderId!!) + val orderId:kotlin.Long = TODO() + val response: ResponseEntity = api.getOrderById(orderId) // TODO: test validations } - + /** - * Place an order for a pet - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test StoreApiController.placeOrder + * + * @throws ApiException + * if the Api call fails + */ @Test fun placeOrderTest() { - val body:Order? = null - val response: ResponseEntity = api.placeOrder(body!!) + val body:Order = TODO() + val response: ResponseEntity = api.placeOrder(body) // TODO: test validations } - + } diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/test/kotlin/org/openapitools/api/UserApiTest.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/test/kotlin/org/openapitools/api/UserApiTest.kt index 14917f70aeb2..c3f07290cfef 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/test/kotlin/org/openapitools/api/UserApiTest.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/test/kotlin/org/openapitools/api/UserApiTest.kt @@ -2,7 +2,6 @@ package org.openapitools.api import org.openapitools.model.User import org.junit.jupiter.api.Test - import org.springframework.http.ResponseEntity class UserApiTest { @@ -10,134 +9,117 @@ class UserApiTest { private val service: UserApiService = UserApiServiceImpl() private val api: UserApiController = UserApiController(service) - /** - * Create user - * - * This can only be done by the logged in user. - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.createUser + * + * @throws ApiException + * if the Api call fails + */ @Test fun createUserTest() { - val body:User? = null - val response: ResponseEntity = api.createUser(body!!) + val body:User = TODO() + val response: ResponseEntity = api.createUser(body) // TODO: test validations } - + /** - * Creates list of users with given input array - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.createUsersWithArrayInput + * + * @throws ApiException + * if the Api call fails + */ @Test fun createUsersWithArrayInputTest() { - val body:kotlin.collections.List? = null - val response: ResponseEntity = api.createUsersWithArrayInput(body!!) + val body:kotlin.collections.List = TODO() + val response: ResponseEntity = api.createUsersWithArrayInput(body) // TODO: test validations } - + /** - * Creates list of users with given input array - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.createUsersWithListInput + * + * @throws ApiException + * if the Api call fails + */ @Test fun createUsersWithListInputTest() { - val body:kotlin.collections.List? = null - val response: ResponseEntity = api.createUsersWithListInput(body!!) + val body:kotlin.collections.List = TODO() + val response: ResponseEntity = api.createUsersWithListInput(body) // TODO: test validations } - + /** - * Delete user - * - * This can only be done by the logged in user. - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.deleteUser + * + * @throws ApiException + * if the Api call fails + */ @Test fun deleteUserTest() { - val username:kotlin.String? = null - val response: ResponseEntity = api.deleteUser(username!!) + val username:kotlin.String = TODO() + val response: ResponseEntity = api.deleteUser(username) // TODO: test validations } - + /** - * Get user by user name - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.getUserByName + * + * @throws ApiException + * if the Api call fails + */ @Test fun getUserByNameTest() { - val username:kotlin.String? = null - val response: ResponseEntity = api.getUserByName(username!!) + val username:kotlin.String = TODO() + val response: ResponseEntity = api.getUserByName(username) // TODO: test validations } - + /** - * Logs user into the system - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.loginUser + * + * @throws ApiException + * if the Api call fails + */ @Test fun loginUserTest() { - val username:kotlin.String? = null - val password:kotlin.String? = null - val response: ResponseEntity = api.loginUser(username!!, password!!) + val username:kotlin.String = TODO() + val password:kotlin.String = TODO() + val response: ResponseEntity = api.loginUser(username, password) // TODO: test validations } - + /** - * Logs out current logged in user session - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.logoutUser + * + * @throws ApiException + * if the Api call fails + */ @Test fun logoutUserTest() { val response: ResponseEntity = api.logoutUser() // TODO: test validations } - + /** - * Updated user - * - * This can only be done by the logged in user. - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.updateUser + * + * @throws ApiException + * if the Api call fails + */ @Test fun updateUserTest() { - val username:kotlin.String? = null - val body:User? = null - val response: ResponseEntity = api.updateUser(username!!, body!!) + val username:kotlin.String = TODO() + val body:User = TODO() + val response: ResponseEntity = api.updateUser(username, body) // TODO: test validations } - + } diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/PetApiTest.kt b/samples/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/PetApiTest.kt index f43c6ecf7ca7..bbc9b118e245 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/PetApiTest.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/PetApiTest.kt @@ -3,7 +3,6 @@ package org.openapitools.api import org.openapitools.model.ModelApiResponse import org.openapitools.model.Pet import org.junit.jupiter.api.Test - import kotlinx.coroutines.flow.Flow; import kotlinx.coroutines.test.runBlockingTest import org.springframework.http.ResponseEntity @@ -13,138 +12,121 @@ class PetApiTest { private val service: PetApiService = PetApiServiceImpl() private val api: PetApiController = PetApiController(service) - /** - * Add a new pet to the store - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.addPet + * + * @throws ApiException + * if the Api call fails + */ @Test fun addPetTest() = runBlockingTest { - val body:Pet? = null - val response: ResponseEntity = api.addPet(body!!) + val body:Pet = TODO() + val response: ResponseEntity = api.addPet(body) // TODO: test validations } - + /** - * Deletes a pet - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.deletePet + * + * @throws ApiException + * if the Api call fails + */ @Test fun deletePetTest() = runBlockingTest { - val petId:kotlin.Long? = null - val apiKey:kotlin.String? = null - val response: ResponseEntity = api.deletePet(petId!!, apiKey!!) + val petId:kotlin.Long = TODO() + val apiKey:kotlin.String? = TODO() + val response: ResponseEntity = api.deletePet(petId, apiKey) // TODO: test validations } - + /** - * Finds Pets by status - * - * Multiple status values can be provided with comma separated strings - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.findPetsByStatus + * + * @throws ApiException + * if the Api call fails + */ @Test fun findPetsByStatusTest() = runBlockingTest { - val status:kotlin.collections.List? = null - val response: ResponseEntity> = api.findPetsByStatus(status!!) + val status:kotlin.collections.List = TODO() + val response: ResponseEntity> = api.findPetsByStatus(status) // TODO: test validations } - + /** - * Finds Pets by tags - * - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.findPetsByTags + * + * @throws ApiException + * if the Api call fails + */ @Test fun findPetsByTagsTest() = runBlockingTest { - val tags:kotlin.collections.List? = null - val response: ResponseEntity> = api.findPetsByTags(tags!!) + val tags:kotlin.collections.List = TODO() + val response: ResponseEntity> = api.findPetsByTags(tags) // TODO: test validations } - + /** - * Find pet by ID - * - * Returns a single pet - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.getPetById + * + * @throws ApiException + * if the Api call fails + */ @Test fun getPetByIdTest() = runBlockingTest { - val petId:kotlin.Long? = null - val response: ResponseEntity = api.getPetById(petId!!) + val petId:kotlin.Long = TODO() + val response: ResponseEntity = api.getPetById(petId) // TODO: test validations } - + /** - * Update an existing pet - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.updatePet + * + * @throws ApiException + * if the Api call fails + */ @Test fun updatePetTest() = runBlockingTest { - val body:Pet? = null - val response: ResponseEntity = api.updatePet(body!!) + val body:Pet = TODO() + val response: ResponseEntity = api.updatePet(body) // TODO: test validations } - + /** - * Updates a pet in the store with form data - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.updatePetWithForm + * + * @throws ApiException + * if the Api call fails + */ @Test fun updatePetWithFormTest() = runBlockingTest { - val petId:kotlin.Long? = null - val name:kotlin.String? = null - val status:kotlin.String? = null - val response: ResponseEntity = api.updatePetWithForm(petId!!, name!!, status!!) + val petId:kotlin.Long = TODO() + val name:kotlin.String? = TODO() + val status:kotlin.String? = TODO() + val response: ResponseEntity = api.updatePetWithForm(petId, name, status) // TODO: test validations } - + /** - * uploads an image - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.uploadFile + * + * @throws ApiException + * if the Api call fails + */ @Test fun uploadFileTest() = runBlockingTest { - val petId:kotlin.Long? = null - val additionalMetadata:kotlin.String? = null - val file:org.springframework.core.io.Resource? = null - val response: ResponseEntity = api.uploadFile(petId!!, additionalMetadata!!, file!!) + val petId:kotlin.Long = TODO() + val additionalMetadata:kotlin.String? = TODO() + val file:org.springframework.core.io.Resource? = TODO() + val response: ResponseEntity = api.uploadFile(petId, additionalMetadata, file) // TODO: test validations } - + } diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/StoreApiTest.kt b/samples/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/StoreApiTest.kt index 31c0a2e07135..1db01446d86b 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/StoreApiTest.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/StoreApiTest.kt @@ -2,7 +2,6 @@ package org.openapitools.api import org.openapitools.model.Order import org.junit.jupiter.api.Test - import kotlinx.coroutines.flow.Flow; import kotlinx.coroutines.test.runBlockingTest import org.springframework.http.ResponseEntity @@ -12,68 +11,59 @@ class StoreApiTest { private val service: StoreApiService = StoreApiServiceImpl() private val api: StoreApiController = StoreApiController(service) - /** - * Delete purchase order by ID - * - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @throws ApiException - * if the Api call fails - */ + * To test StoreApiController.deleteOrder + * + * @throws ApiException + * if the Api call fails + */ @Test fun deleteOrderTest() = runBlockingTest { - val orderId:kotlin.String? = null - val response: ResponseEntity = api.deleteOrder(orderId!!) + val orderId:kotlin.String = TODO() + val response: ResponseEntity = api.deleteOrder(orderId) // TODO: test validations } - + /** - * Returns pet inventories by status - * - * Returns a map of status codes to quantities - * - * @throws ApiException - * if the Api call fails - */ + * To test StoreApiController.getInventory + * + * @throws ApiException + * if the Api call fails + */ @Test fun getInventoryTest() = runBlockingTest { val response: ResponseEntity> = api.getInventory() // TODO: test validations } - + /** - * Find purchase order by ID - * - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * - * @throws ApiException - * if the Api call fails - */ + * To test StoreApiController.getOrderById + * + * @throws ApiException + * if the Api call fails + */ @Test fun getOrderByIdTest() = runBlockingTest { - val orderId:kotlin.Long? = null - val response: ResponseEntity = api.getOrderById(orderId!!) + val orderId:kotlin.Long = TODO() + val response: ResponseEntity = api.getOrderById(orderId) // TODO: test validations } - + /** - * Place an order for a pet - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test StoreApiController.placeOrder + * + * @throws ApiException + * if the Api call fails + */ @Test fun placeOrderTest() = runBlockingTest { - val body:Order? = null - val response: ResponseEntity = api.placeOrder(body!!) + val body:Order = TODO() + val response: ResponseEntity = api.placeOrder(body) // TODO: test validations } - + } diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/UserApiTest.kt b/samples/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/UserApiTest.kt index 3d467deb14f7..126e0700f79c 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/UserApiTest.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/UserApiTest.kt @@ -2,7 +2,6 @@ package org.openapitools.api import org.openapitools.model.User import org.junit.jupiter.api.Test - import kotlinx.coroutines.flow.Flow; import kotlinx.coroutines.test.runBlockingTest import org.springframework.http.ResponseEntity @@ -12,134 +11,117 @@ class UserApiTest { private val service: UserApiService = UserApiServiceImpl() private val api: UserApiController = UserApiController(service) - /** - * Create user - * - * This can only be done by the logged in user. - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.createUser + * + * @throws ApiException + * if the Api call fails + */ @Test fun createUserTest() = runBlockingTest { - val body:User? = null - val response: ResponseEntity = api.createUser(body!!) + val body:User = TODO() + val response: ResponseEntity = api.createUser(body) // TODO: test validations } - + /** - * Creates list of users with given input array - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.createUsersWithArrayInput + * + * @throws ApiException + * if the Api call fails + */ @Test fun createUsersWithArrayInputTest() = runBlockingTest { - val body:kotlin.collections.List? = null - val response: ResponseEntity = api.createUsersWithArrayInput(body!!) + val body:kotlin.collections.List = TODO() + val response: ResponseEntity = api.createUsersWithArrayInput(body) // TODO: test validations } - + /** - * Creates list of users with given input array - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.createUsersWithListInput + * + * @throws ApiException + * if the Api call fails + */ @Test fun createUsersWithListInputTest() = runBlockingTest { - val body:kotlin.collections.List? = null - val response: ResponseEntity = api.createUsersWithListInput(body!!) + val body:kotlin.collections.List = TODO() + val response: ResponseEntity = api.createUsersWithListInput(body) // TODO: test validations } - + /** - * Delete user - * - * This can only be done by the logged in user. - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.deleteUser + * + * @throws ApiException + * if the Api call fails + */ @Test fun deleteUserTest() = runBlockingTest { - val username:kotlin.String? = null - val response: ResponseEntity = api.deleteUser(username!!) + val username:kotlin.String = TODO() + val response: ResponseEntity = api.deleteUser(username) // TODO: test validations } - + /** - * Get user by user name - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.getUserByName + * + * @throws ApiException + * if the Api call fails + */ @Test fun getUserByNameTest() = runBlockingTest { - val username:kotlin.String? = null - val response: ResponseEntity = api.getUserByName(username!!) + val username:kotlin.String = TODO() + val response: ResponseEntity = api.getUserByName(username) // TODO: test validations } - + /** - * Logs user into the system - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.loginUser + * + * @throws ApiException + * if the Api call fails + */ @Test fun loginUserTest() = runBlockingTest { - val username:kotlin.String? = null - val password:kotlin.String? = null - val response: ResponseEntity = api.loginUser(username!!, password!!) + val username:kotlin.String = TODO() + val password:kotlin.String = TODO() + val response: ResponseEntity = api.loginUser(username, password) // TODO: test validations } - + /** - * Logs out current logged in user session - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.logoutUser + * + * @throws ApiException + * if the Api call fails + */ @Test fun logoutUserTest() = runBlockingTest { val response: ResponseEntity = api.logoutUser() // TODO: test validations } - + /** - * Updated user - * - * This can only be done by the logged in user. - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.updateUser + * + * @throws ApiException + * if the Api call fails + */ @Test fun updateUserTest() = runBlockingTest { - val username:kotlin.String? = null - val body:User? = null - val response: ResponseEntity = api.updateUser(username!!, body!!) + val username:kotlin.String = TODO() + val body:User = TODO() + val response: ResponseEntity = api.updateUser(username, body) // TODO: test validations } - + } diff --git a/samples/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/PetApiTest.kt b/samples/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/PetApiTest.kt index d621c1669665..0d3ccd3989f7 100644 --- a/samples/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/PetApiTest.kt +++ b/samples/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/PetApiTest.kt @@ -3,7 +3,6 @@ package org.openapitools.api import org.openapitools.model.ModelApiResponse import org.openapitools.model.Pet import org.junit.jupiter.api.Test - import org.springframework.http.ResponseEntity class PetApiTest { @@ -11,138 +10,121 @@ class PetApiTest { private val service: PetApiService = PetApiServiceImpl() private val api: PetApiController = PetApiController(service) - /** - * Add a new pet to the store - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.addPet + * + * @throws ApiException + * if the Api call fails + */ @Test fun addPetTest() { - val body:Pet? = null - val response: ResponseEntity = api.addPet(body!!) + val body:Pet = TODO() + val response: ResponseEntity = api.addPet(body) // TODO: test validations } - + /** - * Deletes a pet - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.deletePet + * + * @throws ApiException + * if the Api call fails + */ @Test fun deletePetTest() { - val petId:kotlin.Long? = null - val apiKey:kotlin.String? = null - val response: ResponseEntity = api.deletePet(petId!!, apiKey!!) + val petId:kotlin.Long = TODO() + val apiKey:kotlin.String? = TODO() + val response: ResponseEntity = api.deletePet(petId, apiKey) // TODO: test validations } - + /** - * Finds Pets by status - * - * Multiple status values can be provided with comma separated strings - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.findPetsByStatus + * + * @throws ApiException + * if the Api call fails + */ @Test fun findPetsByStatusTest() { - val status:kotlin.collections.List? = null - val response: ResponseEntity> = api.findPetsByStatus(status!!) + val status:kotlin.collections.List = TODO() + val response: ResponseEntity> = api.findPetsByStatus(status) // TODO: test validations } - + /** - * Finds Pets by tags - * - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.findPetsByTags + * + * @throws ApiException + * if the Api call fails + */ @Test fun findPetsByTagsTest() { - val tags:kotlin.collections.List? = null - val response: ResponseEntity> = api.findPetsByTags(tags!!) + val tags:kotlin.collections.List = TODO() + val response: ResponseEntity> = api.findPetsByTags(tags) // TODO: test validations } - + /** - * Find pet by ID - * - * Returns a single pet - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.getPetById + * + * @throws ApiException + * if the Api call fails + */ @Test fun getPetByIdTest() { - val petId:kotlin.Long? = null - val response: ResponseEntity = api.getPetById(petId!!) + val petId:kotlin.Long = TODO() + val response: ResponseEntity = api.getPetById(petId) // TODO: test validations } - + /** - * Update an existing pet - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.updatePet + * + * @throws ApiException + * if the Api call fails + */ @Test fun updatePetTest() { - val body:Pet? = null - val response: ResponseEntity = api.updatePet(body!!) + val body:Pet = TODO() + val response: ResponseEntity = api.updatePet(body) // TODO: test validations } - + /** - * Updates a pet in the store with form data - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.updatePetWithForm + * + * @throws ApiException + * if the Api call fails + */ @Test fun updatePetWithFormTest() { - val petId:kotlin.Long? = null - val name:kotlin.String? = null - val status:kotlin.String? = null - val response: ResponseEntity = api.updatePetWithForm(petId!!, name!!, status!!) + val petId:kotlin.Long = TODO() + val name:kotlin.String? = TODO() + val status:kotlin.String? = TODO() + val response: ResponseEntity = api.updatePetWithForm(petId, name, status) // TODO: test validations } - + /** - * uploads an image - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.uploadFile + * + * @throws ApiException + * if the Api call fails + */ @Test fun uploadFileTest() { - val petId:kotlin.Long? = null - val additionalMetadata:kotlin.String? = null - val file:org.springframework.core.io.Resource? = null - val response: ResponseEntity = api.uploadFile(petId!!, additionalMetadata!!, file!!) + val petId:kotlin.Long = TODO() + val additionalMetadata:kotlin.String? = TODO() + val file:org.springframework.core.io.Resource? = TODO() + val response: ResponseEntity = api.uploadFile(petId, additionalMetadata, file) // TODO: test validations } - + } diff --git a/samples/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/StoreApiTest.kt b/samples/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/StoreApiTest.kt index 82b91cd652bd..fcb00e99e995 100644 --- a/samples/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/StoreApiTest.kt +++ b/samples/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/StoreApiTest.kt @@ -2,7 +2,6 @@ package org.openapitools.api import org.openapitools.model.Order import org.junit.jupiter.api.Test - import org.springframework.http.ResponseEntity class StoreApiTest { @@ -10,68 +9,59 @@ class StoreApiTest { private val service: StoreApiService = StoreApiServiceImpl() private val api: StoreApiController = StoreApiController(service) - /** - * Delete purchase order by ID - * - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @throws ApiException - * if the Api call fails - */ + * To test StoreApiController.deleteOrder + * + * @throws ApiException + * if the Api call fails + */ @Test fun deleteOrderTest() { - val orderId:kotlin.String? = null - val response: ResponseEntity = api.deleteOrder(orderId!!) + val orderId:kotlin.String = TODO() + val response: ResponseEntity = api.deleteOrder(orderId) // TODO: test validations } - + /** - * Returns pet inventories by status - * - * Returns a map of status codes to quantities - * - * @throws ApiException - * if the Api call fails - */ + * To test StoreApiController.getInventory + * + * @throws ApiException + * if the Api call fails + */ @Test fun getInventoryTest() { val response: ResponseEntity> = api.getInventory() // TODO: test validations } - + /** - * Find purchase order by ID - * - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * - * @throws ApiException - * if the Api call fails - */ + * To test StoreApiController.getOrderById + * + * @throws ApiException + * if the Api call fails + */ @Test fun getOrderByIdTest() { - val orderId:kotlin.Long? = null - val response: ResponseEntity = api.getOrderById(orderId!!) + val orderId:kotlin.Long = TODO() + val response: ResponseEntity = api.getOrderById(orderId) // TODO: test validations } - + /** - * Place an order for a pet - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test StoreApiController.placeOrder + * + * @throws ApiException + * if the Api call fails + */ @Test fun placeOrderTest() { - val body:Order? = null - val response: ResponseEntity = api.placeOrder(body!!) + val body:Order = TODO() + val response: ResponseEntity = api.placeOrder(body) // TODO: test validations } - + } diff --git a/samples/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/UserApiTest.kt b/samples/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/UserApiTest.kt index 14917f70aeb2..c3f07290cfef 100644 --- a/samples/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/UserApiTest.kt +++ b/samples/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/UserApiTest.kt @@ -2,7 +2,6 @@ package org.openapitools.api import org.openapitools.model.User import org.junit.jupiter.api.Test - import org.springframework.http.ResponseEntity class UserApiTest { @@ -10,134 +9,117 @@ class UserApiTest { private val service: UserApiService = UserApiServiceImpl() private val api: UserApiController = UserApiController(service) - /** - * Create user - * - * This can only be done by the logged in user. - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.createUser + * + * @throws ApiException + * if the Api call fails + */ @Test fun createUserTest() { - val body:User? = null - val response: ResponseEntity = api.createUser(body!!) + val body:User = TODO() + val response: ResponseEntity = api.createUser(body) // TODO: test validations } - + /** - * Creates list of users with given input array - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.createUsersWithArrayInput + * + * @throws ApiException + * if the Api call fails + */ @Test fun createUsersWithArrayInputTest() { - val body:kotlin.collections.List? = null - val response: ResponseEntity = api.createUsersWithArrayInput(body!!) + val body:kotlin.collections.List = TODO() + val response: ResponseEntity = api.createUsersWithArrayInput(body) // TODO: test validations } - + /** - * Creates list of users with given input array - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.createUsersWithListInput + * + * @throws ApiException + * if the Api call fails + */ @Test fun createUsersWithListInputTest() { - val body:kotlin.collections.List? = null - val response: ResponseEntity = api.createUsersWithListInput(body!!) + val body:kotlin.collections.List = TODO() + val response: ResponseEntity = api.createUsersWithListInput(body) // TODO: test validations } - + /** - * Delete user - * - * This can only be done by the logged in user. - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.deleteUser + * + * @throws ApiException + * if the Api call fails + */ @Test fun deleteUserTest() { - val username:kotlin.String? = null - val response: ResponseEntity = api.deleteUser(username!!) + val username:kotlin.String = TODO() + val response: ResponseEntity = api.deleteUser(username) // TODO: test validations } - + /** - * Get user by user name - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.getUserByName + * + * @throws ApiException + * if the Api call fails + */ @Test fun getUserByNameTest() { - val username:kotlin.String? = null - val response: ResponseEntity = api.getUserByName(username!!) + val username:kotlin.String = TODO() + val response: ResponseEntity = api.getUserByName(username) // TODO: test validations } - + /** - * Logs user into the system - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.loginUser + * + * @throws ApiException + * if the Api call fails + */ @Test fun loginUserTest() { - val username:kotlin.String? = null - val password:kotlin.String? = null - val response: ResponseEntity = api.loginUser(username!!, password!!) + val username:kotlin.String = TODO() + val password:kotlin.String = TODO() + val response: ResponseEntity = api.loginUser(username, password) // TODO: test validations } - + /** - * Logs out current logged in user session - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.logoutUser + * + * @throws ApiException + * if the Api call fails + */ @Test fun logoutUserTest() { val response: ResponseEntity = api.logoutUser() // TODO: test validations } - + /** - * Updated user - * - * This can only be done by the logged in user. - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.updateUser + * + * @throws ApiException + * if the Api call fails + */ @Test fun updateUserTest() { - val username:kotlin.String? = null - val body:User? = null - val response: ResponseEntity = api.updateUser(username!!, body!!) + val username:kotlin.String = TODO() + val body:User = TODO() + val response: ResponseEntity = api.updateUser(username, body) // TODO: test validations } - + } diff --git a/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION b/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION index 3fa3b389a57d..4077803655c0 100644 --- a/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.1-SNAPSHOT \ No newline at end of file +5.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/kotlin/vertx/pom.xml b/samples/server/petstore/kotlin/vertx/pom.xml index 9d1516369718..f7dce917e48f 100644 --- a/samples/server/petstore/kotlin/vertx/pom.xml +++ b/samples/server/petstore/kotlin/vertx/pom.xml @@ -1,14 +1,14 @@ 4.0.0 - + org.openapitools openapi-kotlin-vertx-server 1.0.0-SNAPSHOT jar - + OpenAPI Petstore - + UTF-8 1.8 diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Order.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Order.kt index f3dfdd42e316..a25f7e74bc7f 100644 --- a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Order.kt +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Order.kt @@ -34,7 +34,7 @@ data class Order ( var shipDate: java.time.OffsetDateTime? = null, /* Order Status */ var status: Order.Status? = null, - var complete: kotlin.Boolean? = null + var complete: kotlin.Boolean? = false ) { /** From 8fbd11073a57e08e3413f59a292e2bcaaa7511a9 Mon Sep 17 00:00:00 2001 From: basyskom-dege <72982549+basyskom-dege@users.noreply.github.com> Date: Tue, 14 Dec 2021 11:23:18 +0100 Subject: [PATCH 088/117] [QT][C++]fixed integration test for Oauth (#10921) * fixed missing package, fixed namespace issues * using older function to check if token is valid * using time.h to check if token is valid --- .../resources/cpp-qt-client/CMakeLists.txt.mustache | 7 ++++--- .../main/resources/cpp-qt-client/oauth.cpp.mustache | 9 ++++++--- .../src/main/resources/cpp-qt-client/oauth.h.mustache | 11 +++++------ samples/client/petstore/cpp-qt/CMakeLists.txt | 3 ++- samples/client/petstore/cpp-qt/client/CMakeLists.txt | 5 +++-- samples/client/petstore/cpp-qt/client/PFXOauth.cpp | 5 ++--- samples/client/petstore/cpp-qt/client/PFXOauth.h | 11 +++++------ 7 files changed, 27 insertions(+), 24 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/CMakeLists.txt.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/CMakeLists.txt.mustache index b78e15fb97f0..86b1d5affeb1 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/CMakeLists.txt.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/CMakeLists.txt.mustache @@ -12,7 +12,8 @@ else () endif () find_package(Qt5Core REQUIRED) -find_package(Qt5Network REQUIRED){{#contentCompression}} +find_package(Qt5Network REQUIRED){{#authMethods}}{{#isOAuth}} +find_package(Qt5Gui REQUIRED){{/isOAuth}}{{/authMethods}}{{#contentCompression}} find_package(ZLIB REQUIRED){{/contentCompression}} add_library(${PROJECT_NAME} @@ -31,9 +32,9 @@ add_library(${PROJECT_NAME} {{prefix}}Helpers.cpp {{prefix}}HttpRequest.cpp {{prefix}}HttpFileElement.cpp + {{prefix}}Oauth.cpp ) -target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Network {{#contentCompression}} ${ZLIB_LIBRARIES}{{/contentCompression}}) - +target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Network{{#authMethods}}{{#isOAuth}} Qt5::Gui{{/isOAuth}}{{/authMethods}}{{#contentCompression}} ${ZLIB_LIBRARIES}{{/contentCompression}}) if(NOT APPLE) target_link_libraries(${PROJECT_NAME} PRIVATE ssl crypto) endif() diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/oauth.cpp.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/oauth.cpp.mustache index ebe53654851b..7d4ec2b44f6c 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/oauth.cpp.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/oauth.cpp.mustache @@ -1,6 +1,8 @@ #include "{{prefix}}Oauth.h" -namespace OpenAPI { +{{#cppNamespaceDeclarations}} +namespace {{this}} { +{{/cppNamespaceDeclarations}} /* * Base class to perform oauth2 flows @@ -343,5 +345,6 @@ void ReplyServer::read() emit dataReceived(queryParams); } - -} \ No newline at end of file +{{#cppNamespaceDeclarations}} +} // namespace {{this}} +{{/cppNamespaceDeclarations}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/oauth.h.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/oauth.h.mustache index 03aa0dde9013..91aae71a1b40 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/oauth.h.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/oauth.h.mustache @@ -21,8 +21,7 @@ #include #include #include - - +#include {{#cppNamespaceDeclarations}} namespace {{this}} { @@ -32,19 +31,19 @@ class oauthToken { public: oauthToken(QString token, int expiresIn, QString scope, QString tokenType) : m_token(token), m_scope(scope), m_type(tokenType){ - m_validUntil = QDateTime::fromSecsSinceEpoch(QDateTime::currentSecsSinceEpoch() + expiresIn); + m_validUntil = time(0) + expiresIn; } oauthToken(){ - m_validUntil = QDateTime::fromSecsSinceEpoch(QDateTime::currentSecsSinceEpoch() -1); + m_validUntil = time(0) - 1; } QString getToken(){return m_token;}; QString getScope(){return m_scope;}; QString getType(){return m_type;}; - bool isValid(){return QDateTime::currentDateTime() < m_validUntil;}; + bool isValid(){return time(0) < m_validUntil;}; private: QString m_token; - QDateTime m_validUntil; + time_t m_validUntil; QString m_scope; QString m_type; }; diff --git a/samples/client/petstore/cpp-qt/CMakeLists.txt b/samples/client/petstore/cpp-qt/CMakeLists.txt index 5d408c92e723..6938aca8993a 100644 --- a/samples/client/petstore/cpp-qt/CMakeLists.txt +++ b/samples/client/petstore/cpp-qt/CMakeLists.txt @@ -10,6 +10,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -Wno-unused-variable") find_package(Qt5Core REQUIRED) find_package(Qt5Network REQUIRED) find_package(Qt5Test REQUIRED) +find_package(Qt5Gui REQUIRED) include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/client @@ -23,7 +24,7 @@ add_executable(${PROJECT_NAME} PetStore/UserApiTests.cpp ) target_link_libraries(${PROJECT_NAME} PRIVATE client) -target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Network Qt5::Test) +target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Network Qt5::Test Qt5::Gui) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD_REQUIRED ON) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_EXTENSIONS OFF) diff --git a/samples/client/petstore/cpp-qt/client/CMakeLists.txt b/samples/client/petstore/cpp-qt/client/CMakeLists.txt index 414d1c08636b..29b96a13aaef 100644 --- a/samples/client/petstore/cpp-qt/client/CMakeLists.txt +++ b/samples/client/petstore/cpp-qt/client/CMakeLists.txt @@ -13,6 +13,7 @@ endif () find_package(Qt5Core REQUIRED) find_package(Qt5Network REQUIRED) +find_package(Qt5Gui REQUIRED) add_library(${PROJECT_NAME} PFXApiResponse.cpp @@ -27,9 +28,9 @@ add_library(${PROJECT_NAME} PFXHelpers.cpp PFXHttpRequest.cpp PFXHttpFileElement.cpp + PFXOauth.cpp ) -target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Network ) - +target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Network Qt5::Gui) if(NOT APPLE) target_link_libraries(${PROJECT_NAME} PRIVATE ssl crypto) endif() diff --git a/samples/client/petstore/cpp-qt/client/PFXOauth.cpp b/samples/client/petstore/cpp-qt/client/PFXOauth.cpp index a5cc0da26066..f5617124bb5d 100644 --- a/samples/client/petstore/cpp-qt/client/PFXOauth.cpp +++ b/samples/client/petstore/cpp-qt/client/PFXOauth.cpp @@ -1,6 +1,6 @@ #include "PFXOauth.h" -namespace OpenAPI { +namespace test_namespace { /* * Base class to perform oauth2 flows @@ -343,5 +343,4 @@ void ReplyServer::read() emit dataReceived(queryParams); } - -} \ No newline at end of file +} // namespace test_namespace diff --git a/samples/client/petstore/cpp-qt/client/PFXOauth.h b/samples/client/petstore/cpp-qt/client/PFXOauth.h index f86a29e944f6..df282d47cee9 100644 --- a/samples/client/petstore/cpp-qt/client/PFXOauth.h +++ b/samples/client/petstore/cpp-qt/client/PFXOauth.h @@ -31,8 +31,7 @@ #include #include #include - - +#include namespace test_namespace { @@ -40,19 +39,19 @@ class oauthToken { public: oauthToken(QString token, int expiresIn, QString scope, QString tokenType) : m_token(token), m_scope(scope), m_type(tokenType){ - m_validUntil = QDateTime::fromSecsSinceEpoch(QDateTime::currentSecsSinceEpoch() + expiresIn); + m_validUntil = time(0) + expiresIn; } oauthToken(){ - m_validUntil = QDateTime::fromSecsSinceEpoch(QDateTime::currentSecsSinceEpoch() -1); + m_validUntil = time(0) - 1; } QString getToken(){return m_token;}; QString getScope(){return m_scope;}; QString getType(){return m_type;}; - bool isValid(){return QDateTime::currentDateTime() < m_validUntil;}; + bool isValid(){return time(0) < m_validUntil;}; private: QString m_token; - QDateTime m_validUntil; + time_t m_validUntil; QString m_scope; QString m_type; }; From 8ef49bbaa2363e24573b25ecdfa1a70022d95d8e Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 14 Dec 2021 18:24:21 +0800 Subject: [PATCH 089/117] re-enable cpp-qt test in travis ci --- pom.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/pom.xml b/pom.xml index d55abd2e50d7..999440c675f2 100644 --- a/pom.xml +++ b/pom.xml @@ -1148,9 +1148,7 @@ - samples/client/petstore/rust samples/client/petstore/rust/reqwest/petstore samples/client/petstore/rust/reqwest/petstore-async From e5d58a35a2ff1adc0e1667b162627ac428ba782f Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 14 Dec 2021 18:32:37 +0800 Subject: [PATCH 090/117] update dependencies to newer versions (java) (#11116) --- .../src/main/resources/Java/build.gradle.mustache | 6 +++--- .../libraries/google-api-client/build.gradle.mustache | 8 ++++---- .../Java/libraries/google-api-client/pom.mustache | 6 +++--- .../Java/libraries/resteasy/build.gradle.mustache | 4 ++-- .../main/resources/Java/libraries/resteasy/pom.mustache | 6 ++++-- .../Java/libraries/retrofit2/build.gradle.mustache | 2 +- .../main/resources/Java/libraries/retrofit2/pom.mustache | 8 ++++---- .../Java/libraries/webclient/build.gradle.mustache | 8 ++++---- .../main/resources/Java/libraries/webclient/pom.mustache | 6 +++--- .../src/main/resources/Java/pom.mustache | 4 ++-- .../client/petstore/java/google-api-client/build.gradle | 8 ++++---- samples/client/petstore/java/google-api-client/pom.xml | 6 +++--- samples/client/petstore/java/jersey1/build.gradle | 6 +++--- samples/client/petstore/java/jersey1/pom.xml | 4 ++-- samples/client/petstore/java/resteasy/build.gradle | 4 ++-- samples/client/petstore/java/resteasy/pom.xml | 4 ++-- .../client/petstore/java/retrofit2-play26/build.gradle | 2 +- samples/client/petstore/java/retrofit2-play26/pom.xml | 6 +++--- samples/client/petstore/java/retrofit2/pom.xml | 2 +- samples/client/petstore/java/retrofit2rx2/pom.xml | 2 +- samples/client/petstore/java/retrofit2rx3/pom.xml | 4 ++-- .../petstore/java/webclient-nulable-arrays/build.gradle | 8 ++++---- .../client/petstore/java/webclient-nulable-arrays/pom.xml | 6 +++--- samples/client/petstore/java/webclient/build.gradle | 8 ++++---- samples/client/petstore/java/webclient/pom.xml | 6 +++--- 25 files changed, 68 insertions(+), 66 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache index 2a8fa65cc5fb..d9718c1e5f85 100644 --- a/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache @@ -125,11 +125,11 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.22" - jackson_version = "2.12.1" + swagger_annotations_version = "1.6.3" + jackson_version = "2.12.5" jackson_databind_version = "2.10.5.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" {{#threetenbp}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache index b705c38ff8d1..6341f0271774 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache @@ -109,14 +109,14 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.22" - jackson_version = "2.12.1" + swagger_annotations_version = "1.6.3" + jackson_version = "2.12.5" jackson_databind_version = "2.10.5.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" - google_api_client_version = "1.23.0" + google_api_client_version = "1.32.2" jersey_common_version = "2.25.1" jodatime_version = "2.9.9" junit_version = "4.13.1" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache index bcd5b7d3bff8..81e0ee465214 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache @@ -315,12 +315,12 @@ UTF-8 1.5.22 - 1.30.2 + 1.32.2 2.25.1 2.12.1 - 2.10.4 + 2.10.5.1 {{#openApiNullable}} - 0.2.1 + 0.2.2 {{/openApiNullable}} {{#joda}} 2.9.9 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache index d43c2b7874b6..0a801b9ff86e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache @@ -97,11 +97,11 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.22" + swagger_annotations_version = "1.6.3" jackson_version = "2.10.5" jackson_databind_version = "2.10.5.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" threetenbp_version = "2.9.10" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/pom.mustache index 4f7c83977d51..cf39a160cf0f 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/pom.mustache @@ -272,11 +272,13 @@ UTF-8 - 1.5.22 + 1.6.3 4.5.11.Final 2.10.5 2.10.5.1 - 0.2.1 + {{#openApiNullable}} + 0.2.2 + {{/openApiNullable}} 1.3.5 2.9.10 1.0.0 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache index bb1ca7c917bf..35a63779f646 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache @@ -115,7 +115,7 @@ ext { jackson_version = "2.10.5" jackson_databind_version = "2.10.5.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" {{#play24}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache index 66609e17c2d9..39da1fd02e8a 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache @@ -407,7 +407,7 @@ ${java.version} ${java.version} 1.8.3 - 1.5.22 + 1.6.3 {{#usePlayWS}} 2.12.1 {{#play24}} @@ -420,7 +420,7 @@ 2.6.7 {{/play26}} {{#openApiNullable}} - 0.2.1 + 0.2.2 {{/openApiNullable}} {{/usePlayWS}} 2.5.0 @@ -431,7 +431,7 @@ 2.1.1 {{/useRxJava2}} {{#useRxJava3}} - 3.0.4 + 3.0.4 {{/useRxJava3}} {{#joda}} 2.9.9 @@ -441,7 +441,7 @@ {{/threetenbp}} 1.3.5 {{#useBeanValidation}} - 2.0.2 + 2.0.2 {{/useBeanValidation}} 1.0.1 4.13.1 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache index 08917cfd9093..8481b945bca9 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache @@ -124,12 +124,12 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.6.2" + swagger_annotations_version = "1.6.3" spring_web_version = "2.4.3" - jackson_version = "2.11.3" - jackson_databind_version = "2.11.3" + jackson_version = "2.11.4" + jackson_databind_version = "2.11.4" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" reactor_version = "3.4.3" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache index 3e8e1d6da3f5..b5e01dff5e94 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache @@ -148,12 +148,12 @@ UTF-8 - 1.6.2 + 1.6.3 2.4.3 2.11.3 - 2.11.3 + 2.11.4 {{#openApiNullable}} - 0.2.1 + 0.2.2 {{/openApiNullable}} 1.3.5 4.13.1 diff --git a/modules/openapi-generator/src/main/resources/Java/pom.mustache b/modules/openapi-generator/src/main/resources/Java/pom.mustache index ccb784c095da..5705ea7df67f 100644 --- a/modules/openapi-generator/src/main/resources/Java/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/pom.mustache @@ -360,9 +360,9 @@ UTF-8 - 1.5.21 + 1.6.3 1.19.4 - 2.12.1 + 2.12.5 {{#threetenbp}} 2.9.10 {{/threetenbp}} diff --git a/samples/client/petstore/java/google-api-client/build.gradle b/samples/client/petstore/java/google-api-client/build.gradle index 6b3f54f81662..d4334f128b5b 100644 --- a/samples/client/petstore/java/google-api-client/build.gradle +++ b/samples/client/petstore/java/google-api-client/build.gradle @@ -97,12 +97,12 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.22" - jackson_version = "2.12.1" + swagger_annotations_version = "1.6.3" + jackson_version = "2.12.5" jackson_databind_version = "2.10.5.1" - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" - google_api_client_version = "1.23.0" + google_api_client_version = "1.32.2" jersey_common_version = "2.25.1" jodatime_version = "2.9.9" junit_version = "4.13.1" diff --git a/samples/client/petstore/java/google-api-client/pom.xml b/samples/client/petstore/java/google-api-client/pom.xml index 7614163bc46e..b3016450008d 100644 --- a/samples/client/petstore/java/google-api-client/pom.xml +++ b/samples/client/petstore/java/google-api-client/pom.xml @@ -266,11 +266,11 @@ UTF-8 1.5.22 - 1.30.2 + 1.32.2 2.25.1 2.12.1 - 2.10.4 - 0.2.1 + 2.10.5.1 + 0.2.2 2.9.10 1.3.5 1.0.0 diff --git a/samples/client/petstore/java/jersey1/build.gradle b/samples/client/petstore/java/jersey1/build.gradle index fdcf9b78ae41..36ce7cd1fdc8 100644 --- a/samples/client/petstore/java/jersey1/build.gradle +++ b/samples/client/petstore/java/jersey1/build.gradle @@ -113,10 +113,10 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.22" - jackson_version = "2.12.1" + swagger_annotations_version = "1.6.3" + jackson_version = "2.12.5" jackson_databind_version = "2.10.5.1" - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" jackson_threetenbp_version = "2.9.10" jersey_version = "1.19.4" diff --git a/samples/client/petstore/java/jersey1/pom.xml b/samples/client/petstore/java/jersey1/pom.xml index 04222d579196..76365cd391b2 100644 --- a/samples/client/petstore/java/jersey1/pom.xml +++ b/samples/client/petstore/java/jersey1/pom.xml @@ -288,9 +288,9 @@ UTF-8 - 1.5.21 + 1.6.3 1.19.4 - 2.12.1 + 2.12.5 2.9.10 1.3.5 1.0.0 diff --git a/samples/client/petstore/java/resteasy/build.gradle b/samples/client/petstore/java/resteasy/build.gradle index c794b8613bac..0515f918a1ef 100644 --- a/samples/client/petstore/java/resteasy/build.gradle +++ b/samples/client/petstore/java/resteasy/build.gradle @@ -97,10 +97,10 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.22" + swagger_annotations_version = "1.6.3" jackson_version = "2.10.5" jackson_databind_version = "2.10.5.1" - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" threetenbp_version = "2.9.10" resteasy_version = "4.5.11.Final" diff --git a/samples/client/petstore/java/resteasy/pom.xml b/samples/client/petstore/java/resteasy/pom.xml index 6fbca0739e0e..6e8a8cd96ff6 100644 --- a/samples/client/petstore/java/resteasy/pom.xml +++ b/samples/client/petstore/java/resteasy/pom.xml @@ -253,11 +253,11 @@ UTF-8 - 1.5.22 + 1.6.3 4.5.11.Final 2.10.5 2.10.5.1 - 0.2.1 + 0.2.2 1.3.5 2.9.10 1.0.0 diff --git a/samples/client/petstore/java/retrofit2-play26/build.gradle b/samples/client/petstore/java/retrofit2-play26/build.gradle index a34a42718477..0ea8f2fe7a90 100644 --- a/samples/client/petstore/java/retrofit2-play26/build.gradle +++ b/samples/client/petstore/java/retrofit2-play26/build.gradle @@ -101,7 +101,7 @@ ext { retrofit_version = "2.3.0" jackson_version = "2.10.5" jackson_databind_version = "2.10.5.1" - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" play_version = "2.6.7" swagger_annotations_version = "1.5.22" diff --git a/samples/client/petstore/java/retrofit2-play26/pom.xml b/samples/client/petstore/java/retrofit2-play26/pom.xml index baf6f9835fcb..b6c323b64163 100644 --- a/samples/client/petstore/java/retrofit2-play26/pom.xml +++ b/samples/client/petstore/java/retrofit2-play26/pom.xml @@ -307,14 +307,14 @@ ${java.version} ${java.version} 1.8.3 - 1.5.22 + 1.6.3 2.12.1 2.6.7 - 0.2.1 + 0.2.2 2.5.0 1.4.0 1.3.5 - 2.0.2 + 2.0.2 1.0.1 4.13.1 diff --git a/samples/client/petstore/java/retrofit2/pom.xml b/samples/client/petstore/java/retrofit2/pom.xml index e184e4db6c6a..aa4e1008af84 100644 --- a/samples/client/petstore/java/retrofit2/pom.xml +++ b/samples/client/petstore/java/retrofit2/pom.xml @@ -266,7 +266,7 @@ ${java.version} ${java.version} 1.8.3 - 1.5.22 + 1.6.3 2.5.0 1.4.0 1.3.5 diff --git a/samples/client/petstore/java/retrofit2rx2/pom.xml b/samples/client/petstore/java/retrofit2rx2/pom.xml index c841514837ec..ef8ef477ff04 100644 --- a/samples/client/petstore/java/retrofit2rx2/pom.xml +++ b/samples/client/petstore/java/retrofit2rx2/pom.xml @@ -276,7 +276,7 @@ ${java.version} ${java.version} 1.8.3 - 1.5.22 + 1.6.3 2.5.0 2.1.1 1.4.0 diff --git a/samples/client/petstore/java/retrofit2rx3/pom.xml b/samples/client/petstore/java/retrofit2rx3/pom.xml index adb7eb9927b9..2eefb1398853 100644 --- a/samples/client/petstore/java/retrofit2rx3/pom.xml +++ b/samples/client/petstore/java/retrofit2rx3/pom.xml @@ -276,9 +276,9 @@ ${java.version} ${java.version} 1.8.3 - 1.5.22 + 1.6.3 2.5.0 - 3.0.4 + 3.0.4 1.4.0 1.3.5 1.0.1 diff --git a/samples/client/petstore/java/webclient-nulable-arrays/build.gradle b/samples/client/petstore/java/webclient-nulable-arrays/build.gradle index 6cbf60d744c8..1c32235d403f 100644 --- a/samples/client/petstore/java/webclient-nulable-arrays/build.gradle +++ b/samples/client/petstore/java/webclient-nulable-arrays/build.gradle @@ -112,11 +112,11 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.6.2" + swagger_annotations_version = "1.6.3" spring_web_version = "2.4.3" - jackson_version = "2.11.3" - jackson_databind_version = "2.11.3" - jackson_databind_nullable_version = "0.2.1" + jackson_version = "2.11.4" + jackson_databind_version = "2.11.4" + jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" reactor_version = "3.4.3" reactor_netty_version = "0.7.15.RELEASE" diff --git a/samples/client/petstore/java/webclient-nulable-arrays/pom.xml b/samples/client/petstore/java/webclient-nulable-arrays/pom.xml index 6a4e433806c4..45b15e6002ca 100644 --- a/samples/client/petstore/java/webclient-nulable-arrays/pom.xml +++ b/samples/client/petstore/java/webclient-nulable-arrays/pom.xml @@ -125,11 +125,11 @@ UTF-8 - 1.6.2 + 1.6.3 2.4.3 2.11.3 - 2.11.3 - 0.2.1 + 2.11.4 + 0.2.2 1.3.5 4.13.1 3.4.3 diff --git a/samples/client/petstore/java/webclient/build.gradle b/samples/client/petstore/java/webclient/build.gradle index 4d1f7d9b7f4c..6b7058e6a948 100644 --- a/samples/client/petstore/java/webclient/build.gradle +++ b/samples/client/petstore/java/webclient/build.gradle @@ -112,11 +112,11 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.6.2" + swagger_annotations_version = "1.6.3" spring_web_version = "2.4.3" - jackson_version = "2.11.3" - jackson_databind_version = "2.11.3" - jackson_databind_nullable_version = "0.2.1" + jackson_version = "2.11.4" + jackson_databind_version = "2.11.4" + jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" reactor_version = "3.4.3" reactor_netty_version = "0.7.15.RELEASE" diff --git a/samples/client/petstore/java/webclient/pom.xml b/samples/client/petstore/java/webclient/pom.xml index fa73267d0094..ff3255b2379c 100644 --- a/samples/client/petstore/java/webclient/pom.xml +++ b/samples/client/petstore/java/webclient/pom.xml @@ -125,11 +125,11 @@ UTF-8 - 1.6.2 + 1.6.3 2.4.3 2.11.3 - 2.11.3 - 0.2.1 + 2.11.4 + 0.2.2 1.3.5 4.13.1 3.4.3 From 3eb0465ec450ddfe1eb7cb872553afefb32bbb71 Mon Sep 17 00:00:00 2001 From: Tal Kirshboim Date: Wed, 15 Dec 2021 04:38:10 +0100 Subject: [PATCH 091/117] Update samples (#11119) --- .../kotlin/vertx/.openapi-generator/FILES | 2 +- .../server/petstore/kotlin/vertx/README.md | 2 +- .../server/api/model/ModelApiResponse.kt | 34 +++++++++++++++++++ .../server/api/verticle/PetApi.kt | 4 +-- .../api/verticle/PetApiVertxProxyHandler.kt | 2 +- 5 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/ModelApiResponse.kt diff --git a/samples/server/petstore/kotlin/vertx/.openapi-generator/FILES b/samples/server/petstore/kotlin/vertx/.openapi-generator/FILES index cf01966a4dda..bfa6fd2a60ca 100644 --- a/samples/server/petstore/kotlin/vertx/.openapi-generator/FILES +++ b/samples/server/petstore/kotlin/vertx/.openapi-generator/FILES @@ -1,7 +1,7 @@ README.md pom.xml -src/main/kotlin/org/openapitools/server/api/model/ApiResponse.kt src/main/kotlin/org/openapitools/server/api/model/Category.kt +src/main/kotlin/org/openapitools/server/api/model/ModelApiResponse.kt src/main/kotlin/org/openapitools/server/api/model/Order.kt src/main/kotlin/org/openapitools/server/api/model/Pet.kt src/main/kotlin/org/openapitools/server/api/model/Tag.kt diff --git a/samples/server/petstore/kotlin/vertx/README.md b/samples/server/petstore/kotlin/vertx/README.md index 4e9992d66cbf..47e035f66db9 100644 --- a/samples/server/petstore/kotlin/vertx/README.md +++ b/samples/server/petstore/kotlin/vertx/README.md @@ -51,8 +51,8 @@ This runs all tests and packages the library. ## Documentation for Models - - [org.openapitools.server.api.model.ApiResponse](docs/ApiResponse.md) - [org.openapitools.server.api.model.Category](docs/Category.md) + - [org.openapitools.server.api.model.ModelApiResponse](docs/ModelApiResponse.md) - [org.openapitools.server.api.model.Order](docs/Order.md) - [org.openapitools.server.api.model.Pet](docs/Pet.md) - [org.openapitools.server.api.model.Tag](docs/Tag.md) diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/ModelApiResponse.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/ModelApiResponse.kt new file mode 100644 index 000000000000..ce8326960332 --- /dev/null +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/ModelApiResponse.kt @@ -0,0 +1,34 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.server.api.model + + + +import com.google.gson.annotations.SerializedName +import com.fasterxml.jackson.annotation.JsonIgnoreProperties +import com.fasterxml.jackson.annotation.JsonInclude +/** + * Describes the result of uploading an image resource + * @param code + * @param type + * @param message + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +data class ModelApiResponse ( + var code: kotlin.Int? = null, + var type: kotlin.String? = null, + var message: kotlin.String? = null +) { + +} + diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApi.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApi.kt index 07f92471774c..5968aa12cac2 100644 --- a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApi.kt +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApi.kt @@ -1,6 +1,6 @@ package org.openapitools.server.api.verticle -import org.openapitools.server.api.model.ApiResponse +import org.openapitools.server.api.model.ModelApiResponse import org.openapitools.server.api.model.Pet import io.vertx.core.Vertx import io.vertx.core.json.JsonObject @@ -41,7 +41,7 @@ interface PetApi { suspend fun updatePetWithForm(petId:kotlin.Long?,name:kotlin.String?,status:kotlin.String?,context:OperationRequest):Response /* uploadFile * uploads an image */ - suspend fun uploadFile(petId:kotlin.Long?,additionalMetadata:kotlin.String?,file:kotlin.collections.List?,context:OperationRequest):Response + suspend fun uploadFile(petId:kotlin.Long?,additionalMetadata:kotlin.String?,file:kotlin.collections.List?,context:OperationRequest):Response companion object { const val address = "PetApi-service" suspend fun createRouterFactory(vertx: Vertx,path:String): io.vertx.ext.web.api.contract.openapi3.OpenAPI3RouterFactory { diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApiVertxProxyHandler.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApiVertxProxyHandler.kt index 6d4fcafa98bc..644fc1cee83a 100644 --- a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApiVertxProxyHandler.kt +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApiVertxProxyHandler.kt @@ -16,7 +16,7 @@ import io.vertx.core.json.Json import io.vertx.core.json.JsonArray import com.google.gson.reflect.TypeToken import com.google.gson.Gson -import org.openapitools.server.api.model.ApiResponse +import org.openapitools.server.api.model.ModelApiResponse import org.openapitools.server.api.model.Pet class PetApiVertxProxyHandler(private val vertx: Vertx, private val service: PetApi, topLevel: Boolean, private val timeoutSeconds: Long) : ProxyHandler() { From b2daa5a836fcea8be2e64542b9a57abfd799b204 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 15 Dec 2021 11:41:16 +0800 Subject: [PATCH 092/117] update jackson-databind-nullable to 0.2.2 (#11121) --- .../Java/libraries/apache-httpclient/build.gradle.mustache | 2 +- .../main/resources/Java/libraries/feign/build.gradle.mustache | 2 +- .../src/main/resources/Java/libraries/feign/pom.mustache | 2 +- .../main/resources/Java/libraries/jersey2/build.gradle.mustache | 2 +- .../main/resources/Java/libraries/jersey2/build.sbt.mustache | 2 +- .../src/main/resources/Java/libraries/jersey2/pom.mustache | 2 +- .../src/main/resources/Java/libraries/native/pom.mustache | 2 +- .../Java/libraries/okhttp-gson-nextgen/build.sbt.mustache | 2 +- .../resources/Java/libraries/okhttp-gson-nextgen/pom.mustache | 2 +- .../resources/Java/libraries/okhttp-gson/build.sbt.mustache | 2 +- .../src/main/resources/Java/libraries/okhttp-gson/pom.mustache | 2 +- .../resources/Java/libraries/rest-assured/build.gradle.mustache | 2 +- .../resources/Java/libraries/rest-assured/build.sbt.mustache | 2 +- .../src/main/resources/Java/libraries/rest-assured/pom.mustache | 2 +- .../resources/Java/libraries/resttemplate/build.gradle.mustache | 2 +- .../src/main/resources/Java/libraries/resttemplate/pom.mustache | 2 +- .../main/resources/Java/libraries/vertx/build.gradle.mustache | 2 +- .../src/main/resources/Java/libraries/vertx/pom.mustache | 2 +- .../main/resources/JavaSpring/libraries/spring-mvc/pom.mustache | 2 +- samples/client/others/java/okhttp-gson-streaming/build.sbt | 2 +- samples/client/others/java/okhttp-gson-streaming/pom.xml | 2 +- samples/client/petstore/java/apache-httpclient/build.gradle | 2 +- samples/client/petstore/java/feign/build.gradle | 2 +- samples/client/petstore/java/feign/pom.xml | 2 +- .../petstore/java/jersey2-java8-localdatetime/build.gradle | 2 +- .../client/petstore/java/jersey2-java8-localdatetime/build.sbt | 2 +- .../client/petstore/java/jersey2-java8-localdatetime/pom.xml | 2 +- samples/client/petstore/java/jersey2-java8/build.gradle | 2 +- samples/client/petstore/java/jersey2-java8/build.sbt | 2 +- samples/client/petstore/java/jersey2-java8/pom.xml | 2 +- samples/client/petstore/java/native-async/pom.xml | 2 +- samples/client/petstore/java/native/pom.xml | 2 +- .../petstore/java/okhttp-gson-dynamicOperations/build.sbt | 2 +- .../client/petstore/java/okhttp-gson-dynamicOperations/pom.xml | 2 +- samples/client/petstore/java/okhttp-gson-nextgen/build.sbt | 2 +- samples/client/petstore/java/okhttp-gson-nextgen/pom.xml | 2 +- .../client/petstore/java/okhttp-gson-parcelableModel/build.sbt | 2 +- .../client/petstore/java/okhttp-gson-parcelableModel/pom.xml | 2 +- samples/client/petstore/java/okhttp-gson/build.sbt | 2 +- samples/client/petstore/java/okhttp-gson/pom.xml | 2 +- samples/client/petstore/java/rest-assured-jackson/build.gradle | 2 +- samples/client/petstore/java/rest-assured-jackson/build.sbt | 2 +- samples/client/petstore/java/rest-assured-jackson/pom.xml | 2 +- samples/client/petstore/java/resttemplate-withXml/build.gradle | 2 +- samples/client/petstore/java/resttemplate-withXml/pom.xml | 2 +- samples/client/petstore/java/resttemplate/build.gradle | 2 +- samples/client/petstore/java/resttemplate/pom.xml | 2 +- samples/client/petstore/java/vertx-no-nullable/pom.xml | 2 +- samples/client/petstore/java/vertx/build.gradle | 2 +- samples/client/petstore/java/vertx/pom.xml | 2 +- .../extensions/x-auth-id-alias/java/jersey2-java8/build.gradle | 2 +- .../extensions/x-auth-id-alias/java/jersey2-java8/build.sbt | 2 +- .../extensions/x-auth-id-alias/java/jersey2-java8/pom.xml | 2 +- .../petstore/java/jersey2-java8-special-characters/build.gradle | 2 +- .../petstore/java/jersey2-java8-special-characters/build.sbt | 2 +- .../petstore/java/jersey2-java8-special-characters/pom.xml | 2 +- .../openapi3/client/petstore/java/jersey2-java8/build.gradle | 2 +- samples/openapi3/client/petstore/java/jersey2-java8/build.sbt | 2 +- samples/openapi3/client/petstore/java/jersey2-java8/pom.xml | 2 +- samples/server/petstore/spring-mvc-j8-async/pom.xml | 2 +- samples/server/petstore/spring-mvc-j8-localdatetime/pom.xml | 2 +- samples/server/petstore/spring-mvc-spring-pageable/pom.xml | 2 +- samples/server/petstore/spring-mvc/pom.xml | 2 +- 63 files changed, 63 insertions(+), 63 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/build.gradle.mustache index 2c1de17903a5..5ae33f37e676 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/build.gradle.mustache @@ -129,7 +129,7 @@ ext { jackson_version = "2.12.1" jackson_databind_version = "2.10.5.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" {{#threetenbp}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache index 3ce02e7a06e8..c9bf7c357c2e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache @@ -105,7 +105,7 @@ ext { jackson_version = "2.10.3" jackson_databind_version = "2.10.3" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" {{#threetenbp}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache index 5f87e95f5691..f57614c584a9 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache @@ -365,7 +365,7 @@ 3.8.0 2.10.3 {{#openApiNullable}} - 0.2.1 + 0.2.2 {{/openApiNullable}} 2.10.3 {{#threetenbp}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache index bb3a427f266e..1dc7b62fa42a 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache @@ -114,7 +114,7 @@ ext { jackson_version = "2.13.0" jackson_databind_version = "2.13.0" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" jersey_version = "2.35" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache index 3b16db610654..a1375400af01 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache @@ -29,7 +29,7 @@ lazy val root = (project in file(".")). "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.12.5" % "compile", {{/threetenbp}} {{#openApiNullable}} - "org.openapitools" % "jackson-databind-nullable" % "0.2.1" % "compile", + "org.openapitools" % "jackson-databind-nullable" % "0.2.2" % "compile", {{/openApiNullable}} {{#hasOAuthMethods}} "com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile", diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache index 11857cbbcddb..243be3921b01 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache @@ -391,7 +391,7 @@ 2.35 2.13.0 2.13.0 - 0.2.1 + 0.2.2 {{#threetenbp}} 2.9.10 {{/threetenbp}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache index d81feac5e79b..c0c151cda0ec 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache @@ -229,7 +229,7 @@ 11 11 2.10.4 - 0.2.1 + 0.2.2 1.3.5 {{#threetenbp}} 2.9.10 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/build.sbt.mustache index 907e8a916ec9..5e0c74c55c05 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/build.sbt.mustache @@ -15,7 +15,7 @@ lazy val root = (project in file(".")). "com.google.code.gson" % "gson" % "2.8.6", "org.apache.commons" % "commons-lang3" % "3.10", {{#openApiNullable}} - "org.openapitools" % "jackson-databind-nullable" % "0.2.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.2", {{/openApiNullable}} {{#hasOAuthMethods}} "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1", diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pom.mustache index 5d33c6ce25b1..10dfc15ab7fe 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pom.mustache @@ -398,7 +398,7 @@ 2.8.8 3.12.0 {{#openApiNullable}} - 0.2.1 + 0.2.2 {{/openApiNullable}} {{#joda}} 2.10.9 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache index 907e8a916ec9..5e0c74c55c05 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache @@ -15,7 +15,7 @@ lazy val root = (project in file(".")). "com.google.code.gson" % "gson" % "2.8.6", "org.apache.commons" % "commons-lang3" % "3.10", {{#openApiNullable}} - "org.openapitools" % "jackson-databind-nullable" % "0.2.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.2", {{/openApiNullable}} {{#hasOAuthMethods}} "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1", diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache index cae64378818b..94c057b1424a 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache @@ -388,7 +388,7 @@ 2.8.8 3.12.0 {{#openApiNullable}} - 0.2.1 + 0.2.2 {{/openApiNullable}} {{#joda}} 2.10.9 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache index 2294f8808f2b..e80ea1813d0f 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache @@ -104,7 +104,7 @@ ext { jackson_version = "2.10.3" jackson_databind_version = "2.10.3" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" {{#threetenbp}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache index 22390e12e0e5..6a048b92f884 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache @@ -18,7 +18,7 @@ lazy val root = (project in file(".")). "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3", "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.3", {{#openApiNullable}} - "org.openapitools" % "jackson-databind-nullable" % "0.2.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.2", {{/openApiNullable}} {{#withXml}} "com.fasterxml.jackson.dataformat" % "jackson-dataformat-xml" % "2.10.3", diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache index 7a26d17a1d93..c6e924ecb890 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache @@ -358,7 +358,7 @@ {{/threetenbp}} {{#jackson}} 2.10.3 - 0.2.1 + 0.2.2 {{#threetenbp}} 2.10.0 {{/threetenbp}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache index c915f08bb2a7..75b4478ea8eb 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache @@ -113,7 +113,7 @@ ext { jackson_version = "2.10.5" jackson_databind_version = "2.10.5.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" spring_web_version = "5.2.5.RELEASE" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache index ae3ceab24555..6bd56372de2e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache @@ -319,7 +319,7 @@ 5.2.5.RELEASE 2.10.5 2.10.5.1 - 0.2.1 + 0.2.2 1.3.5 {{#joda}} 2.9.9 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache index bd45198caa86..bc33a0774390 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache @@ -35,7 +35,7 @@ ext { vertx_version = "3.4.2" junit_version = "4.13.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" {{#threetenbp}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache index cd17acbc20f4..2306edbfe84e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache @@ -308,7 +308,7 @@ 1.5.22 2.10.5 2.10.5.1 - 0.2.1 + 0.2.2 1.3.5 4.13.1 diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache index 909113d70139..9230b32c9d32 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache @@ -302,7 +302,7 @@ {{/useBeanValidation}} 4.3.20.RELEASE {{#openApiNullable}} - 0.2.1 + 0.2.2 {{/openApiNullable}} 2.9.8 diff --git a/samples/client/others/java/okhttp-gson-streaming/build.sbt b/samples/client/others/java/okhttp-gson-streaming/build.sbt index 903c7739e546..f37a72fb4b80 100644 --- a/samples/client/others/java/okhttp-gson-streaming/build.sbt +++ b/samples/client/others/java/okhttp-gson-streaming/build.sbt @@ -14,7 +14,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "logging-interceptor" % "4.9.1", "com.google.code.gson" % "gson" % "2.8.6", "org.apache.commons" % "commons-lang3" % "3.10", - "org.openapitools" % "jackson-databind-nullable" % "0.2.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.2", "org.threeten" % "threetenbp" % "1.4.3" % "compile", "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", diff --git a/samples/client/others/java/okhttp-gson-streaming/pom.xml b/samples/client/others/java/okhttp-gson-streaming/pom.xml index be9a75c0b542..2b89ca0c1c20 100644 --- a/samples/client/others/java/okhttp-gson-streaming/pom.xml +++ b/samples/client/others/java/okhttp-gson-streaming/pom.xml @@ -324,7 +324,7 @@ 4.9.2 2.8.8 3.12.0 - 0.2.1 + 0.2.2 1.5.0 1.3.5 4.13.2 diff --git a/samples/client/petstore/java/apache-httpclient/build.gradle b/samples/client/petstore/java/apache-httpclient/build.gradle index 8aec91e0bc07..bc0d42140990 100644 --- a/samples/client/petstore/java/apache-httpclient/build.gradle +++ b/samples/client/petstore/java/apache-httpclient/build.gradle @@ -116,7 +116,7 @@ ext { swagger_annotations_version = "1.5.22" jackson_version = "2.12.1" jackson_databind_version = "2.10.5.1" - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" jackson_threetenbp_version = "2.9.10" httpclient_version = "4.5.13" diff --git a/samples/client/petstore/java/feign/build.gradle b/samples/client/petstore/java/feign/build.gradle index 8cbc10e5c132..aa0a64e08f8d 100644 --- a/samples/client/petstore/java/feign/build.gradle +++ b/samples/client/petstore/java/feign/build.gradle @@ -104,7 +104,7 @@ ext { swagger_annotations_version = "1.5.24" jackson_version = "2.10.3" jackson_databind_version = "2.10.3" - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" jackson_threetenbp_version = "2.9.10" feign_version = "10.11" diff --git a/samples/client/petstore/java/feign/pom.xml b/samples/client/petstore/java/feign/pom.xml index b6ab732f2d49..1f08498e7960 100644 --- a/samples/client/petstore/java/feign/pom.xml +++ b/samples/client/petstore/java/feign/pom.xml @@ -331,7 +331,7 @@ 10.11 3.8.0 2.10.3 - 0.2.1 + 0.2.2 2.10.3 2.9.10 1.3.5 diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/build.gradle b/samples/client/petstore/java/jersey2-java8-localdatetime/build.gradle index 7618c2e444b3..e1a7e57a0b09 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/build.gradle +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/build.gradle @@ -101,7 +101,7 @@ ext { swagger_annotations_version = "1.6.3" jackson_version = "2.13.0" jackson_databind_version = "2.13.0" - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" jersey_version = "2.35" junit_version = "4.13.2" diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/build.sbt b/samples/client/petstore/java/jersey2-java8-localdatetime/build.sbt index a5e716d7c185..c8adbf8c4867 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/build.sbt +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/build.sbt @@ -20,7 +20,7 @@ lazy val root = (project in file(".")). "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.0" % "compile", "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.0" % "compile", "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.0" % "compile", - "org.openapitools" % "jackson-databind-nullable" % "0.2.1" % "compile", + "org.openapitools" % "jackson-databind-nullable" % "0.2.2" % "compile", "com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "junit" % "junit" % "4.13.2" % "test", diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/pom.xml b/samples/client/petstore/java/jersey2-java8-localdatetime/pom.xml index b850beee9e13..e4b20a617b3f 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/pom.xml +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/pom.xml @@ -342,7 +342,7 @@ 2.35 2.13.0 2.13.0 - 0.2.1 + 0.2.2 1.3.5 4.13.2 8.3.1 diff --git a/samples/client/petstore/java/jersey2-java8/build.gradle b/samples/client/petstore/java/jersey2-java8/build.gradle index 57f7cc9b7038..44c89afeab52 100644 --- a/samples/client/petstore/java/jersey2-java8/build.gradle +++ b/samples/client/petstore/java/jersey2-java8/build.gradle @@ -101,7 +101,7 @@ ext { swagger_annotations_version = "1.6.3" jackson_version = "2.13.0" jackson_databind_version = "2.13.0" - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" jersey_version = "2.35" junit_version = "4.13.2" diff --git a/samples/client/petstore/java/jersey2-java8/build.sbt b/samples/client/petstore/java/jersey2-java8/build.sbt index 424fe3d4581a..5a45537b1203 100644 --- a/samples/client/petstore/java/jersey2-java8/build.sbt +++ b/samples/client/petstore/java/jersey2-java8/build.sbt @@ -20,7 +20,7 @@ lazy val root = (project in file(".")). "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.0" % "compile", "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.0" % "compile", "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.0" % "compile", - "org.openapitools" % "jackson-databind-nullable" % "0.2.1" % "compile", + "org.openapitools" % "jackson-databind-nullable" % "0.2.2" % "compile", "com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "junit" % "junit" % "4.13.2" % "test", diff --git a/samples/client/petstore/java/jersey2-java8/pom.xml b/samples/client/petstore/java/jersey2-java8/pom.xml index 2fc62928ae51..30b4ba4016aa 100644 --- a/samples/client/petstore/java/jersey2-java8/pom.xml +++ b/samples/client/petstore/java/jersey2-java8/pom.xml @@ -342,7 +342,7 @@ 2.35 2.13.0 2.13.0 - 0.2.1 + 0.2.2 1.3.5 4.13.2 8.3.1 diff --git a/samples/client/petstore/java/native-async/pom.xml b/samples/client/petstore/java/native-async/pom.xml index eb1bf8a993f7..97c223f6767d 100644 --- a/samples/client/petstore/java/native-async/pom.xml +++ b/samples/client/petstore/java/native-async/pom.xml @@ -215,7 +215,7 @@ 11 11 2.10.4 - 0.2.1 + 0.2.2 1.3.5 4.13.1 diff --git a/samples/client/petstore/java/native/pom.xml b/samples/client/petstore/java/native/pom.xml index eb1bf8a993f7..97c223f6767d 100644 --- a/samples/client/petstore/java/native/pom.xml +++ b/samples/client/petstore/java/native/pom.xml @@ -215,7 +215,7 @@ 11 11 2.10.4 - 0.2.1 + 0.2.2 1.3.5 4.13.1 diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt index 2957b77a9e68..7de5adcd583f 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt @@ -14,7 +14,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "logging-interceptor" % "4.9.1", "com.google.code.gson" % "gson" % "2.8.6", "org.apache.commons" % "commons-lang3" % "3.10", - "org.openapitools" % "jackson-databind-nullable" % "0.2.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.2", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1", "org.threeten" % "threetenbp" % "1.4.3" % "compile", "io.swagger.parser.v3" % "swagger-parser-v3" "2.0.23" % "compile" diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml b/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml index 9c060a66c621..9e8777894cea 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml @@ -334,7 +334,7 @@ 4.9.2 2.8.8 3.12.0 - 0.2.1 + 0.2.2 1.5.0 1.3.5 4.13.2 diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/build.sbt b/samples/client/petstore/java/okhttp-gson-nextgen/build.sbt index 6aebfa8e21c4..504c16ccb001 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-nextgen/build.sbt @@ -14,7 +14,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "logging-interceptor" % "4.9.1", "com.google.code.gson" % "gson" % "2.8.6", "org.apache.commons" % "commons-lang3" % "3.10", - "org.openapitools" % "jackson-databind-nullable" % "0.2.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.2", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1", "org.threeten" % "threetenbp" % "1.4.3" % "compile", "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/pom.xml b/samples/client/petstore/java/okhttp-gson-nextgen/pom.xml index 931f95599d35..e9f84b263ee9 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-nextgen/pom.xml @@ -339,7 +339,7 @@ 4.9.2 2.8.8 3.12.0 - 0.2.1 + 0.2.2 1.5.0 1.3.5 4.13.2 diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt index e566d0fb4fbe..a90f98e2152b 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt @@ -14,7 +14,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "logging-interceptor" % "4.9.1", "com.google.code.gson" % "gson" % "2.8.6", "org.apache.commons" % "commons-lang3" % "3.10", - "org.openapitools" % "jackson-databind-nullable" % "0.2.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.2", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1", "org.threeten" % "threetenbp" % "1.4.3" % "compile", "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml b/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml index 098e028ec8fc..08ffdd44ecbf 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml @@ -336,7 +336,7 @@ 4.9.2 2.8.8 3.12.0 - 0.2.1 + 0.2.2 1.5.0 1.3.5 4.13.2 diff --git a/samples/client/petstore/java/okhttp-gson/build.sbt b/samples/client/petstore/java/okhttp-gson/build.sbt index a791297fd3ea..95fad49a3303 100644 --- a/samples/client/petstore/java/okhttp-gson/build.sbt +++ b/samples/client/petstore/java/okhttp-gson/build.sbt @@ -14,7 +14,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "logging-interceptor" % "4.9.1", "com.google.code.gson" % "gson" % "2.8.6", "org.apache.commons" % "commons-lang3" % "3.10", - "org.openapitools" % "jackson-databind-nullable" % "0.2.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.2", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1", "org.threeten" % "threetenbp" % "1.4.3" % "compile", "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", diff --git a/samples/client/petstore/java/okhttp-gson/pom.xml b/samples/client/petstore/java/okhttp-gson/pom.xml index da2dbbe58e71..43e3d9f548f1 100644 --- a/samples/client/petstore/java/okhttp-gson/pom.xml +++ b/samples/client/petstore/java/okhttp-gson/pom.xml @@ -329,7 +329,7 @@ 4.9.2 2.8.8 3.12.0 - 0.2.1 + 0.2.2 1.5.0 1.3.5 4.13.2 diff --git a/samples/client/petstore/java/rest-assured-jackson/build.gradle b/samples/client/petstore/java/rest-assured-jackson/build.gradle index e99cf39b1197..eefeb332bdd7 100644 --- a/samples/client/petstore/java/rest-assured-jackson/build.gradle +++ b/samples/client/petstore/java/rest-assured-jackson/build.gradle @@ -102,7 +102,7 @@ ext { junit_version = "4.13.1" jackson_version = "2.10.3" jackson_databind_version = "2.10.3" - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" okio_version = "1.17.5" } diff --git a/samples/client/petstore/java/rest-assured-jackson/build.sbt b/samples/client/petstore/java/rest-assured-jackson/build.sbt index 4422008b6359..78811a4180d3 100644 --- a/samples/client/petstore/java/rest-assured-jackson/build.sbt +++ b/samples/client/petstore/java/rest-assured-jackson/build.sbt @@ -16,7 +16,7 @@ lazy val root = (project in file(".")). "com.fasterxml.jackson.core" % "jackson-core" % "2.10.3", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3", "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.3", - "org.openapitools" % "jackson-databind-nullable" % "0.2.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.2", "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.10.3", "com.squareup.okio" % "okio" % "1.17.5" % "compile", "jakarta.validation" % "jakarta.validation-api" % "2.0.2" % "compile", diff --git a/samples/client/petstore/java/rest-assured-jackson/pom.xml b/samples/client/petstore/java/rest-assured-jackson/pom.xml index 0c2e6e4bc455..43201004cbd7 100644 --- a/samples/client/petstore/java/rest-assured-jackson/pom.xml +++ b/samples/client/petstore/java/rest-assured-jackson/pom.xml @@ -287,7 +287,7 @@ 2.8.6 1.8.4 2.10.3 - 0.2.1 + 0.2.2 1.3.5 2.0.2 1.17.5 diff --git a/samples/client/petstore/java/resttemplate-withXml/build.gradle b/samples/client/petstore/java/resttemplate-withXml/build.gradle index f07930b7b5d2..96a7e7dd4132 100644 --- a/samples/client/petstore/java/resttemplate-withXml/build.gradle +++ b/samples/client/petstore/java/resttemplate-withXml/build.gradle @@ -100,7 +100,7 @@ ext { swagger_annotations_version = "1.5.22" jackson_version = "2.10.5" jackson_databind_version = "2.10.5.1" - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" spring_web_version = "5.2.5.RELEASE" jodatime_version = "2.9.9" diff --git a/samples/client/petstore/java/resttemplate-withXml/pom.xml b/samples/client/petstore/java/resttemplate-withXml/pom.xml index 8c6793c1c40e..a63c67fcf200 100644 --- a/samples/client/petstore/java/resttemplate-withXml/pom.xml +++ b/samples/client/petstore/java/resttemplate-withXml/pom.xml @@ -288,7 +288,7 @@ 5.2.5.RELEASE 2.10.5 2.10.5.1 - 0.2.1 + 0.2.2 1.3.5 2.9.10 1.0.0 diff --git a/samples/client/petstore/java/resttemplate/build.gradle b/samples/client/petstore/java/resttemplate/build.gradle index a5719c67de5b..b70d21521b50 100644 --- a/samples/client/petstore/java/resttemplate/build.gradle +++ b/samples/client/petstore/java/resttemplate/build.gradle @@ -100,7 +100,7 @@ ext { swagger_annotations_version = "1.5.22" jackson_version = "2.10.5" jackson_databind_version = "2.10.5.1" - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" spring_web_version = "5.2.5.RELEASE" jodatime_version = "2.9.9" diff --git a/samples/client/petstore/java/resttemplate/pom.xml b/samples/client/petstore/java/resttemplate/pom.xml index 9921e8011ee2..7421690cdc9d 100644 --- a/samples/client/petstore/java/resttemplate/pom.xml +++ b/samples/client/petstore/java/resttemplate/pom.xml @@ -280,7 +280,7 @@ 5.2.5.RELEASE 2.10.5 2.10.5.1 - 0.2.1 + 0.2.2 1.3.5 2.9.10 1.0.0 diff --git a/samples/client/petstore/java/vertx-no-nullable/pom.xml b/samples/client/petstore/java/vertx-no-nullable/pom.xml index c0c0281f9ebb..c7c3a930c979 100644 --- a/samples/client/petstore/java/vertx-no-nullable/pom.xml +++ b/samples/client/petstore/java/vertx-no-nullable/pom.xml @@ -278,7 +278,7 @@ 1.5.22 2.10.5 2.10.5.1 - 0.2.1 + 0.2.2 1.3.5 4.13.1 diff --git a/samples/client/petstore/java/vertx/build.gradle b/samples/client/petstore/java/vertx/build.gradle index c067ccdc2adf..0f060495d960 100644 --- a/samples/client/petstore/java/vertx/build.gradle +++ b/samples/client/petstore/java/vertx/build.gradle @@ -34,7 +34,7 @@ ext { jackson_databind_version = "2.10.5.1" vertx_version = "3.4.2" junit_version = "4.13.1" - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" } diff --git a/samples/client/petstore/java/vertx/pom.xml b/samples/client/petstore/java/vertx/pom.xml index e751a57d0903..5c152ae84fb0 100644 --- a/samples/client/petstore/java/vertx/pom.xml +++ b/samples/client/petstore/java/vertx/pom.xml @@ -278,7 +278,7 @@ 1.5.22 2.10.5 2.10.5.1 - 0.2.1 + 0.2.2 1.3.5 4.13.1 diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.gradle b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.gradle index b33e0d641869..58eba25952ed 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.gradle +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.gradle @@ -101,7 +101,7 @@ ext { swagger_annotations_version = "1.6.3" jackson_version = "2.13.0" jackson_databind_version = "2.13.0" - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" jersey_version = "2.35" junit_version = "4.13.2" diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.sbt b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.sbt index e5074a14e310..90ede61e7a78 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.sbt +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.sbt @@ -20,7 +20,7 @@ lazy val root = (project in file(".")). "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.0" % "compile", "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.0" % "compile", "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.12.5" % "compile", - "org.openapitools" % "jackson-databind-nullable" % "0.2.1" % "compile", + "org.openapitools" % "jackson-databind-nullable" % "0.2.2" % "compile", "com.brsanthu" % "migbase64" % "2.2", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "junit" % "junit" % "4.13.2" % "test", diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/pom.xml b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/pom.xml index dbeb9684fd32..bee91f771940 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/pom.xml +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/pom.xml @@ -342,7 +342,7 @@ 2.35 2.13.0 2.13.0 - 0.2.1 + 0.2.2 2.9.10 1.3.5 4.13.2 diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.gradle b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.gradle index c39ff494aa6d..459364339f38 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.gradle +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.gradle @@ -101,7 +101,7 @@ ext { swagger_annotations_version = "1.6.3" jackson_version = "2.13.0" jackson_databind_version = "2.13.0" - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" jersey_version = "2.35" junit_version = "4.13.2" diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.sbt b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.sbt index 423d4e3b58f7..6cc3961e3039 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.sbt +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.sbt @@ -20,7 +20,7 @@ lazy val root = (project in file(".")). "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.0" % "compile", "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.0" % "compile", "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.0" % "compile", - "org.openapitools" % "jackson-databind-nullable" % "0.2.1" % "compile", + "org.openapitools" % "jackson-databind-nullable" % "0.2.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "junit" % "junit" % "4.13.2" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/pom.xml b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/pom.xml index 8feb1611f5e5..9828623b301e 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/pom.xml +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/pom.xml @@ -337,7 +337,7 @@ 2.35 2.13.0 2.13.0 - 0.2.1 + 0.2.2 1.3.5 4.13.2 2.17.3 diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle b/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle index 6ffa4c5ad7a1..841a3c55eb55 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle +++ b/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle @@ -101,7 +101,7 @@ ext { swagger_annotations_version = "1.6.3" jackson_version = "2.13.0" jackson_databind_version = "2.13.0" - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" jersey_version = "2.35" junit_version = "4.13.2" diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/build.sbt b/samples/openapi3/client/petstore/java/jersey2-java8/build.sbt index a427b720ebd4..a420957d37a8 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/build.sbt +++ b/samples/openapi3/client/petstore/java/jersey2-java8/build.sbt @@ -20,7 +20,7 @@ lazy val root = (project in file(".")). "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.0" % "compile", "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.0" % "compile", "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.0" % "compile", - "org.openapitools" % "jackson-databind-nullable" % "0.2.1" % "compile", + "org.openapitools" % "jackson-databind-nullable" % "0.2.2" % "compile", "com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile", "org.tomitribe" % "tomitribe-http-signatures" % "1.7" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/pom.xml b/samples/openapi3/client/petstore/java/jersey2-java8/pom.xml index 0a3a077b03b6..d088ea0a7aa5 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/pom.xml +++ b/samples/openapi3/client/petstore/java/jersey2-java8/pom.xml @@ -347,7 +347,7 @@ 2.35 2.13.0 2.13.0 - 0.2.1 + 0.2.2 1.3.5 4.13.2 1.7 diff --git a/samples/server/petstore/spring-mvc-j8-async/pom.xml b/samples/server/petstore/spring-mvc-j8-async/pom.xml index 8d2528b1b2a2..75642d4fca41 100644 --- a/samples/server/petstore/spring-mvc-j8-async/pom.xml +++ b/samples/server/petstore/spring-mvc-j8-async/pom.xml @@ -176,7 +176,7 @@ 2.8.4 2.0.2 4.3.20.RELEASE - 0.2.1 + 0.2.2 2.9.8 diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/pom.xml b/samples/server/petstore/spring-mvc-j8-localdatetime/pom.xml index 6155fc3e5125..869d354af92a 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/pom.xml +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/pom.xml @@ -176,7 +176,7 @@ 2.8.4 2.0.2 4.3.20.RELEASE - 0.2.1 + 0.2.2 2.9.8 diff --git a/samples/server/petstore/spring-mvc-spring-pageable/pom.xml b/samples/server/petstore/spring-mvc-spring-pageable/pom.xml index c448133c7981..1407e73ebaf0 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/pom.xml +++ b/samples/server/petstore/spring-mvc-spring-pageable/pom.xml @@ -176,7 +176,7 @@ 2.8.4 2.0.2 4.3.20.RELEASE - 0.2.1 + 0.2.2 2.9.8 diff --git a/samples/server/petstore/spring-mvc/pom.xml b/samples/server/petstore/spring-mvc/pom.xml index c61218492aed..42dc38e182e7 100644 --- a/samples/server/petstore/spring-mvc/pom.xml +++ b/samples/server/petstore/spring-mvc/pom.xml @@ -176,7 +176,7 @@ 2.8.4 2.0.2 4.3.20.RELEASE - 0.2.1 + 0.2.2 2.9.8 From c27ddc67fe309298b2914c946ceb60b576c09a2b Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 15 Dec 2021 22:18:39 +0800 Subject: [PATCH 093/117] show error when schema in discriminator mapping is undefined (#11127) --- .../org/openapitools/codegen/DefaultCodegen.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index 32947d787069..a9780140f4c9 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 @@ -3170,10 +3170,16 @@ protected CodegenDiscriminator createDiscriminator(String schemaName, Schema sch List uniqueDescendants = new ArrayList(); if (sourceDiscriminator.getMapping() != null && !sourceDiscriminator.getMapping().isEmpty()) { for (Entry e : sourceDiscriminator.getMapping().entrySet()) { - String nameOrRef = e.getValue(); - String name = nameOrRef.indexOf('/') >= 0 ? ModelUtils.getSimpleRef(nameOrRef) : nameOrRef; - String modelName = toModelName(name); - uniqueDescendants.add(new MappedModel(e.getKey(), modelName)); + String name; + if (e.getValue().indexOf('/') >= 0) { + name = ModelUtils.getSimpleRef(e.getValue()); + if (ModelUtils.getSchema(openAPI, name) == null) { + LOGGER.error("Failed to lookup the schema '{}' when processing the discriminator mapping of oneOf/anyOf. Please check to ensure it's defined properly.", name); + } + } else { + name = e.getValue(); + } + uniqueDescendants.add(new MappedModel(e.getKey(), toModelName(name))); } } From ebb69147a54866fba800db2de44fa674a5b54a32 Mon Sep 17 00:00:00 2001 From: agilob Date: Fri, 17 Dec 2021 02:11:36 +0000 Subject: [PATCH 094/117] Forbid using standard streams in archunit (#11130) --- .../codegen/languages/DartDioNextClientCodegen.java | 1 - .../java/org/openapitools/codegen/ArchUnitRulesTest.java | 9 +++++++++ .../src/test/resources/archunit_ignore_patterns.txt | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 modules/openapi-generator/src/test/resources/archunit_ignore_patterns.txt diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java index 5f438eb6f8b3..06322152120c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java @@ -430,7 +430,6 @@ private void addBuiltValueSerializerImport(String type) { * @param serializer */ private void addBuiltValueSerializer(BuiltValueSerializer serializer) { - System.out.println("######## Add serializer!"); additionalProperties.compute("builtValueSerializers", (k, v) -> { Set serializers = v == null ? Sets.newHashSet() : ((Set) v); serializers.add(serializer); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/ArchUnitRulesTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/ArchUnitRulesTest.java index 0a9d7a95abf0..fee76d588f6a 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/ArchUnitRulesTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/ArchUnitRulesTest.java @@ -4,6 +4,7 @@ import com.tngtech.archunit.core.domain.JavaModifier; import com.tngtech.archunit.core.importer.ClassFileImporter; import com.tngtech.archunit.lang.ArchRule; +import com.tngtech.archunit.library.GeneralCodingRules; import org.junit.Test; import org.slf4j.Logger; @@ -19,6 +20,14 @@ public void testLoggersAreNotPublicFinalAndNotStatic() { ArchUnitRulesTest.LOGGERS_SHOULD_BE_NOT_PUBLIC_NOT_STATIC_AND_FINAL.check(importedClasses); } + @Test + public void classesNotAllowedToUseStandardStreams() { + final JavaClasses importedClasses = new ClassFileImporter() + .importPackages("org.openapitools.codegen.languages"); + + GeneralCodingRules.NO_CLASSES_SHOULD_ACCESS_STANDARD_STREAMS.check(importedClasses); + } + @Test public void abstractClassesAreAbstract() { final JavaClasses importedClasses = new ClassFileImporter() diff --git a/modules/openapi-generator/src/test/resources/archunit_ignore_patterns.txt b/modules/openapi-generator/src/test/resources/archunit_ignore_patterns.txt new file mode 100644 index 000000000000..e6814b46eb6b --- /dev/null +++ b/modules/openapi-generator/src/test/resources/archunit_ignore_patterns.txt @@ -0,0 +1,2 @@ +# This rule is for ArchUnitRulesTest.classesNotAllowedToUseStandardStreams to ignore method `postProcess()` of CodegenConfig as it contains funding information +.*\.postProcess\(\).* From 9b65513bb1f5ff30a0bf8a51188829b19c62ffb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20=C4=8Cerm=C3=A1k?= Date: Fri, 17 Dec 2021 03:12:11 +0100 Subject: [PATCH 095/117] [Protobuf-Schema] Namespace updates (#11115) * [Protobuf-Schema] Namespace updates * [Protobuf-Schema] Petstore sample updated --- .../codegen/languages/ProtobufSchemaCodegen.java | 16 ++++++++++++---- .../main/resources/protobuf-schema/api.mustache | 2 +- .../resources/protobuf-schema/model.mustache | 2 +- .../test/resources/3_0/protobuf-schema/pet.proto | 2 +- .../protobuf-schema/services/pet_service.proto | 2 +- .../protobuf-schema/services/store_service.proto | 2 +- .../protobuf-schema/services/user_service.proto | 2 +- 7 files changed, 18 insertions(+), 10 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java index d842a935a0fe..777f6fc51690 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java @@ -91,7 +91,7 @@ public ProtobufSchemaCodegen() { apiTemplateFiles.put("api.mustache", ".proto"); embeddedTemplateDir = templateDir = "protobuf-schema"; hideGenerationTimestamp = Boolean.TRUE; - modelPackage = "messages"; + modelPackage = "models"; apiPackage = "services"; defaultIncludes = new HashSet<>( @@ -167,12 +167,20 @@ public void processOpts() { apiDocTemplateFiles.clear(); // TODO: add api doc template modelDocTemplateFiles.clear(); // TODO: add model doc template - modelPackage = "models"; - apiPackage = "services"; - if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) { setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME)); } + else { + additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName); + } + + if (!additionalProperties.containsKey(CodegenConstants.API_PACKAGE)) { + additionalProperties.put(CodegenConstants.API_PACKAGE, apiPackage); + } + + if (!additionalProperties.containsKey(CodegenConstants.MODEL_PACKAGE)) { + additionalProperties.put(CodegenConstants.MODEL_PACKAGE, modelPackage); + } if (additionalProperties.containsKey(this.NUMBERED_FIELD_NUMBER_LIST)) { this.numberedFieldNumberList = convertPropertyToBooleanAndWriteBack(NUMBERED_FIELD_NUMBER_LIST); diff --git a/modules/openapi-generator/src/main/resources/protobuf-schema/api.mustache b/modules/openapi-generator/src/main/resources/protobuf-schema/api.mustache index ccf06f93c6df..dc4ec5e1c392 100644 --- a/modules/openapi-generator/src/main/resources/protobuf-schema/api.mustache +++ b/modules/openapi-generator/src/main/resources/protobuf-schema/api.mustache @@ -1,7 +1,7 @@ {{>partial_header}} syntax = "proto3"; -package {{{packageName}}}; +package {{#lambda.lowercase}}{{{packageName}}}.{{{apiPackage}}}.{{{classname}}};{{/lambda.lowercase}} import "google/protobuf/empty.proto"; {{#imports}} diff --git a/modules/openapi-generator/src/main/resources/protobuf-schema/model.mustache b/modules/openapi-generator/src/main/resources/protobuf-schema/model.mustache index 2a609db9a8d1..2aca6336c955 100644 --- a/modules/openapi-generator/src/main/resources/protobuf-schema/model.mustache +++ b/modules/openapi-generator/src/main/resources/protobuf-schema/model.mustache @@ -1,7 +1,7 @@ {{>partial_header}} syntax = "proto3"; -package {{{packageName}}}; +package {{#lambda.lowercase}}{{{packageName}}};{{/lambda.lowercase}} {{#imports}} {{#import}} diff --git a/modules/openapi-generator/src/test/resources/3_0/protobuf-schema/pet.proto b/modules/openapi-generator/src/test/resources/3_0/protobuf-schema/pet.proto index 7ba4adc282a1..be5371035c98 100644 --- a/modules/openapi-generator/src/test/resources/3_0/protobuf-schema/pet.proto +++ b/modules/openapi-generator/src/test/resources/3_0/protobuf-schema/pet.proto @@ -10,7 +10,7 @@ syntax = "proto3"; -package ; +package openapitools; import public "models/lizard_all_of.proto"; import public "models/snake_all_of.proto"; diff --git a/samples/config/petstore/protobuf-schema/services/pet_service.proto b/samples/config/petstore/protobuf-schema/services/pet_service.proto index 6ac05f1deeb6..ba8b4c18e31c 100644 --- a/samples/config/petstore/protobuf-schema/services/pet_service.proto +++ b/samples/config/petstore/protobuf-schema/services/pet_service.proto @@ -10,7 +10,7 @@ syntax = "proto3"; -package petstore; +package petstore.services.petservice; import "google/protobuf/empty.proto"; import public "models/api_response.proto"; diff --git a/samples/config/petstore/protobuf-schema/services/store_service.proto b/samples/config/petstore/protobuf-schema/services/store_service.proto index e30382ad502a..05ebe84e1f4a 100644 --- a/samples/config/petstore/protobuf-schema/services/store_service.proto +++ b/samples/config/petstore/protobuf-schema/services/store_service.proto @@ -10,7 +10,7 @@ syntax = "proto3"; -package petstore; +package petstore.services.storeservice; import "google/protobuf/empty.proto"; import public "models/order.proto"; diff --git a/samples/config/petstore/protobuf-schema/services/user_service.proto b/samples/config/petstore/protobuf-schema/services/user_service.proto index 8130b04aadd2..119219d6fc8f 100644 --- a/samples/config/petstore/protobuf-schema/services/user_service.proto +++ b/samples/config/petstore/protobuf-schema/services/user_service.proto @@ -10,7 +10,7 @@ syntax = "proto3"; -package petstore; +package petstore.services.userservice; import "google/protobuf/empty.proto"; import public "models/user.proto"; From 2e08c5f403a431490738f32cafec00c7dd55c19f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 17 Dec 2021 10:14:29 +0800 Subject: [PATCH 096/117] Bump actions/download-artifact from 2.0.10 to 2.1.0 (#11066) Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 2.0.10 to 2.1.0. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v2.0.10...v2.1.0) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/check-supported-versions.yaml | 2 +- .github/workflows/openapi-generator.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check-supported-versions.yaml b/.github/workflows/check-supported-versions.yaml index 017b4bdf0ab4..07ad0cbbdf08 100644 --- a/.github/workflows/check-supported-versions.yaml +++ b/.github/workflows/check-supported-versions.yaml @@ -81,7 +81,7 @@ jobs: - name: Check out code uses: actions/checkout@v2 - name: Download build artifact - uses: actions/download-artifact@v2.0.10 + uses: actions/download-artifact@v2.1.0 with: name: artifact - name: Run Ensures Script diff --git a/.github/workflows/openapi-generator.yaml b/.github/workflows/openapi-generator.yaml index b2e477592d48..c75551e26262 100644 --- a/.github/workflows/openapi-generator.yaml +++ b/.github/workflows/openapi-generator.yaml @@ -93,7 +93,7 @@ jobs: java-version: 8 distribution: 'temurin' - name: Download openapi-generator-cli.jar artifact - uses: actions/download-artifact@v2.0.10 + uses: actions/download-artifact@v2.1.0 with: name: openapi-generator-cli.jar path: modules/openapi-generator-cli/target @@ -132,7 +132,7 @@ jobs: java-version: 8 distribution: 'temurin' - name: Download openapi-generator-cli.jar artifact - uses: actions/download-artifact@v2.0.10 + uses: actions/download-artifact@v2.1.0 with: name: openapi-generator-cli.jar path: modules/openapi-generator-cli/target From 94e3ae10fd64aba1baf6b4c5dfa1f0b6d5698057 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 17 Dec 2021 10:14:41 +0800 Subject: [PATCH 097/117] Bump actions/upload-artifact from 2.2.4 to 2.3.1 (#11136) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2.2.4 to 2.3.1. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v2.2.4...v2.3.1) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/check-supported-versions.yaml | 2 +- .github/workflows/openapi-generator.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check-supported-versions.yaml b/.github/workflows/check-supported-versions.yaml index 07ad0cbbdf08..78aba7433a11 100644 --- a/.github/workflows/check-supported-versions.yaml +++ b/.github/workflows/check-supported-versions.yaml @@ -50,7 +50,7 @@ jobs: run: mvn -nsu -B --quiet -Djacoco.skip=true -Dorg.slf4j.simpleLogger.defaultLogLevel=error --no-transfer-progress clean install --file pom.xml ${{ matrix.flags }} - name: Upload Maven build artifact - uses: actions/upload-artifact@v2.2.4 + uses: actions/upload-artifact@v2.3.1 if: matrix.java == '8' && matrix.os == 'ubuntu-latest' with: name: artifact diff --git a/.github/workflows/openapi-generator.yaml b/.github/workflows/openapi-generator.yaml index c75551e26262..b7d6f0fedb9b 100644 --- a/.github/workflows/openapi-generator.yaml +++ b/.github/workflows/openapi-generator.yaml @@ -39,7 +39,7 @@ jobs: run: mvn --no-snapshot-updates --batch-mode --quiet install -DskipTests -Dorg.slf4j.simpleLogger.defaultLogLevel=error - run: ls -la modules/openapi-generator-cli/target - name: Upload openapi-generator-cli.jar artifact - uses: actions/upload-artifact@v2.2.4 + uses: actions/upload-artifact@v2.3.1 with: name: openapi-generator-cli.jar path: modules/openapi-generator-cli/target/openapi-generator-cli.jar @@ -75,7 +75,7 @@ jobs: run: mvn --no-snapshot-updates --batch-mode --quiet --fail-at-end test -Dorg.slf4j.simpleLogger.defaultLogLevel=error - name: Publish unit test reports if: ${{ always() }} - uses: actions/upload-artifact@v2.2.4 + uses: actions/upload-artifact@v2.3.1 with: name: surefire-test-results path: '**/surefire-reports/TEST-*.xml' From fedc54af9a2995df1e76bedf85122d548e78a1d9 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Fri, 17 Dec 2021 03:18:10 +0100 Subject: [PATCH 098/117] [K6 Generator] various enhancements (request body example data extraction, support for generating scenario tests and load tests out of the box, and much more) (#11106) * Further K6 OpenAPI generator enhancements * request body example data extraction * request grouping and ordering * response visibility * request data extraction for chaining requests Signed-off-by: Michael H. Siemaszko * Further K6 OpenAPI generator enhancements - regenerated samples Signed-off-by: Michael H. Siemaszko * Fix suggested changes by linter * Fix extra spaces in the template * Log exception * Rename function signature to camelCase * Address comments on Big-O * Move declaration of variable near the usage * Add config file for generating k6 script * Regenerate k6 script * Regenerate samples * Fix predicate * Fix missing import Co-authored-by: Michael H. Siemaszko --- bin/configs/k6.yaml | 6 + modules/openapi-generator/pom.xml | 5 + .../codegen/CodegenOperation.java | 35 +- .../codegen/languages/K6ClientCodegen.java | 494 +++++++++++-- .../src/main/resources/k6/script.mustache | 80 +-- pom.xml | 1 + .../petstore/k6/.openapi-generator/FILES | 2 + .../petstore/k6/.openapi-generator/VERSION | 2 +- samples/client/petstore/k6/script.js | 656 ++++++++++++++---- 9 files changed, 1044 insertions(+), 237 deletions(-) create mode 100644 bin/configs/k6.yaml create mode 100644 samples/client/petstore/k6/.openapi-generator/FILES diff --git a/bin/configs/k6.yaml b/bin/configs/k6.yaml new file mode 100644 index 000000000000..9933744e3149 --- /dev/null +++ b/bin/configs/k6.yaml @@ -0,0 +1,6 @@ +generatorName: k6 +outputDir: samples/client/petstore/k6 +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/k6 +additionalProperties: + appName: PetstoreClient diff --git a/modules/openapi-generator/pom.xml b/modules/openapi-generator/pom.xml index ada2ac46d9e7..7fbb9f96c3ab 100644 --- a/modules/openapi-generator/pom.xml +++ b/modules/openapi-generator/pom.xml @@ -297,6 +297,11 @@ commons-lang3 ${commons-lang.version} + + org.apache.commons + commons-text + ${commons-text.version} + commons-cli commons-cli diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java index 83413a9ee11e..ca0cca500cd3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java @@ -66,7 +66,11 @@ public class CodegenOperation { * * @return true if parameter exists, false otherwise */ - private static boolean nonempty(List params) { + private static boolean nonEmpty(List params) { + return params != null && params.size() > 0; + } + + private static boolean nonEmpty(Map params) { return params != null && params.size() > 0; } @@ -76,7 +80,7 @@ private static boolean nonempty(List params) { * @return true if body parameter exists, false otherwise */ public boolean getHasBodyParam() { - return nonempty(bodyParams); + return nonEmpty(bodyParams); } /** @@ -85,7 +89,7 @@ public boolean getHasBodyParam() { * @return true if query parameter exists, false otherwise */ public boolean getHasQueryParams() { - return nonempty(queryParams); + return nonEmpty(queryParams); } /** @@ -103,7 +107,7 @@ public boolean getHasQueryParamsOrAuth() { * @return true if header parameter exists, false otherwise */ public boolean getHasHeaderParams() { - return nonempty(headerParams); + return nonEmpty(headerParams); } /** @@ -112,7 +116,7 @@ public boolean getHasHeaderParams() { * @return true if path parameter exists, false otherwise */ public boolean getHasPathParams() { - return nonempty(pathParams); + return nonEmpty(pathParams); } /** @@ -121,7 +125,7 @@ public boolean getHasPathParams() { * @return true if any form parameter exists, false otherwise */ public boolean getHasFormParams() { - return nonempty(formParams); + return nonEmpty(formParams); } /** @@ -139,7 +143,7 @@ public boolean getHasBodyOrFormParams() { * @return true if any cookie parameter exists, false otherwise */ public boolean getHasCookieParams() { - return nonempty(cookieParams); + return nonEmpty(cookieParams); } /** @@ -148,7 +152,7 @@ public boolean getHasCookieParams() { * @return true if any optional parameter exists, false otherwise */ public boolean getHasOptionalParams() { - return nonempty(optionalParams); + return nonEmpty(optionalParams); } /** @@ -157,7 +161,7 @@ public boolean getHasOptionalParams() { * @return true if any optional parameter exists, false otherwise */ public boolean getHasRequiredParams() { - return nonempty(requiredParams); + return nonEmpty(requiredParams); } /** @@ -166,7 +170,7 @@ public boolean getHasRequiredParams() { * @return true if header response exists, false otherwise */ public boolean getHasResponseHeaders() { - return nonempty(responseHeaders); + return nonEmpty(responseHeaders); } /** @@ -175,7 +179,7 @@ public boolean getHasResponseHeaders() { * @return true if examples parameter exists, false otherwise */ public boolean getHasExamples() { - return nonempty(examples); + return nonEmpty(examples); } /** @@ -187,6 +191,15 @@ public boolean getHasDefaultResponse() { return responses.stream().filter(response -> response.isDefault).findFirst().isPresent(); } + /** + * Check if there's at least one vendor extension + * + * @return true if vendor extensions exists, false otherwise + */ + public boolean getHasVendorExtensions() { + return nonEmpty(vendorExtensions); + } + /** * Check if act as Restful index method * diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/K6ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/K6ClientCodegen.java index bf3cf05c81ef..681594ea8eb4 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/K6ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/K6ClientCodegen.java @@ -28,22 +28,28 @@ import java.util.Collection; import java.util.HashMap; import java.util.HashSet; +import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Objects; +import java.util.Optional; +import java.util.OptionalInt; import java.util.Set; +import java.util.TreeMap; import java.util.TreeSet; +import java.util.Map.Entry; import java.util.stream.Collectors; import javax.annotation.Nullable; import com.google.common.collect.ImmutableMap; -import org.apache.commons.lang3.StringEscapeUtils; +import org.apache.commons.text.StringEscapeUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.CodegenModel; +import org.openapitools.codegen.CodegenOperation; import org.openapitools.codegen.CodegenParameter; import org.openapitools.codegen.CodegenProperty; import org.openapitools.codegen.CodegenResponse; @@ -56,10 +62,13 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Mustache.Lambda; import com.samskivert.mustache.Template; +import io.swagger.v3.core.util.Json; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.PathItem; @@ -73,6 +82,24 @@ public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig { + // K6 vendor extension - operation grouping - group operations and define their + // ordering, to allow for e.g. scenario testing + private static final String X_OPERATION_GROUPING = "x-k6-openapi-operation-grouping"; + + // K6 vendor extension - operation response - for now, allows to hide given + // operation response, so that in case of multiple 2xx responses, generated + // script checks only against e.g. code 200 responses + private static final String X_OPERATION_RESPONSE = "x-k6-openapi-operation-response"; + private static final String X_OPERATION_RESPONSE_HIDE = "hide"; + + // K6 vendor extension - extract data from operation - allows to specify path to + // value in body of response which should be extracted and assigned to variable + // for later use by other operations + private static final String X_OPERATION_DATAEXTRACT = "x-k6-openapi-operation-dataextract"; + private static final String X_OPERATION_DATAEXTRACT_OPERATION_ID = "operationId"; // denotes ID of operation whose response body contains value to be extracted + private static final String X_OPERATION_DATAEXTRACT_VALUE_PATH = "valuePath"; // denotes path to value in body of response which should be extracted + private static final String X_OPERATION_DATAEXTRACT_PARAMETER_NAME = "parameterName"; // denotes name of parameter to which extracted value should be assigned + public K6ClientCodegen() { super(); @@ -86,6 +113,7 @@ static class Parameter { String key; Object value; boolean hasExample; + boolean initialize; public Parameter(String key, Object value) { this.key = key; @@ -98,6 +126,11 @@ public Parameter(String key, Object exampleValue, boolean hasExample) { this.hasExample = hasExample; } + public Parameter(String key, boolean initialize) { + this.key = key; + this.initialize = initialize; + } + @Override public int hashCode() { return key.hashCode(); @@ -110,10 +143,35 @@ public boolean equals(Object obj) { if (obj == null || getClass() != obj.getClass()) return false; Parameter p = (Parameter) obj; - return key.equals(p.key) && value.equals(p.value) && hasExample == p.hasExample; + return key.equals(p.key) && value.equals(p.value) && hasExample == p.hasExample + && initialize == p.initialize; } } - + + // Stores information specified in `X_OPERATION_GROUPING` K6 vendor extension + static class OperationGrouping { + String groupName; + int order; + + public OperationGrouping(String groupName, int order) { + this.groupName = groupName; + this.order = order; + } + } + + // Stores information specified in `X_OPERATION_DATAEXTRACT` K6 vendor extension + static class DataExtractSubstituteParameter { + String operationId; + String valuePath; + String paramName; + + public DataExtractSubstituteParameter(String operationId, String valuePath, String paramName) { + this.operationId = operationId; + this.valuePath = valuePath; + this.paramName = paramName; + } + } + static class ParameterValueLambda implements Mustache.Lambda { private static final String NO_EXAMPLE_PARAM_VALUE_PREFIX = "TODO_EDIT_THE_"; @@ -123,7 +181,7 @@ public void execute(Template.Fragment fragment, Writer writer) throws IOExceptio // default used if no example is provided String noExampleParamValue = String.join("", quoteExample( - String.join("", NO_EXAMPLE_PARAM_VALUE_PREFIX, fragment.execute())), + String.join("", NO_EXAMPLE_PARAM_VALUE_PREFIX, fragment.execute())), ";", " // specify value as there is no example value for this parameter in OpenAPI spec"); @@ -138,10 +196,10 @@ public void execute(Template.Fragment fragment, Writer writer) throws IOExceptio @SuppressWarnings("unchecked") Set exampleValues = ((Map) rawValue).values().stream() - .map(x -> quoteExample( - StringEscapeUtils.escapeEcmaScript( - String.valueOf(x.getValue())))) - .collect(Collectors.toCollection(() -> new TreeSet<>())); + .map(x -> quoteExample( + StringEscapeUtils.escapeEcmaScript( + String.valueOf(x.getValue())))) + .collect(Collectors.toCollection(TreeSet::new)); if (!exampleValues.isEmpty()) { @@ -160,11 +218,20 @@ public void execute(Template.Fragment fragment, Writer writer) throws IOExceptio quoteExample( StringEscapeUtils.escapeEcmaScript( String.valueOf( - ((K6ClientCodegen.Parameter) fragment.context()).value))), + ((K6ClientCodegen.Parameter) fragment.context()).value))), ";", " // extracted from 'example' field defined at the parameter level of OpenAPI spec")); } + // param needs to be initialized for subsequent data extraction - see `X_OPERATION_DATAEXTRACT` K6 vendor extension + } else if (fragment.context() instanceof K6ClientCodegen.Parameter + && ((K6ClientCodegen.Parameter) fragment.context()).initialize) { + + writer.write(String.join("", + "null", + ";", + " // parameter initialized for subsequent data extraction")); + } else { writer.write(noExampleParamValue); } @@ -231,25 +298,33 @@ public k6Check(Integer status, String description) { static class HTTPRequest { String method; + boolean isDelete; String path; @Nullable List query; @Nullable HTTPBody body; + boolean hasBodyExample; @Nullable HTTPParameters params; @Nullable List k6Checks; + @Nullable + DataExtractSubstituteParameter dataExtract; public HTTPRequest(String method, String path, @Nullable List query, @Nullable HTTPBody body, - @Nullable HTTPParameters params, @Nullable List k6Checks) { + boolean hasBodyExample, @Nullable HTTPParameters params, @Nullable List k6Checks, + DataExtractSubstituteParameter dataExtract) { // NOTE: https://k6.io/docs/javascript-api/k6-http/del-url-body-params this.method = method.equals("delete") ? "del" : method; + this.isDelete = method.equals("delete"); this.path = path; this.query = query; this.body = body; + this.hasBodyExample = hasBodyExample; this.params = params; this.k6Checks = k6Checks; + this.dataExtract = dataExtract; } } @@ -257,11 +332,26 @@ static public class HTTPRequestGroup { String groupName; Set variables; // query and path parameters List requests; + private final Map requestsMap; - public HTTPRequestGroup(String groupName, Set variables, List requests) { + public HTTPRequestGroup(String groupName, Set variables, Map requestsMap) { this.groupName = groupName; this.variables = variables; - this.requests = requests; + this.requestsMap = requestsMap; + this.requests = sortRequests(requestsMap); + } + + private void addRequests(Map moreRequests) { + this.requestsMap.putAll(moreRequests); + this.requests = sortRequests(this.requestsMap); + } + + private void addVariables(Set moreVariables) { + this.variables.addAll(moreVariables); + } + + private List sortRequests(Map requestsMap) { + return new ArrayList<>(new TreeMap<>(requestsMap).values()); } } @@ -398,14 +488,21 @@ public void preprocessOpenAPI(OpenAPI openAPI) { } additionalProperties.put(BASE_URL, baseURL); - List requestGroups = new ArrayList<>(); + // if data is to be extracted from any of the operations' responses, this has to + // be known prior to executing processing of OpenAPI spec further down + Map dataExtractSubstituteParams = getDataExtractSubstituteParameters( + openAPI); + + Map requestGroups = new HashMap<>(); Set extraParameters = new HashSet<>(); Map> pathVariables = new HashMap<>(); for (String path : openAPI.getPaths().keySet()) { - List requests = new ArrayList<>(); + Map requests = new HashMap<>(); Set variables = new HashSet<>(); + String groupName = path; + for (Map.Entry methodOperation : openAPI.getPaths().get(path). readOperationsMap().entrySet()) { List httpParams = new ArrayList<>(); @@ -416,11 +513,32 @@ public void preprocessOpenAPI(OpenAPI openAPI) { final Operation operation = methodOperation.getValue(); final PathItem.HttpMethod method = methodOperation.getKey(); + OptionalInt operationGroupingOrder = OptionalInt.empty(); + + String operationId = operation.getOperationId(); + + boolean hasRequestBodyExample = false; + + // optionally group and order operations - see `X_OPERATION_GROUPING` K6 vendor + // extension + final CodegenOperation cgOperation = super.fromOperation(path, method.name(), operation, null); + Optional operationGrouping = extractOperationGrouping(cgOperation); + if (operationGrouping.isPresent()) { + groupName = operationGrouping.get().groupName; + operationGroupingOrder = OptionalInt.of(operationGrouping.get().order); + } for (Map.Entry resp : operation.getResponses().entrySet()) { String statusData = resp.getKey().equals("default") ? "200" : resp.getKey(); + + // optionally hide given response - see `X_OPERATION_RESPONSE` K6 vendor + // extension + // i.e. in case of multiple 2xx responses, generated script checks only against + // e.g. code 200 responses + boolean hideOperationResponse = shouldHideOperationResponse(resp.getValue()); + int status = Integer.parseInt(statusData); - if (status >= 200 && status < 300) { + if (!hideOperationResponse && (status >= 200 && status < 300)) { k6Checks.add(new k6Check(status, resp.getValue().getDescription())); } } @@ -428,7 +546,7 @@ public void preprocessOpenAPI(OpenAPI openAPI) { if (hasBodyParameter(openAPI, operation) || hasFormParameter(openAPI, operation)) { String defaultContentType = hasFormParameter(openAPI, operation) ? "application/x-www-form-urlencoded" : "application/json"; List consumes = new ArrayList<>(getConsumesInfo(openAPI, operation)); - String contentTypeValue = consumes == null || consumes.isEmpty() ? defaultContentType : consumes.get(0); + String contentTypeValue = consumes.isEmpty() ? defaultContentType : consumes.get(0); if (contentTypeValue.equals("*/*")) contentTypeValue = "application/json"; Parameter contentType = new Parameter("Content-Type", getDoubleQuotedString(contentTypeValue)); @@ -436,6 +554,12 @@ public void preprocessOpenAPI(OpenAPI openAPI) { RequestBody requestBody = ModelUtils.getReferencedRequestBody(openAPI, operation.getRequestBody()); + // extract request body example, if present + hasRequestBodyExample = hasRequestBodyExample(requestBody, contentTypeValue); + if (hasRequestBodyExample) { + extractRequestBodyExample(requestBody, contentTypeValue, bodyOrFormParams); + } + for (Map.Entry responseEntry : operation.getResponses().entrySet()) { CodegenResponse r = fromResponse(responseEntry.getKey(), responseEntry.getValue()); if (r.baseType != null && @@ -445,30 +569,34 @@ public void preprocessOpenAPI(OpenAPI openAPI) { } } - List formParameters = fromRequestBodyToFormParameters(requestBody, imports); - for (CodegenParameter parameter : formParameters) { - String reference = ""; - if (parameter.isModel) { - Schema nestedSchema = ModelUtils.getSchema(openAPI, parameter.baseType); - CodegenModel model = fromModel(parameter.paramName, nestedSchema); - reference = generateNestedModelTemplate(model); - if (parameter.dataType.equals("List")) { - reference = "[" + reference + "]"; + // if we have at least one request body example, we do not need to construct these dummies + if (!hasRequestBodyExample) { + List formParameters = fromRequestBodyToFormParameters(requestBody, imports); + for (CodegenParameter parameter : formParameters) { + String reference = ""; + if (parameter.isModel) { + Schema nestedSchema = ModelUtils.getSchema(openAPI, parameter.baseType); + CodegenModel model = fromModel(parameter.paramName, nestedSchema); + reference = generateNestedModelTemplate(model); + if (parameter.dataType.equals("List")) { + reference = "[" + reference + "]"; + } } - } - Parameter k6Parameter; - if (parameter.dataType.equals("File")) { - k6Parameter = new Parameter(parameter.paramName, - "http.file(open(\"/path/to/file.bin\", \"b\"), \"test.bin\")"); - } else { - k6Parameter = new Parameter(parameter.paramName, !reference.isEmpty() ? reference - : getDoubleQuotedString(parameter.dataType.toLowerCase(Locale.ROOT))); - } + Parameter k6Parameter; + if (parameter.dataType.equals("File")) { + k6Parameter = new Parameter(parameter.paramName, + "http.file(open(\"/path/to/file.bin\", \"b\"), \"test.bin\")"); + } else { + k6Parameter = new Parameter(parameter.paramName, !reference.isEmpty() ? reference + : getDoubleQuotedString(parameter.dataType.toLowerCase(Locale.ROOT))); + } - bodyOrFormParams.add(k6Parameter); + bodyOrFormParams.add(k6Parameter); + } } } + String accepts = getAccept(openAPI, operation); String responseType = getDoubleQuotedString(accepts); @@ -507,32 +635,46 @@ public void preprocessOpenAPI(OpenAPI openAPI) { } } } catch (NullPointerException e) { - + LOGGER.error(e.getMessage(), e); } - pathVariables.put(path, variables); + pathVariables.put(groupName, variables); final HTTPParameters params = new HTTPParameters(null, null, httpParams, null, null, null, null, null, responseType.length() > 0 ? responseType : null); assert params.headers != null; - requests.add(new HTTPRequest(method.toString().toLowerCase(Locale.ROOT), path, + + // check if data needs to be extracted from response of this operation + Optional dataExtract = getDataExtractSubstituteParameter( + dataExtractSubstituteParams, operationId); + + // calculate order for this current request + Integer requestOrder = calculateRequestOrder(operationGroupingOrder, requests.size()); + + requests.put(requestOrder, new HTTPRequest(method.toString().toLowerCase(Locale.ROOT), path, queryParams.size() > 0 ? queryParams : null, - bodyOrFormParams.size() > 0 ? new HTTPBody(bodyOrFormParams) : null, - params.headers.size() > 0 ? params : null, k6Checks.size() > 0 ? k6Checks : null)); + bodyOrFormParams.size() > 0 ? new HTTPBody(bodyOrFormParams) : null, hasRequestBodyExample, + params.headers.size() > 0 ? params : null, k6Checks.size() > 0 ? k6Checks : null, + dataExtract.orElse(null))); } - requestGroups.add(new HTTPRequestGroup(path, pathVariables.get(path), requests)); + + addOrUpdateRequestGroup(requestGroups, groupName, pathVariables.get(groupName), requests); } - for (HTTPRequestGroup requestGroup : requestGroups) { + for (HTTPRequestGroup requestGroup : requestGroups.values()) { for (HTTPRequest request : requestGroup.requests) { if (request.path.contains("/{")) { request.path = request.path.replace("/{", "/${"); } } + + // any variables not defined yet but used for subsequent data extraction must be + // initialized + initializeDataExtractSubstituteParameters(dataExtractSubstituteParams, requestGroup); } - additionalProperties.put("requestGroups", requestGroups); + additionalProperties.put("requestGroups", requestGroups.values()); additionalProperties.put("extra", extraParameters); for (String[] supportingTemplateFile : JAVASCRIPT_SUPPORTING_FILES) { @@ -744,9 +886,273 @@ private static String getAccept(OpenAPI openAPI, Operation operation) { return accepts; } - + @Override protected ImmutableMap.Builder addMustacheLambdas() { return super.addMustacheLambdas().put("handleParamValue", new ParameterValueLambda()); } + + /** + * We're iterating over paths but grouping requests across paths, therefore + * these need to be aggregated. + * + * @param requestGroups + * @param groupName + * @param variables + * @param requests + */ + private void addOrUpdateRequestGroup(Map requestGroups, String groupName, + Set variables, Map requests) { + if (requestGroups.containsKey(groupName)) { + HTTPRequestGroup existingHTTPRequestGroup = requestGroups.get(groupName); + existingHTTPRequestGroup.addRequests(requests); + existingHTTPRequestGroup.addVariables(variables); + } else { + requestGroups.put(groupName, new HTTPRequestGroup(groupName, variables, requests)); + } + } + + /** + * If `X_OPERATION_DATAEXTRACT` K6 vendor extension is present, extract info + * from it. + * + * @param openAPI + * @return + */ + private Map getDataExtractSubstituteParameters(OpenAPI openAPI) { + Map dataExtractSubstituteParams = new HashMap<>(); + + for (String path : openAPI.getPaths().keySet()) { + for (Map.Entry methodOperation : openAPI.getPaths().get(path) + .readOperationsMap().entrySet()) { + + final PathItem.HttpMethod method = methodOperation.getKey(); + final Operation operation = methodOperation.getValue(); + final CodegenOperation cgOperation = super.fromOperation(path, method.name(), operation, null); + + if (cgOperation.getHasVendorExtensions() + && cgOperation.vendorExtensions.containsKey(X_OPERATION_DATAEXTRACT) + && cgOperation.vendorExtensions.get(X_OPERATION_DATAEXTRACT) instanceof java.util.Map) { + + Optional dataExtractSubstituteParameter = getDataExtractSubstituteParameter( + (Map) cgOperation.vendorExtensions.get(X_OPERATION_DATAEXTRACT)); + + // TODO: add support for extracting data for multiple params + dataExtractSubstituteParameter.ifPresent(extractSubstituteParameter -> dataExtractSubstituteParams.put(extractSubstituteParameter.operationId, + extractSubstituteParameter)); + } + + } + } + + return dataExtractSubstituteParams; + } + + /** + * Optionally, retrieve information specified in the `X_OPERATION_DATAEXTRACT` + * K6 vendor extension + * + * @param xOperationDataExtractProperties + * @return optional as only returned if all required info is present + */ + private Optional getDataExtractSubstituteParameter( + Map xOperationDataExtractProperties) { + + Optional operationId = Optional.empty(); + Optional valuePath = Optional.empty(); + Optional parameterName = Optional.empty(); + + for (Map.Entry xOperationDataExtractPropertiesEntry : xOperationDataExtractProperties.entrySet()) { + + switch (String.valueOf(xOperationDataExtractPropertiesEntry.getKey())) { + case X_OPERATION_DATAEXTRACT_OPERATION_ID: + operationId = Optional.of(String.valueOf(xOperationDataExtractPropertiesEntry.getValue())); + continue; + + case X_OPERATION_DATAEXTRACT_VALUE_PATH: + valuePath = Optional.of(String.valueOf(xOperationDataExtractPropertiesEntry.getValue())); + continue; + + case X_OPERATION_DATAEXTRACT_PARAMETER_NAME: + parameterName = Optional.of(String.valueOf(xOperationDataExtractPropertiesEntry.getValue())); + } + } + + if (operationId.isPresent() && valuePath.isPresent() && parameterName.isPresent()) { + return Optional + .of(new DataExtractSubstituteParameter(operationId.get(), valuePath.get(), parameterName.get())); + + } else { + return Optional.empty(); + } + } + + /** + * Optionally, retrieve data extraction properties for given operation + * + * @param dataExtractSubstituteParams + * @param operationId + * @return optional as only returned if present for given operation + */ + private Optional getDataExtractSubstituteParameter( + Map dataExtractSubstituteParams, String operationId) { + + return (!dataExtractSubstituteParams.isEmpty() && dataExtractSubstituteParams.containsKey(operationId)) + ? Optional.of(dataExtractSubstituteParams.get(operationId)) + : Optional.empty(); + } + + /** + * Optionally, retrieve information specified in the `X_OPERATION_GROUPING` K6 + * vendor extension + * + * @param cgOperation + * @return optional as only returned if required info is present + */ + private Optional extractOperationGrouping(CodegenOperation cgOperation) { + Optional operationGrouping = Optional.empty(); + + if (cgOperation.getHasVendorExtensions() && cgOperation.vendorExtensions.containsKey(X_OPERATION_GROUPING) + && cgOperation.vendorExtensions.get(X_OPERATION_GROUPING) instanceof java.util.Map) { + + Map.Entry operationGroupingEntry = ((Map) cgOperation.vendorExtensions + .get(X_OPERATION_GROUPING)).entrySet().stream().findFirst().get(); + + return Optional.of(new OperationGrouping(String.valueOf(operationGroupingEntry.getKey()), + Integer.parseInt(String.valueOf(operationGroupingEntry.getValue())))); + } + + return operationGrouping; + } + + /** + * If `X_OPERATION_RESPONSE` K6 vendor extension is present, check if given + * operation response should be hidden. + * + * @param resp + * @return true if should be hidden, false otherwise + */ + private boolean shouldHideOperationResponse(ApiResponse resp) { + boolean hideOperationResponse = false; + + if (Objects.nonNull(resp.getExtensions()) && !resp.getExtensions().isEmpty() + && resp.getExtensions().containsKey(X_OPERATION_RESPONSE)) { + + Map respExtensions = (Map) resp.getExtensions().get(X_OPERATION_RESPONSE); + Entry entry = respExtensions.entrySet().stream().findFirst().orElse(null); + + if (entry.getKey().equals(X_OPERATION_RESPONSE_HIDE)) { + return Boolean.parseBoolean(String.valueOf(entry.getValue())); + } + } + + return false; + } + + /** + * Check if example is present for given request body and content type. + * + * @param requestBody + * @param contentTypeValue + * @return true if present, false otherwise + */ + private boolean hasRequestBodyExample(RequestBody requestBody, String contentTypeValue) { + return (Objects.nonNull(requestBody.getContent()) && requestBody.getContent().containsKey(contentTypeValue) + && Objects.nonNull(requestBody.getContent().get(contentTypeValue).getExamples()) + && !requestBody.getContent().get(contentTypeValue).getExamples().isEmpty()); + } + + /** + * Extract example for given request body. + * + * @param requestBody + * @param contentTypeValue + * @param bodyOrFormParams + */ + private void extractRequestBodyExample(RequestBody requestBody, String contentTypeValue, + List bodyOrFormParams) { + + Optional> requestBodyExampleEntry = requestBody.getContent().get(contentTypeValue) + .getExamples().entrySet().stream().findFirst(); + + if (requestBodyExampleEntry.isPresent()) { + + Example requestBodyExample = requestBodyExampleEntry.get().getValue(); + + try { + JsonNode requestBodyExampleValueJsonNode = Json.mapper() + .readTree(String.valueOf(requestBodyExample.getValue())); + + Iterator> fields = requestBodyExampleValueJsonNode.fields(); + while (fields.hasNext()) { + Map.Entry fieldsEntry = fields.next(); + + JsonNode exampleValueAsJsonNode = fieldsEntry.getValue(); + + Parameter k6Parameter = new Parameter(fieldsEntry.getKey(), + exampleValueAsJsonNode.isNumber() ? exampleValueAsJsonNode.asText() + : exampleValueAsJsonNode.toString()); + + bodyOrFormParams.add(k6Parameter); + } + + } catch (JsonProcessingException e) { + LOGGER.error(e.getMessage(), e); + } + } + } + + /** + * Calculate order for this current request + * + * @param operationGroupingOrder + * @param requestsSize + * @return request order + */ + private Integer calculateRequestOrder(OptionalInt operationGroupingOrder, int requestsSize) { + int requestOrder; + + if (operationGroupingOrder.isPresent()) { + requestOrder = operationGroupingOrder.getAsInt() - 1; + + } else { + switch (requestsSize) { + case 0: + case 1: + requestOrder = requestsSize; + break; + + default: + requestOrder = (requestsSize - 1); + break; + } + } + + return requestOrder; + } + + // + /** + * Any variables not defined yet but used for subsequent data extraction must be + * initialized + * + * @param dataExtractSubstituteParams + * @param requestGroup + */ + private void initializeDataExtractSubstituteParameters( + Map dataExtractSubstituteParams, HTTPRequestGroup requestGroup) { + + if (!dataExtractSubstituteParams.isEmpty()) { + Set existingVariablesNames = requestGroup.variables.stream().map(v -> v.key) + .collect(Collectors.toSet()); + + Set initializeVariables = dataExtractSubstituteParams.values().stream() + .filter(p -> !existingVariablesNames.contains(toVarName(p.paramName))).collect(Collectors.toSet()); + + for (DataExtractSubstituteParameter initializeVariable : initializeVariables) { + requestGroup.variables.add(new Parameter(toVarName(initializeVariable.paramName), true)); + } + } + } + } diff --git a/modules/openapi-generator/src/main/resources/k6/script.mustache b/modules/openapi-generator/src/main/resources/k6/script.mustache index cac3381de01f..ed5269a4fec8 100644 --- a/modules/openapi-generator/src/main/resources/k6/script.mustache +++ b/modules/openapi-generator/src/main/resources/k6/script.mustache @@ -19,48 +19,50 @@ export default function() { let {{{key}}} = {{#lambda.handleParamValue}}{{value}}{{/lambda.handleParamValue}} {{/variables}} {{#requests}} - {{#-first}} - let url = BASE_URL + `{{{path}}}{{=<% %>=}}<%#query%><%#-first%>?<%/-first%><%& key%>=<%& value%><%^-last%>&<%/-last%><%/query%><%={{ }}=%>`; - // Request No. {{-index}} - {{#body}} - // TODO: edit the parameters of the request body. - let body = {{#body}}{{=<% %>=}}{<%#parameters%>"<%& key%>": <%& value%><%^-last%>, <%/-last%><%/parameters%>}<%={{ }}=%>{{/body}}; - {{/body}} - {{#params}} - let params = {{#params}}{{=<% %>=}}{headers: {<%# headers%>"<%& key%>": <%& value%><%^-last%>, <%/-last%><%/headers%><%#responseType%>, "Accept": <%& responseType%><%/responseType%>}<%# auth%>, auth: "<%& auth%>"<%/auth%>}<%={{ }}=%>{{/params}}; - {{/params}} - let request = http.{{method}}(url{{#body}}, body{{/body}}{{#params}}, params{{/params}}); - {{#k6Checks}} - {{=<% %>=}} - check(request, { - "<%& description%>": (r) => r.status === <%& status%> - }); - <%={{ }}=%> - {{/k6Checks}} - {{/-first}} - {{^-first}} + // Request No. {{-index}} - {{#body}} - // TODO: edit the parameters of the request body. - body = {{#body}}{{=<% %>=}}{<%#parameters%>"<%& key%>": <%& value%><%^-last%>, <%/-last%><%/parameters%>}<%={{ }}=%>{{/body}}; - {{/body}} - {{#params}} - params = {{#params}}{{=<% %>=}}{headers: {<%# headers%>"<%& key%>": <%& value%><%^-last%>, <%/-last%><%/headers%>}<%# auth%>, auth: "<%& auth%>"<%/auth%>}<%={{ }}=%>{{/params}}; - {{/params}} - request = http.{{method}}(url{{#body}}, body{{/body}}{{#params}}, params{{/params}}); - {{#k6Checks}} - {{=<% %>=}} - check(request, { - "<%& description%>": (r) => r.status === <%& status%> - }); - <%={{ }}=%> - {{/k6Checks}} - {{/-first}} - sleep(SLEEP_DURATION); - {{^-last}} + { + let url = BASE_URL + `{{{path}}}{{=<% %>=}}<%#query%><%#-first%>?<%/-first%><%& key%>=<%& value%><%^-last%>&<%/-last%><%/query%><%={{ }}=%>`; + {{#body}} + {{^hasBodyExample}} + // TODO: edit the parameters of the request body. + {{/hasBodyExample}} + let body = {{#body}}{{=<% %>=}}{<%#parameters%>"<%& key%>": <%& value%><%^-last%>, <%/-last%><%/parameters%>}<%={{ }}=%>{{/body}}; + {{/body}} + {{#params}} + let params = {{#params}}{{=<% %>=}}{headers: {<%# headers%>"<%& key%>": <%& value%><%^-last%>, <%/-last%><%/headers%><%#responseType%>, "Accept": <%& responseType%><%/responseType%>}<%# auth%>, auth: "<%& auth%>"<%/auth%>}<%={{ }}=%>{{/params}}; + {{/params}} + {{#isDelete}} + {{#params}} + // this is a DELETE method request - if params are also set, empty body must be passed + let request = http.{{method}}(url, {} {{#params}}, params{{/params}}); + {{/params}} + {{^params}} + let request = http.{{method}}(url); + {{/params}} + {{/isDelete}} + {{^isDelete}} + let request = http.{{method}}(url{{#body}}, JSON.stringify(body){{/body}}{{#params}}, params{{/params}}); + {{/isDelete}} + + {{#k6Checks}} + {{=<% %>=}} + check(request, { + "<%& description%>": (r) => r.status === <%& status%> + }); + <%={{ }}=%> + {{/k6Checks}} + {{#dataExtract}} - {{/-last}} + {{{paramName}}} = JSON.parse(request.body).{{{valuePath}}}; // extract data for subsequent use + {{/dataExtract}} + {{^-last}} + + sleep(SLEEP_DURATION); + {{/-last}} + } {{/requests}} }); + {{/requestGroups}} } diff --git a/pom.xml b/pom.xml index 999440c675f2..c96acc02e490 100644 --- a/pom.xml +++ b/pom.xml @@ -1545,6 +1545,7 @@ 1.4 2.11.0 3.12.0 + 1.9 1.3.0 1.0.2 4.9.10 diff --git a/samples/client/petstore/k6/.openapi-generator/FILES b/samples/client/petstore/k6/.openapi-generator/FILES new file mode 100644 index 000000000000..343cd1bd1f83 --- /dev/null +++ b/samples/client/petstore/k6/.openapi-generator/FILES @@ -0,0 +1,2 @@ +README.md +script.js diff --git a/samples/client/petstore/k6/.openapi-generator/VERSION b/samples/client/petstore/k6/.openapi-generator/VERSION index 4b448de535c7..4077803655c0 100644 --- a/samples/client/petstore/k6/.openapi-generator/VERSION +++ b/samples/client/petstore/k6/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.0-SNAPSHOT \ No newline at end of file +5.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/k6/script.js b/samples/client/petstore/k6/script.js index 6988d6417da5..7ae1bf14532b 100644 --- a/samples/client/petstore/k6/script.js +++ b/samples/client/petstore/k6/script.js @@ -1,204 +1,576 @@ /* * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This 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 * * NOTE: This class is auto generated by OpenAPI Generator. * https://github.com/OpenAPITools/openapi-generator * - * OpenAPI generator version: 5.3.0-SNAPSHOT + * OpenAPI generator version: 5.3.1-SNAPSHOT */ import http from "k6/http"; import { group, check, sleep } from "k6"; -const BASE_URL = "http://petstore.swagger.io/v2"; +const BASE_URL = "https://127.0.0.1/no_varaible"; // Sleep duration between successive requests. // You might want to edit the value of this variable or remove calls to the sleep function on the script. const SLEEP_DURATION = 0.1; // Global variables should be initialized. +let booleanGroup = "TODO_EDIT_THE_BOOLEAN_GROUP"; +let header1 = "TODO_EDIT_THE_HEADER_1"; let apiKey = "TODO_EDIT_THE_API_KEY"; +let requiredBooleanGroup = "TODO_EDIT_THE_REQUIRED_BOOLEAN_GROUP"; +let enumHeaderStringArray = "TODO_EDIT_THE_ENUM_HEADER_STRING_ARRAY"; +let enumHeaderString = "TODO_EDIT_THE_ENUM_HEADER_STRING"; export default function() { + group("/fake", () => { + let enumQueryInteger = 'TODO_EDIT_THE_ENUM_QUERY_INTEGER'; // specify value as there is no example value for this parameter in OpenAPI spec + let enumQueryString = 'TODO_EDIT_THE_ENUM_QUERY_STRING'; // specify value as there is no example value for this parameter in OpenAPI spec + let enumQueryStringArray = 'TODO_EDIT_THE_ENUM_QUERY_STRING_ARRAY'; // specify value as there is no example value for this parameter in OpenAPI spec + let enumQueryDouble = 'TODO_EDIT_THE_ENUM_QUERY_DOUBLE'; // specify value as there is no example value for this parameter in OpenAPI spec + + // Request No. 1 + { + let url = BASE_URL + `/fake?enum_query_string_array=${enum_query_string_array}&enum_query_string=${enum_query_string}&enum_query_integer=${enum_query_integer}&enum_query_double=${enum_query_double}`; + // TODO: edit the parameters of the request body. + let body = {"enumFormStringArray": "list", "enumFormString": "string"}; + let params = {headers: {"Content-Type": "application/x-www-form-urlencoded", "enum_header_string_array": `${enumHeaderStringArray}`, "enum_header_string": `${enumHeaderString}`, "Accept": "application/json"}}; + let request = http.get(url, JSON.stringify(body), params); + + + sleep(SLEEP_DURATION); + } + + // Request No. 2 + { + let url = BASE_URL + `/fake`; + // TODO: edit the parameters of the request body. + let body = {"client": "string"}; + let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let request = http.patch(url, JSON.stringify(body), params); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + } + }); + + group("/fake/outer/boolean", () => { + + // Request No. 1 + { + let url = BASE_URL + `/fake/outer/boolean`; + let params = {headers: {"Content-Type": "application/json", "Accept": "*/*"}}; + let request = http.post(url, params); + + check(request, { + "Output boolean": (r) => r.status === 200 + }); + } + }); + + group("/another-fake/dummy", () => { + + // Request No. 1 + { + let url = BASE_URL + `/another-fake/dummy`; + // TODO: edit the parameters of the request body. + let body = {"client": "string"}; + let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let request = http.patch(url, JSON.stringify(body), params); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + } + }); + group("/pet", () => { - let url = BASE_URL + `/pet`; + + // Request No. 1 + { + let url = BASE_URL + `/pet`; + // TODO: edit the parameters of the request body. + let body = {"id": "long", "category": {"id": "long", "name": "string"}, "name": "string", "photoUrls": "set", "tags": "list", "status": "string"}; + let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let request = http.put(url, JSON.stringify(body), params); + + check(request, { + "Successful operation": (r) => r.status === 200 + }); + + sleep(SLEEP_DURATION); + } + + // Request No. 2 + { + let url = BASE_URL + `/pet`; + // TODO: edit the parameters of the request body. + let body = {"id": "long", "category": {"id": "long", "name": "string"}, "name": "string", "photoUrls": "set", "tags": "list", "status": "string"}; + let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let request = http.post(url, JSON.stringify(body), params); + + check(request, { + "Successful operation": (r) => r.status === 200 + }); + } + }); + + group("/user/{username}", () => { + let username = 'TODO_EDIT_THE_USERNAME'; // specify value as there is no example value for this parameter in OpenAPI spec + // Request No. 1 - // TODO: edit the parameters of the request body. - let body = {"id": "long", "category": {"id": "long", "name": "string"}, "name": "string", "photoUrls": "list", "tags": [{"id": "long", "name": "string"}], "status": "string"}; - let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; - let request = http.put(url, body, params); - sleep(SLEEP_DURATION); + { + let url = BASE_URL + `/user/${username}`; + let request = http.get(url); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + + sleep(SLEEP_DURATION); + } // Request No. 2 - // TODO: edit the parameters of the request body. - body = {"id": "long", "category": {"id": "long", "name": "string"}, "name": "string", "photoUrls": "list", "tags": [{"id": "long", "name": "string"}], "status": "string"}; - params = {headers: {"Content-Type": "application/json"}}; - request = http.post(url, body, params); - sleep(SLEEP_DURATION); + { + let url = BASE_URL + `/user/${username}`; + let request = http.del(url); + + } }); - group("/pet/findByStatus", () => { - let status = 'TODO_EDIT_THE_STATUS'; // specify value as there is no example value for this parameter in OpenAPI spec - let url = BASE_URL + `/pet/findByStatus?status=${status}`; + + group("/fake/body-with-binary", () => { + // Request No. 1 - let request = http.get(url); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); + { + let url = BASE_URL + `/fake/body-with-binary`; + let params = {headers: {"Content-Type": "image/png", "Accept": "application/json"}}; + let request = http.put(url, params); + + check(request, { + "Success": (r) => r.status === 200 + }); + } }); - group("/pet/findByTags", () => { - let tags = 'TODO_EDIT_THE_TAGS'; // specify value as there is no example value for this parameter in OpenAPI spec - let url = BASE_URL + `/pet/findByTags?tags=${tags}`; + + group("/fake_classname_test", () => { + + // Request No. 1 + { + let url = BASE_URL + `/fake_classname_test`; + // TODO: edit the parameters of the request body. + let body = {"client": "string"}; + let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let request = http.patch(url, JSON.stringify(body), params); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + } + }); + + group("/user/createWithList", () => { + + // Request No. 1 + { + let url = BASE_URL + `/user/createWithList`; + let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let request = http.post(url, params); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + } + }); + + group("/fake/inline-additionalProperties", () => { + + // Request No. 1 + { + let url = BASE_URL + `/fake/inline-additionalProperties`; + let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let request = http.post(url, params); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + } + }); + + group("/store/inventory", () => { + + // Request No. 1 + { + let url = BASE_URL + `/store/inventory`; + let request = http.get(url); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + } + }); + + group("/user/login", () => { + let password = 'TODO_EDIT_THE_PASSWORD'; // specify value as there is no example value for this parameter in OpenAPI spec + let username = 'TODO_EDIT_THE_USERNAME'; // specify value as there is no example value for this parameter in OpenAPI spec + + // Request No. 1 + { + let url = BASE_URL + `/user/login?username=${username}&password=${password}`; + let request = http.get(url); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + } + }); + + group("/fake/outer/composite", () => { + + // Request No. 1 + { + let url = BASE_URL + `/fake/outer/composite`; + // TODO: edit the parameters of the request body. + let body = {"myNumber": "bigdecimal", "myString": "string", "myBoolean": "boolean"}; + let params = {headers: {"Content-Type": "application/json", "Accept": "*/*"}}; + let request = http.post(url, JSON.stringify(body), params); + + check(request, { + "Output composite": (r) => r.status === 200 + }); + } + }); + + group("/fake/jsonFormData", () => { + // Request No. 1 - let request = http.get(url); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); + { + let url = BASE_URL + `/fake/jsonFormData`; + // TODO: edit the parameters of the request body. + let body = {"param": "string", "param2": "string"}; + let params = {headers: {"Content-Type": "application/x-www-form-urlencoded", "Accept": "application/json"}}; + let request = http.get(url, JSON.stringify(body), params); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + } }); + + group("/fake/{petId}/uploadImageWithRequiredFile", () => { + let petId = 'TODO_EDIT_THE_PETID'; // specify value as there is no example value for this parameter in OpenAPI spec + + // Request No. 1 + { + let url = BASE_URL + `/fake/${petId}/uploadImageWithRequiredFile`; + // TODO: edit the parameters of the request body. + let body = {"additionalMetadata": "string", "requiredFile": http.file(open("/path/to/file.bin", "b"), "test.bin")}; + let params = {headers: {"Content-Type": "multipart/form-data", "Accept": "application/json"}}; + let request = http.post(url, JSON.stringify(body), params); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + } + }); + group("/pet/{petId}", () => { let petId = 'TODO_EDIT_THE_PETID'; // specify value as there is no example value for this parameter in OpenAPI spec - let url = BASE_URL + `/pet/${petId}`; + + // Request No. 1 + { + let url = BASE_URL + `/pet/${petId}`; + let request = http.get(url); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + + sleep(SLEEP_DURATION); + } + + // Request No. 2 + { + let url = BASE_URL + `/pet/${petId}`; + let params = {headers: {"api_key": `${apiKey}`, "Accept": "application/json"}}; + // this is a DELETE method request - if params are also set, empty body must be passed + let request = http.del(url, {} , params); + + check(request, { + "Successful operation": (r) => r.status === 200 + }); + } + }); + + group("/foo", () => { + + // Request No. 1 + { + let url = BASE_URL + `/foo`; + let request = http.get(url); + + check(request, { + "response": (r) => r.status === 200 + }); + } + }); + + group("/fake/outer/string", () => { + + // Request No. 1 + { + let url = BASE_URL + `/fake/outer/string`; + let params = {headers: {"Content-Type": "application/json", "Accept": "*/*"}}; + let request = http.post(url, params); + + check(request, { + "Output string": (r) => r.status === 200 + }); + } + }); + + group("/fake/test-query-parameters", () => { + let allowEmpty = 'TODO_EDIT_THE_ALLOWEMPTY'; // specify value as there is no example value for this parameter in OpenAPI spec + let ioutil = 'TODO_EDIT_THE_IOUTIL'; // specify value as there is no example value for this parameter in OpenAPI spec + let context = 'TODO_EDIT_THE_CONTEXT'; // specify value as there is no example value for this parameter in OpenAPI spec + let http = 'TODO_EDIT_THE_HTTP'; // specify value as there is no example value for this parameter in OpenAPI spec + let pipe = 'TODO_EDIT_THE_PIPE'; // specify value as there is no example value for this parameter in OpenAPI spec + let language = 'TODO_EDIT_THE_LANGUAGE'; // specify value as there is no example value for this parameter in OpenAPI spec + let url = 'TODO_EDIT_THE_URL'; // specify value as there is no example value for this parameter in OpenAPI spec + + // Request No. 1 + { + let url = BASE_URL + `/fake/test-query-parameters?pipe=${pipe}&ioutil=${ioutil}&http=${http}&url=${url}&context=${context}&language=${language}&allowEmpty=${allowEmpty}`; + let request = http.put(url); + + check(request, { + "Success": (r) => r.status === 200 + }); + } + }); + + group("/store/order/{order_id}", () => { + let orderId = 'TODO_EDIT_THE_ORDER_ID'; // specify value as there is no example value for this parameter in OpenAPI spec + // Request No. 1 - let request = http.get(url); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); + { + let url = BASE_URL + `/store/order/${order_id}`; + let request = http.get(url); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + + sleep(SLEEP_DURATION); + } // Request No. 2 - // TODO: edit the parameters of the request body. - body = {"name": "string", "status": "string"}; - params = {headers: {"Content-Type": "application/x-www-form-urlencoded"}}; - request = http.post(url, body, params); - sleep(SLEEP_DURATION); + { + let url = BASE_URL + `/store/order/${order_id}`; + let request = http.del(url); + + } + }); + + group("/pet/findByStatus", () => { + let status = 'TODO_EDIT_THE_STATUS'; // specify value as there is no example value for this parameter in OpenAPI spec + + // Request No. 1 + { + let url = BASE_URL + `/pet/findByStatus?status=${status}`; + let request = http.get(url); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + } + }); + + group("/fake/body-with-query-params", () => { + let query = 'TODO_EDIT_THE_QUERY'; // specify value as there is no example value for this parameter in OpenAPI spec + + // Request No. 1 + { + let url = BASE_URL + `/fake/body-with-query-params?query=${query}`; + // TODO: edit the parameters of the request body. + let body = {"id": "long", "username": "string", "firstName": "string", "lastName": "string", "email": "string", "password": "string", "phone": "string", "userStatus": "integer"}; + let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let request = http.put(url, JSON.stringify(body), params); - // Request No. 3 - params = {headers: {"api_key": `${apiKey}`}}; - request = http.del(url, params); - sleep(SLEEP_DURATION); + check(request, { + "Success": (r) => r.status === 200 + }); + } }); + group("/pet/{petId}/uploadImage", () => { let petId = 'TODO_EDIT_THE_PETID'; // specify value as there is no example value for this parameter in OpenAPI spec - let url = BASE_URL + `/pet/${petId}/uploadImage`; + // Request No. 1 - // TODO: edit the parameters of the request body. - let body = {"additionalMetadata": "string", "file": http.file(open("/path/to/file.bin", "b"), "test.bin")}; - let params = {headers: {"Content-Type": "multipart/form-data", "Accept": "application/json"}}; - let request = http.post(url, body, params); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); + { + let url = BASE_URL + `/pet/${petId}/uploadImage`; + // TODO: edit the parameters of the request body. + let body = {"additionalMetadata": "string", "file": http.file(open("/path/to/file.bin", "b"), "test.bin")}; + let params = {headers: {"Content-Type": "multipart/form-data", "Accept": "application/json"}}; + let request = http.post(url, JSON.stringify(body), params); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + } }); - group("/store/inventory", () => { - let url = BASE_URL + `/store/inventory`; + + group("/fake/http-signature-test", () => { + let query1 = 'TODO_EDIT_THE_QUERY_1'; // specify value as there is no example value for this parameter in OpenAPI spec + // Request No. 1 - let request = http.get(url); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); - }); - group("/store/order", () => { - let url = BASE_URL + `/store/order`; - // Request No. 1 - // TODO: edit the parameters of the request body. - let body = {"id": "long", "petId": "long", "quantity": "integer", "shipDate": "date", "status": "string", "complete": "boolean"}; - let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; - let request = http.post(url, body, params); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); - }); - group("/store/order/{orderId}", () => { - let orderId = 'TODO_EDIT_THE_ORDERID'; // specify value as there is no example value for this parameter in OpenAPI spec - let url = BASE_URL + `/store/order/${orderId}`; - // Request No. 1 - let request = http.get(url); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); + { + let url = BASE_URL + `/fake/http-signature-test?query_1=${query_1}`; + // TODO: edit the parameters of the request body. + let body = {"id": "long", "category": {"id": "long", "name": "string"}, "name": "string", "photoUrls": "set", "tags": "list", "status": "string"}; + let params = {headers: {"Content-Type": "application/json", "header_1": `${header1}`, "Accept": "application/json"}}; + let request = http.get(url, JSON.stringify(body), params); - // Request No. 2 - request = http.del(url); - sleep(SLEEP_DURATION); + check(request, { + "The instance started successfully": (r) => r.status === 200 + }); + } }); + group("/user", () => { - let url = BASE_URL + `/user`; + // Request No. 1 - // TODO: edit the parameters of the request body. - let body = {"id": "long", "username": "string", "firstName": "string", "lastName": "string", "email": "string", "password": "string", "phone": "string", "userStatus": "integer"}; - let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; - let request = http.post(url, body, params); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); + { + let url = BASE_URL + `/user`; + // TODO: edit the parameters of the request body. + let body = {"id": "long", "username": "string", "firstName": "string", "lastName": "string", "email": "string", "password": "string", "phone": "string", "userStatus": "integer"}; + let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let request = http.post(url, JSON.stringify(body), params); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + } }); + + group("/fake/property/enum-int", () => { + + // Request No. 1 + { + let url = BASE_URL + `/fake/property/enum-int`; + // TODO: edit the parameters of the request body. + let body = {"value": "outerenuminteger"}; + let params = {headers: {"Content-Type": "application/json", "Accept": "*/*"}}; + let request = http.post(url, JSON.stringify(body), params); + + check(request, { + "Output enum (int)": (r) => r.status === 200 + }); + } + }); + group("/user/createWithArray", () => { - let url = BASE_URL + `/user/createWithArray`; + // Request No. 1 - let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; - let request = http.post(url, params); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); + { + let url = BASE_URL + `/user/createWithArray`; + let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let request = http.post(url, params); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + } }); - group("/user/createWithList", () => { - let url = BASE_URL + `/user/createWithList`; + + group("/fake/body-with-file-schema", () => { + // Request No. 1 - let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; - let request = http.post(url, params); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); + { + let url = BASE_URL + `/fake/body-with-file-schema`; + // TODO: edit the parameters of the request body. + let body = {"file": http.file(open("/path/to/file.bin", "b"), "test.bin"), "files": "list"}; + let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let request = http.put(url, JSON.stringify(body), params); + + check(request, { + "Success": (r) => r.status === 200 + }); + } }); - group("/user/login", () => { - let password = 'TODO_EDIT_THE_PASSWORD'; // specify value as there is no example value for this parameter in OpenAPI spec - let username = 'TODO_EDIT_THE_USERNAME'; // specify value as there is no example value for this parameter in OpenAPI spec - let url = BASE_URL + `/user/login?username=${username}&password=${password}`; + + group("/pet/findByTags", () => { + let tags = 'TODO_EDIT_THE_TAGS'; // specify value as there is no example value for this parameter in OpenAPI spec + // Request No. 1 - let request = http.get(url); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); + { + let url = BASE_URL + `/pet/findByTags?tags=${tags}`; + let request = http.get(url); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + } }); + + group("/store/order", () => { + + // Request No. 1 + { + let url = BASE_URL + `/store/order`; + // TODO: edit the parameters of the request body. + let body = {"id": "long", "petId": "long", "quantity": "integer", "shipDate": "date", "status": "string", "complete": "boolean"}; + let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let request = http.post(url, JSON.stringify(body), params); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + } + }); + group("/user/logout", () => { - let url = BASE_URL + `/user/logout`; + // Request No. 1 - let request = http.get(url); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); + { + let url = BASE_URL + `/user/logout`; + let request = http.get(url); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + } }); - group("/user/{username}", () => { - let username = 'TODO_EDIT_THE_USERNAME'; // specify value as there is no example value for this parameter in OpenAPI spec - let url = BASE_URL + `/user/${username}`; + + group("/fake/health", () => { + // Request No. 1 - let request = http.get(url); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); + { + let url = BASE_URL + `/fake/health`; + let request = http.get(url); - // Request No. 2 - // TODO: edit the parameters of the request body. - body = {"id": "long", "username": "string", "firstName": "string", "lastName": "string", "email": "string", "password": "string", "phone": "string", "userStatus": "integer"}; - params = {headers: {"Content-Type": "application/json"}}; - request = http.put(url, body, params); - sleep(SLEEP_DURATION); + check(request, { + "The instance started successfully": (r) => r.status === 200 + }); + } + }); + + group("/fake/outer/number", () => { - // Request No. 3 - request = http.del(url); - sleep(SLEEP_DURATION); + // Request No. 1 + { + let url = BASE_URL + `/fake/outer/number`; + let params = {headers: {"Content-Type": "application/json", "Accept": "*/*"}}; + let request = http.post(url, params); + + check(request, { + "Output number": (r) => r.status === 200 + }); + } }); + } From 42d635b463f1b3795535c73d0867635e74c22181 Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@users.noreply.github.com> Date: Fri, 17 Dec 2021 02:19:41 +0000 Subject: [PATCH 099/117] [swift5][client] improve code formatting (#11124) * [swift][client] improve code formatting with multiple response as * [kotlin][vertx] update sample project --- .../src/main/resources/swift5/api.mustache | 13 ++++--- .../PetstoreClient/APIs/AnotherFakeAPI.swift | 1 - .../Sources/PetstoreClient/APIs/FakeAPI.swift | 14 -------- .../APIs/FakeClassnameTags123API.swift | 1 - .../Sources/PetstoreClient/APIs/PetAPI.swift | 9 ----- .../PetstoreClient/APIs/StoreAPI.swift | 4 --- .../Sources/PetstoreClient/APIs/UserAPI.swift | 8 ----- .../server/api/model/ApiResponse.kt | 34 ------------------- 8 files changed, 9 insertions(+), 75 deletions(-) delete mode 100644 samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/ApiResponse.kt diff --git a/modules/openapi-generator/src/main/resources/swift5/api.mustache b/modules/openapi-generator/src/main/resources/swift5/api.mustache index 2351c74fd9ba..e5cd7ea4490d 100644 --- a/modules/openapi-generator/src/main/resources/swift5/api.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/api.mustache @@ -23,9 +23,9 @@ extension {{projectName}}API { /** {{{.}}} */{{/description}} {{#objcCompatible}}@objc {{/objcCompatible}}{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class {{classname}}{{#objcCompatible}} : NSObject{{/objcCompatible}} { {{#operation}} - {{#allParams}} {{#isEnum}} + /** * enum for parameter {{paramName}} */ @@ -36,7 +36,6 @@ extension {{projectName}}API { {{/enumVars}} {{/allowableValues}} } - {{/isEnum}} {{/allParams}} {{^useVapor}} @@ -45,6 +44,7 @@ extension {{projectName}}API { {{^useResult}} {{^useCombine}} {{^useAsyncAwait}} + /** {{#summary}} {{{.}}} @@ -80,6 +80,7 @@ extension {{projectName}}API { {{/usePromiseKit}} {{/useVapor}} {{#usePromiseKit}} + /** {{#summary}} {{{.}}} @@ -111,6 +112,7 @@ extension {{projectName}}API { } {{/usePromiseKit}} {{#useRxSwift}} + /** {{#summary}} {{{.}}} @@ -147,6 +149,7 @@ extension {{projectName}}API { } {{/useRxSwift}} {{#useCombine}} + /** {{#summary}} {{{.}}} @@ -186,6 +189,7 @@ extension {{projectName}}API { #endif {{/useCombine}} {{#useAsyncAwait}} + /** {{#summary}} {{{.}}} @@ -229,6 +233,7 @@ extension {{projectName}}API { } {{/useAsyncAwait}} {{#useResult}} + /** {{#summary}} {{{.}}} @@ -241,7 +246,7 @@ extension {{projectName}}API { @available(*, deprecated, message: "This operation is deprecated.") {{/isDeprecated}} @discardableResult - open class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<{{{returnType}}}{{^returnType}}Void{{/returnType}}, ErrorResponse>) -> Void)) -> RequestTask { + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<{{{returnType}}}{{^returnType}}Void{{/returnType}}, ErrorResponse>) -> Void)) -> RequestTask { return {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute(apiResponseQueue) { result in switch result { {{#returnType}} @@ -259,6 +264,7 @@ extension {{projectName}}API { } {{/useResult}} {{#useVapor}} + /** {{#summary}} {{{.}}} @@ -380,7 +386,6 @@ extension {{projectName}}API { } } } - {{/useVapor}} {{^useVapor}} diff --git a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift index 78cd04bd6b19..85f7cf35117c 100644 --- a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift @@ -60,5 +60,4 @@ open class AnotherFakeAPI { } } } - } diff --git a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift index 144a6d4e68af..014da8378336 100644 --- a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift @@ -61,7 +61,6 @@ open class FakeAPI { } } - /** POST /fake/outer/boolean Test serialization of outer boolean types @@ -110,7 +109,6 @@ open class FakeAPI { } } - /** POST /fake/outer/composite Test serialization of object with outer number type @@ -159,7 +157,6 @@ open class FakeAPI { } } - /** POST /fake/outer/number Test serialization of outer number types @@ -208,7 +205,6 @@ open class FakeAPI { } } - /** POST /fake/outer/string Test serialization of outer string types @@ -257,7 +253,6 @@ open class FakeAPI { } } - /** PUT /fake/body-with-file-schema For this test, the body for this request much reference a schema named `File`. @@ -304,7 +299,6 @@ open class FakeAPI { } } - /** PUT /fake/body-with-query-params - parameter query: (query) @@ -358,7 +352,6 @@ open class FakeAPI { } } - /** To test \"client\" model PATCH /fake @@ -407,7 +400,6 @@ open class FakeAPI { } } - /** Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 POST /fake @@ -507,7 +499,6 @@ open class FakeAPI { } } - /** * enum for parameter enumHeaderStringArray */ @@ -661,7 +652,6 @@ open class FakeAPI { } } - /** Fake endpoint to test group parameters (optional) DELETE /fake @@ -736,7 +726,6 @@ open class FakeAPI { } } - /** test inline additionalProperties POST /fake/inline-additionalProperties @@ -783,7 +772,6 @@ open class FakeAPI { } } - /** test json serialization of form data GET /fake/jsonFormData @@ -836,7 +824,6 @@ open class FakeAPI { } } - /** PUT /fake/test-query-parameters To test the collection format in query parameters @@ -904,5 +891,4 @@ open class FakeAPI { } } } - } diff --git a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift index 0a1049525264..e8ad26cffed6 100644 --- a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift @@ -66,5 +66,4 @@ open class FakeClassnameTags123API { } } } - } diff --git a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/PetAPI.swift b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/PetAPI.swift index e07bf6753d12..5e8015215015 100644 --- a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/PetAPI.swift @@ -68,7 +68,6 @@ open class PetAPI { } } - /** Deletes a pet DELETE /pet/{petId} @@ -130,7 +129,6 @@ open class PetAPI { } } - /** * enum for parameter status */ @@ -203,7 +201,6 @@ open class PetAPI { } } - /** Finds Pets by tags GET /pet/findByTags @@ -269,7 +266,6 @@ open class PetAPI { } } - /** Find pet by ID GET /pet/{petId} @@ -332,7 +328,6 @@ open class PetAPI { } } - /** Update an existing pet PUT /pet @@ -394,7 +389,6 @@ open class PetAPI { } } - /** Updates a pet in the store with form data POST /pet/{petId} @@ -458,7 +452,6 @@ open class PetAPI { } } - /** uploads an image POST /pet/{petId}/uploadImage @@ -522,7 +515,6 @@ open class PetAPI { } } - /** uploads an image (required) POST /fake/{petId}/uploadImageWithRequiredFile @@ -585,5 +577,4 @@ open class PetAPI { } } } - } diff --git a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift index 6c3358a61639..d802c4c765ed 100644 --- a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift @@ -66,7 +66,6 @@ open class StoreAPI { } } - /** Returns pet inventories by status GET /store/inventory @@ -118,7 +117,6 @@ open class StoreAPI { } } - /** Find purchase order by ID GET /store/order/{order_id} @@ -175,7 +173,6 @@ open class StoreAPI { } } - /** Place an order for a pet POST /store/order @@ -224,5 +221,4 @@ open class StoreAPI { } } } - } diff --git a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/UserAPI.swift b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/UserAPI.swift index e71a3ee7bf34..183205907691 100644 --- a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/UserAPI.swift @@ -58,7 +58,6 @@ open class UserAPI { } } - /** Creates list of users with given input array POST /user/createWithArray @@ -102,7 +101,6 @@ open class UserAPI { } } - /** Creates list of users with given input array POST /user/createWithList @@ -146,7 +144,6 @@ open class UserAPI { } } - /** Delete user DELETE /user/{username} @@ -200,7 +197,6 @@ open class UserAPI { } } - /** Get user by user name GET /user/{username} @@ -255,7 +251,6 @@ open class UserAPI { } } - /** Logs user into the system GET /user/login @@ -317,7 +312,6 @@ open class UserAPI { } } - /** Logs out current logged in user session GET /user/logout @@ -358,7 +352,6 @@ open class UserAPI { } } - /** Updated user PUT /user/{username} @@ -414,5 +407,4 @@ open class UserAPI { } } } - } diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/ApiResponse.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/ApiResponse.kt deleted file mode 100644 index 223e80919ac3..000000000000 --- a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/ApiResponse.kt +++ /dev/null @@ -1,34 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.server.api.model - - - -import com.google.gson.annotations.SerializedName -import com.fasterxml.jackson.annotation.JsonIgnoreProperties -import com.fasterxml.jackson.annotation.JsonInclude -/** - * Describes the result of uploading an image resource - * @param code - * @param type - * @param message - */ -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown = true) -data class ApiResponse ( - var code: kotlin.Int? = null, - var type: kotlin.String? = null, - var message: kotlin.String? = null -) { - -} - From 80d1eedc20383d6080bd96900598bcd9fd91e9f9 Mon Sep 17 00:00:00 2001 From: Samuel Nelson Date: Fri, 17 Dec 2021 15:20:26 +1300 Subject: [PATCH 100/117] Fix deprecation issue since akka-http 2.6 (#11048) --- .../src/main/resources/scala-akka-client/apiInvoker.mustache | 4 ++-- .../main/scala/org/openapitools/client/core/ApiInvoker.scala | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/scala-akka-client/apiInvoker.mustache b/modules/openapi-generator/src/main/resources/scala-akka-client/apiInvoker.mustache index f9dd5c19b872..ae815e21c637 100644 --- a/modules/openapi-generator/src/main/resources/scala-akka-client/apiInvoker.mustache +++ b/modules/openapi-generator/src/main/resources/scala-akka-client/apiInvoker.mustache @@ -11,7 +11,7 @@ import akka.http.scaladsl.model.Uri.Query import akka.http.scaladsl.model._ import akka.http.scaladsl.model.headers._ import akka.http.scaladsl.unmarshalling.{ Unmarshal, Unmarshaller } -import akka.stream.ActorMaterializer +import akka.stream.Materializer import akka.stream.scaladsl.Source import akka.util.{ ByteString, Timeout } import de.heikoseeberger.akkahttpjson4s.Json4sSupport @@ -81,7 +81,7 @@ class ApiInvoker(formats: Formats)(implicit system: ActorSystem) extends CustomC protected val settings: ApiSettings = ApiSettings(system) - private implicit val materializer: ActorMaterializer = ActorMaterializer() + private implicit val materializer: Materializer = Materializer(system) private implicit val serialization: Serialization = jackson.Serialization diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiInvoker.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiInvoker.scala index 74575e12cdd1..4b28ea9862ec 100644 --- a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiInvoker.scala +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiInvoker.scala @@ -21,7 +21,7 @@ import akka.http.scaladsl.model.Uri.Query import akka.http.scaladsl.model._ import akka.http.scaladsl.model.headers._ import akka.http.scaladsl.unmarshalling.{ Unmarshal, Unmarshaller } -import akka.stream.ActorMaterializer +import akka.stream.Materializer import akka.stream.scaladsl.Source import akka.util.{ ByteString, Timeout } import de.heikoseeberger.akkahttpjson4s.Json4sSupport @@ -91,7 +91,7 @@ class ApiInvoker(formats: Formats)(implicit system: ActorSystem) extends CustomC protected val settings: ApiSettings = ApiSettings(system) - private implicit val materializer: ActorMaterializer = ActorMaterializer() + private implicit val materializer: Materializer = Materializer(system) private implicit val serialization: Serialization = jackson.Serialization From 6f6d4f8c02fd459de5aaee4755f64d0f82dedc9e Mon Sep 17 00:00:00 2001 From: Josh Burton Date: Fri, 17 Dec 2021 15:36:42 +1300 Subject: [PATCH 101/117] [dart-dio-next] Removes dioLibrary option (#10931) As there is no longer a fork of the dio library this option can be removed --- ...ext-dio-http-petstore-client-lib-fake.yaml | 11 - docs/generators/dart-dio-next.md | 1 - .../languages/DartDioNextClientCodegen.java | 54 +- .../resources/dart/libraries/dio/api.mustache | 2 +- .../dart/libraries/dio/api_client.mustache | 2 +- .../libraries/dio/auth/api_key_auth.mustache | 2 +- .../dart/libraries/dio/auth/auth.mustache | 2 +- .../libraries/dio/auth/basic_auth.mustache | 2 +- .../libraries/dio/auth/bearer_auth.mustache | 2 +- .../dart/libraries/dio/auth/oauth.mustache | 2 +- .../dart/libraries/dio/pubspec.mustache | 5 - .../built_value/api_util.mustache | 4 +- .../dio/DartDioNextClientCodegenTest.java | 20 - .../dio/DartDioNextClientOptionsTest.java | 1 - .../DartDioNextClientOptionsProvider.java | 1 - pom.xml | 1 - .../.gitignore | 41 - .../.openapi-generator-ignore | 23 - .../.openapi-generator/FILES | 121 -- .../.openapi-generator/VERSION | 1 - .../README.md | 200 --- .../analysis_options.yaml | 9 - .../doc/AdditionalPropertiesClass.md | 16 - .../doc/Animal.md | 16 - .../doc/AnotherFakeApi.md | 57 - .../doc/ApiResponse.md | 17 - .../doc/ArrayOfArrayOfNumberOnly.md | 15 - .../doc/ArrayOfNumberOnly.md | 15 - .../doc/ArrayTest.md | 17 - .../doc/Capitalization.md | 20 - .../doc/Cat.md | 17 - .../doc/CatAllOf.md | 15 - .../doc/Category.md | 16 - .../doc/ClassModel.md | 15 - .../doc/DefaultApi.md | 51 - .../doc/DeprecatedObject.md | 15 - .../doc/Dog.md | 17 - .../doc/DogAllOf.md | 15 - .../doc/EnumArrays.md | 16 - .../doc/EnumTest.md | 22 - .../doc/FakeApi.md | 816 ---------- .../doc/FakeClassnameTags123Api.md | 61 - .../doc/FileSchemaTestClass.md | 16 - .../doc/Foo.md | 15 - .../doc/FormatTest.md | 30 - .../doc/HasOnlyReadOnly.md | 16 - .../doc/HealthCheckResult.md | 15 - .../doc/InlineResponseDefault.md | 15 - .../doc/MapTest.md | 18 - ...dPropertiesAndAdditionalPropertiesClass.md | 17 - .../doc/Model200Response.md | 16 - .../doc/ModelClient.md | 15 - .../doc/ModelEnumClass.md | 14 - .../doc/ModelFile.md | 15 - .../doc/ModelList.md | 15 - .../doc/ModelReturn.md | 15 - .../doc/Name.md | 18 - .../doc/NullableClass.md | 26 - .../doc/NumberOnly.md | 15 - .../doc/ObjectWithDeprecatedFields.md | 18 - .../doc/Order.md | 20 - .../doc/OuterComposite.md | 17 - .../doc/OuterEnum.md | 14 - .../doc/OuterEnumDefaultValue.md | 14 - .../doc/OuterEnumInteger.md | 14 - .../doc/OuterEnumIntegerDefaultValue.md | 14 - .../doc/OuterObjectWithEnumProperty.md | 15 - .../doc/Pet.md | 20 - .../doc/PetApi.md | 427 ----- .../doc/ReadOnlyFirst.md | 16 - .../doc/SpecialModelName.md | 15 - .../doc/StoreApi.md | 186 --- .../doc/Tag.md | 16 - .../doc/User.md | 22 - .../doc/UserApi.md | 349 ---- .../lib/openapi.dart | 65 - .../lib/src/api.dart | 115 -- .../lib/src/api/another_fake_api.dart | 113 -- .../lib/src/api/default_api.dart | 92 -- .../lib/src/api/fake_api.dart | 1417 ----------------- .../src/api/fake_classname_tags123_api.dart | 120 -- .../lib/src/api/pet_api.dart | 755 --------- .../lib/src/api/store_api.dart | 314 ---- .../lib/src/api/user_api.dart | 532 ------- .../lib/src/api_util.dart | 78 - .../lib/src/auth/api_key_auth.dart | 30 - .../lib/src/auth/auth.dart | 18 - .../lib/src/auth/basic_auth.dart | 37 - .../lib/src/auth/bearer_auth.dart | 26 - .../lib/src/auth/oauth.dart | 26 - .../lib/src/date_serializer.dart | 31 - .../model/additional_properties_class.dart | 87 - .../lib/src/model/animal.dart | 85 - .../lib/src/model/api_response.dart | 101 -- .../model/array_of_array_of_number_only.dart | 72 - .../lib/src/model/array_of_number_only.dart | 72 - .../lib/src/model/array_test.dart | 103 -- .../lib/src/model/capitalization.dart | 147 -- .../lib/src/model/cat.dart | 104 -- .../lib/src/model/cat_all_of.dart | 71 - .../lib/src/model/category.dart | 85 - .../lib/src/model/class_model.dart | 71 - .../lib/src/model/date.dart | 70 - .../lib/src/model/deprecated_object.dart | 71 - .../lib/src/model/dog.dart | 104 -- .../lib/src/model/dog_all_of.dart | 71 - .../lib/src/model/enum_arrays.dart | 119 -- .../lib/src/model/enum_test.dart | 252 --- .../lib/src/model/file_schema_test_class.dart | 88 - .../lib/src/model/foo.dart | 72 - .../lib/src/model/format_test.dart | 292 ---- .../lib/src/model/has_only_read_only.dart | 86 - .../lib/src/model/health_check_result.dart | 72 - .../src/model/inline_response_default.dart | 72 - .../lib/src/model/map_test.dart | 133 -- ...rties_and_additional_properties_class.dart | 103 -- .../lib/src/model/model200_response.dart | 86 - .../lib/src/model/model_client.dart | 71 - .../lib/src/model/model_enum_class.dart | 35 - .../lib/src/model/model_file.dart | 72 - .../lib/src/model/model_list.dart | 71 - .../lib/src/model/model_return.dart | 71 - .../lib/src/model/name.dart | 114 -- .../lib/src/model/nullable_class.dart | 249 --- .../lib/src/model/number_only.dart | 71 - .../model/object_with_deprecated_fields.dart | 118 -- .../lib/src/model/order.dart | 170 -- .../lib/src/model/outer_composite.dart | 101 -- .../lib/src/model/outer_enum.dart | 35 - .../src/model/outer_enum_default_value.dart | 35 - .../lib/src/model/outer_enum_integer.dart | 35 - .../outer_enum_integer_default_value.dart | 35 - .../outer_object_with_enum_property.dart | 71 - .../lib/src/model/pet.dart | 167 -- .../lib/src/model/read_only_first.dart | 86 - .../lib/src/model/special_model_name.dart | 71 - .../lib/src/model/tag.dart | 86 - .../lib/src/model/user.dart | 177 -- .../lib/src/serializers.dart | 146 -- .../dio_http_petstore_client_lib_fake/pom.xml | 88 - .../pubspec.yaml | 17 - .../additional_properties_class_test.dart | 21 - .../test/animal_test.dart | 21 - .../test/another_fake_api_test.dart | 20 - .../test/api_response_test.dart | 26 - .../array_of_array_of_number_only_test.dart | 16 - .../test/array_of_number_only_test.dart | 16 - .../test/array_test_test.dart | 26 - .../test/capitalization_test.dart | 42 - .../test/cat_all_of_test.dart | 16 - .../test/cat_test.dart | 26 - .../test/category_test.dart | 21 - .../test/class_model_test.dart | 16 - .../test/default_api_test.dart | 16 - .../test/deprecated_object_test.dart | 16 - .../test/dog_all_of_test.dart | 16 - .../test/dog_test.dart | 26 - .../test/enum_arrays_test.dart | 21 - .../test/enum_test_test.dart | 51 - .../test/fake_api_test.dart | 136 -- .../test/fake_classname_tags123_api_test.dart | 20 - .../test/file_schema_test_class_test.dart | 21 - .../test/foo_test.dart | 16 - .../test/format_test_test.dart | 93 -- .../test/has_only_read_only_test.dart | 21 - .../test/health_check_result_test.dart | 16 - .../test/inline_response_default_test.dart | 16 - .../test/map_test_test.dart | 31 - ..._and_additional_properties_class_test.dart | 26 - .../test/model200_response_test.dart | 21 - .../test/model_client_test.dart | 16 - .../test/model_enum_class_test.dart | 9 - .../test/model_file_test.dart | 17 - .../test/model_list_test.dart | 16 - .../test/model_return_test.dart | 16 - .../test/name_test.dart | 31 - .../test/nullable_class_test.dart | 71 - .../test/number_only_test.dart | 16 - .../object_with_deprecated_fields_test.dart | 31 - .../test/order_test.dart | 42 - .../test/outer_composite_test.dart | 26 - .../test/outer_enum_default_value_test.dart | 9 - ...outer_enum_integer_default_value_test.dart | 9 - .../test/outer_enum_integer_test.dart | 9 - .../test/outer_enum_test.dart | 9 - .../outer_object_with_enum_property_test.dart | 16 - .../test/pet_api_test.dart | 80 - .../test/pet_test.dart | 42 - .../test/read_only_first_test.dart | 21 - .../test/special_model_name_test.dart | 16 - .../test/store_api_test.dart | 45 - .../test/tag_test.dart | 21 - .../test/user_api_test.dart | 73 - .../test/user_test.dart | 52 - 194 files changed, 12 insertions(+), 13385 deletions(-) delete mode 100644 bin/configs/dart-dio-next-dio-http-petstore-client-lib-fake.yaml delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.gitignore delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.openapi-generator-ignore delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.openapi-generator/FILES delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.openapi-generator/VERSION delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/README.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/analysis_options.yaml delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/AdditionalPropertiesClass.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Animal.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/AnotherFakeApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ApiResponse.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ArrayOfArrayOfNumberOnly.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ArrayOfNumberOnly.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ArrayTest.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Capitalization.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Cat.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/CatAllOf.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Category.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ClassModel.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/DefaultApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/DeprecatedObject.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Dog.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/DogAllOf.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/EnumArrays.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/EnumTest.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/FakeApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/FakeClassnameTags123Api.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/FileSchemaTestClass.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Foo.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/FormatTest.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/HasOnlyReadOnly.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/HealthCheckResult.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/InlineResponseDefault.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/MapTest.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/MixedPropertiesAndAdditionalPropertiesClass.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Model200Response.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelClient.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelEnumClass.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelFile.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelList.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelReturn.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Name.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/NullableClass.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/NumberOnly.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ObjectWithDeprecatedFields.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Order.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterComposite.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterEnum.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterEnumDefaultValue.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterEnumInteger.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterEnumIntegerDefaultValue.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterObjectWithEnumProperty.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Pet.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/PetApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ReadOnlyFirst.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/SpecialModelName.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/StoreApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Tag.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/User.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/UserApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/openapi.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/another_fake_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/default_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/fake_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/fake_classname_tags123_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/pet_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/store_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/user_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api_util.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/api_key_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/basic_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/bearer_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/oauth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/date_serializer.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/additional_properties_class.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/animal.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/api_response.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/array_of_array_of_number_only.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/array_of_number_only.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/array_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/capitalization.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/cat.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/cat_all_of.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/category.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/class_model.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/date.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/deprecated_object.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/dog.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/dog_all_of.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/enum_arrays.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/enum_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/file_schema_test_class.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/foo.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/format_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/has_only_read_only.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/health_check_result.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/inline_response_default.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/map_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/mixed_properties_and_additional_properties_class.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model200_response.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_client.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_enum_class.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_file.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_list.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_return.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/name.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/nullable_class.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/number_only.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/object_with_deprecated_fields.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/order.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_composite.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_enum.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_enum_default_value.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_enum_integer.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_enum_integer_default_value.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_object_with_enum_property.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/pet.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/read_only_first.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/special_model_name.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/tag.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/user.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/serializers.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/pom.xml delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/pubspec.yaml delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/additional_properties_class_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/animal_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/another_fake_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/api_response_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/array_of_array_of_number_only_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/array_of_number_only_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/array_test_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/capitalization_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/cat_all_of_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/cat_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/category_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/class_model_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/default_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/deprecated_object_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/dog_all_of_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/dog_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/enum_arrays_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/enum_test_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/fake_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/fake_classname_tags123_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/file_schema_test_class_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/foo_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/format_test_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/has_only_read_only_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/health_check_result_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/inline_response_default_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/map_test_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/mixed_properties_and_additional_properties_class_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model200_response_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_client_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_enum_class_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_file_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_list_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_return_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/name_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/nullable_class_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/number_only_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/object_with_deprecated_fields_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/order_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_composite_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_enum_default_value_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_enum_integer_default_value_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_enum_integer_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_enum_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_object_with_enum_property_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/pet_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/pet_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/read_only_first_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/special_model_name_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/store_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/tag_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/user_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/user_test.dart diff --git a/bin/configs/dart-dio-next-dio-http-petstore-client-lib-fake.yaml b/bin/configs/dart-dio-next-dio-http-petstore-client-lib-fake.yaml deleted file mode 100644 index eb33c1a7f2f1..000000000000 --- a/bin/configs/dart-dio-next-dio-http-petstore-client-lib-fake.yaml +++ /dev/null @@ -1,11 +0,0 @@ -generatorName: dart-dio-next -outputDir: samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio -typeMappings: - Client: "ModelClient" - File: "ModelFile" - EnumClass: "ModelEnumClass" -additionalProperties: - hideGenerationTimestamp: "true" - dioLibrary: "dio_http" diff --git a/docs/generators/dart-dio-next.md b/docs/generators/dart-dio-next.md index ac9d15dc0693..d644e35b04a9 100644 --- a/docs/generators/dart-dio-next.md +++ b/docs/generators/dart-dio-next.md @@ -9,7 +9,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |dateLibrary|Specify Date library|
            **core**
            [DEFAULT] Dart core library (DateTime)
            **timemachine**
            Time Machine is date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing.
            |core| -|dioLibrary|Specify Dio library|
            **dio_http**
            dio_http 5.x
            **dio**
            [DEFAULT] dio 4.x
            |dio| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java index 06322152120c..5b9f96a21624 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java @@ -39,11 +39,6 @@ public class DartDioNextClientCodegen extends AbstractDartCodegen { private final Logger LOGGER = LoggerFactory.getLogger(DartDioNextClientCodegen.class); - public static final String DIO_LIBRARY = "dioLibrary"; - public static final String DIO_ORIGINAL = "dio"; - public static final String DIO_HTTP = "dio_http"; - public static final String DIO_LIBRARY_DEFAULT = DIO_ORIGINAL; - public static final String DATE_LIBRARY = "dateLibrary"; public static final String DATE_LIBRARY_CORE = "core"; public static final String DATE_LIBRARY_TIME_MACHINE = "timemachine"; @@ -52,13 +47,11 @@ public class DartDioNextClientCodegen extends AbstractDartCodegen { public static final String SERIALIZATION_LIBRARY_BUILT_VALUE = "built_value"; public static final String SERIALIZATION_LIBRARY_DEFAULT = SERIALIZATION_LIBRARY_BUILT_VALUE; + private static final String DIO_IMPORT = "package:dio/dio.dart"; private static final String CLIENT_NAME = "clientName"; private String dateLibrary; - private String dioLibrary; - private String dioImport; - private String clientName; public DartDioNextClientCodegen() { @@ -87,7 +80,6 @@ public DartDioNextClientCodegen() { serializationLibrary.setDefault(SERIALIZATION_LIBRARY_DEFAULT); cliOptions.add(serializationLibrary); - // Date Library Option final CliOption dateOption = CliOption.newString(DATE_LIBRARY, "Specify Date library"); dateOption.setDefault(DATE_LIBRARY_DEFAULT); @@ -96,16 +88,6 @@ public DartDioNextClientCodegen() { dateOptions.put(DATE_LIBRARY_TIME_MACHINE, "Time Machine is date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing."); dateOption.setEnum(dateOptions); cliOptions.add(dateOption); - - // Dio Library Option - final CliOption dioOption = CliOption.newString(DIO_LIBRARY, "Specify Dio library"); - dioOption.setDefault(DIO_LIBRARY_DEFAULT); - - final Map dioOptions = new HashMap<>(); - dioOptions.put(DIO_ORIGINAL, "[DEFAULT] dio 4.x"); - dioOptions.put(DIO_HTTP, "dio_http 5.x"); - dioOption.setEnum(dioOptions); - cliOptions.add(dioOption); } public String getDateLibrary() { @@ -116,14 +98,6 @@ public void setDateLibrary(String library) { this.dateLibrary = library; } - public String getDioLibrary() { - return dioLibrary; - } - - public void setDioLibrary(String library) { - this.dioLibrary = library; - } - public String getClientName() { return clientName; } @@ -163,12 +137,6 @@ public void processOpts() { } setDateLibrary(additionalProperties.get(DATE_LIBRARY).toString()); - if (!additionalProperties.containsKey(DIO_LIBRARY)) { - additionalProperties.put(DIO_LIBRARY, DIO_LIBRARY_DEFAULT); - LOGGER.debug("Dio library not set, using default {}", DIO_LIBRARY_DEFAULT); - } - setDioLibrary(additionalProperties.get(DIO_LIBRARY).toString()); - if (!additionalProperties.containsKey(CLIENT_NAME)) { final String name = org.openapitools.codegen.utils.StringUtils.camelize(pubName); additionalProperties.put(CLIENT_NAME, name); @@ -194,31 +162,15 @@ public void processOpts() { supportingFiles.add(new SupportingFile("auth/oauth.mustache", authFolder, "oauth.dart")); supportingFiles.add(new SupportingFile("auth/auth.mustache", authFolder, "auth.dart")); - configureDioLibrary(); configureSerializationLibrary(srcFolder); configureDateLibrary(srcFolder); } - private void configureDioLibrary() { - switch (dioLibrary) { - case DIO_HTTP: - dioImport = "package:dio_http/dio_http.dart"; - break; - case DIO_ORIGINAL: - default: - dioImport = "package:dio/dio.dart"; - break; - } - } - private void configureSerializationLibrary(String srcFolder) { switch (library) { default: case SERIALIZATION_LIBRARY_BUILT_VALUE: additionalProperties.put("useBuiltValue", "true"); - additionalProperties.put("useDioHttp", dioLibrary.equals(DIO_HTTP)); - additionalProperties.put("dioImport", dioImport); - additionalProperties.put("dioLibrary", dioLibrary); configureSerializationLibraryBuiltValue(srcFolder); break; } @@ -243,7 +195,7 @@ private void configureSerializationLibraryBuiltValue(String srcFolder) { imports.put("BuiltMap", "package:built_collection/built_collection.dart"); imports.put("JsonObject", "package:built_value/json_object.dart"); imports.put("Uint8List", "dart:typed_data"); - imports.put("MultipartFile", dioImport); + imports.put("MultipartFile", DIO_IMPORT); } private void configureDateLibrary(String srcFolder) { @@ -442,7 +394,7 @@ private Set rewriteImports(Set originalImports, boolean isModel) for (String modelImport : originalImports) { if (imports.containsKey(modelImport)) { String i = imports.get(modelImport); - if (Objects.equals(i, dioImport) && !isModel) { + if (Objects.equals(i, DIO_IMPORT) && !isModel) { // Don't add imports to operations that are already imported continue; } diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache index ce040b2d8a61..01663cfd23c2 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache @@ -2,7 +2,7 @@ import 'dart:async'; {{#useBuiltValue}}import 'package:built_value/serializer.dart';{{/useBuiltValue}} -import '{{dioImport}}'; +import 'package:dio/dio.dart'; {{#operations}} {{#imports}}import '{{.}}'; diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_client.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_client.mustache index 97b998b1d674..35fabd973d1e 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_client.mustache @@ -1,5 +1,5 @@ {{>header}} -import '{{dioImport}}';{{#useBuiltValue}} +import 'package:dio/dio.dart';{{#useBuiltValue}} import 'package:built_value/serializer.dart'; import 'package:{{pubName}}/src/serializers.dart';{{/useBuiltValue}} import 'package:{{pubName}}/src/auth/api_key_auth.dart'; diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/api_key_auth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/api_key_auth.mustache index 71d10a818556..2174d159630b 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/api_key_auth.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/api_key_auth.mustache @@ -1,6 +1,6 @@ {{>header}} -import '{{dioImport}}'; +import 'package:dio/dio.dart'; import 'package:{{pubName}}/src/auth/auth.dart'; class ApiKeyAuthInterceptor extends AuthInterceptor { diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/auth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/auth.mustache index 7c275784c050..a266e2384c77 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/auth.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/auth.mustache @@ -1,5 +1,5 @@ {{>header}} -import '{{dioImport}}'; +import 'package:dio/dio.dart'; abstract class AuthInterceptor extends Interceptor { /// Get auth information on given route for the given type. diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/basic_auth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/basic_auth.mustache index 3472d1cd228b..c286274c3a23 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/basic_auth.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/basic_auth.mustache @@ -1,7 +1,7 @@ {{>header}} import 'dart:convert'; -import '{{dioImport}}'; +import 'package:dio/dio.dart'; import 'package:{{pubName}}/src/auth/auth.dart'; class BasicAuthInfo { diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/bearer_auth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/bearer_auth.mustache index 7aa011d9169d..626c7d238d03 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/bearer_auth.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/bearer_auth.mustache @@ -1,5 +1,5 @@ {{>header}} -import '{{dioImport}}'; +import 'package:dio/dio.dart'; import 'package:{{pubName}}/src/auth/auth.dart'; class BearerAuthInterceptor extends AuthInterceptor { diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/oauth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/oauth.mustache index fccc6610f4e5..4f7b79655af9 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/oauth.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/oauth.mustache @@ -1,5 +1,5 @@ {{>header}} -import '{{dioImport}}'; +import 'package:dio/dio.dart'; import 'package:{{pubName}}/src/auth/auth.dart'; class OAuthInterceptor extends AuthInterceptor { diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache index d480e663acc9..6bf879a48973 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache @@ -7,12 +7,7 @@ environment: sdk: '>=2.12.0 <3.0.0' dependencies: -{{#useDioHttp}} - dio_http: '>=5.0.0 <6.0.0' -{{/useDioHttp}} -{{^useDioHttp}} dio: '>=4.0.0 <5.0.0' -{{/useDioHttp}} {{#useBuiltValue}} built_value: '>=8.1.0 <9.0.0' built_collection: '>=5.1.0 <6.0.0' diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api_util.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api_util.mustache index 4cdede63a0e9..fb5ab08aeda0 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api_util.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api_util.mustache @@ -4,8 +4,8 @@ import 'dart:typed_data'; import 'package:built_collection/built_collection.dart'; import 'package:built_value/serializer.dart'; -import '{{dioImport}}'; -import 'package:{{dioLibrary}}/src/parameter.dart'; +import 'package:dio/dio.dart'; +import 'package:dio/src/parameter.dart'; /// Format the given form parameter object into something that Dio can handle. /// Returns primitive or String. diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioNextClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioNextClientCodegenTest.java index 7166ac04044b..1d0e81d23608 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioNextClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioNextClientCodegenTest.java @@ -84,24 +84,4 @@ public void testKeywords() throws Exception { } } - - @Test - public void testInitialDioLibraryValues() throws Exception { - final DartDioNextClientCodegen codegen = new DartDioNextClientCodegen(); - codegen.processOpts(); - - Assert.assertEquals(codegen.additionalProperties().get(DartDioNextClientCodegen.DIO_LIBRARY), DartDioNextClientCodegen.DIO_LIBRARY_DEFAULT); - Assert.assertEquals(codegen.getDioLibrary(), DartDioNextClientCodegen.DIO_LIBRARY_DEFAULT); - } - - @Test - public void testAdditionalPropertiesPutForDioLibraryValues() throws Exception { - final DartDioNextClientCodegen codegen = new DartDioNextClientCodegen(); - codegen.additionalProperties().put(DartDioNextClientCodegen.DIO_LIBRARY, DartDioNextClientCodegen.DIO_HTTP); - codegen.processOpts(); - - Assert.assertEquals(codegen.additionalProperties().get(DartDioNextClientCodegen.DIO_LIBRARY), DartDioNextClientCodegen.DIO_HTTP); - Assert.assertEquals(codegen.getDioLibrary(), DartDioNextClientCodegen.DIO_HTTP); - } - } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioNextClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioNextClientOptionsTest.java index 210c8290cd6d..f2237e4fbaaa 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioNextClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioNextClientOptionsTest.java @@ -50,7 +50,6 @@ protected void verifyOptions() { verify(clientCodegen).setSourceFolder(DartDioNextClientOptionsProvider.SOURCE_FOLDER_VALUE); verify(clientCodegen).setUseEnumExtension(Boolean.parseBoolean(DartDioNextClientOptionsProvider.USE_ENUM_EXTENSION)); verify(clientCodegen).setDateLibrary(DartDioNextClientCodegen.DATE_LIBRARY_DEFAULT); - verify(clientCodegen).setDioLibrary(DartDioNextClientCodegen.DIO_LIBRARY_DEFAULT); verify(clientCodegen).setLibrary(DartDioNextClientCodegen.SERIALIZATION_LIBRARY_DEFAULT); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioNextClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioNextClientOptionsProvider.java index 2b4840d7d42c..b03f2a972142 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioNextClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioNextClientOptionsProvider.java @@ -58,7 +58,6 @@ public Map createOptions() { .put(DartDioNextClientCodegen.PUB_HOMEPAGE, PUB_HOMEPAGE_VALUE) .put(CodegenConstants.SERIALIZATION_LIBRARY, DartDioNextClientCodegen.SERIALIZATION_LIBRARY_DEFAULT) .put(DartDioNextClientCodegen.DATE_LIBRARY, DartDioNextClientCodegen.DATE_LIBRARY_DEFAULT) - .put(DartDioNextClientCodegen.DIO_LIBRARY, DartDioNextClientCodegen.DIO_LIBRARY_DEFAULT) .put(CodegenConstants.SOURCE_FOLDER, SOURCE_FOLDER_VALUE) .put(DartDioNextClientCodegen.USE_ENUM_EXTENSION, USE_ENUM_EXTENSION) .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) diff --git a/pom.xml b/pom.xml index c96acc02e490..6dd63afc4b4a 100644 --- a/pom.xml +++ b/pom.xml @@ -1402,7 +1402,6 @@ samples/openapi3/client/petstore/dart2/petstore_client_lib samples/openapi3/client/petstore/dart2/petstore samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake - samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.gitignore b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.gitignore deleted file mode 100644 index 4298cdcbd1a2..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.gitignore +++ /dev/null @@ -1,41 +0,0 @@ -# See https://dart.dev/guides/libraries/private-files - -# Files and directories created by pub -.dart_tool/ -.buildlog -.packages -.project -.pub/ -build/ -**/packages/ - -# Files created by dart2js -# (Most Dart developers will use pub build to compile Dart, use/modify these -# rules if you intend to use dart2js directly -# Convention is to use extension '.dart.js' for Dart compiled to Javascript to -# differentiate from explicit Javascript files) -*.dart.js -*.part.js -*.js.deps -*.js.map -*.info.json - -# Directory created by dartdoc -doc/api/ - -# Don't commit pubspec lock file -# (Library packages only! Remove pattern if developing an application package) -pubspec.lock - -# Don’t commit files and directories created by other development environments. -# For example, if your development environment creates any of the following files, -# consider putting them in a global ignore file: - -# IntelliJ -*.iml -*.ipr -*.iws -.idea/ - -# Mac -.DS_Store diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.openapi-generator-ignore b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.openapi-generator/FILES deleted file mode 100644 index ae28fd24bea0..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.openapi-generator/FILES +++ /dev/null @@ -1,121 +0,0 @@ -.gitignore -README.md -analysis_options.yaml -doc/AdditionalPropertiesClass.md -doc/Animal.md -doc/AnotherFakeApi.md -doc/ApiResponse.md -doc/ArrayOfArrayOfNumberOnly.md -doc/ArrayOfNumberOnly.md -doc/ArrayTest.md -doc/Capitalization.md -doc/Cat.md -doc/CatAllOf.md -doc/Category.md -doc/ClassModel.md -doc/DefaultApi.md -doc/DeprecatedObject.md -doc/Dog.md -doc/DogAllOf.md -doc/EnumArrays.md -doc/EnumTest.md -doc/FakeApi.md -doc/FakeClassnameTags123Api.md -doc/FileSchemaTestClass.md -doc/Foo.md -doc/FormatTest.md -doc/HasOnlyReadOnly.md -doc/HealthCheckResult.md -doc/InlineResponseDefault.md -doc/MapTest.md -doc/MixedPropertiesAndAdditionalPropertiesClass.md -doc/Model200Response.md -doc/ModelClient.md -doc/ModelEnumClass.md -doc/ModelFile.md -doc/ModelList.md -doc/ModelReturn.md -doc/Name.md -doc/NullableClass.md -doc/NumberOnly.md -doc/ObjectWithDeprecatedFields.md -doc/Order.md -doc/OuterComposite.md -doc/OuterEnum.md -doc/OuterEnumDefaultValue.md -doc/OuterEnumInteger.md -doc/OuterEnumIntegerDefaultValue.md -doc/OuterObjectWithEnumProperty.md -doc/Pet.md -doc/PetApi.md -doc/ReadOnlyFirst.md -doc/SpecialModelName.md -doc/StoreApi.md -doc/Tag.md -doc/User.md -doc/UserApi.md -lib/openapi.dart -lib/src/api.dart -lib/src/api/another_fake_api.dart -lib/src/api/default_api.dart -lib/src/api/fake_api.dart -lib/src/api/fake_classname_tags123_api.dart -lib/src/api/pet_api.dart -lib/src/api/store_api.dart -lib/src/api/user_api.dart -lib/src/api_util.dart -lib/src/auth/api_key_auth.dart -lib/src/auth/auth.dart -lib/src/auth/basic_auth.dart -lib/src/auth/bearer_auth.dart -lib/src/auth/oauth.dart -lib/src/date_serializer.dart -lib/src/model/additional_properties_class.dart -lib/src/model/animal.dart -lib/src/model/api_response.dart -lib/src/model/array_of_array_of_number_only.dart -lib/src/model/array_of_number_only.dart -lib/src/model/array_test.dart -lib/src/model/capitalization.dart -lib/src/model/cat.dart -lib/src/model/cat_all_of.dart -lib/src/model/category.dart -lib/src/model/class_model.dart -lib/src/model/date.dart -lib/src/model/deprecated_object.dart -lib/src/model/dog.dart -lib/src/model/dog_all_of.dart -lib/src/model/enum_arrays.dart -lib/src/model/enum_test.dart -lib/src/model/file_schema_test_class.dart -lib/src/model/foo.dart -lib/src/model/format_test.dart -lib/src/model/has_only_read_only.dart -lib/src/model/health_check_result.dart -lib/src/model/inline_response_default.dart -lib/src/model/map_test.dart -lib/src/model/mixed_properties_and_additional_properties_class.dart -lib/src/model/model200_response.dart -lib/src/model/model_client.dart -lib/src/model/model_enum_class.dart -lib/src/model/model_file.dart -lib/src/model/model_list.dart -lib/src/model/model_return.dart -lib/src/model/name.dart -lib/src/model/nullable_class.dart -lib/src/model/number_only.dart -lib/src/model/object_with_deprecated_fields.dart -lib/src/model/order.dart -lib/src/model/outer_composite.dart -lib/src/model/outer_enum.dart -lib/src/model/outer_enum_default_value.dart -lib/src/model/outer_enum_integer.dart -lib/src/model/outer_enum_integer_default_value.dart -lib/src/model/outer_object_with_enum_property.dart -lib/src/model/pet.dart -lib/src/model/read_only_first.dart -lib/src/model/special_model_name.dart -lib/src/model/tag.dart -lib/src/model/user.dart -lib/src/serializers.dart -pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.openapi-generator/VERSION deleted file mode 100644 index 4077803655c0..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -5.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/README.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/README.md deleted file mode 100644 index 52553e236b05..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/README.md +++ /dev/null @@ -1,200 +0,0 @@ -# openapi (EXPERIMENTAL) -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: 1.0.0 -- Build package: org.openapitools.codegen.languages.DartDioNextClientCodegen - -## Requirements - -* Dart 2.12.0 or later OR Flutter 1.26.0 or later -* Dio 4.0.0+ - -## Installation & Usage - -### pub.dev -To use the package from [pub.dev](https://pub.dev), please include the following in pubspec.yaml -```yaml -dependencies: - openapi: 1.0.0 -``` - -### Github -If this Dart package is published to Github, please include the following in pubspec.yaml -```yaml -dependencies: - openapi: - git: - url: https://github.com/GIT_USER_ID/GIT_REPO_ID.git - #ref: main -``` - -### Local development -To use the package from your local drive, please include the following in pubspec.yaml -```yaml -dependencies: - openapi: - path: /path/to/openapi -``` - -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: - -```dart -import 'package:openapi/openapi.dart'; - - -final api = Openapi().getAnotherFakeApi(); -final ModelClient modelClient = ; // ModelClient | client model - -try { - final response = await api.call123testSpecialTags(modelClient); - print(response); -} catch on DioError (e) { - print("Exception when calling AnotherFakeApi->call123testSpecialTags: $e\n"); -} - -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -[*AnotherFakeApi*](doc/AnotherFakeApi.md) | [**call123testSpecialTags**](doc/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags -[*DefaultApi*](doc/DefaultApi.md) | [**fooGet**](doc/DefaultApi.md#fooget) | **GET** /foo | -[*FakeApi*](doc/FakeApi.md) | [**fakeHealthGet**](doc/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint -[*FakeApi*](doc/FakeApi.md) | [**fakeHttpSignatureTest**](doc/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication -[*FakeApi*](doc/FakeApi.md) | [**fakeOuterBooleanSerialize**](doc/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | -[*FakeApi*](doc/FakeApi.md) | [**fakeOuterCompositeSerialize**](doc/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | -[*FakeApi*](doc/FakeApi.md) | [**fakeOuterNumberSerialize**](doc/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | -[*FakeApi*](doc/FakeApi.md) | [**fakeOuterStringSerialize**](doc/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | -[*FakeApi*](doc/FakeApi.md) | [**fakePropertyEnumIntegerSerialize**](doc/FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int | -[*FakeApi*](doc/FakeApi.md) | [**testBodyWithBinary**](doc/FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary | -[*FakeApi*](doc/FakeApi.md) | [**testBodyWithFileSchema**](doc/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | -[*FakeApi*](doc/FakeApi.md) | [**testBodyWithQueryParams**](doc/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | -[*FakeApi*](doc/FakeApi.md) | [**testClientModel**](doc/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[*FakeApi*](doc/FakeApi.md) | [**testEndpointParameters**](doc/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -[*FakeApi*](doc/FakeApi.md) | [**testEnumParameters**](doc/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters -[*FakeApi*](doc/FakeApi.md) | [**testGroupParameters**](doc/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -[*FakeApi*](doc/FakeApi.md) | [**testInlineAdditionalProperties**](doc/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -[*FakeApi*](doc/FakeApi.md) | [**testJsonFormData**](doc/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data -[*FakeApi*](doc/FakeApi.md) | [**testQueryParameterCollectionFormat**](doc/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | -[*FakeClassnameTags123Api*](doc/FakeClassnameTags123Api.md) | [**testClassname**](doc/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case -[*PetApi*](doc/PetApi.md) | [**addPet**](doc/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store -[*PetApi*](doc/PetApi.md) | [**deletePet**](doc/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -[*PetApi*](doc/PetApi.md) | [**findPetsByStatus**](doc/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -[*PetApi*](doc/PetApi.md) | [**findPetsByTags**](doc/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -[*PetApi*](doc/PetApi.md) | [**getPetById**](doc/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -[*PetApi*](doc/PetApi.md) | [**updatePet**](doc/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet -[*PetApi*](doc/PetApi.md) | [**updatePetWithForm**](doc/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -[*PetApi*](doc/PetApi.md) | [**uploadFile**](doc/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -[*PetApi*](doc/PetApi.md) | [**uploadFileWithRequiredFile**](doc/PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -[*StoreApi*](doc/StoreApi.md) | [**deleteOrder**](doc/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -[*StoreApi*](doc/StoreApi.md) | [**getInventory**](doc/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -[*StoreApi*](doc/StoreApi.md) | [**getOrderById**](doc/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID -[*StoreApi*](doc/StoreApi.md) | [**placeOrder**](doc/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet -[*UserApi*](doc/UserApi.md) | [**createUser**](doc/UserApi.md#createuser) | **POST** /user | Create user -[*UserApi*](doc/UserApi.md) | [**createUsersWithArrayInput**](doc/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -[*UserApi*](doc/UserApi.md) | [**createUsersWithListInput**](doc/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -[*UserApi*](doc/UserApi.md) | [**deleteUser**](doc/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user -[*UserApi*](doc/UserApi.md) | [**getUserByName**](doc/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name -[*UserApi*](doc/UserApi.md) | [**loginUser**](doc/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system -[*UserApi*](doc/UserApi.md) | [**logoutUser**](doc/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -[*UserApi*](doc/UserApi.md) | [**updateUser**](doc/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user - - -## Documentation For Models - - - [AdditionalPropertiesClass](doc/AdditionalPropertiesClass.md) - - [Animal](doc/Animal.md) - - [ApiResponse](doc/ApiResponse.md) - - [ArrayOfArrayOfNumberOnly](doc/ArrayOfArrayOfNumberOnly.md) - - [ArrayOfNumberOnly](doc/ArrayOfNumberOnly.md) - - [ArrayTest](doc/ArrayTest.md) - - [Capitalization](doc/Capitalization.md) - - [Cat](doc/Cat.md) - - [CatAllOf](doc/CatAllOf.md) - - [Category](doc/Category.md) - - [ClassModel](doc/ClassModel.md) - - [DeprecatedObject](doc/DeprecatedObject.md) - - [Dog](doc/Dog.md) - - [DogAllOf](doc/DogAllOf.md) - - [EnumArrays](doc/EnumArrays.md) - - [EnumTest](doc/EnumTest.md) - - [FileSchemaTestClass](doc/FileSchemaTestClass.md) - - [Foo](doc/Foo.md) - - [FormatTest](doc/FormatTest.md) - - [HasOnlyReadOnly](doc/HasOnlyReadOnly.md) - - [HealthCheckResult](doc/HealthCheckResult.md) - - [InlineResponseDefault](doc/InlineResponseDefault.md) - - [MapTest](doc/MapTest.md) - - [MixedPropertiesAndAdditionalPropertiesClass](doc/MixedPropertiesAndAdditionalPropertiesClass.md) - - [Model200Response](doc/Model200Response.md) - - [ModelClient](doc/ModelClient.md) - - [ModelEnumClass](doc/ModelEnumClass.md) - - [ModelFile](doc/ModelFile.md) - - [ModelList](doc/ModelList.md) - - [ModelReturn](doc/ModelReturn.md) - - [Name](doc/Name.md) - - [NullableClass](doc/NullableClass.md) - - [NumberOnly](doc/NumberOnly.md) - - [ObjectWithDeprecatedFields](doc/ObjectWithDeprecatedFields.md) - - [Order](doc/Order.md) - - [OuterComposite](doc/OuterComposite.md) - - [OuterEnum](doc/OuterEnum.md) - - [OuterEnumDefaultValue](doc/OuterEnumDefaultValue.md) - - [OuterEnumInteger](doc/OuterEnumInteger.md) - - [OuterEnumIntegerDefaultValue](doc/OuterEnumIntegerDefaultValue.md) - - [OuterObjectWithEnumProperty](doc/OuterObjectWithEnumProperty.md) - - [Pet](doc/Pet.md) - - [ReadOnlyFirst](doc/ReadOnlyFirst.md) - - [SpecialModelName](doc/SpecialModelName.md) - - [Tag](doc/Tag.md) - - [User](doc/User.md) - - -## Documentation For Authorization - - -## api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - -## api_key_query - -- **Type**: API key -- **API key parameter name**: api_key_query -- **Location**: URL query string - -## bearer_test - -- **Type**: HTTP basic authentication - -## http_basic_test - -- **Type**: HTTP basic authentication - -## http_signature_test - -- **Type**: HTTP basic authentication - -## petstore_auth - -- **Type**: OAuth -- **Flow**: implicit -- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog -- **Scopes**: - - **write:pets**: modify pets in your account - - **read:pets**: read your pets - - -## Author - - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/analysis_options.yaml b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/analysis_options.yaml deleted file mode 100644 index a611887d3acf..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/analysis_options.yaml +++ /dev/null @@ -1,9 +0,0 @@ -analyzer: - language: - strict-inference: true - strict-raw-types: true - strong-mode: - implicit-dynamic: false - implicit-casts: false - exclude: - - test/*.dart diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/AdditionalPropertiesClass.md deleted file mode 100644 index f9f7857894d0..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/AdditionalPropertiesClass.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.AdditionalPropertiesClass - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mapProperty** | **BuiltMap<String, String>** | | [optional] -**mapOfMapProperty** | [**BuiltMap<String, BuiltMap<String, String>>**](BuiltMap.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Animal.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Animal.md deleted file mode 100644 index 415b56e9bc2e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Animal.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.Animal - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**className** | **String** | | -**color** | **String** | | [optional] [default to 'red'] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/AnotherFakeApi.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/AnotherFakeApi.md deleted file mode 100644 index df89b0eb12a8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/AnotherFakeApi.md +++ /dev/null @@ -1,57 +0,0 @@ -# openapi.api.AnotherFakeApi - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**call123testSpecialTags**](AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags - - -# **call123testSpecialTags** -> ModelClient call123testSpecialTags(modelClient) - -To test special tags - -To test special tags and operation ID starting with number - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getAnotherFakeApi(); -final ModelClient modelClient = ; // ModelClient | client model - -try { - final response = api.call123testSpecialTags(modelClient); - print(response); -} catch on DioError (e) { - print('Exception when calling AnotherFakeApi->call123testSpecialTags: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **modelClient** | [**ModelClient**](ModelClient.md)| client model | - -### Return type - -[**ModelClient**](ModelClient.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ApiResponse.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ApiResponse.md deleted file mode 100644 index 7ad5da0f89e4..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ApiResponse.md +++ /dev/null @@ -1,17 +0,0 @@ -# openapi.model.ApiResponse - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **int** | | [optional] -**type** | **String** | | [optional] -**message** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ArrayOfArrayOfNumberOnly.md deleted file mode 100644 index d1a272ab6023..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ArrayOfArrayOfNumberOnly.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.ArrayOfArrayOfNumberOnly - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayArrayNumber** | [**BuiltList<BuiltList<num>>**](BuiltList.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ArrayOfNumberOnly.md deleted file mode 100644 index 94b60f272fd4..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ArrayOfNumberOnly.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.ArrayOfNumberOnly - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayNumber** | **BuiltList<num>** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ArrayTest.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ArrayTest.md deleted file mode 100644 index 0813d4fa93c6..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ArrayTest.md +++ /dev/null @@ -1,17 +0,0 @@ -# openapi.model.ArrayTest - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayOfString** | **BuiltList<String>** | | [optional] -**arrayArrayOfInteger** | [**BuiltList<BuiltList<int>>**](BuiltList.md) | | [optional] -**arrayArrayOfModel** | [**BuiltList<BuiltList<ReadOnlyFirst>>**](BuiltList.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Capitalization.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Capitalization.md deleted file mode 100644 index 4a07b4eb820d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Capitalization.md +++ /dev/null @@ -1,20 +0,0 @@ -# openapi.model.Capitalization - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**smallCamel** | **String** | | [optional] -**capitalCamel** | **String** | | [optional] -**smallSnake** | **String** | | [optional] -**capitalSnake** | **String** | | [optional] -**sCAETHFlowPoints** | **String** | | [optional] -**ATT_NAME** | **String** | Name of the pet | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Cat.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Cat.md deleted file mode 100644 index 6552eea4b435..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Cat.md +++ /dev/null @@ -1,17 +0,0 @@ -# openapi.model.Cat - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**className** | **String** | | -**color** | **String** | | [optional] [default to 'red'] -**declawed** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/CatAllOf.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/CatAllOf.md deleted file mode 100644 index 36b2ae0e8ab3..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/CatAllOf.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.CatAllOf - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Category.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Category.md deleted file mode 100644 index ae6bc52e89d8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Category.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.Category - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**name** | **String** | | [default to 'default-name'] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ClassModel.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ClassModel.md deleted file mode 100644 index 13ae5d3a4708..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ClassModel.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.ClassModel - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**class_** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/DefaultApi.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/DefaultApi.md deleted file mode 100644 index f1753b62ee84..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/DefaultApi.md +++ /dev/null @@ -1,51 +0,0 @@ -# openapi.api.DefaultApi - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**fooGet**](DefaultApi.md#fooget) | **GET** /foo | - - -# **fooGet** -> InlineResponseDefault fooGet() - - - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getDefaultApi(); - -try { - final response = api.fooGet(); - print(response); -} catch on DioError (e) { - print('Exception when calling DefaultApi->fooGet: $e\n'); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**InlineResponseDefault**](InlineResponseDefault.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/DeprecatedObject.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/DeprecatedObject.md deleted file mode 100644 index bf2ef67a26fc..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/DeprecatedObject.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.DeprecatedObject - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Dog.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Dog.md deleted file mode 100644 index d36439b767bb..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Dog.md +++ /dev/null @@ -1,17 +0,0 @@ -# openapi.model.Dog - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**className** | **String** | | -**color** | **String** | | [optional] [default to 'red'] -**breed** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/DogAllOf.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/DogAllOf.md deleted file mode 100644 index 97a7c8fba492..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/DogAllOf.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.DogAllOf - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/EnumArrays.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/EnumArrays.md deleted file mode 100644 index 06170bb8f51d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/EnumArrays.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.EnumArrays - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**justSymbol** | **String** | | [optional] -**arrayEnum** | **BuiltList<String>** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/EnumTest.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/EnumTest.md deleted file mode 100644 index 7c24fe2347b4..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/EnumTest.md +++ /dev/null @@ -1,22 +0,0 @@ -# openapi.model.EnumTest - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enumString** | **String** | | [optional] -**enumStringRequired** | **String** | | -**enumInteger** | **int** | | [optional] -**enumNumber** | **double** | | [optional] -**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] -**outerEnumInteger** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] -**outerEnumDefaultValue** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] -**outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/FakeApi.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/FakeApi.md deleted file mode 100644 index 740e5ee66833..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/FakeApi.md +++ /dev/null @@ -1,816 +0,0 @@ -# openapi.api.FakeApi - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**fakeHealthGet**](FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint -[**fakeHttpSignatureTest**](FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication -[**fakeOuterBooleanSerialize**](FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | -[**fakeOuterCompositeSerialize**](FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | -[**fakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | -[**fakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | -[**fakePropertyEnumIntegerSerialize**](FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int | -[**testBodyWithBinary**](FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary | -[**testBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | -[**testBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | -[**testClientModel**](FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[**testEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -[**testEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters -[**testGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -[**testInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -[**testJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data -[**testQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | - - -# **fakeHealthGet** -> HealthCheckResult fakeHealthGet() - -Health check endpoint - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); - -try { - final response = api.fakeHealthGet(); - print(response); -} catch on DioError (e) { - print('Exception when calling FakeApi->fakeHealthGet: $e\n'); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**HealthCheckResult**](HealthCheckResult.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[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) - -# **fakeHttpSignatureTest** -> fakeHttpSignatureTest(pet, query1, header1) - -test http signature authentication - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure HTTP basic authorization: http_signature_test -//defaultApiClient.getAuthentication('http_signature_test').username = 'YOUR_USERNAME' -//defaultApiClient.getAuthentication('http_signature_test').password = 'YOUR_PASSWORD'; - -final api = Openapi().getFakeApi(); -final Pet pet = ; // Pet | Pet object that needs to be added to the store -final String query1 = query1_example; // String | query parameter -final String header1 = header1_example; // String | header parameter - -try { - api.fakeHttpSignatureTest(pet, query1, header1); -} catch on DioError (e) { - print('Exception when calling FakeApi->fakeHttpSignatureTest: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - **query1** | **String**| query parameter | [optional] - **header1** | **String**| header parameter | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[http_signature_test](../README.md#http_signature_test) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakeOuterBooleanSerialize** -> bool fakeOuterBooleanSerialize(body) - - - -Test serialization of outer boolean types - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final bool body = true; // bool | Input boolean as post body - -try { - final response = api.fakeOuterBooleanSerialize(body); - print(response); -} catch on DioError (e) { - print('Exception when calling FakeApi->fakeOuterBooleanSerialize: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **bool**| Input boolean as post body | [optional] - -### Return type - -**bool** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(outerComposite) - - - -Test serialization of object with outer number type - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final OuterComposite outerComposite = ; // OuterComposite | Input composite as post body - -try { - final response = api.fakeOuterCompositeSerialize(outerComposite); - print(response); -} catch on DioError (e) { - print('Exception when calling FakeApi->fakeOuterCompositeSerialize: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] - -### Return type - -[**OuterComposite**](OuterComposite.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakeOuterNumberSerialize** -> num fakeOuterNumberSerialize(body) - - - -Test serialization of outer number types - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final num body = 8.14; // num | Input number as post body - -try { - final response = api.fakeOuterNumberSerialize(body); - print(response); -} catch on DioError (e) { - print('Exception when calling FakeApi->fakeOuterNumberSerialize: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **num**| Input number as post body | [optional] - -### Return type - -**num** - -### Authorization - -No authorization required - -### HTTP request headers - - - **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) - -# **fakeOuterStringSerialize** -> String fakeOuterStringSerialize(body) - - - -Test serialization of outer string types - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final String body = body_example; // String | Input string as post body - -try { - final response = api.fakeOuterStringSerialize(body); - print(response); -} catch on DioError (e) { - print('Exception when calling FakeApi->fakeOuterStringSerialize: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **String**| Input string as post body | [optional] - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **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) - -# **fakePropertyEnumIntegerSerialize** -> OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty) - - - -Test serialization of enum (int) properties with examples - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final OuterObjectWithEnumProperty outerObjectWithEnumProperty = ; // OuterObjectWithEnumProperty | Input enum (int) as post body - -try { - final response = api.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty); - print(response); -} catch on DioError (e) { - print('Exception when calling FakeApi->fakePropertyEnumIntegerSerialize: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **outerObjectWithEnumProperty** | [**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md)| Input enum (int) as post body | - -### Return type - -[**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **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) - -# **testBodyWithBinary** -> testBodyWithBinary(body) - - - -For this test, the body has to be a binary file. - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final MultipartFile body = BINARY_DATA_HERE; // MultipartFile | image to upload - -try { - api.testBodyWithBinary(body); -} catch on DioError (e) { - print('Exception when calling FakeApi->testBodyWithBinary: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **MultipartFile**| image to upload | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: image/png - - **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) - -# **testBodyWithFileSchema** -> testBodyWithFileSchema(fileSchemaTestClass) - - - -For this test, the body for this request must reference a schema named `File`. - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final FileSchemaTestClass fileSchemaTestClass = ; // FileSchemaTestClass | - -try { - api.testBodyWithFileSchema(fileSchemaTestClass); -} catch on DioError (e) { - print('Exception when calling FakeApi->testBodyWithFileSchema: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testBodyWithQueryParams** -> testBodyWithQueryParams(query, user) - - - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final String query = query_example; // String | -final User user = ; // User | - -try { - api.testBodyWithQueryParams(query, user); -} catch on DioError (e) { - print('Exception when calling FakeApi->testBodyWithQueryParams: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **query** | **String**| | - **user** | [**User**](User.md)| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testClientModel** -> ModelClient testClientModel(modelClient) - -To test \"client\" model - -To test \"client\" model - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final ModelClient modelClient = ; // ModelClient | client model - -try { - final response = api.testClientModel(modelClient); - print(response); -} catch on DioError (e) { - print('Exception when calling FakeApi->testClientModel: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **modelClient** | [**ModelClient**](ModelClient.md)| client model | - -### Return type - -[**ModelClient**](ModelClient.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testEndpointParameters** -> testEndpointParameters(number, double_, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, callback) - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure HTTP basic authorization: http_basic_test -//defaultApiClient.getAuthentication('http_basic_test').username = 'YOUR_USERNAME' -//defaultApiClient.getAuthentication('http_basic_test').password = 'YOUR_PASSWORD'; - -final api = Openapi().getFakeApi(); -final num number = 8.14; // num | None -final double double_ = 1.2; // double | None -final String patternWithoutDelimiter = patternWithoutDelimiter_example; // String | None -final String byte = BYTE_ARRAY_DATA_HERE; // String | None -final int integer = 56; // int | None -final int int32 = 56; // int | None -final int int64 = 789; // int | None -final double float = 3.4; // double | None -final String string = string_example; // String | None -final Uint8List binary = BINARY_DATA_HERE; // Uint8List | None -final Date date = 2013-10-20; // Date | None -final DateTime dateTime = 2013-10-20T19:20:30+01:00; // DateTime | None -final String password = password_example; // String | None -final String callback = callback_example; // String | None - -try { - api.testEndpointParameters(number, double_, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, callback); -} catch on DioError (e) { - print('Exception when calling FakeApi->testEndpointParameters: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **number** | **num**| None | - **double_** | **double**| None | - **patternWithoutDelimiter** | **String**| None | - **byte** | **String**| None | - **integer** | **int**| None | [optional] - **int32** | **int**| None | [optional] - **int64** | **int**| None | [optional] - **float** | **double**| None | [optional] - **string** | **String**| None | [optional] - **binary** | **Uint8List**| None | [optional] - **date** | **Date**| None | [optional] - **dateTime** | **DateTime**| None | [optional] - **password** | **String**| None | [optional] - **callback** | **String**| None | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[http_basic_test](../README.md#http_basic_test) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testEnumParameters** -> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) - -To test enum parameters - -To test enum parameters - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final BuiltList enumHeaderStringArray = ; // BuiltList | Header parameter enum test (string array) -final String enumHeaderString = enumHeaderString_example; // String | Header parameter enum test (string) -final BuiltList enumQueryStringArray = ; // BuiltList | Query parameter enum test (string array) -final String enumQueryString = enumQueryString_example; // String | Query parameter enum test (string) -final int enumQueryInteger = 56; // int | Query parameter enum test (double) -final double enumQueryDouble = 1.2; // double | Query parameter enum test (double) -final BuiltList enumFormStringArray = ; // BuiltList | Form parameter enum test (string array) -final String enumFormString = enumFormString_example; // String | Form parameter enum test (string) - -try { - api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); -} catch on DioError (e) { - print('Exception when calling FakeApi->testEnumParameters: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enumHeaderStringArray** | [**BuiltList<String>**](String.md)| Header parameter enum test (string array) | [optional] - **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to '-efg'] - **enumQueryStringArray** | [**BuiltList<String>**](String.md)| Query parameter enum test (string array) | [optional] - **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to '-efg'] - **enumQueryInteger** | **int**| Query parameter enum test (double) | [optional] - **enumQueryDouble** | **double**| Query parameter enum test (double) | [optional] - **enumFormStringArray** | [**BuiltList<String>**](String.md)| Form parameter enum test (string array) | [optional] [default to '$'] - **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to '-efg'] - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testGroupParameters** -> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) - -Fake endpoint to test group parameters (optional) - -Fake endpoint to test group parameters (optional) - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure HTTP basic authorization: bearer_test -//defaultApiClient.getAuthentication('bearer_test').username = 'YOUR_USERNAME' -//defaultApiClient.getAuthentication('bearer_test').password = 'YOUR_PASSWORD'; - -final api = Openapi().getFakeApi(); -final int requiredStringGroup = 56; // int | Required String in group parameters -final bool requiredBooleanGroup = true; // bool | Required Boolean in group parameters -final int requiredInt64Group = 789; // int | Required Integer in group parameters -final int stringGroup = 56; // int | String in group parameters -final bool booleanGroup = true; // bool | Boolean in group parameters -final int int64Group = 789; // int | Integer in group parameters - -try { - api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); -} catch on DioError (e) { - print('Exception when calling FakeApi->testGroupParameters: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **requiredStringGroup** | **int**| Required String in group parameters | - **requiredBooleanGroup** | **bool**| Required Boolean in group parameters | - **requiredInt64Group** | **int**| Required Integer in group parameters | - **stringGroup** | **int**| String in group parameters | [optional] - **booleanGroup** | **bool**| Boolean in group parameters | [optional] - **int64Group** | **int**| Integer in group parameters | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[bearer_test](../README.md#bearer_test) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testInlineAdditionalProperties** -> testInlineAdditionalProperties(requestBody) - -test inline additionalProperties - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final BuiltMap requestBody = ; // BuiltMap | request body - -try { - api.testInlineAdditionalProperties(requestBody); -} catch on DioError (e) { - print('Exception when calling FakeApi->testInlineAdditionalProperties: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **requestBody** | [**BuiltMap<String, String>**](String.md)| request body | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testJsonFormData** -> testJsonFormData(param, param2) - -test json serialization of form data - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final String param = param_example; // String | field1 -final String param2 = param2_example; // String | field2 - -try { - api.testJsonFormData(param, param2); -} catch on DioError (e) { - print('Exception when calling FakeApi->testJsonFormData: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | **String**| field1 | - **param2** | **String**| field2 | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testQueryParameterCollectionFormat** -> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language) - - - -To test the collection format in query parameters - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final BuiltList pipe = ; // BuiltList | -final BuiltList ioutil = ; // BuiltList | -final BuiltList http = ; // BuiltList | -final BuiltList url = ; // BuiltList | -final BuiltList context = ; // BuiltList | -final String allowEmpty = allowEmpty_example; // String | -final BuiltMap language = ; // BuiltMap | - -try { - api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language); -} catch on DioError (e) { - print('Exception when calling FakeApi->testQueryParameterCollectionFormat: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pipe** | [**BuiltList<String>**](String.md)| | - **ioutil** | [**BuiltList<String>**](String.md)| | - **http** | [**BuiltList<String>**](String.md)| | - **url** | [**BuiltList<String>**](String.md)| | - **context** | [**BuiltList<String>**](String.md)| | - **allowEmpty** | **String**| | - **language** | [**BuiltMap<String, String>**](String.md)| | [optional] - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/FakeClassnameTags123Api.md deleted file mode 100644 index 35e244fbf21e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/FakeClassnameTags123Api.md +++ /dev/null @@ -1,61 +0,0 @@ -# openapi.api.FakeClassnameTags123Api - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**testClassname**](FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case - - -# **testClassname** -> ModelClient testClassname(modelClient) - -To test class name in snake case - -To test class name in snake case - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure API key authorization: api_key_query -//defaultApiClient.getAuthentication('api_key_query').apiKey = 'YOUR_API_KEY'; -// uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('api_key_query').apiKeyPrefix = 'Bearer'; - -final api = Openapi().getFakeClassnameTags123Api(); -final ModelClient modelClient = ; // ModelClient | client model - -try { - final response = api.testClassname(modelClient); - print(response); -} catch on DioError (e) { - print('Exception when calling FakeClassnameTags123Api->testClassname: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **modelClient** | [**ModelClient**](ModelClient.md)| client model | - -### Return type - -[**ModelClient**](ModelClient.md) - -### Authorization - -[api_key_query](../README.md#api_key_query) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/FileSchemaTestClass.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/FileSchemaTestClass.md deleted file mode 100644 index 105fece87f1d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/FileSchemaTestClass.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.FileSchemaTestClass - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**file** | [**ModelFile**](ModelFile.md) | | [optional] -**files** | [**BuiltList<ModelFile>**](ModelFile.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Foo.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Foo.md deleted file mode 100644 index 185b76e3f5b4..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Foo.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.Foo - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] [default to 'bar'] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/FormatTest.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/FormatTest.md deleted file mode 100644 index f811264ca2ba..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/FormatTest.md +++ /dev/null @@ -1,30 +0,0 @@ -# openapi.model.FormatTest - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integer** | **int** | | [optional] -**int32** | **int** | | [optional] -**int64** | **int** | | [optional] -**number** | **num** | | -**float** | **double** | | [optional] -**double_** | **double** | | [optional] -**decimal** | **double** | | [optional] -**string** | **String** | | [optional] -**byte** | **String** | | -**binary** | [**Uint8List**](Uint8List.md) | | [optional] -**date** | [**Date**](Date.md) | | -**dateTime** | [**DateTime**](DateTime.md) | | [optional] -**uuid** | **String** | | [optional] -**password** | **String** | | -**patternWithDigits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional] -**patternWithDigitsAndDelimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/HasOnlyReadOnly.md deleted file mode 100644 index 32cae937155d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/HasOnlyReadOnly.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.HasOnlyReadOnly - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] -**foo** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/HealthCheckResult.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/HealthCheckResult.md deleted file mode 100644 index 4d6aeb75d965..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/HealthCheckResult.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.HealthCheckResult - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**nullableMessage** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/InlineResponseDefault.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/InlineResponseDefault.md deleted file mode 100644 index c5e61e1162bf..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/InlineResponseDefault.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.InlineResponseDefault - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**string** | [**Foo**](Foo.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/MapTest.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/MapTest.md deleted file mode 100644 index 4ad87df64232..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/MapTest.md +++ /dev/null @@ -1,18 +0,0 @@ -# openapi.model.MapTest - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mapMapOfString** | [**BuiltMap<String, BuiltMap<String, String>>**](BuiltMap.md) | | [optional] -**mapOfEnumString** | **BuiltMap<String, String>** | | [optional] -**directMap** | **BuiltMap<String, bool>** | | [optional] -**indirectMap** | **BuiltMap<String, bool>** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/MixedPropertiesAndAdditionalPropertiesClass.md deleted file mode 100644 index b1a4c4ccc401..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/MixedPropertiesAndAdditionalPropertiesClass.md +++ /dev/null @@ -1,17 +0,0 @@ -# openapi.model.MixedPropertiesAndAdditionalPropertiesClass - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | **String** | | [optional] -**dateTime** | [**DateTime**](DateTime.md) | | [optional] -**map** | [**BuiltMap<String, Animal>**](Animal.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Model200Response.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Model200Response.md deleted file mode 100644 index 5aa3fb97c32e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Model200Response.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.Model200Response - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **int** | | [optional] -**class_** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelClient.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelClient.md deleted file mode 100644 index f7b922f4a398..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelClient.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.ModelClient - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelEnumClass.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelEnumClass.md deleted file mode 100644 index ebaafb44c7f7..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelEnumClass.md +++ /dev/null @@ -1,14 +0,0 @@ -# openapi.model.ModelEnumClass - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelFile.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelFile.md deleted file mode 100644 index 4be260e93f6e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelFile.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.ModelFile - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**sourceURI** | **String** | Test capitalization | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelList.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelList.md deleted file mode 100644 index 283aa1f6b711..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelList.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.ModelList - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**n123list** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelReturn.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelReturn.md deleted file mode 100644 index bc02df7a3692..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelReturn.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.ModelReturn - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**return_** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Name.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Name.md deleted file mode 100644 index 25f49ea946b4..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Name.md +++ /dev/null @@ -1,18 +0,0 @@ -# openapi.model.Name - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **int** | | -**snakeCase** | **int** | | [optional] -**property** | **String** | | [optional] -**n123number** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/NullableClass.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/NullableClass.md deleted file mode 100644 index 4ce8d5e17576..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/NullableClass.md +++ /dev/null @@ -1,26 +0,0 @@ -# openapi.model.NullableClass - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integerProp** | **int** | | [optional] -**numberProp** | **num** | | [optional] -**booleanProp** | **bool** | | [optional] -**stringProp** | **String** | | [optional] -**dateProp** | [**Date**](Date.md) | | [optional] -**datetimeProp** | [**DateTime**](DateTime.md) | | [optional] -**arrayNullableProp** | [**BuiltList<JsonObject>**](JsonObject.md) | | [optional] -**arrayAndItemsNullableProp** | [**BuiltList<JsonObject>**](JsonObject.md) | | [optional] -**arrayItemsNullable** | [**BuiltList<JsonObject>**](JsonObject.md) | | [optional] -**objectNullableProp** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | | [optional] -**objectAndItemsNullableProp** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | | [optional] -**objectItemsNullable** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/NumberOnly.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/NumberOnly.md deleted file mode 100644 index d8096a3db37a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/NumberOnly.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.NumberOnly - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**justNumber** | **num** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ObjectWithDeprecatedFields.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ObjectWithDeprecatedFields.md deleted file mode 100644 index 3e7848d382c2..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ObjectWithDeprecatedFields.md +++ /dev/null @@ -1,18 +0,0 @@ -# openapi.model.ObjectWithDeprecatedFields - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | **String** | | [optional] -**id** | **num** | | [optional] -**deprecatedRef** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional] -**bars** | **BuiltList<String>** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Order.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Order.md deleted file mode 100644 index bde5ffe51a2c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Order.md +++ /dev/null @@ -1,20 +0,0 @@ -# openapi.model.Order - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**petId** | **int** | | [optional] -**quantity** | **int** | | [optional] -**shipDate** | [**DateTime**](DateTime.md) | | [optional] -**status** | **String** | Order Status | [optional] -**complete** | **bool** | | [optional] [default to false] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterComposite.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterComposite.md deleted file mode 100644 index 04bab7eff5d1..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterComposite.md +++ /dev/null @@ -1,17 +0,0 @@ -# openapi.model.OuterComposite - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**myNumber** | **num** | | [optional] -**myString** | **String** | | [optional] -**myBoolean** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterEnum.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterEnum.md deleted file mode 100644 index af62ad87ab2e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterEnum.md +++ /dev/null @@ -1,14 +0,0 @@ -# openapi.model.OuterEnum - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterEnumDefaultValue.md deleted file mode 100644 index c1bf8b0dec44..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterEnumDefaultValue.md +++ /dev/null @@ -1,14 +0,0 @@ -# openapi.model.OuterEnumDefaultValue - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterEnumInteger.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterEnumInteger.md deleted file mode 100644 index 8c80a9e5c85f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterEnumInteger.md +++ /dev/null @@ -1,14 +0,0 @@ -# openapi.model.OuterEnumInteger - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterEnumIntegerDefaultValue.md deleted file mode 100644 index eb8b55d70249..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterEnumIntegerDefaultValue.md +++ /dev/null @@ -1,14 +0,0 @@ -# openapi.model.OuterEnumIntegerDefaultValue - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterObjectWithEnumProperty.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterObjectWithEnumProperty.md deleted file mode 100644 index eab2ae8f66b4..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterObjectWithEnumProperty.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.OuterObjectWithEnumProperty - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | [**OuterEnumInteger**](OuterEnumInteger.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Pet.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Pet.md deleted file mode 100644 index 08e0aeedd784..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Pet.md +++ /dev/null @@ -1,20 +0,0 @@ -# openapi.model.Pet - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**name** | **String** | | -**photoUrls** | **BuiltSet<String>** | | -**tags** | [**BuiltList<Tag>**](Tag.md) | | [optional] -**status** | **String** | pet status in the store | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/PetApi.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/PetApi.md deleted file mode 100644 index 6afc643ea56a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/PetApi.md +++ /dev/null @@ -1,427 +0,0 @@ -# openapi.api.PetApi - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**addPet**](PetApi.md#addpet) | **POST** /pet | Add a new pet to the store -[**deletePet**](PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -[**findPetsByStatus**](PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -[**findPetsByTags**](PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -[**getPetById**](PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -[**updatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet -[**updatePetWithForm**](PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -[**uploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -[**uploadFileWithRequiredFile**](PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) - - -# **addPet** -> addPet(pet) - -Add a new pet to the store - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -final api = Openapi().getPetApi(); -final Pet pet = ; // Pet | Pet object that needs to be added to the store - -try { - api.addPet(pet); -} catch on DioError (e) { - print('Exception when calling PetApi->addPet: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **deletePet** -> deletePet(petId, apiKey) - -Deletes a pet - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -final api = Openapi().getPetApi(); -final int petId = 789; // int | Pet id to delete -final String apiKey = apiKey_example; // String | - -try { - api.deletePet(petId, apiKey); -} catch on DioError (e) { - print('Exception when calling PetApi->deletePet: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **int**| Pet id to delete | - **apiKey** | **String**| | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **findPetsByStatus** -> BuiltList findPetsByStatus(status) - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -final api = Openapi().getPetApi(); -final BuiltList status = ; // BuiltList | Status values that need to be considered for filter - -try { - final response = api.findPetsByStatus(status); - print(response); -} catch on DioError (e) { - print('Exception when calling PetApi->findPetsByStatus: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**BuiltList<String>**](String.md)| Status values that need to be considered for filter | - -### Return type - -[**BuiltList<Pet>**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **findPetsByTags** -> BuiltSet findPetsByTags(tags) - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -final api = Openapi().getPetApi(); -final BuiltSet tags = ; // BuiltSet | Tags to filter by - -try { - final response = api.findPetsByTags(tags); - print(response); -} catch on DioError (e) { - print('Exception when calling PetApi->findPetsByTags: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**BuiltSet<String>**](String.md)| Tags to filter by | - -### Return type - -[**BuiltSet<Pet>**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getPetById** -> Pet getPetById(petId) - -Find pet by ID - -Returns a single pet - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure API key authorization: api_key -//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; -// uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; - -final api = Openapi().getPetApi(); -final int petId = 789; // int | ID of pet to return - -try { - final response = api.getPetById(petId); - print(response); -} catch on DioError (e) { - print('Exception when calling PetApi->getPetById: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet to return | - -### Return type - -[**Pet**](Pet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updatePet** -> updatePet(pet) - -Update an existing pet - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -final api = Openapi().getPetApi(); -final Pet pet = ; // Pet | Pet object that needs to be added to the store - -try { - api.updatePet(pet); -} catch on DioError (e) { - print('Exception when calling PetApi->updatePet: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updatePetWithForm** -> updatePetWithForm(petId, name, status) - -Updates a pet in the store with form data - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -final api = Openapi().getPetApi(); -final int petId = 789; // int | ID of pet that needs to be updated -final String name = name_example; // String | Updated name of the pet -final String status = status_example; // String | Updated status of the pet - -try { - api.updatePetWithForm(petId, name, status); -} catch on DioError (e) { - print('Exception when calling PetApi->updatePetWithForm: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet that needs to be updated | - **name** | **String**| Updated name of the pet | [optional] - **status** | **String**| Updated status of the pet | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **uploadFile** -> ApiResponse uploadFile(petId, additionalMetadata, file) - -uploads an image - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -final api = Openapi().getPetApi(); -final int petId = 789; // int | ID of pet to update -final String additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server -final MultipartFile file = BINARY_DATA_HERE; // MultipartFile | file to upload - -try { - final response = api.uploadFile(petId, additionalMetadata, file); - print(response); -} catch on DioError (e) { - print('Exception when calling PetApi->uploadFile: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet to update | - **additionalMetadata** | **String**| Additional data to pass to server | [optional] - **file** | **MultipartFile**| file to upload | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **uploadFileWithRequiredFile** -> ApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) - -uploads an image (required) - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -final api = Openapi().getPetApi(); -final int petId = 789; // int | ID of pet to update -final MultipartFile requiredFile = BINARY_DATA_HERE; // MultipartFile | file to upload -final String additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server - -try { - final response = api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); - print(response); -} catch on DioError (e) { - print('Exception when calling PetApi->uploadFileWithRequiredFile: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet to update | - **requiredFile** | **MultipartFile**| file to upload | - **additionalMetadata** | **String**| Additional data to pass to server | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ReadOnlyFirst.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ReadOnlyFirst.md deleted file mode 100644 index 8f612e8ba19f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ReadOnlyFirst.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.ReadOnlyFirst - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] -**baz** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/SpecialModelName.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/SpecialModelName.md deleted file mode 100644 index 5fcfa98e0b36..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/SpecialModelName.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.SpecialModelName - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/StoreApi.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/StoreApi.md deleted file mode 100644 index 5c8a683579e2..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/StoreApi.md +++ /dev/null @@ -1,186 +0,0 @@ -# openapi.api.StoreApi - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -[**getInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID -[**placeOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet - - -# **deleteOrder** -> deleteOrder(orderId) - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getStoreApi(); -final String orderId = orderId_example; // String | ID of the order that needs to be deleted - -try { - api.deleteOrder(orderId); -} catch on DioError (e) { - print('Exception when calling StoreApi->deleteOrder: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **String**| ID of the order that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getInventory** -> BuiltMap getInventory() - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure API key authorization: api_key -//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; -// uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; - -final api = Openapi().getStoreApi(); - -try { - final response = api.getInventory(); - print(response); -} catch on DioError (e) { - print('Exception when calling StoreApi->getInventory: $e\n'); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**BuiltMap<String, int>** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getOrderById** -> Order getOrderById(orderId) - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getStoreApi(); -final int orderId = 789; // int | ID of pet that needs to be fetched - -try { - final response = api.getOrderById(orderId); - print(response); -} catch on DioError (e) { - print('Exception when calling StoreApi->getOrderById: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **int**| ID of pet that needs to be fetched | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **placeOrder** -> Order placeOrder(order) - -Place an order for a pet - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getStoreApi(); -final Order order = ; // Order | order placed for purchasing the pet - -try { - final response = api.placeOrder(order); - print(response); -} catch on DioError (e) { - print('Exception when calling StoreApi->placeOrder: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md)| order placed for purchasing the pet | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Tag.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Tag.md deleted file mode 100644 index c219f987c19c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Tag.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.Tag - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**name** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/User.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/User.md deleted file mode 100644 index fa87e64d8595..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/User.md +++ /dev/null @@ -1,22 +0,0 @@ -# openapi.model.User - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**username** | **String** | | [optional] -**firstName** | **String** | | [optional] -**lastName** | **String** | | [optional] -**email** | **String** | | [optional] -**password** | **String** | | [optional] -**phone** | **String** | | [optional] -**userStatus** | **int** | User Status | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/UserApi.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/UserApi.md deleted file mode 100644 index e3af05ffb087..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/UserApi.md +++ /dev/null @@ -1,349 +0,0 @@ -# openapi.api.UserApi - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createUser**](UserApi.md#createuser) | **POST** /user | Create user -[**createUsersWithArrayInput**](UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -[**createUsersWithListInput**](UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -[**deleteUser**](UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user -[**getUserByName**](UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name -[**loginUser**](UserApi.md#loginuser) | **GET** /user/login | Logs user into the system -[**logoutUser**](UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -[**updateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user - - -# **createUser** -> createUser(user) - -Create user - -This can only be done by the logged in user. - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getUserApi(); -final User user = ; // User | Created user object - -try { - api.createUser(user); -} catch on DioError (e) { - print('Exception when calling UserApi->createUser: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| Created user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **createUsersWithArrayInput** -> createUsersWithArrayInput(user) - -Creates list of users with given input array - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getUserApi(); -final BuiltList user = ; // BuiltList | List of user object - -try { - api.createUsersWithArrayInput(user); -} catch on DioError (e) { - print('Exception when calling UserApi->createUsersWithArrayInput: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**BuiltList<User>**](User.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **createUsersWithListInput** -> createUsersWithListInput(user) - -Creates list of users with given input array - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getUserApi(); -final BuiltList user = ; // BuiltList | List of user object - -try { - api.createUsersWithListInput(user); -} catch on DioError (e) { - print('Exception when calling UserApi->createUsersWithListInput: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**BuiltList<User>**](User.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **deleteUser** -> deleteUser(username) - -Delete user - -This can only be done by the logged in user. - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getUserApi(); -final String username = username_example; // String | The name that needs to be deleted - -try { - api.deleteUser(username); -} catch on DioError (e) { - print('Exception when calling UserApi->deleteUser: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getUserByName** -> User getUserByName(username) - -Get user by user name - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getUserApi(); -final String username = username_example; // String | The name that needs to be fetched. Use user1 for testing. - -try { - final response = api.getUserByName(username); - print(response); -} catch on DioError (e) { - print('Exception when calling UserApi->getUserByName: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**User**](User.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **loginUser** -> String loginUser(username, password) - -Logs user into the system - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getUserApi(); -final String username = username_example; // String | The user name for login -final String password = password_example; // String | The password for login in clear text - -try { - final response = api.loginUser(username, password); - print(response); -} catch on DioError (e) { - print('Exception when calling UserApi->loginUser: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | - **password** | **String**| The password for login in clear text | - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **logoutUser** -> logoutUser() - -Logs out current logged in user session - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getUserApi(); - -try { - api.logoutUser(); -} catch on DioError (e) { - print('Exception when calling UserApi->logoutUser: $e\n'); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updateUser** -> updateUser(username, user) - -Updated user - -This can only be done by the logged in user. - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getUserApi(); -final String username = username_example; // String | name that need to be deleted -final User user = ; // User | Updated user object - -try { - api.updateUser(username, user); -} catch on DioError (e) { - print('Exception when calling UserApi->updateUser: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | - **user** | [**User**](User.md)| Updated user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/openapi.dart deleted file mode 100644 index 5dbf2a6964dc..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/openapi.dart +++ /dev/null @@ -1,65 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -export 'package:openapi/src/api.dart'; -export 'package:openapi/src/auth/api_key_auth.dart'; -export 'package:openapi/src/auth/basic_auth.dart'; -export 'package:openapi/src/auth/oauth.dart'; -export 'package:openapi/src/serializers.dart'; -export 'package:openapi/src/model/date.dart'; - -export 'package:openapi/src/api/another_fake_api.dart'; -export 'package:openapi/src/api/default_api.dart'; -export 'package:openapi/src/api/fake_api.dart'; -export 'package:openapi/src/api/fake_classname_tags123_api.dart'; -export 'package:openapi/src/api/pet_api.dart'; -export 'package:openapi/src/api/store_api.dart'; -export 'package:openapi/src/api/user_api.dart'; - -export 'package:openapi/src/model/additional_properties_class.dart'; -export 'package:openapi/src/model/animal.dart'; -export 'package:openapi/src/model/api_response.dart'; -export 'package:openapi/src/model/array_of_array_of_number_only.dart'; -export 'package:openapi/src/model/array_of_number_only.dart'; -export 'package:openapi/src/model/array_test.dart'; -export 'package:openapi/src/model/capitalization.dart'; -export 'package:openapi/src/model/cat.dart'; -export 'package:openapi/src/model/cat_all_of.dart'; -export 'package:openapi/src/model/category.dart'; -export 'package:openapi/src/model/class_model.dart'; -export 'package:openapi/src/model/deprecated_object.dart'; -export 'package:openapi/src/model/dog.dart'; -export 'package:openapi/src/model/dog_all_of.dart'; -export 'package:openapi/src/model/enum_arrays.dart'; -export 'package:openapi/src/model/enum_test.dart'; -export 'package:openapi/src/model/file_schema_test_class.dart'; -export 'package:openapi/src/model/foo.dart'; -export 'package:openapi/src/model/format_test.dart'; -export 'package:openapi/src/model/has_only_read_only.dart'; -export 'package:openapi/src/model/health_check_result.dart'; -export 'package:openapi/src/model/inline_response_default.dart'; -export 'package:openapi/src/model/map_test.dart'; -export 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart'; -export 'package:openapi/src/model/model200_response.dart'; -export 'package:openapi/src/model/model_client.dart'; -export 'package:openapi/src/model/model_enum_class.dart'; -export 'package:openapi/src/model/model_file.dart'; -export 'package:openapi/src/model/model_list.dart'; -export 'package:openapi/src/model/model_return.dart'; -export 'package:openapi/src/model/name.dart'; -export 'package:openapi/src/model/nullable_class.dart'; -export 'package:openapi/src/model/number_only.dart'; -export 'package:openapi/src/model/object_with_deprecated_fields.dart'; -export 'package:openapi/src/model/order.dart'; -export 'package:openapi/src/model/outer_composite.dart'; -export 'package:openapi/src/model/outer_enum.dart'; -export 'package:openapi/src/model/outer_enum_default_value.dart'; -export 'package:openapi/src/model/outer_enum_integer.dart'; -export 'package:openapi/src/model/outer_enum_integer_default_value.dart'; -export 'package:openapi/src/model/outer_object_with_enum_property.dart'; -export 'package:openapi/src/model/pet.dart'; -export 'package:openapi/src/model/read_only_first.dart'; -export 'package:openapi/src/model/special_model_name.dart'; -export 'package:openapi/src/model/tag.dart'; -export 'package:openapi/src/model/user.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api.dart deleted file mode 100644 index d2d54f38185f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api.dart +++ /dev/null @@ -1,115 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:dio_http/dio_http.dart'; -import 'package:built_value/serializer.dart'; -import 'package:openapi/src/serializers.dart'; -import 'package:openapi/src/auth/api_key_auth.dart'; -import 'package:openapi/src/auth/basic_auth.dart'; -import 'package:openapi/src/auth/bearer_auth.dart'; -import 'package:openapi/src/auth/oauth.dart'; -import 'package:openapi/src/api/another_fake_api.dart'; -import 'package:openapi/src/api/default_api.dart'; -import 'package:openapi/src/api/fake_api.dart'; -import 'package:openapi/src/api/fake_classname_tags123_api.dart'; -import 'package:openapi/src/api/pet_api.dart'; -import 'package:openapi/src/api/store_api.dart'; -import 'package:openapi/src/api/user_api.dart'; - -class Openapi { - static const String basePath = r'http://petstore.swagger.io:80/v2'; - - final Dio dio; - final Serializers serializers; - - Openapi({ - Dio? dio, - Serializers? serializers, - String? basePathOverride, - List? interceptors, - }) : this.serializers = serializers ?? standardSerializers, - this.dio = dio ?? - Dio(BaseOptions( - baseUrl: basePathOverride ?? basePath, - connectTimeout: 5000, - receiveTimeout: 3000, - )) { - if (interceptors == null) { - this.dio.interceptors.addAll([ - OAuthInterceptor(), - BasicAuthInterceptor(), - BearerAuthInterceptor(), - ApiKeyAuthInterceptor(), - ]); - } else { - this.dio.interceptors.addAll(interceptors); - } - } - - void setOAuthToken(String name, String token) { - if (this.dio.interceptors.any((i) => i is OAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) as OAuthInterceptor).tokens[name] = token; - } - } - - void setBearerAuth(String name, String token) { - if (this.dio.interceptors.any((i) => i is BearerAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is BearerAuthInterceptor) as BearerAuthInterceptor).tokens[name] = token; - } - } - - void setBasicAuth(String name, String username, String password) { - if (this.dio.interceptors.any((i) => i is BasicAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) as BasicAuthInterceptor).authInfo[name] = BasicAuthInfo(username, password); - } - } - - void setApiKey(String name, String apiKey) { - if (this.dio.interceptors.any((i) => i is ApiKeyAuthInterceptor)) { - (this.dio.interceptors.firstWhere((element) => element is ApiKeyAuthInterceptor) as ApiKeyAuthInterceptor).apiKeys[name] = apiKey; - } - } - - /// Get AnotherFakeApi instance, base route and serializer can be overridden by a given but be careful, - /// by doing that all interceptors will not be executed - AnotherFakeApi getAnotherFakeApi() { - return AnotherFakeApi(dio, serializers); - } - - /// Get DefaultApi instance, base route and serializer can be overridden by a given but be careful, - /// by doing that all interceptors will not be executed - DefaultApi getDefaultApi() { - return DefaultApi(dio, serializers); - } - - /// Get FakeApi instance, base route and serializer can be overridden by a given but be careful, - /// by doing that all interceptors will not be executed - FakeApi getFakeApi() { - return FakeApi(dio, serializers); - } - - /// Get FakeClassnameTags123Api instance, base route and serializer can be overridden by a given but be careful, - /// by doing that all interceptors will not be executed - FakeClassnameTags123Api getFakeClassnameTags123Api() { - return FakeClassnameTags123Api(dio, serializers); - } - - /// Get PetApi instance, base route and serializer can be overridden by a given but be careful, - /// by doing that all interceptors will not be executed - PetApi getPetApi() { - return PetApi(dio, serializers); - } - - /// Get StoreApi instance, base route and serializer can be overridden by a given but be careful, - /// by doing that all interceptors will not be executed - StoreApi getStoreApi() { - return StoreApi(dio, serializers); - } - - /// Get UserApi instance, base route and serializer can be overridden by a given but be careful, - /// by doing that all interceptors will not be executed - UserApi getUserApi() { - return UserApi(dio, serializers); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/another_fake_api.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/another_fake_api.dart deleted file mode 100644 index d361f9ce96de..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/another_fake_api.dart +++ /dev/null @@ -1,113 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -import 'package:built_value/serializer.dart'; -import 'package:dio_http/dio_http.dart'; - -import 'package:openapi/src/model/model_client.dart'; - -class AnotherFakeApi { - - final Dio _dio; - - final Serializers _serializers; - - const AnotherFakeApi(this._dio, this._serializers); - - /// To test special tags - /// To test special tags and operation ID starting with number - /// - /// Parameters: - /// * [modelClient] - client model - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [ModelClient] as data - /// Throws [DioError] if API call or serialization fails - Future> call123testSpecialTags({ - required ModelClient modelClient, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/another-fake/dummy'; - final _options = Options( - method: r'PATCH', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - const _type = FullType(ModelClient); - _bodyData = _serializers.serialize(modelClient, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - ModelClient _responseData; - - try { - const _responseType = FullType(ModelClient); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as ModelClient; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/default_api.dart deleted file mode 100644 index 87c6f0dd2fcf..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/default_api.dart +++ /dev/null @@ -1,92 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -import 'package:built_value/serializer.dart'; -import 'package:dio_http/dio_http.dart'; - -import 'package:openapi/src/model/inline_response_default.dart'; - -class DefaultApi { - - final Dio _dio; - - final Serializers _serializers; - - const DefaultApi(this._dio, this._serializers); - - /// fooGet - /// - /// - /// Parameters: - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [InlineResponseDefault] as data - /// Throws [DioError] if API call or serialization fails - Future> fooGet({ - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/foo'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - InlineResponseDefault _responseData; - - try { - const _responseType = FullType(InlineResponseDefault); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as InlineResponseDefault; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/fake_api.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/fake_api.dart deleted file mode 100644 index d8640836000a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/fake_api.dart +++ /dev/null @@ -1,1417 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -import 'package:built_value/serializer.dart'; -import 'package:dio_http/dio_http.dart'; - -import 'dart:typed_data'; -import 'package:built_collection/built_collection.dart'; -import 'package:openapi/src/api_util.dart'; -import 'package:openapi/src/model/date.dart'; -import 'package:openapi/src/model/file_schema_test_class.dart'; -import 'package:openapi/src/model/health_check_result.dart'; -import 'package:openapi/src/model/model_client.dart'; -import 'package:openapi/src/model/outer_composite.dart'; -import 'package:openapi/src/model/outer_object_with_enum_property.dart'; -import 'package:openapi/src/model/pet.dart'; -import 'package:openapi/src/model/user.dart'; - -class FakeApi { - - final Dio _dio; - - final Serializers _serializers; - - const FakeApi(this._dio, this._serializers); - - /// Health check endpoint - /// - /// - /// Parameters: - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [HealthCheckResult] as data - /// Throws [DioError] if API call or serialization fails - Future> fakeHealthGet({ - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/health'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - HealthCheckResult _responseData; - - try { - const _responseType = FullType(HealthCheckResult); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as HealthCheckResult; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// test http signature authentication - /// - /// - /// Parameters: - /// * [pet] - Pet object that needs to be added to the store - /// * [query1] - query parameter - /// * [header1] - header parameter - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> fakeHttpSignatureTest({ - required Pet pet, - String? query1, - String? header1, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/http-signature-test'; - final _options = Options( - method: r'GET', - headers: { - if (header1 != null) r'header_1': header1, - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'http', - 'scheme': 'signature', - 'name': 'http_signature_test', - }, - ], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - final _queryParameters = { - if (query1 != null) r'query_1': encodeQueryParameter(_serializers, query1, const FullType(String)), - }; - - dynamic _bodyData; - - try { - const _type = FullType(Pet); - _bodyData = _serializers.serialize(pet, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - queryParameters: _queryParameters, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// fakeOuterBooleanSerialize - /// Test serialization of outer boolean types - /// - /// Parameters: - /// * [body] - Input boolean as post body - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [bool] as data - /// Throws [DioError] if API call or serialization fails - Future> fakeOuterBooleanSerialize({ - bool? body, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/outer/boolean'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - _bodyData = body; - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - bool _responseData; - - try { - _responseData = _response.data as bool; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// fakeOuterCompositeSerialize - /// Test serialization of object with outer number type - /// - /// Parameters: - /// * [outerComposite] - Input composite as post body - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [OuterComposite] as data - /// Throws [DioError] if API call or serialization fails - Future> fakeOuterCompositeSerialize({ - OuterComposite? outerComposite, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/outer/composite'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - const _type = FullType(OuterComposite); - _bodyData = outerComposite == null ? null : _serializers.serialize(outerComposite, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - OuterComposite _responseData; - - try { - const _responseType = FullType(OuterComposite); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as OuterComposite; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// fakeOuterNumberSerialize - /// Test serialization of outer number types - /// - /// Parameters: - /// * [body] - Input number as post body - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [num] as data - /// Throws [DioError] if API call or serialization fails - Future> fakeOuterNumberSerialize({ - num? body, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/outer/number'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - _bodyData = body; - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - num _responseData; - - try { - _responseData = _response.data as num; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// fakeOuterStringSerialize - /// Test serialization of outer string types - /// - /// Parameters: - /// * [body] - Input string as post body - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [String] as data - /// Throws [DioError] if API call or serialization fails - Future> fakeOuterStringSerialize({ - String? body, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/outer/string'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - _bodyData = body; - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - String _responseData; - - try { - _responseData = _response.data as String; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// fakePropertyEnumIntegerSerialize - /// Test serialization of enum (int) properties with examples - /// - /// Parameters: - /// * [outerObjectWithEnumProperty] - Input enum (int) as post body - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [OuterObjectWithEnumProperty] as data - /// Throws [DioError] if API call or serialization fails - Future> fakePropertyEnumIntegerSerialize({ - required OuterObjectWithEnumProperty outerObjectWithEnumProperty, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/property/enum-int'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - const _type = FullType(OuterObjectWithEnumProperty); - _bodyData = _serializers.serialize(outerObjectWithEnumProperty, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - OuterObjectWithEnumProperty _responseData; - - try { - const _responseType = FullType(OuterObjectWithEnumProperty); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as OuterObjectWithEnumProperty; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// testBodyWithBinary - /// For this test, the body has to be a binary file. - /// - /// Parameters: - /// * [body] - image to upload - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testBodyWithBinary({ - MultipartFile? body, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/body-with-binary'; - final _options = Options( - method: r'PUT', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'image/png', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - _bodyData = body?.finalize(); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// testBodyWithFileSchema - /// For this test, the body for this request must reference a schema named `File`. - /// - /// Parameters: - /// * [fileSchemaTestClass] - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testBodyWithFileSchema({ - required FileSchemaTestClass fileSchemaTestClass, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/body-with-file-schema'; - final _options = Options( - method: r'PUT', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - const _type = FullType(FileSchemaTestClass); - _bodyData = _serializers.serialize(fileSchemaTestClass, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// testBodyWithQueryParams - /// - /// - /// Parameters: - /// * [query] - /// * [user] - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testBodyWithQueryParams({ - required String query, - required User user, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/body-with-query-params'; - final _options = Options( - method: r'PUT', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - final _queryParameters = { - r'query': encodeQueryParameter(_serializers, query, const FullType(String)), - }; - - dynamic _bodyData; - - try { - const _type = FullType(User); - _bodyData = _serializers.serialize(user, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - queryParameters: _queryParameters, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// To test \"client\" model - /// To test \"client\" model - /// - /// Parameters: - /// * [modelClient] - client model - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [ModelClient] as data - /// Throws [DioError] if API call or serialization fails - Future> testClientModel({ - required ModelClient modelClient, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake'; - final _options = Options( - method: r'PATCH', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - const _type = FullType(ModelClient); - _bodyData = _serializers.serialize(modelClient, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - ModelClient _responseData; - - try { - const _responseType = FullType(ModelClient); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as ModelClient; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - /// - /// Parameters: - /// * [number] - None - /// * [double_] - None - /// * [patternWithoutDelimiter] - None - /// * [byte] - None - /// * [integer] - None - /// * [int32] - None - /// * [int64] - None - /// * [float] - None - /// * [string] - None - /// * [binary] - None - /// * [date] - None - /// * [dateTime] - None - /// * [password] - None - /// * [callback] - None - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testEndpointParameters({ - required num number, - required double double_, - required String patternWithoutDelimiter, - required String byte, - int? integer, - int? int32, - int? int64, - double? float, - String? string, - Uint8List? binary, - Date? date, - DateTime? dateTime, - String? password, - String? callback, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'http', - 'scheme': 'basic', - 'name': 'http_basic_test', - }, - ], - ...?extra, - }, - contentType: 'application/x-www-form-urlencoded', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - _bodyData = { - if (integer != null) r'integer': encodeQueryParameter(_serializers, integer, const FullType(int)), - if (int32 != null) r'int32': encodeQueryParameter(_serializers, int32, const FullType(int)), - if (int64 != null) r'int64': encodeQueryParameter(_serializers, int64, const FullType(int)), - r'number': encodeQueryParameter(_serializers, number, const FullType(num)), - if (float != null) r'float': encodeQueryParameter(_serializers, float, const FullType(double)), - r'double': encodeQueryParameter(_serializers, double_, const FullType(double)), - if (string != null) r'string': encodeQueryParameter(_serializers, string, const FullType(String)), - r'pattern_without_delimiter': encodeQueryParameter(_serializers, patternWithoutDelimiter, const FullType(String)), - r'byte': encodeQueryParameter(_serializers, byte, const FullType(String)), - if (binary != null) r'binary': encodeQueryParameter(_serializers, binary, const FullType(Uint8List)), - if (date != null) r'date': encodeQueryParameter(_serializers, date, const FullType(Date)), - if (dateTime != null) r'dateTime': encodeQueryParameter(_serializers, dateTime, const FullType(DateTime)), - if (password != null) r'password': encodeQueryParameter(_serializers, password, const FullType(String)), - if (callback != null) r'callback': encodeQueryParameter(_serializers, callback, const FullType(String)), - }; - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// To test enum parameters - /// To test enum parameters - /// - /// Parameters: - /// * [enumHeaderStringArray] - Header parameter enum test (string array) - /// * [enumHeaderString] - Header parameter enum test (string) - /// * [enumQueryStringArray] - Query parameter enum test (string array) - /// * [enumQueryString] - Query parameter enum test (string) - /// * [enumQueryInteger] - Query parameter enum test (double) - /// * [enumQueryDouble] - Query parameter enum test (double) - /// * [enumFormStringArray] - Form parameter enum test (string array) - /// * [enumFormString] - Form parameter enum test (string) - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testEnumParameters({ - BuiltList? enumHeaderStringArray, - String? enumHeaderString = '-efg', - BuiltList? enumQueryStringArray, - String? enumQueryString = '-efg', - int? enumQueryInteger, - double? enumQueryDouble, - BuiltList? enumFormStringArray, - String? enumFormString, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake'; - final _options = Options( - method: r'GET', - headers: { - if (enumHeaderStringArray != null) r'enum_header_string_array': enumHeaderStringArray, - if (enumHeaderString != null) r'enum_header_string': enumHeaderString, - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/x-www-form-urlencoded', - validateStatus: validateStatus, - ); - - final _queryParameters = { - if (enumQueryStringArray != null) r'enum_query_string_array': encodeCollectionQueryParameter(_serializers, enumQueryStringArray, const FullType(BuiltList, [FullType(String)]), format: ListFormat.multi,), - if (enumQueryString != null) r'enum_query_string': encodeQueryParameter(_serializers, enumQueryString, const FullType(String)), - if (enumQueryInteger != null) r'enum_query_integer': encodeQueryParameter(_serializers, enumQueryInteger, const FullType(int)), - if (enumQueryDouble != null) r'enum_query_double': encodeQueryParameter(_serializers, enumQueryDouble, const FullType(double)), - }; - - dynamic _bodyData; - - try { - _bodyData = { - if (enumFormStringArray != null) r'enum_form_string_array': encodeCollectionQueryParameter(_serializers, enumFormStringArray, const FullType(BuiltList, [FullType(String)]), format: ListFormat.csv,), - if (enumFormString != null) r'enum_form_string': encodeQueryParameter(_serializers, enumFormString, const FullType(String)), - }; - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - queryParameters: _queryParameters, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// Fake endpoint to test group parameters (optional) - /// Fake endpoint to test group parameters (optional) - /// - /// Parameters: - /// * [requiredStringGroup] - Required String in group parameters - /// * [requiredBooleanGroup] - Required Boolean in group parameters - /// * [requiredInt64Group] - Required Integer in group parameters - /// * [stringGroup] - String in group parameters - /// * [booleanGroup] - Boolean in group parameters - /// * [int64Group] - Integer in group parameters - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testGroupParameters({ - required int requiredStringGroup, - required bool requiredBooleanGroup, - required int requiredInt64Group, - int? stringGroup, - bool? booleanGroup, - int? int64Group, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake'; - final _options = Options( - method: r'DELETE', - headers: { - r'required_boolean_group': requiredBooleanGroup, - if (booleanGroup != null) r'boolean_group': booleanGroup, - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'http', - 'scheme': 'bearer', - 'name': 'bearer_test', - }, - ], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _queryParameters = { - r'required_string_group': encodeQueryParameter(_serializers, requiredStringGroup, const FullType(int)), - r'required_int64_group': encodeQueryParameter(_serializers, requiredInt64Group, const FullType(int)), - if (stringGroup != null) r'string_group': encodeQueryParameter(_serializers, stringGroup, const FullType(int)), - if (int64Group != null) r'int64_group': encodeQueryParameter(_serializers, int64Group, const FullType(int)), - }; - - final _response = await _dio.request( - _path, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// test inline additionalProperties - /// - /// - /// Parameters: - /// * [requestBody] - request body - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testInlineAdditionalProperties({ - required BuiltMap requestBody, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/inline-additionalProperties'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - const _type = FullType(BuiltMap, [FullType(String), FullType(String)]); - _bodyData = _serializers.serialize(requestBody, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// test json serialization of form data - /// - /// - /// Parameters: - /// * [param] - field1 - /// * [param2] - field2 - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testJsonFormData({ - required String param, - required String param2, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/jsonFormData'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/x-www-form-urlencoded', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - _bodyData = { - r'param': encodeQueryParameter(_serializers, param, const FullType(String)), - r'param2': encodeQueryParameter(_serializers, param2, const FullType(String)), - }; - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// testQueryParameterCollectionFormat - /// To test the collection format in query parameters - /// - /// Parameters: - /// * [pipe] - /// * [ioutil] - /// * [http] - /// * [url] - /// * [context] - /// * [allowEmpty] - /// * [language] - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testQueryParameterCollectionFormat({ - required BuiltList pipe, - required BuiltList ioutil, - required BuiltList http, - required BuiltList url, - required BuiltList context, - required String allowEmpty, - BuiltMap? language, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/test-query-parameters'; - final _options = Options( - method: r'PUT', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _queryParameters = { - r'pipe': encodeCollectionQueryParameter(_serializers, pipe, const FullType(BuiltList, [FullType(String)]), format: ListFormat.pipes,), - r'ioutil': encodeCollectionQueryParameter(_serializers, ioutil, const FullType(BuiltList, [FullType(String)]), format: ListFormat.csv,), - r'http': encodeCollectionQueryParameter(_serializers, http, const FullType(BuiltList, [FullType(String)]), format: ListFormat.ssv,), - r'url': encodeCollectionQueryParameter(_serializers, url, const FullType(BuiltList, [FullType(String)]), format: ListFormat.csv,), - r'context': encodeCollectionQueryParameter(_serializers, context, const FullType(BuiltList, [FullType(String)]), format: ListFormat.multi,), - if (language != null) r'language': encodeQueryParameter(_serializers, language, const FullType(BuiltMap, [FullType(String), FullType(String)]), ), - r'allowEmpty': encodeQueryParameter(_serializers, allowEmpty, const FullType(String)), - }; - - final _response = await _dio.request( - _path, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/fake_classname_tags123_api.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/fake_classname_tags123_api.dart deleted file mode 100644 index e39c39e2f5d9..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/fake_classname_tags123_api.dart +++ /dev/null @@ -1,120 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -import 'package:built_value/serializer.dart'; -import 'package:dio_http/dio_http.dart'; - -import 'package:openapi/src/model/model_client.dart'; - -class FakeClassnameTags123Api { - - final Dio _dio; - - final Serializers _serializers; - - const FakeClassnameTags123Api(this._dio, this._serializers); - - /// To test class name in snake case - /// To test class name in snake case - /// - /// Parameters: - /// * [modelClient] - client model - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [ModelClient] as data - /// Throws [DioError] if API call or serialization fails - Future> testClassname({ - required ModelClient modelClient, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake_classname_test'; - final _options = Options( - method: r'PATCH', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'apiKey', - 'name': 'api_key_query', - 'keyName': 'api_key_query', - 'where': 'query', - }, - ], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - const _type = FullType(ModelClient); - _bodyData = _serializers.serialize(modelClient, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - ModelClient _responseData; - - try { - const _responseType = FullType(ModelClient); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as ModelClient; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/pet_api.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/pet_api.dart deleted file mode 100644 index a1d8a0fc2d7a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/pet_api.dart +++ /dev/null @@ -1,755 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -import 'package:built_value/serializer.dart'; -import 'package:dio_http/dio_http.dart'; - -import 'package:built_collection/built_collection.dart'; -import 'package:openapi/src/api_util.dart'; -import 'package:openapi/src/model/api_response.dart'; -import 'package:openapi/src/model/pet.dart'; - -class PetApi { - - final Dio _dio; - - final Serializers _serializers; - - const PetApi(this._dio, this._serializers); - - /// Add a new pet to the store - /// - /// - /// Parameters: - /// * [pet] - Pet object that needs to be added to the store - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> addPet({ - required Pet pet, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/pet'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'oauth2', - 'name': 'petstore_auth', - }, - ], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - const _type = FullType(Pet); - _bodyData = _serializers.serialize(pet, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// Deletes a pet - /// - /// - /// Parameters: - /// * [petId] - Pet id to delete - /// * [apiKey] - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> deletePet({ - required int petId, - String? apiKey, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); - final _options = Options( - method: r'DELETE', - headers: { - if (apiKey != null) r'api_key': apiKey, - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'oauth2', - 'name': 'petstore_auth', - }, - ], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// Finds Pets by status - /// Multiple status values can be provided with comma separated strings - /// - /// Parameters: - /// * [status] - Status values that need to be considered for filter - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [BuiltList] as data - /// Throws [DioError] if API call or serialization fails - Future>> findPetsByStatus({ - required BuiltList status, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/pet/findByStatus'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'oauth2', - 'name': 'petstore_auth', - }, - ], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _queryParameters = { - r'status': encodeCollectionQueryParameter(_serializers, status, const FullType(BuiltList, [FullType(String)]), format: ListFormat.csv,), - }; - - final _response = await _dio.request( - _path, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - BuiltList _responseData; - - try { - const _responseType = FullType(BuiltList, [FullType(Pet)]); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as BuiltList; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response>( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// Finds Pets by tags - /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - /// - /// Parameters: - /// * [tags] - Tags to filter by - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [BuiltSet] as data - /// Throws [DioError] if API call or serialization fails - @Deprecated('This operation has been deprecated') - Future>> findPetsByTags({ - required BuiltSet tags, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/pet/findByTags'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'oauth2', - 'name': 'petstore_auth', - }, - ], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _queryParameters = { - r'tags': encodeCollectionQueryParameter(_serializers, tags, const FullType(BuiltSet, [FullType(String)]), format: ListFormat.csv,), - }; - - final _response = await _dio.request( - _path, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - BuiltSet _responseData; - - try { - const _responseType = FullType(BuiltSet, [FullType(Pet)]); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as BuiltSet; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response>( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// Find pet by ID - /// Returns a single pet - /// - /// Parameters: - /// * [petId] - ID of pet to return - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [Pet] as data - /// Throws [DioError] if API call or serialization fails - Future> getPetById({ - required int petId, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'apiKey', - 'name': 'api_key', - 'keyName': 'api_key', - 'where': 'header', - }, - ], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - Pet _responseData; - - try { - const _responseType = FullType(Pet); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as Pet; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// Update an existing pet - /// - /// - /// Parameters: - /// * [pet] - Pet object that needs to be added to the store - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> updatePet({ - required Pet pet, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/pet'; - final _options = Options( - method: r'PUT', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'oauth2', - 'name': 'petstore_auth', - }, - ], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - const _type = FullType(Pet); - _bodyData = _serializers.serialize(pet, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// Updates a pet in the store with form data - /// - /// - /// Parameters: - /// * [petId] - ID of pet that needs to be updated - /// * [name] - Updated name of the pet - /// * [status] - Updated status of the pet - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> updatePetWithForm({ - required int petId, - String? name, - String? status, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'oauth2', - 'name': 'petstore_auth', - }, - ], - ...?extra, - }, - contentType: 'application/x-www-form-urlencoded', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - _bodyData = { - if (name != null) r'name': encodeQueryParameter(_serializers, name, const FullType(String)), - if (status != null) r'status': encodeQueryParameter(_serializers, status, const FullType(String)), - }; - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// uploads an image - /// - /// - /// Parameters: - /// * [petId] - ID of pet to update - /// * [additionalMetadata] - Additional data to pass to server - /// * [file] - file to upload - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [ApiResponse] as data - /// Throws [DioError] if API call or serialization fails - Future> uploadFile({ - required int petId, - String? additionalMetadata, - MultipartFile? file, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/pet/{petId}/uploadImage'.replaceAll('{' r'petId' '}', petId.toString()); - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'oauth2', - 'name': 'petstore_auth', - }, - ], - ...?extra, - }, - contentType: 'multipart/form-data', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - _bodyData = FormData.fromMap({ - if (additionalMetadata != null) r'additionalMetadata': encodeFormParameter(_serializers, additionalMetadata, const FullType(String)), - if (file != null) r'file': file, - }); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - ApiResponse _responseData; - - try { - const _responseType = FullType(ApiResponse); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as ApiResponse; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// uploads an image (required) - /// - /// - /// Parameters: - /// * [petId] - ID of pet to update - /// * [requiredFile] - file to upload - /// * [additionalMetadata] - Additional data to pass to server - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [ApiResponse] as data - /// Throws [DioError] if API call or serialization fails - Future> uploadFileWithRequiredFile({ - required int petId, - required MultipartFile requiredFile, - String? additionalMetadata, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/{petId}/uploadImageWithRequiredFile'.replaceAll('{' r'petId' '}', petId.toString()); - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'oauth2', - 'name': 'petstore_auth', - }, - ], - ...?extra, - }, - contentType: 'multipart/form-data', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - _bodyData = FormData.fromMap({ - if (additionalMetadata != null) r'additionalMetadata': encodeFormParameter(_serializers, additionalMetadata, const FullType(String)), - r'requiredFile': requiredFile, - }); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - ApiResponse _responseData; - - try { - const _responseType = FullType(ApiResponse); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as ApiResponse; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/store_api.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/store_api.dart deleted file mode 100644 index bb10a12cbe55..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/store_api.dart +++ /dev/null @@ -1,314 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -import 'package:built_value/serializer.dart'; -import 'package:dio_http/dio_http.dart'; - -import 'package:built_collection/built_collection.dart'; -import 'package:openapi/src/model/order.dart'; - -class StoreApi { - - final Dio _dio; - - final Serializers _serializers; - - const StoreApi(this._dio, this._serializers); - - /// Delete purchase order by ID - /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - /// - /// Parameters: - /// * [orderId] - ID of the order that needs to be deleted - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> deleteOrder({ - required String orderId, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString()); - final _options = Options( - method: r'DELETE', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// Returns pet inventories by status - /// Returns a map of status codes to quantities - /// - /// Parameters: - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [BuiltMap] as data - /// Throws [DioError] if API call or serialization fails - Future>> getInventory({ - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/store/inventory'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'apiKey', - 'name': 'api_key', - 'keyName': 'api_key', - 'where': 'header', - }, - ], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - BuiltMap _responseData; - - try { - const _responseType = FullType(BuiltMap, [FullType(String), FullType(int)]); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as BuiltMap; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response>( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// Find purchase order by ID - /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - /// - /// Parameters: - /// * [orderId] - ID of pet that needs to be fetched - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [Order] as data - /// Throws [DioError] if API call or serialization fails - Future> getOrderById({ - required int orderId, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString()); - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - Order _responseData; - - try { - const _responseType = FullType(Order); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as Order; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// Place an order for a pet - /// - /// - /// Parameters: - /// * [order] - order placed for purchasing the pet - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [Order] as data - /// Throws [DioError] if API call or serialization fails - Future> placeOrder({ - required Order order, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/store/order'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - const _type = FullType(Order); - _bodyData = _serializers.serialize(order, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - Order _responseData; - - try { - const _responseType = FullType(Order); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as Order; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/user_api.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/user_api.dart deleted file mode 100644 index e628b862c029..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/user_api.dart +++ /dev/null @@ -1,532 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -import 'package:built_value/serializer.dart'; -import 'package:dio_http/dio_http.dart'; - -import 'package:built_collection/built_collection.dart'; -import 'package:openapi/src/api_util.dart'; -import 'package:openapi/src/model/user.dart'; - -class UserApi { - - final Dio _dio; - - final Serializers _serializers; - - const UserApi(this._dio, this._serializers); - - /// Create user - /// This can only be done by the logged in user. - /// - /// Parameters: - /// * [user] - Created user object - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> createUser({ - required User user, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/user'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - const _type = FullType(User); - _bodyData = _serializers.serialize(user, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// Creates list of users with given input array - /// - /// - /// Parameters: - /// * [user] - List of user object - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> createUsersWithArrayInput({ - required BuiltList user, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/user/createWithArray'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - const _type = FullType(BuiltList, [FullType(User)]); - _bodyData = _serializers.serialize(user, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// Creates list of users with given input array - /// - /// - /// Parameters: - /// * [user] - List of user object - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> createUsersWithListInput({ - required BuiltList user, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/user/createWithList'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - const _type = FullType(BuiltList, [FullType(User)]); - _bodyData = _serializers.serialize(user, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// Delete user - /// This can only be done by the logged in user. - /// - /// Parameters: - /// * [username] - The name that needs to be deleted - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> deleteUser({ - required String username, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/user/{username}'.replaceAll('{' r'username' '}', username.toString()); - final _options = Options( - method: r'DELETE', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// Get user by user name - /// - /// - /// Parameters: - /// * [username] - The name that needs to be fetched. Use user1 for testing. - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [User] as data - /// Throws [DioError] if API call or serialization fails - Future> getUserByName({ - required String username, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/user/{username}'.replaceAll('{' r'username' '}', username.toString()); - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - User _responseData; - - try { - const _responseType = FullType(User); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as User; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// Logs user into the system - /// - /// - /// Parameters: - /// * [username] - The user name for login - /// * [password] - The password for login in clear text - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [String] as data - /// Throws [DioError] if API call or serialization fails - Future> loginUser({ - required String username, - required String password, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/user/login'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _queryParameters = { - r'username': encodeQueryParameter(_serializers, username, const FullType(String)), - r'password': encodeQueryParameter(_serializers, password, const FullType(String)), - }; - - final _response = await _dio.request( - _path, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - String _responseData; - - try { - _responseData = _response.data as String; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// Logs out current logged in user session - /// - /// - /// Parameters: - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> logoutUser({ - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/user/logout'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// Updated user - /// This can only be done by the logged in user. - /// - /// Parameters: - /// * [username] - name that need to be deleted - /// * [user] - Updated user object - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> updateUser({ - required String username, - required User user, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/user/{username}'.replaceAll('{' r'username' '}', username.toString()); - final _options = Options( - method: r'PUT', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - const _type = FullType(User); - _bodyData = _serializers.serialize(user, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api_util.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api_util.dart deleted file mode 100644 index 5841689c3792..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api_util.dart +++ /dev/null @@ -1,78 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:convert'; -import 'dart:typed_data'; - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/serializer.dart'; -import 'package:dio_http/dio_http.dart'; -import 'package:dio_http/src/parameter.dart'; - -/// Format the given form parameter object into something that Dio can handle. -/// Returns primitive or String. -/// Returns List/Map if the value is BuildList/BuiltMap. -dynamic encodeFormParameter(Serializers serializers, dynamic value, FullType type) { - if (value == null) { - return ''; - } - if (value is String || value is num || value is bool) { - return value; - } - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (serialized is String) { - return serialized; - } - if (value is BuiltList || value is BuiltSet || value is BuiltMap) { - return serialized; - } - return json.encode(serialized); -} - -dynamic encodeQueryParameter( - Serializers serializers, - dynamic value, - FullType type, -) { - if (value == null) { - return ''; - } - if (value is String || value is num || value is bool) { - return value; - } - if (value is Uint8List) { - // Currently not sure how to serialize this - return value; - } - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (serialized == null) { - return ''; - } - if (serialized is String) { - return serialized; - } - return serialized; -} - -ListParam encodeCollectionQueryParameter( - Serializers serializers, - dynamic value, - FullType type, { - ListFormat format = ListFormat.multi, -}) { - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (value is BuiltList || value is BuiltSet) { - return ListParam(List.of((serialized as Iterable).cast()), format); - } - throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/api_key_auth.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/api_key_auth.dart deleted file mode 100644 index ba24d7a2bc87..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/api_key_auth.dart +++ /dev/null @@ -1,30 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - - -import 'package:dio_http/dio_http.dart'; -import 'package:openapi/src/auth/auth.dart'; - -class ApiKeyAuthInterceptor extends AuthInterceptor { - final Map apiKeys = {}; - - @override - void onRequest(RequestOptions options, RequestInterceptorHandler handler) { - final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'apiKey'); - for (final info in authInfo) { - final authName = info['name'] as String; - final authKeyName = info['keyName'] as String; - final authWhere = info['where'] as String; - final apiKey = apiKeys[authName]; - if (apiKey != null) { - if (authWhere == 'query') { - options.queryParameters[authKeyName] = apiKey; - } else { - options.headers[authKeyName] = apiKey; - } - } - } - super.onRequest(options, handler); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/auth.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/auth.dart deleted file mode 100644 index e6dd5c4f6f89..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/auth.dart +++ /dev/null @@ -1,18 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:dio_http/dio_http.dart'; - -abstract class AuthInterceptor extends Interceptor { - /// Get auth information on given route for the given type. - /// Can return an empty list if type is not present on auth data or - /// if route doesn't need authentication. - List> getAuthInfo(RequestOptions route, bool Function(Map secure) handles) { - if (route.extra.containsKey('secure')) { - final auth = route.extra['secure'] as List>; - return auth.where((secure) => handles(secure)).toList(); - } - return []; - } -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/basic_auth.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/basic_auth.dart deleted file mode 100644 index 18ba52cefc3c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/basic_auth.dart +++ /dev/null @@ -1,37 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:convert'; - -import 'package:dio_http/dio_http.dart'; -import 'package:openapi/src/auth/auth.dart'; - -class BasicAuthInfo { - final String username; - final String password; - - const BasicAuthInfo(this.username, this.password); -} - -class BasicAuthInterceptor extends AuthInterceptor { - final Map authInfo = {}; - - @override - void onRequest( - RequestOptions options, - RequestInterceptorHandler handler, - ) { - final metadataAuthInfo = getAuthInfo(options, (secure) => (secure['type'] == 'http' && secure['scheme'] == 'basic') || secure['type'] == 'basic'); - for (final info in metadataAuthInfo) { - final authName = info['name'] as String; - final basicAuthInfo = authInfo[authName]; - if (basicAuthInfo != null) { - final basicAuth = 'Basic ${base64Encode(utf8.encode('${basicAuthInfo.username}:${basicAuthInfo.password}'))}'; - options.headers['Authorization'] = basicAuth; - break; - } - } - super.onRequest(options, handler); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/bearer_auth.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/bearer_auth.dart deleted file mode 100644 index daa817130089..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/bearer_auth.dart +++ /dev/null @@ -1,26 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:dio_http/dio_http.dart'; -import 'package:openapi/src/auth/auth.dart'; - -class BearerAuthInterceptor extends AuthInterceptor { - final Map tokens = {}; - - @override - void onRequest( - RequestOptions options, - RequestInterceptorHandler handler, - ) { - final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'http' && secure['scheme'] == 'bearer'); - for (final info in authInfo) { - final token = tokens[info['name']]; - if (token != null) { - options.headers['Authorization'] = 'Bearer ${token}'; - break; - } - } - super.onRequest(options, handler); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/oauth.dart deleted file mode 100644 index 82140409b32a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/oauth.dart +++ /dev/null @@ -1,26 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:dio_http/dio_http.dart'; -import 'package:openapi/src/auth/auth.dart'; - -class OAuthInterceptor extends AuthInterceptor { - final Map tokens = {}; - - @override - void onRequest( - RequestOptions options, - RequestInterceptorHandler handler, - ) { - final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'oauth' || secure['type'] == 'oauth2'); - for (final info in authInfo) { - final token = tokens[info['name']]; - if (token != null) { - options.headers['Authorization'] = 'Bearer ${token}'; - break; - } - } - super.onRequest(options, handler); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/date_serializer.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/date_serializer.dart deleted file mode 100644 index db3c5c437db1..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/date_serializer.dart +++ /dev/null @@ -1,31 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/serializer.dart'; -import 'package:openapi/src/model/date.dart'; - -class DateSerializer implements PrimitiveSerializer { - - const DateSerializer(); - - @override - Iterable get types => BuiltList.of([Date]); - - @override - String get wireName => 'Date'; - - @override - Date deserialize(Serializers serializers, Object serialized, - {FullType specifiedType = FullType.unspecified}) { - final parsed = DateTime.parse(serialized as String); - return Date(parsed.year, parsed.month, parsed.day); - } - - @override - Object serialize(Serializers serializers, Date date, - {FullType specifiedType = FullType.unspecified}) { - return date.toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/additional_properties_class.dart deleted file mode 100644 index 4d45be3abbfb..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/additional_properties_class.dart +++ /dev/null @@ -1,87 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'additional_properties_class.g.dart'; - -/// AdditionalPropertiesClass -/// -/// Properties: -/// * [mapProperty] -/// * [mapOfMapProperty] -abstract class AdditionalPropertiesClass implements Built { - @BuiltValueField(wireName: r'map_property') - BuiltMap? get mapProperty; - - @BuiltValueField(wireName: r'map_of_map_property') - BuiltMap>? get mapOfMapProperty; - - AdditionalPropertiesClass._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(AdditionalPropertiesClassBuilder b) => b; - - factory AdditionalPropertiesClass([void updates(AdditionalPropertiesClassBuilder b)]) = _$AdditionalPropertiesClass; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$AdditionalPropertiesClassSerializer(); -} - -class _$AdditionalPropertiesClassSerializer implements StructuredSerializer { - @override - final Iterable types = const [AdditionalPropertiesClass, _$AdditionalPropertiesClass]; - - @override - final String wireName = r'AdditionalPropertiesClass'; - - @override - Iterable serialize(Serializers serializers, AdditionalPropertiesClass object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.mapProperty != null) { - result - ..add(r'map_property') - ..add(serializers.serialize(object.mapProperty, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(String)]))); - } - if (object.mapOfMapProperty != null) { - result - ..add(r'map_of_map_property') - ..add(serializers.serialize(object.mapOfMapProperty, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]))); - } - return result; - } - - @override - AdditionalPropertiesClass deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = AdditionalPropertiesClassBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'map_property': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(String)])) as BuiltMap; - result.mapProperty.replace(valueDes); - break; - case r'map_of_map_property': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])])) as BuiltMap>; - result.mapOfMapProperty.replace(valueDes); - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/animal.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/animal.dart deleted file mode 100644 index cd9084ceb289..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/animal.dart +++ /dev/null @@ -1,85 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'animal.g.dart'; - -/// Animal -/// -/// Properties: -/// * [className] -/// * [color] -abstract class Animal implements Built { - @BuiltValueField(wireName: r'className') - String get className; - - @BuiltValueField(wireName: r'color') - String? get color; - - Animal._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(AnimalBuilder b) => b - ..color = 'red'; - - factory Animal([void updates(AnimalBuilder b)]) = _$Animal; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$AnimalSerializer(); -} - -class _$AnimalSerializer implements StructuredSerializer { - @override - final Iterable types = const [Animal, _$Animal]; - - @override - final String wireName = r'Animal'; - - @override - Iterable serialize(Serializers serializers, Animal object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - result - ..add(r'className') - ..add(serializers.serialize(object.className, - specifiedType: const FullType(String))); - if (object.color != null) { - result - ..add(r'color') - ..add(serializers.serialize(object.color, - specifiedType: const FullType(String))); - } - return result; - } - - @override - Animal deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = AnimalBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'className': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.className = valueDes; - break; - case r'color': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.color = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/api_response.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/api_response.dart deleted file mode 100644 index c2ebff7ffeab..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/api_response.dart +++ /dev/null @@ -1,101 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'api_response.g.dart'; - -/// ApiResponse -/// -/// Properties: -/// * [code] -/// * [type] -/// * [message] -abstract class ApiResponse implements Built { - @BuiltValueField(wireName: r'code') - int? get code; - - @BuiltValueField(wireName: r'type') - String? get type; - - @BuiltValueField(wireName: r'message') - String? get message; - - ApiResponse._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(ApiResponseBuilder b) => b; - - factory ApiResponse([void updates(ApiResponseBuilder b)]) = _$ApiResponse; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ApiResponseSerializer(); -} - -class _$ApiResponseSerializer implements StructuredSerializer { - @override - final Iterable types = const [ApiResponse, _$ApiResponse]; - - @override - final String wireName = r'ApiResponse'; - - @override - Iterable serialize(Serializers serializers, ApiResponse object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.code != null) { - result - ..add(r'code') - ..add(serializers.serialize(object.code, - specifiedType: const FullType(int))); - } - if (object.type != null) { - result - ..add(r'type') - ..add(serializers.serialize(object.type, - specifiedType: const FullType(String))); - } - if (object.message != null) { - result - ..add(r'message') - ..add(serializers.serialize(object.message, - specifiedType: const FullType(String))); - } - return result; - } - - @override - ApiResponse deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = ApiResponseBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'code': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.code = valueDes; - break; - case r'type': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.type = valueDes; - break; - case r'message': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.message = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/array_of_array_of_number_only.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/array_of_array_of_number_only.dart deleted file mode 100644 index 1fa583bccc15..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/array_of_array_of_number_only.dart +++ /dev/null @@ -1,72 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'array_of_array_of_number_only.g.dart'; - -/// ArrayOfArrayOfNumberOnly -/// -/// Properties: -/// * [arrayArrayNumber] -abstract class ArrayOfArrayOfNumberOnly implements Built { - @BuiltValueField(wireName: r'ArrayArrayNumber') - BuiltList>? get arrayArrayNumber; - - ArrayOfArrayOfNumberOnly._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(ArrayOfArrayOfNumberOnlyBuilder b) => b; - - factory ArrayOfArrayOfNumberOnly([void updates(ArrayOfArrayOfNumberOnlyBuilder b)]) = _$ArrayOfArrayOfNumberOnly; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ArrayOfArrayOfNumberOnlySerializer(); -} - -class _$ArrayOfArrayOfNumberOnlySerializer implements StructuredSerializer { - @override - final Iterable types = const [ArrayOfArrayOfNumberOnly, _$ArrayOfArrayOfNumberOnly]; - - @override - final String wireName = r'ArrayOfArrayOfNumberOnly'; - - @override - Iterable serialize(Serializers serializers, ArrayOfArrayOfNumberOnly object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.arrayArrayNumber != null) { - result - ..add(r'ArrayArrayNumber') - ..add(serializers.serialize(object.arrayArrayNumber, - specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(num)])]))); - } - return result; - } - - @override - ArrayOfArrayOfNumberOnly deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = ArrayOfArrayOfNumberOnlyBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'ArrayArrayNumber': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(num)])])) as BuiltList>; - result.arrayArrayNumber.replace(valueDes); - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/array_of_number_only.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/array_of_number_only.dart deleted file mode 100644 index fcbd7d393bea..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/array_of_number_only.dart +++ /dev/null @@ -1,72 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'array_of_number_only.g.dart'; - -/// ArrayOfNumberOnly -/// -/// Properties: -/// * [arrayNumber] -abstract class ArrayOfNumberOnly implements Built { - @BuiltValueField(wireName: r'ArrayNumber') - BuiltList? get arrayNumber; - - ArrayOfNumberOnly._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(ArrayOfNumberOnlyBuilder b) => b; - - factory ArrayOfNumberOnly([void updates(ArrayOfNumberOnlyBuilder b)]) = _$ArrayOfNumberOnly; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ArrayOfNumberOnlySerializer(); -} - -class _$ArrayOfNumberOnlySerializer implements StructuredSerializer { - @override - final Iterable types = const [ArrayOfNumberOnly, _$ArrayOfNumberOnly]; - - @override - final String wireName = r'ArrayOfNumberOnly'; - - @override - Iterable serialize(Serializers serializers, ArrayOfNumberOnly object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.arrayNumber != null) { - result - ..add(r'ArrayNumber') - ..add(serializers.serialize(object.arrayNumber, - specifiedType: const FullType(BuiltList, [FullType(num)]))); - } - return result; - } - - @override - ArrayOfNumberOnly deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = ArrayOfNumberOnlyBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'ArrayNumber': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltList, [FullType(num)])) as BuiltList; - result.arrayNumber.replace(valueDes); - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/array_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/array_test.dart deleted file mode 100644 index 8025d141c124..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/array_test.dart +++ /dev/null @@ -1,103 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:openapi/src/model/read_only_first.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'array_test.g.dart'; - -/// ArrayTest -/// -/// Properties: -/// * [arrayOfString] -/// * [arrayArrayOfInteger] -/// * [arrayArrayOfModel] -abstract class ArrayTest implements Built { - @BuiltValueField(wireName: r'array_of_string') - BuiltList? get arrayOfString; - - @BuiltValueField(wireName: r'array_array_of_integer') - BuiltList>? get arrayArrayOfInteger; - - @BuiltValueField(wireName: r'array_array_of_model') - BuiltList>? get arrayArrayOfModel; - - ArrayTest._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(ArrayTestBuilder b) => b; - - factory ArrayTest([void updates(ArrayTestBuilder b)]) = _$ArrayTest; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ArrayTestSerializer(); -} - -class _$ArrayTestSerializer implements StructuredSerializer { - @override - final Iterable types = const [ArrayTest, _$ArrayTest]; - - @override - final String wireName = r'ArrayTest'; - - @override - Iterable serialize(Serializers serializers, ArrayTest object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.arrayOfString != null) { - result - ..add(r'array_of_string') - ..add(serializers.serialize(object.arrayOfString, - specifiedType: const FullType(BuiltList, [FullType(String)]))); - } - if (object.arrayArrayOfInteger != null) { - result - ..add(r'array_array_of_integer') - ..add(serializers.serialize(object.arrayArrayOfInteger, - specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(int)])]))); - } - if (object.arrayArrayOfModel != null) { - result - ..add(r'array_array_of_model') - ..add(serializers.serialize(object.arrayArrayOfModel, - specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(ReadOnlyFirst)])]))); - } - return result; - } - - @override - ArrayTest deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = ArrayTestBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'array_of_string': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltList, [FullType(String)])) as BuiltList; - result.arrayOfString.replace(valueDes); - break; - case r'array_array_of_integer': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(int)])])) as BuiltList>; - result.arrayArrayOfInteger.replace(valueDes); - break; - case r'array_array_of_model': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(ReadOnlyFirst)])])) as BuiltList>; - result.arrayArrayOfModel.replace(valueDes); - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/capitalization.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/capitalization.dart deleted file mode 100644 index 15a8f080e9b1..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/capitalization.dart +++ /dev/null @@ -1,147 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'capitalization.g.dart'; - -/// Capitalization -/// -/// Properties: -/// * [smallCamel] -/// * [capitalCamel] -/// * [smallSnake] -/// * [capitalSnake] -/// * [sCAETHFlowPoints] -/// * [ATT_NAME] - Name of the pet -abstract class Capitalization implements Built { - @BuiltValueField(wireName: r'smallCamel') - String? get smallCamel; - - @BuiltValueField(wireName: r'CapitalCamel') - String? get capitalCamel; - - @BuiltValueField(wireName: r'small_Snake') - String? get smallSnake; - - @BuiltValueField(wireName: r'Capital_Snake') - String? get capitalSnake; - - @BuiltValueField(wireName: r'SCA_ETH_Flow_Points') - String? get sCAETHFlowPoints; - - /// Name of the pet - @BuiltValueField(wireName: r'ATT_NAME') - String? get ATT_NAME; - - Capitalization._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(CapitalizationBuilder b) => b; - - factory Capitalization([void updates(CapitalizationBuilder b)]) = _$Capitalization; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$CapitalizationSerializer(); -} - -class _$CapitalizationSerializer implements StructuredSerializer { - @override - final Iterable types = const [Capitalization, _$Capitalization]; - - @override - final String wireName = r'Capitalization'; - - @override - Iterable serialize(Serializers serializers, Capitalization object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.smallCamel != null) { - result - ..add(r'smallCamel') - ..add(serializers.serialize(object.smallCamel, - specifiedType: const FullType(String))); - } - if (object.capitalCamel != null) { - result - ..add(r'CapitalCamel') - ..add(serializers.serialize(object.capitalCamel, - specifiedType: const FullType(String))); - } - if (object.smallSnake != null) { - result - ..add(r'small_Snake') - ..add(serializers.serialize(object.smallSnake, - specifiedType: const FullType(String))); - } - if (object.capitalSnake != null) { - result - ..add(r'Capital_Snake') - ..add(serializers.serialize(object.capitalSnake, - specifiedType: const FullType(String))); - } - if (object.sCAETHFlowPoints != null) { - result - ..add(r'SCA_ETH_Flow_Points') - ..add(serializers.serialize(object.sCAETHFlowPoints, - specifiedType: const FullType(String))); - } - if (object.ATT_NAME != null) { - result - ..add(r'ATT_NAME') - ..add(serializers.serialize(object.ATT_NAME, - specifiedType: const FullType(String))); - } - return result; - } - - @override - Capitalization deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = CapitalizationBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'smallCamel': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.smallCamel = valueDes; - break; - case r'CapitalCamel': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.capitalCamel = valueDes; - break; - case r'small_Snake': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.smallSnake = valueDes; - break; - case r'Capital_Snake': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.capitalSnake = valueDes; - break; - case r'SCA_ETH_Flow_Points': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.sCAETHFlowPoints = valueDes; - break; - case r'ATT_NAME': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.ATT_NAME = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/cat.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/cat.dart deleted file mode 100644 index 2c905783610b..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/cat.dart +++ /dev/null @@ -1,104 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:openapi/src/model/animal.dart'; -import 'package:openapi/src/model/cat_all_of.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'cat.g.dart'; - -// ignore_for_file: unused_import - -/// Cat -/// -/// Properties: -/// * [className] -/// * [color] -/// * [declawed] -abstract class Cat implements Built { - @BuiltValueField(wireName: r'className') - String get className; - - @BuiltValueField(wireName: r'color') - String? get color; - - @BuiltValueField(wireName: r'declawed') - bool? get declawed; - - Cat._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(CatBuilder b) => b - ..color = 'red'; - - factory Cat([void updates(CatBuilder b)]) = _$Cat; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$CatSerializer(); -} - -class _$CatSerializer implements StructuredSerializer { - @override - final Iterable types = const [Cat, _$Cat]; - - @override - final String wireName = r'Cat'; - - @override - Iterable serialize(Serializers serializers, Cat object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - result - ..add(r'className') - ..add(serializers.serialize(object.className, - specifiedType: const FullType(String))); - if (object.color != null) { - result - ..add(r'color') - ..add(serializers.serialize(object.color, - specifiedType: const FullType(String))); - } - if (object.declawed != null) { - result - ..add(r'declawed') - ..add(serializers.serialize(object.declawed, - specifiedType: const FullType(bool))); - } - return result; - } - - @override - Cat deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = CatBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'className': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.className = valueDes; - break; - case r'color': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.color = valueDes; - break; - case r'declawed': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(bool)) as bool; - result.declawed = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/cat_all_of.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/cat_all_of.dart deleted file mode 100644 index 1734098fe224..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/cat_all_of.dart +++ /dev/null @@ -1,71 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'cat_all_of.g.dart'; - -/// CatAllOf -/// -/// Properties: -/// * [declawed] -abstract class CatAllOf implements Built { - @BuiltValueField(wireName: r'declawed') - bool? get declawed; - - CatAllOf._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(CatAllOfBuilder b) => b; - - factory CatAllOf([void updates(CatAllOfBuilder b)]) = _$CatAllOf; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$CatAllOfSerializer(); -} - -class _$CatAllOfSerializer implements StructuredSerializer { - @override - final Iterable types = const [CatAllOf, _$CatAllOf]; - - @override - final String wireName = r'CatAllOf'; - - @override - Iterable serialize(Serializers serializers, CatAllOf object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.declawed != null) { - result - ..add(r'declawed') - ..add(serializers.serialize(object.declawed, - specifiedType: const FullType(bool))); - } - return result; - } - - @override - CatAllOf deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = CatAllOfBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'declawed': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(bool)) as bool; - result.declawed = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/category.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/category.dart deleted file mode 100644 index 9ee9a94a3e7c..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/category.dart +++ /dev/null @@ -1,85 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'category.g.dart'; - -/// Category -/// -/// Properties: -/// * [id] -/// * [name] -abstract class Category implements Built { - @BuiltValueField(wireName: r'id') - int? get id; - - @BuiltValueField(wireName: r'name') - String get name; - - Category._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(CategoryBuilder b) => b - ..name = 'default-name'; - - factory Category([void updates(CategoryBuilder b)]) = _$Category; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$CategorySerializer(); -} - -class _$CategorySerializer implements StructuredSerializer { - @override - final Iterable types = const [Category, _$Category]; - - @override - final String wireName = r'Category'; - - @override - Iterable serialize(Serializers serializers, Category object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.id != null) { - result - ..add(r'id') - ..add(serializers.serialize(object.id, - specifiedType: const FullType(int))); - } - result - ..add(r'name') - ..add(serializers.serialize(object.name, - specifiedType: const FullType(String))); - return result; - } - - @override - Category deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = CategoryBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'id': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.id = valueDes; - break; - case r'name': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.name = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/class_model.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/class_model.dart deleted file mode 100644 index ca90835c83de..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/class_model.dart +++ /dev/null @@ -1,71 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'class_model.g.dart'; - -/// Model for testing model with \"_class\" property -/// -/// Properties: -/// * [class_] -abstract class ClassModel implements Built { - @BuiltValueField(wireName: r'_class') - String? get class_; - - ClassModel._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(ClassModelBuilder b) => b; - - factory ClassModel([void updates(ClassModelBuilder b)]) = _$ClassModel; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ClassModelSerializer(); -} - -class _$ClassModelSerializer implements StructuredSerializer { - @override - final Iterable types = const [ClassModel, _$ClassModel]; - - @override - final String wireName = r'ClassModel'; - - @override - Iterable serialize(Serializers serializers, ClassModel object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.class_ != null) { - result - ..add(r'_class') - ..add(serializers.serialize(object.class_, - specifiedType: const FullType(String))); - } - return result; - } - - @override - ClassModel deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = ClassModelBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'_class': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.class_ = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/date.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/date.dart deleted file mode 100644 index b21c7f544bee..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/date.dart +++ /dev/null @@ -1,70 +0,0 @@ -/// A gregorian calendar date generated by -/// OpenAPI generator to differentiate -/// between [DateTime] and [Date] formats. -class Date implements Comparable { - final int year; - - /// January is 1. - final int month; - - /// First day is 1. - final int day; - - Date(this.year, this.month, this.day); - - /// The current date - static Date now({bool utc = false}) { - var now = DateTime.now(); - if (utc) { - now = now.toUtc(); - } - return now.toDate(); - } - - /// Convert to a [DateTime]. - DateTime toDateTime({bool utc = false}) { - if (utc) { - return DateTime.utc(year, month, day); - } else { - return DateTime(year, month, day); - } - } - - @override - int compareTo(Date other) { - int d = year.compareTo(other.year); - if (d != 0) { - return d; - } - d = month.compareTo(other.month); - if (d != 0) { - return d; - } - return day.compareTo(other.day); - } - - @override - bool operator ==(Object other) => - identical(this, other) || - other is Date && - runtimeType == other.runtimeType && - year == other.year && - month == other.month && - day == other.day; - - @override - int get hashCode => year.hashCode ^ month.hashCode ^ day.hashCode; - - @override - String toString() { - final yyyy = year.toString(); - final mm = month.toString().padLeft(2, '0'); - final dd = day.toString().padLeft(2, '0'); - - return '$yyyy-$mm-$dd'; - } -} - -extension DateTimeToDate on DateTime { - Date toDate() => Date(year, month, day); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/deprecated_object.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/deprecated_object.dart deleted file mode 100644 index 98db39b4f44d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/deprecated_object.dart +++ /dev/null @@ -1,71 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'deprecated_object.g.dart'; - -/// DeprecatedObject -/// -/// Properties: -/// * [name] -abstract class DeprecatedObject implements Built { - @BuiltValueField(wireName: r'name') - String? get name; - - DeprecatedObject._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(DeprecatedObjectBuilder b) => b; - - factory DeprecatedObject([void updates(DeprecatedObjectBuilder b)]) = _$DeprecatedObject; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$DeprecatedObjectSerializer(); -} - -class _$DeprecatedObjectSerializer implements StructuredSerializer { - @override - final Iterable types = const [DeprecatedObject, _$DeprecatedObject]; - - @override - final String wireName = r'DeprecatedObject'; - - @override - Iterable serialize(Serializers serializers, DeprecatedObject object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.name != null) { - result - ..add(r'name') - ..add(serializers.serialize(object.name, - specifiedType: const FullType(String))); - } - return result; - } - - @override - DeprecatedObject deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = DeprecatedObjectBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'name': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.name = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/dog.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/dog.dart deleted file mode 100644 index 9e36ec77bd8e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/dog.dart +++ /dev/null @@ -1,104 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:openapi/src/model/dog_all_of.dart'; -import 'package:openapi/src/model/animal.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'dog.g.dart'; - -// ignore_for_file: unused_import - -/// Dog -/// -/// Properties: -/// * [className] -/// * [color] -/// * [breed] -abstract class Dog implements Built { - @BuiltValueField(wireName: r'className') - String get className; - - @BuiltValueField(wireName: r'color') - String? get color; - - @BuiltValueField(wireName: r'breed') - String? get breed; - - Dog._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(DogBuilder b) => b - ..color = 'red'; - - factory Dog([void updates(DogBuilder b)]) = _$Dog; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$DogSerializer(); -} - -class _$DogSerializer implements StructuredSerializer { - @override - final Iterable types = const [Dog, _$Dog]; - - @override - final String wireName = r'Dog'; - - @override - Iterable serialize(Serializers serializers, Dog object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - result - ..add(r'className') - ..add(serializers.serialize(object.className, - specifiedType: const FullType(String))); - if (object.color != null) { - result - ..add(r'color') - ..add(serializers.serialize(object.color, - specifiedType: const FullType(String))); - } - if (object.breed != null) { - result - ..add(r'breed') - ..add(serializers.serialize(object.breed, - specifiedType: const FullType(String))); - } - return result; - } - - @override - Dog deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = DogBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'className': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.className = valueDes; - break; - case r'color': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.color = valueDes; - break; - case r'breed': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.breed = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/dog_all_of.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/dog_all_of.dart deleted file mode 100644 index 23387e4da75a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/dog_all_of.dart +++ /dev/null @@ -1,71 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'dog_all_of.g.dart'; - -/// DogAllOf -/// -/// Properties: -/// * [breed] -abstract class DogAllOf implements Built { - @BuiltValueField(wireName: r'breed') - String? get breed; - - DogAllOf._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(DogAllOfBuilder b) => b; - - factory DogAllOf([void updates(DogAllOfBuilder b)]) = _$DogAllOf; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$DogAllOfSerializer(); -} - -class _$DogAllOfSerializer implements StructuredSerializer { - @override - final Iterable types = const [DogAllOf, _$DogAllOf]; - - @override - final String wireName = r'DogAllOf'; - - @override - Iterable serialize(Serializers serializers, DogAllOf object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.breed != null) { - result - ..add(r'breed') - ..add(serializers.serialize(object.breed, - specifiedType: const FullType(String))); - } - return result; - } - - @override - DogAllOf deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = DogAllOfBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'breed': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.breed = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/enum_arrays.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/enum_arrays.dart deleted file mode 100644 index bda9790c1049..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/enum_arrays.dart +++ /dev/null @@ -1,119 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'enum_arrays.g.dart'; - -/// EnumArrays -/// -/// Properties: -/// * [justSymbol] -/// * [arrayEnum] -abstract class EnumArrays implements Built { - @BuiltValueField(wireName: r'just_symbol') - EnumArraysJustSymbolEnum? get justSymbol; - // enum justSymbolEnum { >=, $, }; - - @BuiltValueField(wireName: r'array_enum') - BuiltList? get arrayEnum; - // enum arrayEnumEnum { fish, crab, }; - - EnumArrays._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(EnumArraysBuilder b) => b; - - factory EnumArrays([void updates(EnumArraysBuilder b)]) = _$EnumArrays; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$EnumArraysSerializer(); -} - -class _$EnumArraysSerializer implements StructuredSerializer { - @override - final Iterable types = const [EnumArrays, _$EnumArrays]; - - @override - final String wireName = r'EnumArrays'; - - @override - Iterable serialize(Serializers serializers, EnumArrays object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.justSymbol != null) { - result - ..add(r'just_symbol') - ..add(serializers.serialize(object.justSymbol, - specifiedType: const FullType(EnumArraysJustSymbolEnum))); - } - if (object.arrayEnum != null) { - result - ..add(r'array_enum') - ..add(serializers.serialize(object.arrayEnum, - specifiedType: const FullType(BuiltList, [FullType(EnumArraysArrayEnumEnum)]))); - } - return result; - } - - @override - EnumArrays deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = EnumArraysBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'just_symbol': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(EnumArraysJustSymbolEnum)) as EnumArraysJustSymbolEnum; - result.justSymbol = valueDes; - break; - case r'array_enum': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltList, [FullType(EnumArraysArrayEnumEnum)])) as BuiltList; - result.arrayEnum.replace(valueDes); - break; - } - } - return result.build(); - } -} - -class EnumArraysJustSymbolEnum extends EnumClass { - - @BuiltValueEnumConst(wireName: r'>=') - static const EnumArraysJustSymbolEnum greaterThanEqual = _$enumArraysJustSymbolEnum_greaterThanEqual; - @BuiltValueEnumConst(wireName: r'$') - static const EnumArraysJustSymbolEnum dollar = _$enumArraysJustSymbolEnum_dollar; - - static Serializer get serializer => _$enumArraysJustSymbolEnumSerializer; - - const EnumArraysJustSymbolEnum._(String name): super(name); - - static BuiltSet get values => _$enumArraysJustSymbolEnumValues; - static EnumArraysJustSymbolEnum valueOf(String name) => _$enumArraysJustSymbolEnumValueOf(name); -} - -class EnumArraysArrayEnumEnum extends EnumClass { - - @BuiltValueEnumConst(wireName: r'fish') - static const EnumArraysArrayEnumEnum fish = _$enumArraysArrayEnumEnum_fish; - @BuiltValueEnumConst(wireName: r'crab') - static const EnumArraysArrayEnumEnum crab = _$enumArraysArrayEnumEnum_crab; - - static Serializer get serializer => _$enumArraysArrayEnumEnumSerializer; - - const EnumArraysArrayEnumEnum._(String name): super(name); - - static BuiltSet get values => _$enumArraysArrayEnumEnumValues; - static EnumArraysArrayEnumEnum valueOf(String name) => _$enumArraysArrayEnumEnumValueOf(name); -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/enum_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/enum_test.dart deleted file mode 100644 index 7ca76d22fe0f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/enum_test.dart +++ /dev/null @@ -1,252 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:openapi/src/model/outer_enum.dart'; -import 'package:openapi/src/model/outer_enum_default_value.dart'; -import 'package:built_collection/built_collection.dart'; -import 'package:openapi/src/model/outer_enum_integer.dart'; -import 'package:openapi/src/model/outer_enum_integer_default_value.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'enum_test.g.dart'; - -/// EnumTest -/// -/// Properties: -/// * [enumString] -/// * [enumStringRequired] -/// * [enumInteger] -/// * [enumNumber] -/// * [outerEnum] -/// * [outerEnumInteger] -/// * [outerEnumDefaultValue] -/// * [outerEnumIntegerDefaultValue] -abstract class EnumTest implements Built { - @BuiltValueField(wireName: r'enum_string') - EnumTestEnumStringEnum? get enumString; - // enum enumStringEnum { UPPER, lower, , }; - - @BuiltValueField(wireName: r'enum_string_required') - EnumTestEnumStringRequiredEnum get enumStringRequired; - // enum enumStringRequiredEnum { UPPER, lower, , }; - - @BuiltValueField(wireName: r'enum_integer') - EnumTestEnumIntegerEnum? get enumInteger; - // enum enumIntegerEnum { 1, -1, }; - - @BuiltValueField(wireName: r'enum_number') - EnumTestEnumNumberEnum? get enumNumber; - // enum enumNumberEnum { 1.1, -1.2, }; - - @BuiltValueField(wireName: r'outerEnum') - OuterEnum? get outerEnum; - // enum outerEnumEnum { placed, approved, delivered, }; - - @BuiltValueField(wireName: r'outerEnumInteger') - OuterEnumInteger? get outerEnumInteger; - // enum outerEnumIntegerEnum { 0, 1, 2, }; - - @BuiltValueField(wireName: r'outerEnumDefaultValue') - OuterEnumDefaultValue? get outerEnumDefaultValue; - // enum outerEnumDefaultValueEnum { placed, approved, delivered, }; - - @BuiltValueField(wireName: r'outerEnumIntegerDefaultValue') - OuterEnumIntegerDefaultValue? get outerEnumIntegerDefaultValue; - // enum outerEnumIntegerDefaultValueEnum { 0, 1, 2, }; - - EnumTest._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(EnumTestBuilder b) => b; - - factory EnumTest([void updates(EnumTestBuilder b)]) = _$EnumTest; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$EnumTestSerializer(); -} - -class _$EnumTestSerializer implements StructuredSerializer { - @override - final Iterable types = const [EnumTest, _$EnumTest]; - - @override - final String wireName = r'EnumTest'; - - @override - Iterable serialize(Serializers serializers, EnumTest object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.enumString != null) { - result - ..add(r'enum_string') - ..add(serializers.serialize(object.enumString, - specifiedType: const FullType(EnumTestEnumStringEnum))); - } - result - ..add(r'enum_string_required') - ..add(serializers.serialize(object.enumStringRequired, - specifiedType: const FullType(EnumTestEnumStringRequiredEnum))); - if (object.enumInteger != null) { - result - ..add(r'enum_integer') - ..add(serializers.serialize(object.enumInteger, - specifiedType: const FullType(EnumTestEnumIntegerEnum))); - } - if (object.enumNumber != null) { - result - ..add(r'enum_number') - ..add(serializers.serialize(object.enumNumber, - specifiedType: const FullType(EnumTestEnumNumberEnum))); - } - if (object.outerEnum != null) { - result - ..add(r'outerEnum') - ..add(serializers.serialize(object.outerEnum, - specifiedType: const FullType.nullable(OuterEnum))); - } - if (object.outerEnumInteger != null) { - result - ..add(r'outerEnumInteger') - ..add(serializers.serialize(object.outerEnumInteger, - specifiedType: const FullType(OuterEnumInteger))); - } - if (object.outerEnumDefaultValue != null) { - result - ..add(r'outerEnumDefaultValue') - ..add(serializers.serialize(object.outerEnumDefaultValue, - specifiedType: const FullType(OuterEnumDefaultValue))); - } - if (object.outerEnumIntegerDefaultValue != null) { - result - ..add(r'outerEnumIntegerDefaultValue') - ..add(serializers.serialize(object.outerEnumIntegerDefaultValue, - specifiedType: const FullType(OuterEnumIntegerDefaultValue))); - } - return result; - } - - @override - EnumTest deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = EnumTestBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'enum_string': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(EnumTestEnumStringEnum)) as EnumTestEnumStringEnum; - result.enumString = valueDes; - break; - case r'enum_string_required': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(EnumTestEnumStringRequiredEnum)) as EnumTestEnumStringRequiredEnum; - result.enumStringRequired = valueDes; - break; - case r'enum_integer': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(EnumTestEnumIntegerEnum)) as EnumTestEnumIntegerEnum; - result.enumInteger = valueDes; - break; - case r'enum_number': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(EnumTestEnumNumberEnum)) as EnumTestEnumNumberEnum; - result.enumNumber = valueDes; - break; - case r'outerEnum': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType.nullable(OuterEnum)) as OuterEnum?; - if (valueDes == null) continue; - result.outerEnum = valueDes; - break; - case r'outerEnumInteger': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(OuterEnumInteger)) as OuterEnumInteger; - result.outerEnumInteger = valueDes; - break; - case r'outerEnumDefaultValue': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(OuterEnumDefaultValue)) as OuterEnumDefaultValue; - result.outerEnumDefaultValue = valueDes; - break; - case r'outerEnumIntegerDefaultValue': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(OuterEnumIntegerDefaultValue)) as OuterEnumIntegerDefaultValue; - result.outerEnumIntegerDefaultValue = valueDes; - break; - } - } - return result.build(); - } -} - -class EnumTestEnumStringEnum extends EnumClass { - - @BuiltValueEnumConst(wireName: r'UPPER') - static const EnumTestEnumStringEnum UPPER = _$enumTestEnumStringEnum_UPPER; - @BuiltValueEnumConst(wireName: r'lower') - static const EnumTestEnumStringEnum lower = _$enumTestEnumStringEnum_lower; - @BuiltValueEnumConst(wireName: r'') - static const EnumTestEnumStringEnum empty = _$enumTestEnumStringEnum_empty; - - static Serializer get serializer => _$enumTestEnumStringEnumSerializer; - - const EnumTestEnumStringEnum._(String name): super(name); - - static BuiltSet get values => _$enumTestEnumStringEnumValues; - static EnumTestEnumStringEnum valueOf(String name) => _$enumTestEnumStringEnumValueOf(name); -} - -class EnumTestEnumStringRequiredEnum extends EnumClass { - - @BuiltValueEnumConst(wireName: r'UPPER') - static const EnumTestEnumStringRequiredEnum UPPER = _$enumTestEnumStringRequiredEnum_UPPER; - @BuiltValueEnumConst(wireName: r'lower') - static const EnumTestEnumStringRequiredEnum lower = _$enumTestEnumStringRequiredEnum_lower; - @BuiltValueEnumConst(wireName: r'') - static const EnumTestEnumStringRequiredEnum empty = _$enumTestEnumStringRequiredEnum_empty; - - static Serializer get serializer => _$enumTestEnumStringRequiredEnumSerializer; - - const EnumTestEnumStringRequiredEnum._(String name): super(name); - - static BuiltSet get values => _$enumTestEnumStringRequiredEnumValues; - static EnumTestEnumStringRequiredEnum valueOf(String name) => _$enumTestEnumStringRequiredEnumValueOf(name); -} - -class EnumTestEnumIntegerEnum extends EnumClass { - - @BuiltValueEnumConst(wireNumber: 1) - static const EnumTestEnumIntegerEnum number1 = _$enumTestEnumIntegerEnum_number1; - @BuiltValueEnumConst(wireNumber: -1) - static const EnumTestEnumIntegerEnum numberNegative1 = _$enumTestEnumIntegerEnum_numberNegative1; - - static Serializer get serializer => _$enumTestEnumIntegerEnumSerializer; - - const EnumTestEnumIntegerEnum._(String name): super(name); - - static BuiltSet get values => _$enumTestEnumIntegerEnumValues; - static EnumTestEnumIntegerEnum valueOf(String name) => _$enumTestEnumIntegerEnumValueOf(name); -} - -class EnumTestEnumNumberEnum extends EnumClass { - - @BuiltValueEnumConst(wireName: r'1.1') - static const EnumTestEnumNumberEnum number1Period1 = _$enumTestEnumNumberEnum_number1Period1; - @BuiltValueEnumConst(wireName: r'-1.2') - static const EnumTestEnumNumberEnum numberNegative1Period2 = _$enumTestEnumNumberEnum_numberNegative1Period2; - - static Serializer get serializer => _$enumTestEnumNumberEnumSerializer; - - const EnumTestEnumNumberEnum._(String name): super(name); - - static BuiltSet get values => _$enumTestEnumNumberEnumValues; - static EnumTestEnumNumberEnum valueOf(String name) => _$enumTestEnumNumberEnumValueOf(name); -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/file_schema_test_class.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/file_schema_test_class.dart deleted file mode 100644 index 7a2090e87dad..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/file_schema_test_class.dart +++ /dev/null @@ -1,88 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:openapi/src/model/model_file.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'file_schema_test_class.g.dart'; - -/// FileSchemaTestClass -/// -/// Properties: -/// * [file] -/// * [files] -abstract class FileSchemaTestClass implements Built { - @BuiltValueField(wireName: r'file') - ModelFile? get file; - - @BuiltValueField(wireName: r'files') - BuiltList? get files; - - FileSchemaTestClass._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(FileSchemaTestClassBuilder b) => b; - - factory FileSchemaTestClass([void updates(FileSchemaTestClassBuilder b)]) = _$FileSchemaTestClass; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$FileSchemaTestClassSerializer(); -} - -class _$FileSchemaTestClassSerializer implements StructuredSerializer { - @override - final Iterable types = const [FileSchemaTestClass, _$FileSchemaTestClass]; - - @override - final String wireName = r'FileSchemaTestClass'; - - @override - Iterable serialize(Serializers serializers, FileSchemaTestClass object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.file != null) { - result - ..add(r'file') - ..add(serializers.serialize(object.file, - specifiedType: const FullType(ModelFile))); - } - if (object.files != null) { - result - ..add(r'files') - ..add(serializers.serialize(object.files, - specifiedType: const FullType(BuiltList, [FullType(ModelFile)]))); - } - return result; - } - - @override - FileSchemaTestClass deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = FileSchemaTestClassBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'file': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(ModelFile)) as ModelFile; - result.file.replace(valueDes); - break; - case r'files': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltList, [FullType(ModelFile)])) as BuiltList; - result.files.replace(valueDes); - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/foo.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/foo.dart deleted file mode 100644 index dd3691968d4a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/foo.dart +++ /dev/null @@ -1,72 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'foo.g.dart'; - -/// Foo -/// -/// Properties: -/// * [bar] -abstract class Foo implements Built { - @BuiltValueField(wireName: r'bar') - String? get bar; - - Foo._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(FooBuilder b) => b - ..bar = 'bar'; - - factory Foo([void updates(FooBuilder b)]) = _$Foo; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$FooSerializer(); -} - -class _$FooSerializer implements StructuredSerializer { - @override - final Iterable types = const [Foo, _$Foo]; - - @override - final String wireName = r'Foo'; - - @override - Iterable serialize(Serializers serializers, Foo object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.bar != null) { - result - ..add(r'bar') - ..add(serializers.serialize(object.bar, - specifiedType: const FullType(String))); - } - return result; - } - - @override - Foo deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = FooBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'bar': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.bar = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/format_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/format_test.dart deleted file mode 100644 index cf1be44ab5b7..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/format_test.dart +++ /dev/null @@ -1,292 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:typed_data'; -import 'package:openapi/src/model/date.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'format_test.g.dart'; - -/// FormatTest -/// -/// Properties: -/// * [integer] -/// * [int32] -/// * [int64] -/// * [number] -/// * [float] -/// * [double_] -/// * [decimal] -/// * [string] -/// * [byte] -/// * [binary] -/// * [date] -/// * [dateTime] -/// * [uuid] -/// * [password] -/// * [patternWithDigits] - A string that is a 10 digit number. Can have leading zeros. -/// * [patternWithDigitsAndDelimiter] - A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. -abstract class FormatTest implements Built { - @BuiltValueField(wireName: r'integer') - int? get integer; - - @BuiltValueField(wireName: r'int32') - int? get int32; - - @BuiltValueField(wireName: r'int64') - int? get int64; - - @BuiltValueField(wireName: r'number') - num get number; - - @BuiltValueField(wireName: r'float') - double? get float; - - @BuiltValueField(wireName: r'double') - double? get double_; - - @BuiltValueField(wireName: r'decimal') - double? get decimal; - - @BuiltValueField(wireName: r'string') - String? get string; - - @BuiltValueField(wireName: r'byte') - String get byte; - - @BuiltValueField(wireName: r'binary') - Uint8List? get binary; - - @BuiltValueField(wireName: r'date') - Date get date; - - @BuiltValueField(wireName: r'dateTime') - DateTime? get dateTime; - - @BuiltValueField(wireName: r'uuid') - String? get uuid; - - @BuiltValueField(wireName: r'password') - String get password; - - /// A string that is a 10 digit number. Can have leading zeros. - @BuiltValueField(wireName: r'pattern_with_digits') - String? get patternWithDigits; - - /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. - @BuiltValueField(wireName: r'pattern_with_digits_and_delimiter') - String? get patternWithDigitsAndDelimiter; - - FormatTest._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(FormatTestBuilder b) => b; - - factory FormatTest([void updates(FormatTestBuilder b)]) = _$FormatTest; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$FormatTestSerializer(); -} - -class _$FormatTestSerializer implements StructuredSerializer { - @override - final Iterable types = const [FormatTest, _$FormatTest]; - - @override - final String wireName = r'FormatTest'; - - @override - Iterable serialize(Serializers serializers, FormatTest object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.integer != null) { - result - ..add(r'integer') - ..add(serializers.serialize(object.integer, - specifiedType: const FullType(int))); - } - if (object.int32 != null) { - result - ..add(r'int32') - ..add(serializers.serialize(object.int32, - specifiedType: const FullType(int))); - } - if (object.int64 != null) { - result - ..add(r'int64') - ..add(serializers.serialize(object.int64, - specifiedType: const FullType(int))); - } - result - ..add(r'number') - ..add(serializers.serialize(object.number, - specifiedType: const FullType(num))); - if (object.float != null) { - result - ..add(r'float') - ..add(serializers.serialize(object.float, - specifiedType: const FullType(double))); - } - if (object.double_ != null) { - result - ..add(r'double') - ..add(serializers.serialize(object.double_, - specifiedType: const FullType(double))); - } - if (object.decimal != null) { - result - ..add(r'decimal') - ..add(serializers.serialize(object.decimal, - specifiedType: const FullType(double))); - } - if (object.string != null) { - result - ..add(r'string') - ..add(serializers.serialize(object.string, - specifiedType: const FullType(String))); - } - result - ..add(r'byte') - ..add(serializers.serialize(object.byte, - specifiedType: const FullType(String))); - if (object.binary != null) { - result - ..add(r'binary') - ..add(serializers.serialize(object.binary, - specifiedType: const FullType(Uint8List))); - } - result - ..add(r'date') - ..add(serializers.serialize(object.date, - specifiedType: const FullType(Date))); - if (object.dateTime != null) { - result - ..add(r'dateTime') - ..add(serializers.serialize(object.dateTime, - specifiedType: const FullType(DateTime))); - } - if (object.uuid != null) { - result - ..add(r'uuid') - ..add(serializers.serialize(object.uuid, - specifiedType: const FullType(String))); - } - result - ..add(r'password') - ..add(serializers.serialize(object.password, - specifiedType: const FullType(String))); - if (object.patternWithDigits != null) { - result - ..add(r'pattern_with_digits') - ..add(serializers.serialize(object.patternWithDigits, - specifiedType: const FullType(String))); - } - if (object.patternWithDigitsAndDelimiter != null) { - result - ..add(r'pattern_with_digits_and_delimiter') - ..add(serializers.serialize(object.patternWithDigitsAndDelimiter, - specifiedType: const FullType(String))); - } - return result; - } - - @override - FormatTest deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = FormatTestBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'integer': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.integer = valueDes; - break; - case r'int32': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.int32 = valueDes; - break; - case r'int64': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.int64 = valueDes; - break; - case r'number': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(num)) as num; - result.number = valueDes; - break; - case r'float': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(double)) as double; - result.float = valueDes; - break; - case r'double': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(double)) as double; - result.double_ = valueDes; - break; - case r'decimal': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(double)) as double; - result.decimal = valueDes; - break; - case r'string': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.string = valueDes; - break; - case r'byte': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.byte = valueDes; - break; - case r'binary': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(Uint8List)) as Uint8List; - result.binary = valueDes; - break; - case r'date': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(Date)) as Date; - result.date = valueDes; - break; - case r'dateTime': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(DateTime)) as DateTime; - result.dateTime = valueDes; - break; - case r'uuid': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.uuid = valueDes; - break; - case r'password': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.password = valueDes; - break; - case r'pattern_with_digits': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.patternWithDigits = valueDes; - break; - case r'pattern_with_digits_and_delimiter': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.patternWithDigitsAndDelimiter = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/has_only_read_only.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/has_only_read_only.dart deleted file mode 100644 index 21b44ece26ed..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/has_only_read_only.dart +++ /dev/null @@ -1,86 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'has_only_read_only.g.dart'; - -/// HasOnlyReadOnly -/// -/// Properties: -/// * [bar] -/// * [foo] -abstract class HasOnlyReadOnly implements Built { - @BuiltValueField(wireName: r'bar') - String? get bar; - - @BuiltValueField(wireName: r'foo') - String? get foo; - - HasOnlyReadOnly._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(HasOnlyReadOnlyBuilder b) => b; - - factory HasOnlyReadOnly([void updates(HasOnlyReadOnlyBuilder b)]) = _$HasOnlyReadOnly; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$HasOnlyReadOnlySerializer(); -} - -class _$HasOnlyReadOnlySerializer implements StructuredSerializer { - @override - final Iterable types = const [HasOnlyReadOnly, _$HasOnlyReadOnly]; - - @override - final String wireName = r'HasOnlyReadOnly'; - - @override - Iterable serialize(Serializers serializers, HasOnlyReadOnly object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.bar != null) { - result - ..add(r'bar') - ..add(serializers.serialize(object.bar, - specifiedType: const FullType(String))); - } - if (object.foo != null) { - result - ..add(r'foo') - ..add(serializers.serialize(object.foo, - specifiedType: const FullType(String))); - } - return result; - } - - @override - HasOnlyReadOnly deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = HasOnlyReadOnlyBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'bar': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.bar = valueDes; - break; - case r'foo': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.foo = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/health_check_result.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/health_check_result.dart deleted file mode 100644 index e589cb7bd35d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/health_check_result.dart +++ /dev/null @@ -1,72 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'health_check_result.g.dart'; - -/// Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. -/// -/// Properties: -/// * [nullableMessage] -abstract class HealthCheckResult implements Built { - @BuiltValueField(wireName: r'NullableMessage') - String? get nullableMessage; - - HealthCheckResult._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(HealthCheckResultBuilder b) => b; - - factory HealthCheckResult([void updates(HealthCheckResultBuilder b)]) = _$HealthCheckResult; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$HealthCheckResultSerializer(); -} - -class _$HealthCheckResultSerializer implements StructuredSerializer { - @override - final Iterable types = const [HealthCheckResult, _$HealthCheckResult]; - - @override - final String wireName = r'HealthCheckResult'; - - @override - Iterable serialize(Serializers serializers, HealthCheckResult object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.nullableMessage != null) { - result - ..add(r'NullableMessage') - ..add(serializers.serialize(object.nullableMessage, - specifiedType: const FullType.nullable(String))); - } - return result; - } - - @override - HealthCheckResult deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = HealthCheckResultBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'NullableMessage': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType.nullable(String)) as String?; - if (valueDes == null) continue; - result.nullableMessage = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/inline_response_default.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/inline_response_default.dart deleted file mode 100644 index b611f8beb6aa..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/inline_response_default.dart +++ /dev/null @@ -1,72 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:openapi/src/model/foo.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'inline_response_default.g.dart'; - -/// InlineResponseDefault -/// -/// Properties: -/// * [string] -abstract class InlineResponseDefault implements Built { - @BuiltValueField(wireName: r'string') - Foo? get string; - - InlineResponseDefault._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(InlineResponseDefaultBuilder b) => b; - - factory InlineResponseDefault([void updates(InlineResponseDefaultBuilder b)]) = _$InlineResponseDefault; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$InlineResponseDefaultSerializer(); -} - -class _$InlineResponseDefaultSerializer implements StructuredSerializer { - @override - final Iterable types = const [InlineResponseDefault, _$InlineResponseDefault]; - - @override - final String wireName = r'InlineResponseDefault'; - - @override - Iterable serialize(Serializers serializers, InlineResponseDefault object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.string != null) { - result - ..add(r'string') - ..add(serializers.serialize(object.string, - specifiedType: const FullType(Foo))); - } - return result; - } - - @override - InlineResponseDefault deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = InlineResponseDefaultBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'string': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(Foo)) as Foo; - result.string.replace(valueDes); - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/map_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/map_test.dart deleted file mode 100644 index e5ae30f2290f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/map_test.dart +++ /dev/null @@ -1,133 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'map_test.g.dart'; - -/// MapTest -/// -/// Properties: -/// * [mapMapOfString] -/// * [mapOfEnumString] -/// * [directMap] -/// * [indirectMap] -abstract class MapTest implements Built { - @BuiltValueField(wireName: r'map_map_of_string') - BuiltMap>? get mapMapOfString; - - @BuiltValueField(wireName: r'map_of_enum_string') - BuiltMap? get mapOfEnumString; - // enum mapOfEnumStringEnum { UPPER, lower, }; - - @BuiltValueField(wireName: r'direct_map') - BuiltMap? get directMap; - - @BuiltValueField(wireName: r'indirect_map') - BuiltMap? get indirectMap; - - MapTest._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(MapTestBuilder b) => b; - - factory MapTest([void updates(MapTestBuilder b)]) = _$MapTest; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$MapTestSerializer(); -} - -class _$MapTestSerializer implements StructuredSerializer { - @override - final Iterable types = const [MapTest, _$MapTest]; - - @override - final String wireName = r'MapTest'; - - @override - Iterable serialize(Serializers serializers, MapTest object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.mapMapOfString != null) { - result - ..add(r'map_map_of_string') - ..add(serializers.serialize(object.mapMapOfString, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]))); - } - if (object.mapOfEnumString != null) { - result - ..add(r'map_of_enum_string') - ..add(serializers.serialize(object.mapOfEnumString, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(MapTestMapOfEnumStringEnum)]))); - } - if (object.directMap != null) { - result - ..add(r'direct_map') - ..add(serializers.serialize(object.directMap, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]))); - } - if (object.indirectMap != null) { - result - ..add(r'indirect_map') - ..add(serializers.serialize(object.indirectMap, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]))); - } - return result; - } - - @override - MapTest deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = MapTestBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'map_map_of_string': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])])) as BuiltMap>; - result.mapMapOfString.replace(valueDes); - break; - case r'map_of_enum_string': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(MapTestMapOfEnumStringEnum)])) as BuiltMap; - result.mapOfEnumString.replace(valueDes); - break; - case r'direct_map': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)])) as BuiltMap; - result.directMap.replace(valueDes); - break; - case r'indirect_map': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)])) as BuiltMap; - result.indirectMap.replace(valueDes); - break; - } - } - return result.build(); - } -} - -class MapTestMapOfEnumStringEnum extends EnumClass { - - @BuiltValueEnumConst(wireName: r'UPPER') - static const MapTestMapOfEnumStringEnum UPPER = _$mapTestMapOfEnumStringEnum_UPPER; - @BuiltValueEnumConst(wireName: r'lower') - static const MapTestMapOfEnumStringEnum lower = _$mapTestMapOfEnumStringEnum_lower; - - static Serializer get serializer => _$mapTestMapOfEnumStringEnumSerializer; - - const MapTestMapOfEnumStringEnum._(String name): super(name); - - static BuiltSet get values => _$mapTestMapOfEnumStringEnumValues; - static MapTestMapOfEnumStringEnum valueOf(String name) => _$mapTestMapOfEnumStringEnumValueOf(name); -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/mixed_properties_and_additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/mixed_properties_and_additional_properties_class.dart deleted file mode 100644 index 27c6993cc70f..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/mixed_properties_and_additional_properties_class.dart +++ /dev/null @@ -1,103 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:openapi/src/model/animal.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'mixed_properties_and_additional_properties_class.g.dart'; - -/// MixedPropertiesAndAdditionalPropertiesClass -/// -/// Properties: -/// * [uuid] -/// * [dateTime] -/// * [map] -abstract class MixedPropertiesAndAdditionalPropertiesClass implements Built { - @BuiltValueField(wireName: r'uuid') - String? get uuid; - - @BuiltValueField(wireName: r'dateTime') - DateTime? get dateTime; - - @BuiltValueField(wireName: r'map') - BuiltMap? get map; - - MixedPropertiesAndAdditionalPropertiesClass._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(MixedPropertiesAndAdditionalPropertiesClassBuilder b) => b; - - factory MixedPropertiesAndAdditionalPropertiesClass([void updates(MixedPropertiesAndAdditionalPropertiesClassBuilder b)]) = _$MixedPropertiesAndAdditionalPropertiesClass; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$MixedPropertiesAndAdditionalPropertiesClassSerializer(); -} - -class _$MixedPropertiesAndAdditionalPropertiesClassSerializer implements StructuredSerializer { - @override - final Iterable types = const [MixedPropertiesAndAdditionalPropertiesClass, _$MixedPropertiesAndAdditionalPropertiesClass]; - - @override - final String wireName = r'MixedPropertiesAndAdditionalPropertiesClass'; - - @override - Iterable serialize(Serializers serializers, MixedPropertiesAndAdditionalPropertiesClass object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.uuid != null) { - result - ..add(r'uuid') - ..add(serializers.serialize(object.uuid, - specifiedType: const FullType(String))); - } - if (object.dateTime != null) { - result - ..add(r'dateTime') - ..add(serializers.serialize(object.dateTime, - specifiedType: const FullType(DateTime))); - } - if (object.map != null) { - result - ..add(r'map') - ..add(serializers.serialize(object.map, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(Animal)]))); - } - return result; - } - - @override - MixedPropertiesAndAdditionalPropertiesClass deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = MixedPropertiesAndAdditionalPropertiesClassBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'uuid': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.uuid = valueDes; - break; - case r'dateTime': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(DateTime)) as DateTime; - result.dateTime = valueDes; - break; - case r'map': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(Animal)])) as BuiltMap; - result.map.replace(valueDes); - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model200_response.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model200_response.dart deleted file mode 100644 index 7392f71fe849..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model200_response.dart +++ /dev/null @@ -1,86 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'model200_response.g.dart'; - -/// Model for testing model name starting with number -/// -/// Properties: -/// * [name] -/// * [class_] -abstract class Model200Response implements Built { - @BuiltValueField(wireName: r'name') - int? get name; - - @BuiltValueField(wireName: r'class') - String? get class_; - - Model200Response._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(Model200ResponseBuilder b) => b; - - factory Model200Response([void updates(Model200ResponseBuilder b)]) = _$Model200Response; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$Model200ResponseSerializer(); -} - -class _$Model200ResponseSerializer implements StructuredSerializer { - @override - final Iterable types = const [Model200Response, _$Model200Response]; - - @override - final String wireName = r'Model200Response'; - - @override - Iterable serialize(Serializers serializers, Model200Response object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.name != null) { - result - ..add(r'name') - ..add(serializers.serialize(object.name, - specifiedType: const FullType(int))); - } - if (object.class_ != null) { - result - ..add(r'class') - ..add(serializers.serialize(object.class_, - specifiedType: const FullType(String))); - } - return result; - } - - @override - Model200Response deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = Model200ResponseBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'name': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.name = valueDes; - break; - case r'class': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.class_ = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_client.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_client.dart deleted file mode 100644 index 23c30a77f2b0..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_client.dart +++ /dev/null @@ -1,71 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'model_client.g.dart'; - -/// ModelClient -/// -/// Properties: -/// * [client] -abstract class ModelClient implements Built { - @BuiltValueField(wireName: r'client') - String? get client; - - ModelClient._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(ModelClientBuilder b) => b; - - factory ModelClient([void updates(ModelClientBuilder b)]) = _$ModelClient; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ModelClientSerializer(); -} - -class _$ModelClientSerializer implements StructuredSerializer { - @override - final Iterable types = const [ModelClient, _$ModelClient]; - - @override - final String wireName = r'ModelClient'; - - @override - Iterable serialize(Serializers serializers, ModelClient object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.client != null) { - result - ..add(r'client') - ..add(serializers.serialize(object.client, - specifiedType: const FullType(String))); - } - return result; - } - - @override - ModelClient deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = ModelClientBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'client': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.client = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_enum_class.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_enum_class.dart deleted file mode 100644 index ba6ca8c45dd3..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_enum_class.dart +++ /dev/null @@ -1,35 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'model_enum_class.g.dart'; - -class ModelEnumClass extends EnumClass { - - @BuiltValueEnumConst(wireName: r'_abc') - static const ModelEnumClass abc = _$abc; - @BuiltValueEnumConst(wireName: r'-efg') - static const ModelEnumClass efg = _$efg; - @BuiltValueEnumConst(wireName: r'(xyz)') - static const ModelEnumClass leftParenthesisXyzRightParenthesis = _$leftParenthesisXyzRightParenthesis; - - static Serializer get serializer => _$modelEnumClassSerializer; - - const ModelEnumClass._(String name): super(name); - - static BuiltSet get values => _$values; - static ModelEnumClass valueOf(String name) => _$valueOf(name); -} - -/// Optionally, enum_class can generate a mixin to go with your enum for use -/// with Angular. It exposes your enum constants as getters. So, if you mix it -/// in to your Dart component class, the values become available to the -/// corresponding Angular template. -/// -/// Trigger mixin generation by writing a line like this one next to your enum. -abstract class ModelEnumClassMixin = Object with _$ModelEnumClassMixin; - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_file.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_file.dart deleted file mode 100644 index aa7b5ecfeddf..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_file.dart +++ /dev/null @@ -1,72 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'model_file.g.dart'; - -/// Must be named `File` for test. -/// -/// Properties: -/// * [sourceURI] - Test capitalization -abstract class ModelFile implements Built { - /// Test capitalization - @BuiltValueField(wireName: r'sourceURI') - String? get sourceURI; - - ModelFile._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(ModelFileBuilder b) => b; - - factory ModelFile([void updates(ModelFileBuilder b)]) = _$ModelFile; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ModelFileSerializer(); -} - -class _$ModelFileSerializer implements StructuredSerializer { - @override - final Iterable types = const [ModelFile, _$ModelFile]; - - @override - final String wireName = r'ModelFile'; - - @override - Iterable serialize(Serializers serializers, ModelFile object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.sourceURI != null) { - result - ..add(r'sourceURI') - ..add(serializers.serialize(object.sourceURI, - specifiedType: const FullType(String))); - } - return result; - } - - @override - ModelFile deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = ModelFileBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'sourceURI': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.sourceURI = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_list.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_list.dart deleted file mode 100644 index 87e10153b1ac..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_list.dart +++ /dev/null @@ -1,71 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'model_list.g.dart'; - -/// ModelList -/// -/// Properties: -/// * [n123list] -abstract class ModelList implements Built { - @BuiltValueField(wireName: r'123-list') - String? get n123list; - - ModelList._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(ModelListBuilder b) => b; - - factory ModelList([void updates(ModelListBuilder b)]) = _$ModelList; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ModelListSerializer(); -} - -class _$ModelListSerializer implements StructuredSerializer { - @override - final Iterable types = const [ModelList, _$ModelList]; - - @override - final String wireName = r'ModelList'; - - @override - Iterable serialize(Serializers serializers, ModelList object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.n123list != null) { - result - ..add(r'123-list') - ..add(serializers.serialize(object.n123list, - specifiedType: const FullType(String))); - } - return result; - } - - @override - ModelList deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = ModelListBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'123-list': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.n123list = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_return.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_return.dart deleted file mode 100644 index c63e0464faad..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_return.dart +++ /dev/null @@ -1,71 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'model_return.g.dart'; - -/// Model for testing reserved words -/// -/// Properties: -/// * [return_] -abstract class ModelReturn implements Built { - @BuiltValueField(wireName: r'return') - int? get return_; - - ModelReturn._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(ModelReturnBuilder b) => b; - - factory ModelReturn([void updates(ModelReturnBuilder b)]) = _$ModelReturn; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ModelReturnSerializer(); -} - -class _$ModelReturnSerializer implements StructuredSerializer { - @override - final Iterable types = const [ModelReturn, _$ModelReturn]; - - @override - final String wireName = r'ModelReturn'; - - @override - Iterable serialize(Serializers serializers, ModelReturn object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.return_ != null) { - result - ..add(r'return') - ..add(serializers.serialize(object.return_, - specifiedType: const FullType(int))); - } - return result; - } - - @override - ModelReturn deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = ModelReturnBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'return': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.return_ = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/name.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/name.dart deleted file mode 100644 index 78f9f8e545ef..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/name.dart +++ /dev/null @@ -1,114 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'name.g.dart'; - -/// Model for testing model name same as property name -/// -/// Properties: -/// * [name] -/// * [snakeCase] -/// * [property] -/// * [n123number] -abstract class Name implements Built { - @BuiltValueField(wireName: r'name') - int get name; - - @BuiltValueField(wireName: r'snake_case') - int? get snakeCase; - - @BuiltValueField(wireName: r'property') - String? get property; - - @BuiltValueField(wireName: r'123Number') - int? get n123number; - - Name._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(NameBuilder b) => b; - - factory Name([void updates(NameBuilder b)]) = _$Name; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$NameSerializer(); -} - -class _$NameSerializer implements StructuredSerializer { - @override - final Iterable types = const [Name, _$Name]; - - @override - final String wireName = r'Name'; - - @override - Iterable serialize(Serializers serializers, Name object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - result - ..add(r'name') - ..add(serializers.serialize(object.name, - specifiedType: const FullType(int))); - if (object.snakeCase != null) { - result - ..add(r'snake_case') - ..add(serializers.serialize(object.snakeCase, - specifiedType: const FullType(int))); - } - if (object.property != null) { - result - ..add(r'property') - ..add(serializers.serialize(object.property, - specifiedType: const FullType(String))); - } - if (object.n123number != null) { - result - ..add(r'123Number') - ..add(serializers.serialize(object.n123number, - specifiedType: const FullType(int))); - } - return result; - } - - @override - Name deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = NameBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'name': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.name = valueDes; - break; - case r'snake_case': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.snakeCase = valueDes; - break; - case r'property': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.property = valueDes; - break; - case r'123Number': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.n123number = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/nullable_class.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/nullable_class.dart deleted file mode 100644 index efddc42e3072..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/nullable_class.dart +++ /dev/null @@ -1,249 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:openapi/src/model/date.dart'; -import 'package:built_value/json_object.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'nullable_class.g.dart'; - -/// NullableClass -/// -/// Properties: -/// * [integerProp] -/// * [numberProp] -/// * [booleanProp] -/// * [stringProp] -/// * [dateProp] -/// * [datetimeProp] -/// * [arrayNullableProp] -/// * [arrayAndItemsNullableProp] -/// * [arrayItemsNullable] -/// * [objectNullableProp] -/// * [objectAndItemsNullableProp] -/// * [objectItemsNullable] -abstract class NullableClass implements Built { - @BuiltValueField(wireName: r'integer_prop') - int? get integerProp; - - @BuiltValueField(wireName: r'number_prop') - num? get numberProp; - - @BuiltValueField(wireName: r'boolean_prop') - bool? get booleanProp; - - @BuiltValueField(wireName: r'string_prop') - String? get stringProp; - - @BuiltValueField(wireName: r'date_prop') - Date? get dateProp; - - @BuiltValueField(wireName: r'datetime_prop') - DateTime? get datetimeProp; - - @BuiltValueField(wireName: r'array_nullable_prop') - BuiltList? get arrayNullableProp; - - @BuiltValueField(wireName: r'array_and_items_nullable_prop') - BuiltList? get arrayAndItemsNullableProp; - - @BuiltValueField(wireName: r'array_items_nullable') - BuiltList? get arrayItemsNullable; - - @BuiltValueField(wireName: r'object_nullable_prop') - BuiltMap? get objectNullableProp; - - @BuiltValueField(wireName: r'object_and_items_nullable_prop') - BuiltMap? get objectAndItemsNullableProp; - - @BuiltValueField(wireName: r'object_items_nullable') - BuiltMap? get objectItemsNullable; - - NullableClass._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(NullableClassBuilder b) => b; - - factory NullableClass([void updates(NullableClassBuilder b)]) = _$NullableClass; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$NullableClassSerializer(); -} - -class _$NullableClassSerializer implements StructuredSerializer { - @override - final Iterable types = const [NullableClass, _$NullableClass]; - - @override - final String wireName = r'NullableClass'; - - @override - Iterable serialize(Serializers serializers, NullableClass object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.integerProp != null) { - result - ..add(r'integer_prop') - ..add(serializers.serialize(object.integerProp, - specifiedType: const FullType.nullable(int))); - } - if (object.numberProp != null) { - result - ..add(r'number_prop') - ..add(serializers.serialize(object.numberProp, - specifiedType: const FullType.nullable(num))); - } - if (object.booleanProp != null) { - result - ..add(r'boolean_prop') - ..add(serializers.serialize(object.booleanProp, - specifiedType: const FullType.nullable(bool))); - } - if (object.stringProp != null) { - result - ..add(r'string_prop') - ..add(serializers.serialize(object.stringProp, - specifiedType: const FullType.nullable(String))); - } - if (object.dateProp != null) { - result - ..add(r'date_prop') - ..add(serializers.serialize(object.dateProp, - specifiedType: const FullType.nullable(Date))); - } - if (object.datetimeProp != null) { - result - ..add(r'datetime_prop') - ..add(serializers.serialize(object.datetimeProp, - specifiedType: const FullType.nullable(DateTime))); - } - if (object.arrayNullableProp != null) { - result - ..add(r'array_nullable_prop') - ..add(serializers.serialize(object.arrayNullableProp, - specifiedType: const FullType.nullable(BuiltList, [FullType(JsonObject)]))); - } - if (object.arrayAndItemsNullableProp != null) { - result - ..add(r'array_and_items_nullable_prop') - ..add(serializers.serialize(object.arrayAndItemsNullableProp, - specifiedType: const FullType.nullable(BuiltList, [FullType.nullable(JsonObject)]))); - } - if (object.arrayItemsNullable != null) { - result - ..add(r'array_items_nullable') - ..add(serializers.serialize(object.arrayItemsNullable, - specifiedType: const FullType(BuiltList, [FullType.nullable(JsonObject)]))); - } - if (object.objectNullableProp != null) { - result - ..add(r'object_nullable_prop') - ..add(serializers.serialize(object.objectNullableProp, - specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType(JsonObject)]))); - } - if (object.objectAndItemsNullableProp != null) { - result - ..add(r'object_and_items_nullable_prop') - ..add(serializers.serialize(object.objectAndItemsNullableProp, - specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]))); - } - if (object.objectItemsNullable != null) { - result - ..add(r'object_items_nullable') - ..add(serializers.serialize(object.objectItemsNullable, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]))); - } - return result; - } - - @override - NullableClass deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = NullableClassBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'integer_prop': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType.nullable(int)) as int?; - if (valueDes == null) continue; - result.integerProp = valueDes; - break; - case r'number_prop': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType.nullable(num)) as num?; - if (valueDes == null) continue; - result.numberProp = valueDes; - break; - case r'boolean_prop': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType.nullable(bool)) as bool?; - if (valueDes == null) continue; - result.booleanProp = valueDes; - break; - case r'string_prop': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType.nullable(String)) as String?; - if (valueDes == null) continue; - result.stringProp = valueDes; - break; - case r'date_prop': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType.nullable(Date)) as Date?; - if (valueDes == null) continue; - result.dateProp = valueDes; - break; - case r'datetime_prop': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType.nullable(DateTime)) as DateTime?; - if (valueDes == null) continue; - result.datetimeProp = valueDes; - break; - case r'array_nullable_prop': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType.nullable(BuiltList, [FullType(JsonObject)])) as BuiltList?; - if (valueDes == null) continue; - result.arrayNullableProp.replace(valueDes); - break; - case r'array_and_items_nullable_prop': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType.nullable(BuiltList, [FullType.nullable(JsonObject)])) as BuiltList?; - if (valueDes == null) continue; - result.arrayAndItemsNullableProp.replace(valueDes); - break; - case r'array_items_nullable': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltList, [FullType.nullable(JsonObject)])) as BuiltList; - result.arrayItemsNullable.replace(valueDes); - break; - case r'object_nullable_prop': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType(JsonObject)])) as BuiltMap?; - if (valueDes == null) continue; - result.objectNullableProp.replace(valueDes); - break; - case r'object_and_items_nullable_prop': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType.nullable(JsonObject)])) as BuiltMap?; - if (valueDes == null) continue; - result.objectAndItemsNullableProp.replace(valueDes); - break; - case r'object_items_nullable': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType.nullable(JsonObject)])) as BuiltMap; - result.objectItemsNullable.replace(valueDes); - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/number_only.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/number_only.dart deleted file mode 100644 index e90cc9b93408..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/number_only.dart +++ /dev/null @@ -1,71 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'number_only.g.dart'; - -/// NumberOnly -/// -/// Properties: -/// * [justNumber] -abstract class NumberOnly implements Built { - @BuiltValueField(wireName: r'JustNumber') - num? get justNumber; - - NumberOnly._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(NumberOnlyBuilder b) => b; - - factory NumberOnly([void updates(NumberOnlyBuilder b)]) = _$NumberOnly; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$NumberOnlySerializer(); -} - -class _$NumberOnlySerializer implements StructuredSerializer { - @override - final Iterable types = const [NumberOnly, _$NumberOnly]; - - @override - final String wireName = r'NumberOnly'; - - @override - Iterable serialize(Serializers serializers, NumberOnly object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.justNumber != null) { - result - ..add(r'JustNumber') - ..add(serializers.serialize(object.justNumber, - specifiedType: const FullType(num))); - } - return result; - } - - @override - NumberOnly deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = NumberOnlyBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'JustNumber': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(num)) as num; - result.justNumber = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/object_with_deprecated_fields.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/object_with_deprecated_fields.dart deleted file mode 100644 index 881ede54d0d6..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/object_with_deprecated_fields.dart +++ /dev/null @@ -1,118 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:openapi/src/model/deprecated_object.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'object_with_deprecated_fields.g.dart'; - -/// ObjectWithDeprecatedFields -/// -/// Properties: -/// * [uuid] -/// * [id] -/// * [deprecatedRef] -/// * [bars] -abstract class ObjectWithDeprecatedFields implements Built { - @BuiltValueField(wireName: r'uuid') - String? get uuid; - - @BuiltValueField(wireName: r'id') - num? get id; - - @BuiltValueField(wireName: r'deprecatedRef') - DeprecatedObject? get deprecatedRef; - - @BuiltValueField(wireName: r'bars') - BuiltList? get bars; - - ObjectWithDeprecatedFields._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(ObjectWithDeprecatedFieldsBuilder b) => b; - - factory ObjectWithDeprecatedFields([void updates(ObjectWithDeprecatedFieldsBuilder b)]) = _$ObjectWithDeprecatedFields; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ObjectWithDeprecatedFieldsSerializer(); -} - -class _$ObjectWithDeprecatedFieldsSerializer implements StructuredSerializer { - @override - final Iterable types = const [ObjectWithDeprecatedFields, _$ObjectWithDeprecatedFields]; - - @override - final String wireName = r'ObjectWithDeprecatedFields'; - - @override - Iterable serialize(Serializers serializers, ObjectWithDeprecatedFields object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.uuid != null) { - result - ..add(r'uuid') - ..add(serializers.serialize(object.uuid, - specifiedType: const FullType(String))); - } - if (object.id != null) { - result - ..add(r'id') - ..add(serializers.serialize(object.id, - specifiedType: const FullType(num))); - } - if (object.deprecatedRef != null) { - result - ..add(r'deprecatedRef') - ..add(serializers.serialize(object.deprecatedRef, - specifiedType: const FullType(DeprecatedObject))); - } - if (object.bars != null) { - result - ..add(r'bars') - ..add(serializers.serialize(object.bars, - specifiedType: const FullType(BuiltList, [FullType(String)]))); - } - return result; - } - - @override - ObjectWithDeprecatedFields deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = ObjectWithDeprecatedFieldsBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'uuid': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.uuid = valueDes; - break; - case r'id': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(num)) as num; - result.id = valueDes; - break; - case r'deprecatedRef': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(DeprecatedObject)) as DeprecatedObject; - result.deprecatedRef.replace(valueDes); - break; - case r'bars': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltList, [FullType(String)])) as BuiltList; - result.bars.replace(valueDes); - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/order.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/order.dart deleted file mode 100644 index 3f9aed726558..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/order.dart +++ /dev/null @@ -1,170 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'order.g.dart'; - -/// Order -/// -/// Properties: -/// * [id] -/// * [petId] -/// * [quantity] -/// * [shipDate] -/// * [status] - Order Status -/// * [complete] -abstract class Order implements Built { - @BuiltValueField(wireName: r'id') - int? get id; - - @BuiltValueField(wireName: r'petId') - int? get petId; - - @BuiltValueField(wireName: r'quantity') - int? get quantity; - - @BuiltValueField(wireName: r'shipDate') - DateTime? get shipDate; - - /// Order Status - @BuiltValueField(wireName: r'status') - OrderStatusEnum? get status; - // enum statusEnum { placed, approved, delivered, }; - - @BuiltValueField(wireName: r'complete') - bool? get complete; - - Order._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(OrderBuilder b) => b - ..complete = false; - - factory Order([void updates(OrderBuilder b)]) = _$Order; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$OrderSerializer(); -} - -class _$OrderSerializer implements StructuredSerializer { - @override - final Iterable types = const [Order, _$Order]; - - @override - final String wireName = r'Order'; - - @override - Iterable serialize(Serializers serializers, Order object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.id != null) { - result - ..add(r'id') - ..add(serializers.serialize(object.id, - specifiedType: const FullType(int))); - } - if (object.petId != null) { - result - ..add(r'petId') - ..add(serializers.serialize(object.petId, - specifiedType: const FullType(int))); - } - if (object.quantity != null) { - result - ..add(r'quantity') - ..add(serializers.serialize(object.quantity, - specifiedType: const FullType(int))); - } - if (object.shipDate != null) { - result - ..add(r'shipDate') - ..add(serializers.serialize(object.shipDate, - specifiedType: const FullType(DateTime))); - } - if (object.status != null) { - result - ..add(r'status') - ..add(serializers.serialize(object.status, - specifiedType: const FullType(OrderStatusEnum))); - } - if (object.complete != null) { - result - ..add(r'complete') - ..add(serializers.serialize(object.complete, - specifiedType: const FullType(bool))); - } - return result; - } - - @override - Order deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = OrderBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'id': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.id = valueDes; - break; - case r'petId': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.petId = valueDes; - break; - case r'quantity': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.quantity = valueDes; - break; - case r'shipDate': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(DateTime)) as DateTime; - result.shipDate = valueDes; - break; - case r'status': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(OrderStatusEnum)) as OrderStatusEnum; - result.status = valueDes; - break; - case r'complete': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(bool)) as bool; - result.complete = valueDes; - break; - } - } - return result.build(); - } -} - -class OrderStatusEnum extends EnumClass { - - /// Order Status - @BuiltValueEnumConst(wireName: r'placed') - static const OrderStatusEnum placed = _$orderStatusEnum_placed; - /// Order Status - @BuiltValueEnumConst(wireName: r'approved') - static const OrderStatusEnum approved = _$orderStatusEnum_approved; - /// Order Status - @BuiltValueEnumConst(wireName: r'delivered') - static const OrderStatusEnum delivered = _$orderStatusEnum_delivered; - - static Serializer get serializer => _$orderStatusEnumSerializer; - - const OrderStatusEnum._(String name): super(name); - - static BuiltSet get values => _$orderStatusEnumValues; - static OrderStatusEnum valueOf(String name) => _$orderStatusEnumValueOf(name); -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_composite.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_composite.dart deleted file mode 100644 index 0715bdff3056..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_composite.dart +++ /dev/null @@ -1,101 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'outer_composite.g.dart'; - -/// OuterComposite -/// -/// Properties: -/// * [myNumber] -/// * [myString] -/// * [myBoolean] -abstract class OuterComposite implements Built { - @BuiltValueField(wireName: r'my_number') - num? get myNumber; - - @BuiltValueField(wireName: r'my_string') - String? get myString; - - @BuiltValueField(wireName: r'my_boolean') - bool? get myBoolean; - - OuterComposite._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(OuterCompositeBuilder b) => b; - - factory OuterComposite([void updates(OuterCompositeBuilder b)]) = _$OuterComposite; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$OuterCompositeSerializer(); -} - -class _$OuterCompositeSerializer implements StructuredSerializer { - @override - final Iterable types = const [OuterComposite, _$OuterComposite]; - - @override - final String wireName = r'OuterComposite'; - - @override - Iterable serialize(Serializers serializers, OuterComposite object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.myNumber != null) { - result - ..add(r'my_number') - ..add(serializers.serialize(object.myNumber, - specifiedType: const FullType(num))); - } - if (object.myString != null) { - result - ..add(r'my_string') - ..add(serializers.serialize(object.myString, - specifiedType: const FullType(String))); - } - if (object.myBoolean != null) { - result - ..add(r'my_boolean') - ..add(serializers.serialize(object.myBoolean, - specifiedType: const FullType(bool))); - } - return result; - } - - @override - OuterComposite deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = OuterCompositeBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'my_number': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(num)) as num; - result.myNumber = valueDes; - break; - case r'my_string': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.myString = valueDes; - break; - case r'my_boolean': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(bool)) as bool; - result.myBoolean = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_enum.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_enum.dart deleted file mode 100644 index 6476ca57d462..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_enum.dart +++ /dev/null @@ -1,35 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'outer_enum.g.dart'; - -class OuterEnum extends EnumClass { - - @BuiltValueEnumConst(wireName: r'placed') - static const OuterEnum placed = _$placed; - @BuiltValueEnumConst(wireName: r'approved') - static const OuterEnum approved = _$approved; - @BuiltValueEnumConst(wireName: r'delivered') - static const OuterEnum delivered = _$delivered; - - static Serializer get serializer => _$outerEnumSerializer; - - const OuterEnum._(String name): super(name); - - static BuiltSet get values => _$values; - static OuterEnum valueOf(String name) => _$valueOf(name); -} - -/// Optionally, enum_class can generate a mixin to go with your enum for use -/// with Angular. It exposes your enum constants as getters. So, if you mix it -/// in to your Dart component class, the values become available to the -/// corresponding Angular template. -/// -/// Trigger mixin generation by writing a line like this one next to your enum. -abstract class OuterEnumMixin = Object with _$OuterEnumMixin; - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_enum_default_value.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_enum_default_value.dart deleted file mode 100644 index af04c76ed44e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_enum_default_value.dart +++ /dev/null @@ -1,35 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'outer_enum_default_value.g.dart'; - -class OuterEnumDefaultValue extends EnumClass { - - @BuiltValueEnumConst(wireName: r'placed') - static const OuterEnumDefaultValue placed = _$placed; - @BuiltValueEnumConst(wireName: r'approved') - static const OuterEnumDefaultValue approved = _$approved; - @BuiltValueEnumConst(wireName: r'delivered') - static const OuterEnumDefaultValue delivered = _$delivered; - - static Serializer get serializer => _$outerEnumDefaultValueSerializer; - - const OuterEnumDefaultValue._(String name): super(name); - - static BuiltSet get values => _$values; - static OuterEnumDefaultValue valueOf(String name) => _$valueOf(name); -} - -/// Optionally, enum_class can generate a mixin to go with your enum for use -/// with Angular. It exposes your enum constants as getters. So, if you mix it -/// in to your Dart component class, the values become available to the -/// corresponding Angular template. -/// -/// Trigger mixin generation by writing a line like this one next to your enum. -abstract class OuterEnumDefaultValueMixin = Object with _$OuterEnumDefaultValueMixin; - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_enum_integer.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_enum_integer.dart deleted file mode 100644 index c3b4b7d8f5d8..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_enum_integer.dart +++ /dev/null @@ -1,35 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'outer_enum_integer.g.dart'; - -class OuterEnumInteger extends EnumClass { - - @BuiltValueEnumConst(wireNumber: 0) - static const OuterEnumInteger number0 = _$number0; - @BuiltValueEnumConst(wireNumber: 1) - static const OuterEnumInteger number1 = _$number1; - @BuiltValueEnumConst(wireNumber: 2) - static const OuterEnumInteger number2 = _$number2; - - static Serializer get serializer => _$outerEnumIntegerSerializer; - - const OuterEnumInteger._(String name): super(name); - - static BuiltSet get values => _$values; - static OuterEnumInteger valueOf(String name) => _$valueOf(name); -} - -/// Optionally, enum_class can generate a mixin to go with your enum for use -/// with Angular. It exposes your enum constants as getters. So, if you mix it -/// in to your Dart component class, the values become available to the -/// corresponding Angular template. -/// -/// Trigger mixin generation by writing a line like this one next to your enum. -abstract class OuterEnumIntegerMixin = Object with _$OuterEnumIntegerMixin; - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_enum_integer_default_value.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_enum_integer_default_value.dart deleted file mode 100644 index cf71a0217650..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_enum_integer_default_value.dart +++ /dev/null @@ -1,35 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'outer_enum_integer_default_value.g.dart'; - -class OuterEnumIntegerDefaultValue extends EnumClass { - - @BuiltValueEnumConst(wireNumber: 0) - static const OuterEnumIntegerDefaultValue number0 = _$number0; - @BuiltValueEnumConst(wireNumber: 1) - static const OuterEnumIntegerDefaultValue number1 = _$number1; - @BuiltValueEnumConst(wireNumber: 2) - static const OuterEnumIntegerDefaultValue number2 = _$number2; - - static Serializer get serializer => _$outerEnumIntegerDefaultValueSerializer; - - const OuterEnumIntegerDefaultValue._(String name): super(name); - - static BuiltSet get values => _$values; - static OuterEnumIntegerDefaultValue valueOf(String name) => _$valueOf(name); -} - -/// Optionally, enum_class can generate a mixin to go with your enum for use -/// with Angular. It exposes your enum constants as getters. So, if you mix it -/// in to your Dart component class, the values become available to the -/// corresponding Angular template. -/// -/// Trigger mixin generation by writing a line like this one next to your enum. -abstract class OuterEnumIntegerDefaultValueMixin = Object with _$OuterEnumIntegerDefaultValueMixin; - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_object_with_enum_property.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_object_with_enum_property.dart deleted file mode 100644 index 91524a285b84..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_object_with_enum_property.dart +++ /dev/null @@ -1,71 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:openapi/src/model/outer_enum_integer.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'outer_object_with_enum_property.g.dart'; - -/// OuterObjectWithEnumProperty -/// -/// Properties: -/// * [value] -abstract class OuterObjectWithEnumProperty implements Built { - @BuiltValueField(wireName: r'value') - OuterEnumInteger get value; - // enum valueEnum { 0, 1, 2, }; - - OuterObjectWithEnumProperty._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(OuterObjectWithEnumPropertyBuilder b) => b; - - factory OuterObjectWithEnumProperty([void updates(OuterObjectWithEnumPropertyBuilder b)]) = _$OuterObjectWithEnumProperty; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$OuterObjectWithEnumPropertySerializer(); -} - -class _$OuterObjectWithEnumPropertySerializer implements StructuredSerializer { - @override - final Iterable types = const [OuterObjectWithEnumProperty, _$OuterObjectWithEnumProperty]; - - @override - final String wireName = r'OuterObjectWithEnumProperty'; - - @override - Iterable serialize(Serializers serializers, OuterObjectWithEnumProperty object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - result - ..add(r'value') - ..add(serializers.serialize(object.value, - specifiedType: const FullType(OuterEnumInteger))); - return result; - } - - @override - OuterObjectWithEnumProperty deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = OuterObjectWithEnumPropertyBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'value': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(OuterEnumInteger)) as OuterEnumInteger; - result.value = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/pet.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/pet.dart deleted file mode 100644 index 4aea3f370f99..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/pet.dart +++ /dev/null @@ -1,167 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:openapi/src/model/category.dart'; -import 'package:openapi/src/model/tag.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'pet.g.dart'; - -/// Pet -/// -/// Properties: -/// * [id] -/// * [category] -/// * [name] -/// * [photoUrls] -/// * [tags] -/// * [status] - pet status in the store -abstract class Pet implements Built { - @BuiltValueField(wireName: r'id') - int? get id; - - @BuiltValueField(wireName: r'category') - Category? get category; - - @BuiltValueField(wireName: r'name') - String get name; - - @BuiltValueField(wireName: r'photoUrls') - BuiltSet get photoUrls; - - @BuiltValueField(wireName: r'tags') - BuiltList? get tags; - - /// pet status in the store - @BuiltValueField(wireName: r'status') - PetStatusEnum? get status; - // enum statusEnum { available, pending, sold, }; - - Pet._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(PetBuilder b) => b; - - factory Pet([void updates(PetBuilder b)]) = _$Pet; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$PetSerializer(); -} - -class _$PetSerializer implements StructuredSerializer { - @override - final Iterable types = const [Pet, _$Pet]; - - @override - final String wireName = r'Pet'; - - @override - Iterable serialize(Serializers serializers, Pet object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.id != null) { - result - ..add(r'id') - ..add(serializers.serialize(object.id, - specifiedType: const FullType(int))); - } - if (object.category != null) { - result - ..add(r'category') - ..add(serializers.serialize(object.category, - specifiedType: const FullType(Category))); - } - result - ..add(r'name') - ..add(serializers.serialize(object.name, - specifiedType: const FullType(String))); - result - ..add(r'photoUrls') - ..add(serializers.serialize(object.photoUrls, - specifiedType: const FullType(BuiltSet, [FullType(String)]))); - if (object.tags != null) { - result - ..add(r'tags') - ..add(serializers.serialize(object.tags, - specifiedType: const FullType(BuiltList, [FullType(Tag)]))); - } - if (object.status != null) { - result - ..add(r'status') - ..add(serializers.serialize(object.status, - specifiedType: const FullType(PetStatusEnum))); - } - return result; - } - - @override - Pet deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = PetBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'id': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.id = valueDes; - break; - case r'category': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(Category)) as Category; - result.category.replace(valueDes); - break; - case r'name': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.name = valueDes; - break; - case r'photoUrls': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltSet, [FullType(String)])) as BuiltSet; - result.photoUrls.replace(valueDes); - break; - case r'tags': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltList, [FullType(Tag)])) as BuiltList; - result.tags.replace(valueDes); - break; - case r'status': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(PetStatusEnum)) as PetStatusEnum; - result.status = valueDes; - break; - } - } - return result.build(); - } -} - -class PetStatusEnum extends EnumClass { - - /// pet status in the store - @BuiltValueEnumConst(wireName: r'available') - static const PetStatusEnum available = _$petStatusEnum_available; - /// pet status in the store - @BuiltValueEnumConst(wireName: r'pending') - static const PetStatusEnum pending = _$petStatusEnum_pending; - /// pet status in the store - @BuiltValueEnumConst(wireName: r'sold') - static const PetStatusEnum sold = _$petStatusEnum_sold; - - static Serializer get serializer => _$petStatusEnumSerializer; - - const PetStatusEnum._(String name): super(name); - - static BuiltSet get values => _$petStatusEnumValues; - static PetStatusEnum valueOf(String name) => _$petStatusEnumValueOf(name); -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/read_only_first.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/read_only_first.dart deleted file mode 100644 index b9f108fb6259..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/read_only_first.dart +++ /dev/null @@ -1,86 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'read_only_first.g.dart'; - -/// ReadOnlyFirst -/// -/// Properties: -/// * [bar] -/// * [baz] -abstract class ReadOnlyFirst implements Built { - @BuiltValueField(wireName: r'bar') - String? get bar; - - @BuiltValueField(wireName: r'baz') - String? get baz; - - ReadOnlyFirst._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(ReadOnlyFirstBuilder b) => b; - - factory ReadOnlyFirst([void updates(ReadOnlyFirstBuilder b)]) = _$ReadOnlyFirst; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ReadOnlyFirstSerializer(); -} - -class _$ReadOnlyFirstSerializer implements StructuredSerializer { - @override - final Iterable types = const [ReadOnlyFirst, _$ReadOnlyFirst]; - - @override - final String wireName = r'ReadOnlyFirst'; - - @override - Iterable serialize(Serializers serializers, ReadOnlyFirst object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.bar != null) { - result - ..add(r'bar') - ..add(serializers.serialize(object.bar, - specifiedType: const FullType(String))); - } - if (object.baz != null) { - result - ..add(r'baz') - ..add(serializers.serialize(object.baz, - specifiedType: const FullType(String))); - } - return result; - } - - @override - ReadOnlyFirst deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = ReadOnlyFirstBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'bar': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.bar = valueDes; - break; - case r'baz': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.baz = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/special_model_name.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/special_model_name.dart deleted file mode 100644 index dcfe12bb066a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/special_model_name.dart +++ /dev/null @@ -1,71 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'special_model_name.g.dart'; - -/// SpecialModelName -/// -/// Properties: -/// * [dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket] -abstract class SpecialModelName implements Built { - @BuiltValueField(wireName: r'$special[property.name]') - int? get dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket; - - SpecialModelName._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(SpecialModelNameBuilder b) => b; - - factory SpecialModelName([void updates(SpecialModelNameBuilder b)]) = _$SpecialModelName; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$SpecialModelNameSerializer(); -} - -class _$SpecialModelNameSerializer implements StructuredSerializer { - @override - final Iterable types = const [SpecialModelName, _$SpecialModelName]; - - @override - final String wireName = r'SpecialModelName'; - - @override - Iterable serialize(Serializers serializers, SpecialModelName object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket != null) { - result - ..add(r'$special[property.name]') - ..add(serializers.serialize(object.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket, - specifiedType: const FullType(int))); - } - return result; - } - - @override - SpecialModelName deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = SpecialModelNameBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'$special[property.name]': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/tag.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/tag.dart deleted file mode 100644 index 5a7ed38d94c3..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/tag.dart +++ /dev/null @@ -1,86 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'tag.g.dart'; - -/// Tag -/// -/// Properties: -/// * [id] -/// * [name] -abstract class Tag implements Built { - @BuiltValueField(wireName: r'id') - int? get id; - - @BuiltValueField(wireName: r'name') - String? get name; - - Tag._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(TagBuilder b) => b; - - factory Tag([void updates(TagBuilder b)]) = _$Tag; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$TagSerializer(); -} - -class _$TagSerializer implements StructuredSerializer { - @override - final Iterable types = const [Tag, _$Tag]; - - @override - final String wireName = r'Tag'; - - @override - Iterable serialize(Serializers serializers, Tag object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.id != null) { - result - ..add(r'id') - ..add(serializers.serialize(object.id, - specifiedType: const FullType(int))); - } - if (object.name != null) { - result - ..add(r'name') - ..add(serializers.serialize(object.name, - specifiedType: const FullType(String))); - } - return result; - } - - @override - Tag deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = TagBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'id': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.id = valueDes; - break; - case r'name': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.name = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/user.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/user.dart deleted file mode 100644 index d590c20bdc70..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/user.dart +++ /dev/null @@ -1,177 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'user.g.dart'; - -/// User -/// -/// Properties: -/// * [id] -/// * [username] -/// * [firstName] -/// * [lastName] -/// * [email] -/// * [password] -/// * [phone] -/// * [userStatus] - User Status -abstract class User implements Built { - @BuiltValueField(wireName: r'id') - int? get id; - - @BuiltValueField(wireName: r'username') - String? get username; - - @BuiltValueField(wireName: r'firstName') - String? get firstName; - - @BuiltValueField(wireName: r'lastName') - String? get lastName; - - @BuiltValueField(wireName: r'email') - String? get email; - - @BuiltValueField(wireName: r'password') - String? get password; - - @BuiltValueField(wireName: r'phone') - String? get phone; - - /// User Status - @BuiltValueField(wireName: r'userStatus') - int? get userStatus; - - User._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(UserBuilder b) => b; - - factory User([void updates(UserBuilder b)]) = _$User; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$UserSerializer(); -} - -class _$UserSerializer implements StructuredSerializer { - @override - final Iterable types = const [User, _$User]; - - @override - final String wireName = r'User'; - - @override - Iterable serialize(Serializers serializers, User object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.id != null) { - result - ..add(r'id') - ..add(serializers.serialize(object.id, - specifiedType: const FullType(int))); - } - if (object.username != null) { - result - ..add(r'username') - ..add(serializers.serialize(object.username, - specifiedType: const FullType(String))); - } - if (object.firstName != null) { - result - ..add(r'firstName') - ..add(serializers.serialize(object.firstName, - specifiedType: const FullType(String))); - } - if (object.lastName != null) { - result - ..add(r'lastName') - ..add(serializers.serialize(object.lastName, - specifiedType: const FullType(String))); - } - if (object.email != null) { - result - ..add(r'email') - ..add(serializers.serialize(object.email, - specifiedType: const FullType(String))); - } - if (object.password != null) { - result - ..add(r'password') - ..add(serializers.serialize(object.password, - specifiedType: const FullType(String))); - } - if (object.phone != null) { - result - ..add(r'phone') - ..add(serializers.serialize(object.phone, - specifiedType: const FullType(String))); - } - if (object.userStatus != null) { - result - ..add(r'userStatus') - ..add(serializers.serialize(object.userStatus, - specifiedType: const FullType(int))); - } - return result; - } - - @override - User deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = UserBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'id': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.id = valueDes; - break; - case r'username': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.username = valueDes; - break; - case r'firstName': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.firstName = valueDes; - break; - case r'lastName': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.lastName = valueDes; - break; - case r'email': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.email = valueDes; - break; - case r'password': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.password = valueDes; - break; - case r'phone': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.phone = valueDes; - break; - case r'userStatus': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.userStatus = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/serializers.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/serializers.dart deleted file mode 100644 index 5ee82d7b5019..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/serializers.dart +++ /dev/null @@ -1,146 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_import - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/json_object.dart'; -import 'package:built_value/serializer.dart'; -import 'package:built_value/standard_json_plugin.dart'; -import 'package:built_value/iso_8601_date_time_serializer.dart'; -import 'package:openapi/src/date_serializer.dart'; -import 'package:openapi/src/model/date.dart'; - -import 'package:openapi/src/model/additional_properties_class.dart'; -import 'package:openapi/src/model/animal.dart'; -import 'package:openapi/src/model/api_response.dart'; -import 'package:openapi/src/model/array_of_array_of_number_only.dart'; -import 'package:openapi/src/model/array_of_number_only.dart'; -import 'package:openapi/src/model/array_test.dart'; -import 'package:openapi/src/model/capitalization.dart'; -import 'package:openapi/src/model/cat.dart'; -import 'package:openapi/src/model/cat_all_of.dart'; -import 'package:openapi/src/model/category.dart'; -import 'package:openapi/src/model/class_model.dart'; -import 'package:openapi/src/model/deprecated_object.dart'; -import 'package:openapi/src/model/dog.dart'; -import 'package:openapi/src/model/dog_all_of.dart'; -import 'package:openapi/src/model/enum_arrays.dart'; -import 'package:openapi/src/model/enum_test.dart'; -import 'package:openapi/src/model/file_schema_test_class.dart'; -import 'package:openapi/src/model/foo.dart'; -import 'package:openapi/src/model/format_test.dart'; -import 'package:openapi/src/model/has_only_read_only.dart'; -import 'package:openapi/src/model/health_check_result.dart'; -import 'package:openapi/src/model/inline_response_default.dart'; -import 'package:openapi/src/model/map_test.dart'; -import 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart'; -import 'package:openapi/src/model/model200_response.dart'; -import 'package:openapi/src/model/model_client.dart'; -import 'package:openapi/src/model/model_enum_class.dart'; -import 'package:openapi/src/model/model_file.dart'; -import 'package:openapi/src/model/model_list.dart'; -import 'package:openapi/src/model/model_return.dart'; -import 'package:openapi/src/model/name.dart'; -import 'package:openapi/src/model/nullable_class.dart'; -import 'package:openapi/src/model/number_only.dart'; -import 'package:openapi/src/model/object_with_deprecated_fields.dart'; -import 'package:openapi/src/model/order.dart'; -import 'package:openapi/src/model/outer_composite.dart'; -import 'package:openapi/src/model/outer_enum.dart'; -import 'package:openapi/src/model/outer_enum_default_value.dart'; -import 'package:openapi/src/model/outer_enum_integer.dart'; -import 'package:openapi/src/model/outer_enum_integer_default_value.dart'; -import 'package:openapi/src/model/outer_object_with_enum_property.dart'; -import 'package:openapi/src/model/pet.dart'; -import 'package:openapi/src/model/read_only_first.dart'; -import 'package:openapi/src/model/special_model_name.dart'; -import 'package:openapi/src/model/tag.dart'; -import 'package:openapi/src/model/user.dart'; - -part 'serializers.g.dart'; - -@SerializersFor([ - AdditionalPropertiesClass, - Animal, - ApiResponse, - ArrayOfArrayOfNumberOnly, - ArrayOfNumberOnly, - ArrayTest, - Capitalization, - Cat, - CatAllOf, - Category, - ClassModel, - DeprecatedObject, - Dog, - DogAllOf, - EnumArrays, - EnumTest, - FileSchemaTestClass, - Foo, - FormatTest, - HasOnlyReadOnly, - HealthCheckResult, - InlineResponseDefault, - MapTest, - MixedPropertiesAndAdditionalPropertiesClass, - Model200Response, - ModelClient, - ModelEnumClass, - ModelFile, - ModelList, - ModelReturn, - Name, - NullableClass, - NumberOnly, - ObjectWithDeprecatedFields, - Order, - OuterComposite, - OuterEnum, - OuterEnumDefaultValue, - OuterEnumInteger, - OuterEnumIntegerDefaultValue, - OuterObjectWithEnumProperty, - Pet, - ReadOnlyFirst, - SpecialModelName, - Tag, - User, -]) -Serializers serializers = (_$serializers.toBuilder() - ..addBuilderFactory( - const FullType(BuiltMap, [FullType(String), FullType(String)]), - () => MapBuilder(), - ) - ..addBuilderFactory( - const FullType(BuiltList, [FullType(User)]), - () => ListBuilder(), - ) - ..addBuilderFactory( - const FullType(BuiltSet, [FullType(String)]), - () => SetBuilder(), - ) - ..addBuilderFactory( - const FullType(BuiltSet, [FullType(Pet)]), - () => SetBuilder(), - ) - ..addBuilderFactory( - const FullType(BuiltList, [FullType(Pet)]), - () => ListBuilder(), - ) - ..addBuilderFactory( - const FullType(BuiltMap, [FullType(String), FullType(int)]), - () => MapBuilder(), - ) - ..addBuilderFactory( - const FullType(BuiltList, [FullType(String)]), - () => ListBuilder(), - ) - ..add(const DateSerializer()) - ..add(Iso8601DateTimeSerializer())) - .build(); - -Serializers standardSerializers = - (serializers.toBuilder()..addPlugin(StandardJsonPlugin())).build(); diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/pom.xml b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/pom.xml deleted file mode 100644 index 6963cf3c0f98..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/pom.xml +++ /dev/null @@ -1,88 +0,0 @@ - - 4.0.0 - org.openapitools - DartDioNextDioHttpPetstoreClientLibFakeTests - pom - 1.0.0-SNAPSHOT - DartDioNext DioHttp Petstore Client Lib Fake - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - pub-get - pre-integration-test - - exec - - - pub - - get - - - - - pub-run-build-runner - pre-integration-test - - exec - - - pub - - run - build_runner - build - - - - - dart-analyze - integration-test - - exec - - - dart - - analyze - --fatal-infos - - - - - dart-test - integration-test - - exec - - - dart - - test - - - - - - - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/pubspec.yaml deleted file mode 100644 index 1ba7418109ee..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/pubspec.yaml +++ /dev/null @@ -1,17 +0,0 @@ -name: openapi -version: 1.0.0 -description: OpenAPI API client -homepage: homepage - -environment: - sdk: '>=2.12.0 <3.0.0' - -dependencies: - dio_http: '>=5.0.0 <6.0.0' - built_value: '>=8.1.0 <9.0.0' - built_collection: '>=5.1.0 <6.0.0' - -dev_dependencies: - built_value_generator: '>=8.1.0 <9.0.0' - build_runner: any - test: '>=1.16.0 <1.17.0' diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/additional_properties_class_test.dart deleted file mode 100644 index c231e6dc2807..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/additional_properties_class_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for AdditionalPropertiesClass -void main() { - final instance = AdditionalPropertiesClassBuilder(); - // TODO add properties to the builder and call build() - - group(AdditionalPropertiesClass, () { - // BuiltMap mapProperty - test('to test the property `mapProperty`', () async { - // TODO - }); - - // BuiltMap> mapOfMapProperty - test('to test the property `mapOfMapProperty`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/animal_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/animal_test.dart deleted file mode 100644 index 875bb42a106a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/animal_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Animal -void main() { - final instance = AnimalBuilder(); - // TODO add properties to the builder and call build() - - group(Animal, () { - // String className - test('to test the property `className`', () async { - // TODO - }); - - // String color (default value: 'red') - test('to test the property `color`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/another_fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/another_fake_api_test.dart deleted file mode 100644 index ddafef2a831b..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/another_fake_api_test.dart +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - - -/// tests for AnotherFakeApi -void main() { - final instance = Openapi().getAnotherFakeApi(); - - group(AnotherFakeApi, () { - // To test special tags - // - // To test special tags and operation ID starting with number - // - //Future call123testSpecialTags(ModelClient modelClient) async - test('test call123testSpecialTags', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/api_response_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/api_response_test.dart deleted file mode 100644 index cf1a744cd629..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/api_response_test.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ApiResponse -void main() { - final instance = ApiResponseBuilder(); - // TODO add properties to the builder and call build() - - group(ApiResponse, () { - // int code - test('to test the property `code`', () async { - // TODO - }); - - // String type - test('to test the property `type`', () async { - // TODO - }); - - // String message - test('to test the property `message`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/array_of_array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/array_of_array_of_number_only_test.dart deleted file mode 100644 index a679a6c4223d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/array_of_array_of_number_only_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ArrayOfArrayOfNumberOnly -void main() { - final instance = ArrayOfArrayOfNumberOnlyBuilder(); - // TODO add properties to the builder and call build() - - group(ArrayOfArrayOfNumberOnly, () { - // BuiltList> arrayArrayNumber - test('to test the property `arrayArrayNumber`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/array_of_number_only_test.dart deleted file mode 100644 index cc648bc115c5..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/array_of_number_only_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ArrayOfNumberOnly -void main() { - final instance = ArrayOfNumberOnlyBuilder(); - // TODO add properties to the builder and call build() - - group(ArrayOfNumberOnly, () { - // BuiltList arrayNumber - test('to test the property `arrayNumber`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/array_test_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/array_test_test.dart deleted file mode 100644 index 210216f224b5..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/array_test_test.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ArrayTest -void main() { - final instance = ArrayTestBuilder(); - // TODO add properties to the builder and call build() - - group(ArrayTest, () { - // BuiltList arrayOfString - test('to test the property `arrayOfString`', () async { - // TODO - }); - - // BuiltList> arrayArrayOfInteger - test('to test the property `arrayArrayOfInteger`', () async { - // TODO - }); - - // BuiltList> arrayArrayOfModel - test('to test the property `arrayArrayOfModel`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/capitalization_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/capitalization_test.dart deleted file mode 100644 index 23e04b0001bb..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/capitalization_test.dart +++ /dev/null @@ -1,42 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Capitalization -void main() { - final instance = CapitalizationBuilder(); - // TODO add properties to the builder and call build() - - group(Capitalization, () { - // String smallCamel - test('to test the property `smallCamel`', () async { - // TODO - }); - - // String capitalCamel - test('to test the property `capitalCamel`', () async { - // TODO - }); - - // String smallSnake - test('to test the property `smallSnake`', () async { - // TODO - }); - - // String capitalSnake - test('to test the property `capitalSnake`', () async { - // TODO - }); - - // String sCAETHFlowPoints - test('to test the property `sCAETHFlowPoints`', () async { - // TODO - }); - - // Name of the pet - // String ATT_NAME - test('to test the property `ATT_NAME`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/cat_all_of_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/cat_all_of_test.dart deleted file mode 100644 index afdac82ad182..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/cat_all_of_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for CatAllOf -void main() { - final instance = CatAllOfBuilder(); - // TODO add properties to the builder and call build() - - group(CatAllOf, () { - // bool declawed - test('to test the property `declawed`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/cat_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/cat_test.dart deleted file mode 100644 index b8fc252acc60..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/cat_test.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Cat -void main() { - final instance = CatBuilder(); - // TODO add properties to the builder and call build() - - group(Cat, () { - // String className - test('to test the property `className`', () async { - // TODO - }); - - // String color (default value: 'red') - test('to test the property `color`', () async { - // TODO - }); - - // bool declawed - test('to test the property `declawed`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/category_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/category_test.dart deleted file mode 100644 index 70f5fb5e02ac..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/category_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Category -void main() { - final instance = CategoryBuilder(); - // TODO add properties to the builder and call build() - - group(Category, () { - // int id - test('to test the property `id`', () async { - // TODO - }); - - // String name (default value: 'default-name') - test('to test the property `name`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/class_model_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/class_model_test.dart deleted file mode 100644 index 92f95f186c91..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/class_model_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ClassModel -void main() { - final instance = ClassModelBuilder(); - // TODO add properties to the builder and call build() - - group(ClassModel, () { - // String class_ - test('to test the property `class_`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/default_api_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/default_api_test.dart deleted file mode 100644 index eef4c41652eb..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/default_api_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - - -/// tests for DefaultApi -void main() { - final instance = Openapi().getDefaultApi(); - - group(DefaultApi, () { - //Future fooGet() async - test('test fooGet', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/deprecated_object_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/deprecated_object_test.dart deleted file mode 100644 index 98ab991b2b14..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/deprecated_object_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for DeprecatedObject -void main() { - final instance = DeprecatedObjectBuilder(); - // TODO add properties to the builder and call build() - - group(DeprecatedObject, () { - // String name - test('to test the property `name`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/dog_all_of_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/dog_all_of_test.dart deleted file mode 100644 index 7b58b3a27552..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/dog_all_of_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for DogAllOf -void main() { - final instance = DogAllOfBuilder(); - // TODO add properties to the builder and call build() - - group(DogAllOf, () { - // String breed - test('to test the property `breed`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/dog_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/dog_test.dart deleted file mode 100644 index f57fcdc413df..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/dog_test.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Dog -void main() { - final instance = DogBuilder(); - // TODO add properties to the builder and call build() - - group(Dog, () { - // String className - test('to test the property `className`', () async { - // TODO - }); - - // String color (default value: 'red') - test('to test the property `color`', () async { - // TODO - }); - - // String breed - test('to test the property `breed`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/enum_arrays_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/enum_arrays_test.dart deleted file mode 100644 index 438c36db0745..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/enum_arrays_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for EnumArrays -void main() { - final instance = EnumArraysBuilder(); - // TODO add properties to the builder and call build() - - group(EnumArrays, () { - // String justSymbol - test('to test the property `justSymbol`', () async { - // TODO - }); - - // BuiltList arrayEnum - test('to test the property `arrayEnum`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/enum_test_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/enum_test_test.dart deleted file mode 100644 index b5f3aeb7fbdd..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/enum_test_test.dart +++ /dev/null @@ -1,51 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for EnumTest -void main() { - final instance = EnumTestBuilder(); - // TODO add properties to the builder and call build() - - group(EnumTest, () { - // String enumString - test('to test the property `enumString`', () async { - // TODO - }); - - // String enumStringRequired - test('to test the property `enumStringRequired`', () async { - // TODO - }); - - // int enumInteger - test('to test the property `enumInteger`', () async { - // TODO - }); - - // double enumNumber - test('to test the property `enumNumber`', () async { - // TODO - }); - - // OuterEnum outerEnum - test('to test the property `outerEnum`', () async { - // TODO - }); - - // OuterEnumInteger outerEnumInteger - test('to test the property `outerEnumInteger`', () async { - // TODO - }); - - // OuterEnumDefaultValue outerEnumDefaultValue - test('to test the property `outerEnumDefaultValue`', () async { - // TODO - }); - - // OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue - test('to test the property `outerEnumIntegerDefaultValue`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/fake_api_test.dart deleted file mode 100644 index 1eff7d0447bf..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/fake_api_test.dart +++ /dev/null @@ -1,136 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - - -/// tests for FakeApi -void main() { - final instance = Openapi().getFakeApi(); - - group(FakeApi, () { - // Health check endpoint - // - //Future fakeHealthGet() async - test('test fakeHealthGet', () async { - // TODO - }); - - // test http signature authentication - // - //Future fakeHttpSignatureTest(Pet pet, { String query1, String header1 }) async - test('test fakeHttpSignatureTest', () async { - // TODO - }); - - // Test serialization of outer boolean types - // - //Future fakeOuterBooleanSerialize({ bool body }) async - test('test fakeOuterBooleanSerialize', () async { - // TODO - }); - - // Test serialization of object with outer number type - // - //Future fakeOuterCompositeSerialize({ OuterComposite outerComposite }) async - test('test fakeOuterCompositeSerialize', () async { - // TODO - }); - - // Test serialization of outer number types - // - //Future fakeOuterNumberSerialize({ num body }) async - test('test fakeOuterNumberSerialize', () async { - // TODO - }); - - // Test serialization of outer string types - // - //Future fakeOuterStringSerialize({ String body }) async - test('test fakeOuterStringSerialize', () async { - // TODO - }); - - // Test serialization of enum (int) properties with examples - // - //Future fakePropertyEnumIntegerSerialize(OuterObjectWithEnumProperty outerObjectWithEnumProperty) async - test('test fakePropertyEnumIntegerSerialize', () async { - // TODO - }); - - // For this test, the body has to be a binary file. - // - //Future testBodyWithBinary(MultipartFile body) async - test('test testBodyWithBinary', () async { - // TODO - }); - - // For this test, the body for this request must reference a schema named `File`. - // - //Future testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) async - test('test testBodyWithFileSchema', () async { - // TODO - }); - - //Future testBodyWithQueryParams(String query, User user) async - test('test testBodyWithQueryParams', () async { - // TODO - }); - - // To test \"client\" model - // - // To test \"client\" model - // - //Future testClientModel(ModelClient modelClient) async - test('test testClientModel', () async { - // TODO - }); - - // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - // - // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - // - //Future testEndpointParameters(num number, double double_, String patternWithoutDelimiter, String byte, { int integer, int int32, int int64, double float, String string, Uint8List binary, Date date, DateTime dateTime, String password, String callback }) async - test('test testEndpointParameters', () async { - // TODO - }); - - // To test enum parameters - // - // To test enum parameters - // - //Future testEnumParameters({ BuiltList enumHeaderStringArray, String enumHeaderString, BuiltList enumQueryStringArray, String enumQueryString, int enumQueryInteger, double enumQueryDouble, BuiltList enumFormStringArray, String enumFormString }) async - test('test testEnumParameters', () async { - // TODO - }); - - // Fake endpoint to test group parameters (optional) - // - // Fake endpoint to test group parameters (optional) - // - //Future testGroupParameters(int requiredStringGroup, bool requiredBooleanGroup, int requiredInt64Group, { int stringGroup, bool booleanGroup, int int64Group }) async - test('test testGroupParameters', () async { - // TODO - }); - - // test inline additionalProperties - // - //Future testInlineAdditionalProperties(BuiltMap requestBody) async - test('test testInlineAdditionalProperties', () async { - // TODO - }); - - // test json serialization of form data - // - //Future testJsonFormData(String param, String param2) async - test('test testJsonFormData', () async { - // TODO - }); - - // To test the collection format in query parameters - // - //Future testQueryParameterCollectionFormat(BuiltList pipe, BuiltList ioutil, BuiltList http, BuiltList url, BuiltList context, String allowEmpty, { BuiltMap language }) async - test('test testQueryParameterCollectionFormat', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/fake_classname_tags123_api_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/fake_classname_tags123_api_test.dart deleted file mode 100644 index 3075147f52fd..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/fake_classname_tags123_api_test.dart +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - - -/// tests for FakeClassnameTags123Api -void main() { - final instance = Openapi().getFakeClassnameTags123Api(); - - group(FakeClassnameTags123Api, () { - // To test class name in snake case - // - // To test class name in snake case - // - //Future testClassname(ModelClient modelClient) async - test('test testClassname', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/file_schema_test_class_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/file_schema_test_class_test.dart deleted file mode 100644 index ca8695bd4a47..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/file_schema_test_class_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for FileSchemaTestClass -void main() { - final instance = FileSchemaTestClassBuilder(); - // TODO add properties to the builder and call build() - - group(FileSchemaTestClass, () { - // ModelFile file - test('to test the property `file`', () async { - // TODO - }); - - // BuiltList files - test('to test the property `files`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/foo_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/foo_test.dart deleted file mode 100644 index 205237788aeb..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/foo_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Foo -void main() { - final instance = FooBuilder(); - // TODO add properties to the builder and call build() - - group(Foo, () { - // String bar (default value: 'bar') - test('to test the property `bar`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/format_test_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/format_test_test.dart deleted file mode 100644 index 558c3aa4b659..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/format_test_test.dart +++ /dev/null @@ -1,93 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for FormatTest -void main() { - final instance = FormatTestBuilder(); - // TODO add properties to the builder and call build() - - group(FormatTest, () { - // int integer - test('to test the property `integer`', () async { - // TODO - }); - - // int int32 - test('to test the property `int32`', () async { - // TODO - }); - - // int int64 - test('to test the property `int64`', () async { - // TODO - }); - - // num number - test('to test the property `number`', () async { - // TODO - }); - - // double float - test('to test the property `float`', () async { - // TODO - }); - - // double double_ - test('to test the property `double_`', () async { - // TODO - }); - - // double decimal - test('to test the property `decimal`', () async { - // TODO - }); - - // String string - test('to test the property `string`', () async { - // TODO - }); - - // String byte - test('to test the property `byte`', () async { - // TODO - }); - - // Uint8List binary - test('to test the property `binary`', () async { - // TODO - }); - - // Date date - test('to test the property `date`', () async { - // TODO - }); - - // DateTime dateTime - test('to test the property `dateTime`', () async { - // TODO - }); - - // String uuid - test('to test the property `uuid`', () async { - // TODO - }); - - // String password - test('to test the property `password`', () async { - // TODO - }); - - // A string that is a 10 digit number. Can have leading zeros. - // String patternWithDigits - test('to test the property `patternWithDigits`', () async { - // TODO - }); - - // A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. - // String patternWithDigitsAndDelimiter - test('to test the property `patternWithDigitsAndDelimiter`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/has_only_read_only_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/has_only_read_only_test.dart deleted file mode 100644 index c34522214751..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/has_only_read_only_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for HasOnlyReadOnly -void main() { - final instance = HasOnlyReadOnlyBuilder(); - // TODO add properties to the builder and call build() - - group(HasOnlyReadOnly, () { - // String bar - test('to test the property `bar`', () async { - // TODO - }); - - // String foo - test('to test the property `foo`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/health_check_result_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/health_check_result_test.dart deleted file mode 100644 index fda0c9218217..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/health_check_result_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for HealthCheckResult -void main() { - final instance = HealthCheckResultBuilder(); - // TODO add properties to the builder and call build() - - group(HealthCheckResult, () { - // String nullableMessage - test('to test the property `nullableMessage`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/inline_response_default_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/inline_response_default_test.dart deleted file mode 100644 index 56fbf1d0b1ac..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/inline_response_default_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for InlineResponseDefault -void main() { - final instance = InlineResponseDefaultBuilder(); - // TODO add properties to the builder and call build() - - group(InlineResponseDefault, () { - // Foo string - test('to test the property `string`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/map_test_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/map_test_test.dart deleted file mode 100644 index 56a27610ee5a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/map_test_test.dart +++ /dev/null @@ -1,31 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for MapTest -void main() { - final instance = MapTestBuilder(); - // TODO add properties to the builder and call build() - - group(MapTest, () { - // BuiltMap> mapMapOfString - test('to test the property `mapMapOfString`', () async { - // TODO - }); - - // BuiltMap mapOfEnumString - test('to test the property `mapOfEnumString`', () async { - // TODO - }); - - // BuiltMap directMap - test('to test the property `directMap`', () async { - // TODO - }); - - // BuiltMap indirectMap - test('to test the property `indirectMap`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/mixed_properties_and_additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/mixed_properties_and_additional_properties_class_test.dart deleted file mode 100644 index 85b113387a08..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/mixed_properties_and_additional_properties_class_test.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for MixedPropertiesAndAdditionalPropertiesClass -void main() { - final instance = MixedPropertiesAndAdditionalPropertiesClassBuilder(); - // TODO add properties to the builder and call build() - - group(MixedPropertiesAndAdditionalPropertiesClass, () { - // String uuid - test('to test the property `uuid`', () async { - // TODO - }); - - // DateTime dateTime - test('to test the property `dateTime`', () async { - // TODO - }); - - // BuiltMap map - test('to test the property `map`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model200_response_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model200_response_test.dart deleted file mode 100644 index 39ff6ec59c0b..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model200_response_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Model200Response -void main() { - final instance = Model200ResponseBuilder(); - // TODO add properties to the builder and call build() - - group(Model200Response, () { - // int name - test('to test the property `name`', () async { - // TODO - }); - - // String class_ - test('to test the property `class_`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_client_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_client_test.dart deleted file mode 100644 index f494dfd08499..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_client_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ModelClient -void main() { - final instance = ModelClientBuilder(); - // TODO add properties to the builder and call build() - - group(ModelClient, () { - // String client - test('to test the property `client`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_enum_class_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_enum_class_test.dart deleted file mode 100644 index 03e5855bf004..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_enum_class_test.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ModelEnumClass -void main() { - - group(ModelEnumClass, () { - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_file_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_file_test.dart deleted file mode 100644 index 4f1397726226..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_file_test.dart +++ /dev/null @@ -1,17 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ModelFile -void main() { - final instance = ModelFileBuilder(); - // TODO add properties to the builder and call build() - - group(ModelFile, () { - // Test capitalization - // String sourceURI - test('to test the property `sourceURI`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_list_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_list_test.dart deleted file mode 100644 index d35e02fe0c9a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_list_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ModelList -void main() { - final instance = ModelListBuilder(); - // TODO add properties to the builder and call build() - - group(ModelList, () { - // String n123list - test('to test the property `n123list`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_return_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_return_test.dart deleted file mode 100644 index eedfe7eb281a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_return_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ModelReturn -void main() { - final instance = ModelReturnBuilder(); - // TODO add properties to the builder and call build() - - group(ModelReturn, () { - // int return_ - test('to test the property `return_`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/name_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/name_test.dart deleted file mode 100644 index 6b2329bb0819..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/name_test.dart +++ /dev/null @@ -1,31 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Name -void main() { - final instance = NameBuilder(); - // TODO add properties to the builder and call build() - - group(Name, () { - // int name - test('to test the property `name`', () async { - // TODO - }); - - // int snakeCase - test('to test the property `snakeCase`', () async { - // TODO - }); - - // String property - test('to test the property `property`', () async { - // TODO - }); - - // int n123number - test('to test the property `n123number`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/nullable_class_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/nullable_class_test.dart deleted file mode 100644 index 1a6767dbb2ab..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/nullable_class_test.dart +++ /dev/null @@ -1,71 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for NullableClass -void main() { - final instance = NullableClassBuilder(); - // TODO add properties to the builder and call build() - - group(NullableClass, () { - // int integerProp - test('to test the property `integerProp`', () async { - // TODO - }); - - // num numberProp - test('to test the property `numberProp`', () async { - // TODO - }); - - // bool booleanProp - test('to test the property `booleanProp`', () async { - // TODO - }); - - // String stringProp - test('to test the property `stringProp`', () async { - // TODO - }); - - // Date dateProp - test('to test the property `dateProp`', () async { - // TODO - }); - - // DateTime datetimeProp - test('to test the property `datetimeProp`', () async { - // TODO - }); - - // BuiltList arrayNullableProp - test('to test the property `arrayNullableProp`', () async { - // TODO - }); - - // BuiltList arrayAndItemsNullableProp - test('to test the property `arrayAndItemsNullableProp`', () async { - // TODO - }); - - // BuiltList arrayItemsNullable - test('to test the property `arrayItemsNullable`', () async { - // TODO - }); - - // BuiltMap objectNullableProp - test('to test the property `objectNullableProp`', () async { - // TODO - }); - - // BuiltMap objectAndItemsNullableProp - test('to test the property `objectAndItemsNullableProp`', () async { - // TODO - }); - - // BuiltMap objectItemsNullable - test('to test the property `objectItemsNullable`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/number_only_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/number_only_test.dart deleted file mode 100644 index 7167d78a4962..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/number_only_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for NumberOnly -void main() { - final instance = NumberOnlyBuilder(); - // TODO add properties to the builder and call build() - - group(NumberOnly, () { - // num justNumber - test('to test the property `justNumber`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/object_with_deprecated_fields_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/object_with_deprecated_fields_test.dart deleted file mode 100644 index cd04ed4d48e0..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/object_with_deprecated_fields_test.dart +++ /dev/null @@ -1,31 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ObjectWithDeprecatedFields -void main() { - final instance = ObjectWithDeprecatedFieldsBuilder(); - // TODO add properties to the builder and call build() - - group(ObjectWithDeprecatedFields, () { - // String uuid - test('to test the property `uuid`', () async { - // TODO - }); - - // num id - test('to test the property `id`', () async { - // TODO - }); - - // DeprecatedObject deprecatedRef - test('to test the property `deprecatedRef`', () async { - // TODO - }); - - // BuiltList bars - test('to test the property `bars`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/order_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/order_test.dart deleted file mode 100644 index 7ff992230bf6..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/order_test.dart +++ /dev/null @@ -1,42 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Order -void main() { - final instance = OrderBuilder(); - // TODO add properties to the builder and call build() - - group(Order, () { - // int id - test('to test the property `id`', () async { - // TODO - }); - - // int petId - test('to test the property `petId`', () async { - // TODO - }); - - // int quantity - test('to test the property `quantity`', () async { - // TODO - }); - - // DateTime shipDate - test('to test the property `shipDate`', () async { - // TODO - }); - - // Order Status - // String status - test('to test the property `status`', () async { - // TODO - }); - - // bool complete (default value: false) - test('to test the property `complete`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_composite_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_composite_test.dart deleted file mode 100644 index dac257d9a0d6..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_composite_test.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for OuterComposite -void main() { - final instance = OuterCompositeBuilder(); - // TODO add properties to the builder and call build() - - group(OuterComposite, () { - // num myNumber - test('to test the property `myNumber`', () async { - // TODO - }); - - // String myString - test('to test the property `myString`', () async { - // TODO - }); - - // bool myBoolean - test('to test the property `myBoolean`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_enum_default_value_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_enum_default_value_test.dart deleted file mode 100644 index 502c8326be58..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_enum_default_value_test.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for OuterEnumDefaultValue -void main() { - - group(OuterEnumDefaultValue, () { - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_enum_integer_default_value_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_enum_integer_default_value_test.dart deleted file mode 100644 index c535fe8ac354..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_enum_integer_default_value_test.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for OuterEnumIntegerDefaultValue -void main() { - - group(OuterEnumIntegerDefaultValue, () { - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_enum_integer_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_enum_integer_test.dart deleted file mode 100644 index d945bc8c489d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_enum_integer_test.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for OuterEnumInteger -void main() { - - group(OuterEnumInteger, () { - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_enum_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_enum_test.dart deleted file mode 100644 index 8e11eb02fb8a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_enum_test.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for OuterEnum -void main() { - - group(OuterEnum, () { - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_object_with_enum_property_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_object_with_enum_property_test.dart deleted file mode 100644 index d6d763c5d93a..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_object_with_enum_property_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for OuterObjectWithEnumProperty -void main() { - final instance = OuterObjectWithEnumPropertyBuilder(); - // TODO add properties to the builder and call build() - - group(OuterObjectWithEnumProperty, () { - // OuterEnumInteger value - test('to test the property `value`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/pet_api_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/pet_api_test.dart deleted file mode 100644 index c4bf8d699688..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/pet_api_test.dart +++ /dev/null @@ -1,80 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - - -/// tests for PetApi -void main() { - final instance = Openapi().getPetApi(); - - group(PetApi, () { - // Add a new pet to the store - // - //Future addPet(Pet pet) async - test('test addPet', () async { - // TODO - }); - - // Deletes a pet - // - //Future deletePet(int petId, { String apiKey }) async - test('test deletePet', () async { - // TODO - }); - - // Finds Pets by status - // - // Multiple status values can be provided with comma separated strings - // - //Future> findPetsByStatus(BuiltList status) async - test('test findPetsByStatus', () async { - // TODO - }); - - // Finds Pets by tags - // - // Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - // - //Future> findPetsByTags(BuiltSet tags) async - test('test findPetsByTags', () async { - // TODO - }); - - // Find pet by ID - // - // Returns a single pet - // - //Future getPetById(int petId) async - test('test getPetById', () async { - // TODO - }); - - // Update an existing pet - // - //Future updatePet(Pet pet) async - test('test updatePet', () async { - // TODO - }); - - // Updates a pet in the store with form data - // - //Future updatePetWithForm(int petId, { String name, String status }) async - test('test updatePetWithForm', () async { - // TODO - }); - - // uploads an image - // - //Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async - test('test uploadFile', () async { - // TODO - }); - - // uploads an image (required) - // - //Future uploadFileWithRequiredFile(int petId, MultipartFile requiredFile, { String additionalMetadata }) async - test('test uploadFileWithRequiredFile', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/pet_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/pet_test.dart deleted file mode 100644 index b2bac5351d2e..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/pet_test.dart +++ /dev/null @@ -1,42 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Pet -void main() { - final instance = PetBuilder(); - // TODO add properties to the builder and call build() - - group(Pet, () { - // int id - test('to test the property `id`', () async { - // TODO - }); - - // Category category - test('to test the property `category`', () async { - // TODO - }); - - // String name - test('to test the property `name`', () async { - // TODO - }); - - // BuiltSet photoUrls - test('to test the property `photoUrls`', () async { - // TODO - }); - - // BuiltList tags - test('to test the property `tags`', () async { - // TODO - }); - - // pet status in the store - // String status - test('to test the property `status`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/read_only_first_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/read_only_first_test.dart deleted file mode 100644 index 550d3d793ec6..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/read_only_first_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ReadOnlyFirst -void main() { - final instance = ReadOnlyFirstBuilder(); - // TODO add properties to the builder and call build() - - group(ReadOnlyFirst, () { - // String bar - test('to test the property `bar`', () async { - // TODO - }); - - // String baz - test('to test the property `baz`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/special_model_name_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/special_model_name_test.dart deleted file mode 100644 index 08a4592a1ed7..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/special_model_name_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for SpecialModelName -void main() { - final instance = SpecialModelNameBuilder(); - // TODO add properties to the builder and call build() - - group(SpecialModelName, () { - // int dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket - test('to test the property `dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/store_api_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/store_api_test.dart deleted file mode 100644 index 9eac725762b7..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/store_api_test.dart +++ /dev/null @@ -1,45 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - - -/// tests for StoreApi -void main() { - final instance = Openapi().getStoreApi(); - - group(StoreApi, () { - // Delete purchase order by ID - // - // For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - // - //Future deleteOrder(String orderId) async - test('test deleteOrder', () async { - // TODO - }); - - // Returns pet inventories by status - // - // Returns a map of status codes to quantities - // - //Future> getInventory() async - test('test getInventory', () async { - // TODO - }); - - // Find purchase order by ID - // - // For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - // - //Future getOrderById(int orderId) async - test('test getOrderById', () async { - // TODO - }); - - // Place an order for a pet - // - //Future placeOrder(Order order) async - test('test placeOrder', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/tag_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/tag_test.dart deleted file mode 100644 index 6f7c63b8f0c2..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/tag_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Tag -void main() { - final instance = TagBuilder(); - // TODO add properties to the builder and call build() - - group(Tag, () { - // int id - test('to test the property `id`', () async { - // TODO - }); - - // String name - test('to test the property `name`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/user_api_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/user_api_test.dart deleted file mode 100644 index 01eaad61fc2d..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/user_api_test.dart +++ /dev/null @@ -1,73 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - - -/// tests for UserApi -void main() { - final instance = Openapi().getUserApi(); - - group(UserApi, () { - // Create user - // - // This can only be done by the logged in user. - // - //Future createUser(User user) async - test('test createUser', () async { - // TODO - }); - - // Creates list of users with given input array - // - //Future createUsersWithArrayInput(BuiltList user) async - test('test createUsersWithArrayInput', () async { - // TODO - }); - - // Creates list of users with given input array - // - //Future createUsersWithListInput(BuiltList user) async - test('test createUsersWithListInput', () async { - // TODO - }); - - // Delete user - // - // This can only be done by the logged in user. - // - //Future deleteUser(String username) async - test('test deleteUser', () async { - // TODO - }); - - // Get user by user name - // - //Future getUserByName(String username) async - test('test getUserByName', () async { - // TODO - }); - - // Logs user into the system - // - //Future loginUser(String username, String password) async - test('test loginUser', () async { - // TODO - }); - - // Logs out current logged in user session - // - //Future logoutUser() async - test('test logoutUser', () async { - // TODO - }); - - // Updated user - // - // This can only be done by the logged in user. - // - //Future updateUser(String username, User user) async - test('test updateUser', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/user_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/user_test.dart deleted file mode 100644 index 1e6a1bc23faa..000000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/user_test.dart +++ /dev/null @@ -1,52 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for User -void main() { - final instance = UserBuilder(); - // TODO add properties to the builder and call build() - - group(User, () { - // int id - test('to test the property `id`', () async { - // TODO - }); - - // String username - test('to test the property `username`', () async { - // TODO - }); - - // String firstName - test('to test the property `firstName`', () async { - // TODO - }); - - // String lastName - test('to test the property `lastName`', () async { - // TODO - }); - - // String email - test('to test the property `email`', () async { - // TODO - }); - - // String password - test('to test the property `password`', () async { - // TODO - }); - - // String phone - test('to test the property `phone`', () async { - // TODO - }); - - // User Status - // int userStatus - test('to test the property `userStatus`', () async { - // TODO - }); - - }); -} From acadba4bfb49dd4785e23b67ef8e0784cf9014a9 Mon Sep 17 00:00:00 2001 From: Tal Kirshboim Date: Fri, 17 Dec 2021 05:12:47 +0100 Subject: [PATCH 102/117] Declare Kotlin API classes as open (#11129) --- .../libraries/multiplatform/api.mustache | 4 ++-- .../org/openapitools/client/apis/PetApi.kt | 18 +++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 10 +++++----- .../org/openapitools/client/apis/UserApi.kt | 18 +++++++++--------- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/api.mustache index c523b913d2a3..7449f13a4c11 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/api.mustache @@ -16,7 +16,7 @@ import kotlinx.serialization.descriptors.* import kotlinx.serialization.encoding.* {{#operations}} -{{#nonPublicApi}}internal {{/nonPublicApi}}class {{classname}}( +{{#nonPublicApi}}internal {{/nonPublicApi}}open class {{classname}}( baseUrl: String = ApiClient.BASE_URL, httpClientEngine: HttpClientEngine? = null, httpClientConfig: ((HttpClientConfig<*>) -> Unit)? = null, @@ -33,7 +33,7 @@ import kotlinx.serialization.encoding.* {{#returnType}} @Suppress("UNCHECKED_CAST") {{/returnType}} - suspend fun {{operationId}}({{#allParams}}{{{paramName}}}: {{{dataType}}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): HttpResponse<{{{returnType}}}{{^returnType}}Unit{{/returnType}}> { + open suspend fun {{operationId}}({{#allParams}}{{{paramName}}}: {{{dataType}}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): HttpResponse<{{{returnType}}}{{^returnType}}Unit{{/returnType}}> { val localVariableAuthNames = listOf({{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}}) diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/PetApi.kt index 1cdbc9d10529..d8bd813cbe85 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/PetApi.kt @@ -34,7 +34,7 @@ import kotlinx.serialization.* import kotlinx.serialization.descriptors.* import kotlinx.serialization.encoding.* -class PetApi( +open class PetApi( baseUrl: String = ApiClient.BASE_URL, httpClientEngine: HttpClientEngine? = null, httpClientConfig: ((HttpClientConfig<*>) -> Unit)? = null, @@ -47,7 +47,7 @@ class PetApi( * @param body Pet object that needs to be added to the store * @return void */ - suspend fun addPet(body: Pet): HttpResponse { + open suspend fun addPet(body: Pet): HttpResponse { val localVariableAuthNames = listOf("petstore_auth") @@ -80,7 +80,7 @@ class PetApi( * @param apiKey (optional) * @return void */ - suspend fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?): HttpResponse { + open suspend fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?): HttpResponse { val localVariableAuthNames = listOf("petstore_auth") @@ -114,7 +114,7 @@ class PetApi( * @return kotlin.collections.List */ @Suppress("UNCHECKED_CAST") - suspend fun findPetsByStatus(status: kotlin.collections.List): HttpResponse> { + open suspend fun findPetsByStatus(status: kotlin.collections.List): HttpResponse> { val localVariableAuthNames = listOf("petstore_auth") @@ -158,7 +158,7 @@ class PetApi( * @return kotlin.collections.List */ @Suppress("UNCHECKED_CAST") - suspend fun findPetsByTags(tags: kotlin.collections.List): HttpResponse> { + open suspend fun findPetsByTags(tags: kotlin.collections.List): HttpResponse> { val localVariableAuthNames = listOf("petstore_auth") @@ -202,7 +202,7 @@ class PetApi( * @return Pet */ @Suppress("UNCHECKED_CAST") - suspend fun getPetById(petId: kotlin.Long): HttpResponse { + open suspend fun getPetById(petId: kotlin.Long): HttpResponse { val localVariableAuthNames = listOf("api_key") @@ -234,7 +234,7 @@ class PetApi( * @param body Pet object that needs to be added to the store * @return void */ - suspend fun updatePet(body: Pet): HttpResponse { + open suspend fun updatePet(body: Pet): HttpResponse { val localVariableAuthNames = listOf("petstore_auth") @@ -268,7 +268,7 @@ class PetApi( * @param status Updated status of the pet (optional) * @return void */ - suspend fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): HttpResponse { + open suspend fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): HttpResponse { val localVariableAuthNames = listOf("petstore_auth") @@ -306,7 +306,7 @@ class PetApi( * @return ModelApiResponse */ @Suppress("UNCHECKED_CAST") - suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: io.ktor.client.request.forms.InputProvider?): HttpResponse { + open suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: io.ktor.client.request.forms.InputProvider?): HttpResponse { val localVariableAuthNames = listOf("petstore_auth") diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/StoreApi.kt index ab2acfc425f4..057d82fce9b4 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -33,7 +33,7 @@ import kotlinx.serialization.* import kotlinx.serialization.descriptors.* import kotlinx.serialization.encoding.* -class StoreApi( +open class StoreApi( baseUrl: String = ApiClient.BASE_URL, httpClientEngine: HttpClientEngine? = null, httpClientConfig: ((HttpClientConfig<*>) -> Unit)? = null, @@ -46,7 +46,7 @@ class StoreApi( * @param orderId ID of the order that needs to be deleted * @return void */ - suspend fun deleteOrder(orderId: kotlin.String): HttpResponse { + open suspend fun deleteOrder(orderId: kotlin.String): HttpResponse { val localVariableAuthNames = listOf() @@ -78,7 +78,7 @@ class StoreApi( * @return kotlin.collections.Map */ @Suppress("UNCHECKED_CAST") - suspend fun getInventory(): HttpResponse> { + open suspend fun getInventory(): HttpResponse> { val localVariableAuthNames = listOf("api_key") @@ -121,7 +121,7 @@ class StoreApi( * @return Order */ @Suppress("UNCHECKED_CAST") - suspend fun getOrderById(orderId: kotlin.Long): HttpResponse { + open suspend fun getOrderById(orderId: kotlin.Long): HttpResponse { val localVariableAuthNames = listOf() @@ -154,7 +154,7 @@ class StoreApi( * @return Order */ @Suppress("UNCHECKED_CAST") - suspend fun placeOrder(body: Order): HttpResponse { + open suspend fun placeOrder(body: Order): HttpResponse { val localVariableAuthNames = listOf() diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/UserApi.kt index 83832e3cfa9d..12e3221175a9 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/UserApi.kt @@ -33,7 +33,7 @@ import kotlinx.serialization.* import kotlinx.serialization.descriptors.* import kotlinx.serialization.encoding.* -class UserApi( +open class UserApi( baseUrl: String = ApiClient.BASE_URL, httpClientEngine: HttpClientEngine? = null, httpClientConfig: ((HttpClientConfig<*>) -> Unit)? = null, @@ -46,7 +46,7 @@ class UserApi( * @param body Created user object * @return void */ - suspend fun createUser(body: User): HttpResponse { + open suspend fun createUser(body: User): HttpResponse { val localVariableAuthNames = listOf() @@ -78,7 +78,7 @@ class UserApi( * @param body List of user object * @return void */ - suspend fun createUsersWithArrayInput(body: kotlin.collections.List): HttpResponse { + open suspend fun createUsersWithArrayInput(body: kotlin.collections.List): HttpResponse { val localVariableAuthNames = listOf() @@ -119,7 +119,7 @@ class UserApi( * @param body List of user object * @return void */ - suspend fun createUsersWithListInput(body: kotlin.collections.List): HttpResponse { + open suspend fun createUsersWithListInput(body: kotlin.collections.List): HttpResponse { val localVariableAuthNames = listOf() @@ -160,7 +160,7 @@ class UserApi( * @param username The name that needs to be deleted * @return void */ - suspend fun deleteUser(username: kotlin.String): HttpResponse { + open suspend fun deleteUser(username: kotlin.String): HttpResponse { val localVariableAuthNames = listOf() @@ -193,7 +193,7 @@ class UserApi( * @return User */ @Suppress("UNCHECKED_CAST") - suspend fun getUserByName(username: kotlin.String): HttpResponse { + open suspend fun getUserByName(username: kotlin.String): HttpResponse { val localVariableAuthNames = listOf() @@ -227,7 +227,7 @@ class UserApi( * @return kotlin.String */ @Suppress("UNCHECKED_CAST") - suspend fun loginUser(username: kotlin.String, password: kotlin.String): HttpResponse { + open suspend fun loginUser(username: kotlin.String, password: kotlin.String): HttpResponse { val localVariableAuthNames = listOf() @@ -260,7 +260,7 @@ class UserApi( * * @return void */ - suspend fun logoutUser(): HttpResponse { + open suspend fun logoutUser(): HttpResponse { val localVariableAuthNames = listOf() @@ -293,7 +293,7 @@ class UserApi( * @param body Updated user object * @return void */ - suspend fun updateUser(username: kotlin.String, body: User): HttpResponse { + open suspend fun updateUser(username: kotlin.String, body: User): HttpResponse { val localVariableAuthNames = listOf() From 1e3dd1f7c8ac580f5e4637b716ed6865ba7f9118 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Br=C3=BCgmann?= Date: Fri, 17 Dec 2021 05:14:20 +0100 Subject: [PATCH 103/117] [Swift5] replace special characters in Swift enum var name (#11131) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * replace replaceSpecialCharacters in enum var names * test special characters in enum var names * ./bin/utils/export_docs_generators.sh * bring back replacement check for whole string * Revert "./bin/utils/export_docs_generators.sh" This reverts commit 63dfd33dd309739831d4f833f29817b28bdb45fe. Co-authored-by: Michael Brügmann --- .../languages/Swift5ClientCodegen.java | 75 ++++++++++++++----- .../swift5/Swift5ClientCodegenTest.java | 10 +++ 2 files changed, 65 insertions(+), 20 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java index 2cd6ebd8dd45..4610b7ded05f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java @@ -988,20 +988,22 @@ public String toEnumVarName(String name, String datatype) { return "empty"; } - Pattern startWithNumberPattern = Pattern.compile("^\\d+"); - Matcher startWithNumberMatcher = startWithNumberPattern.matcher(name); - if (startWithNumberMatcher.find()) { - String startingNumbers = startWithNumberMatcher.group(0); - String nameWithoutStartingNumbers = name.substring(startingNumbers.length()); + // Reserved Name + String nameLowercase = StringUtils.lowerCase(name); + if (isReservedWord(nameLowercase)) { + return escapeReservedWord(nameLowercase); + } - return "_" + startingNumbers + camelize(nameWithoutStartingNumbers, true); + // Prefix with underscore if name starts with number + if (name.matches("\\d.*")) { + return "_" + replaceSpecialCharacters(camelize(name, true)); } // for symbol, e.g. $, # if (getSymbolName(name) != null) { return camelize(WordUtils.capitalizeFully(getSymbolName(name).toUpperCase(Locale.ROOT)), true); } - + // Camelize only when we have a structure defined below Boolean camelized = false; if (name.matches("[A-Z][a-z0-9]+[a-zA-Z0-9]*")) { @@ -1009,34 +1011,67 @@ public String toEnumVarName(String name, String datatype) { camelized = true; } - // Reserved Name - String nameLowercase = StringUtils.lowerCase(name); - if (isReservedWord(nameLowercase)) { - return escapeReservedWord(nameLowercase); - } - // Check for numerical conversions if ("Int".equals(datatype) || "Int32".equals(datatype) || "Int64".equals(datatype) || "Float".equals(datatype) || "Double".equals(datatype)) { String varName = "number" + camelize(name); - varName = varName.replaceAll("-", "minus"); - varName = varName.replaceAll("\\+", "plus"); - varName = varName.replaceAll("\\.", "dot"); - return varName; + return replaceSpecialCharacters(varName); } // If we have already camelized the word, don't progress // any further if (camelized) { - return name; + return replaceSpecialCharacters(name); } char[] separators = {'-', '_', ' ', ':', '(', ')'}; - return camelize(WordUtils.capitalizeFully(StringUtils.lowerCase(name), separators) - .replaceAll("[-_ :\\(\\)]", ""), + return camelize(replaceSpecialCharacters(WordUtils.capitalizeFully(StringUtils.lowerCase(name), separators) + .replaceAll("[-_ :\\(\\)]", "")), true); } + private String replaceSpecialCharacters(String name) { + for (Map.Entry specialCharacters : specialCharReplacements.entrySet()) { + String specialChar = specialCharacters.getKey(); + String replacement = specialCharacters.getValue(); + // Underscore is the only special character we'll allow + if (!specialChar.equals("_") && name.contains(specialChar)) { + name = replaceCharacters(name, specialChar, replacement); + } + } + + // Fallback, replace unknowns with underscore. + name = name.replaceAll("\\W+", "_"); + + return name; + } + + private String replaceCharacters(String word, String oldValue, String newValue) { + if (!word.contains(oldValue)) { + return word; + } + if (word.equals(oldValue)) { + return newValue; + } + int i = word.indexOf(oldValue); + String start = word.substring(0, i); + String end = recurseOnEndOfWord(word, oldValue, newValue, i); + return start + newValue + end; + } + + private String recurseOnEndOfWord(String word, String oldValue, String newValue, int lastReplacedValue) { + String end = word.substring(lastReplacedValue + 1); + if (!end.isEmpty()) { + end = titleCase(end); + end = replaceCharacters(end, oldValue, newValue); + } + return end; + } + + private String titleCase(final String input) { + return input.substring(0, 1).toUpperCase(Locale.ROOT) + input.substring(1); + } + @Override public String toEnumName(CodegenProperty property) { String enumName = toModelName(property.name); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5ClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5ClientCodegenTest.java index 8073f7065d8e..0f7e12737165 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5ClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5ClientCodegenTest.java @@ -95,6 +95,16 @@ public void testStartingWithNumber() throws Exception { Assert.assertEquals(swiftCodegen.toEnumVarName("123EntryName123", null), "_123entryName123"); } + @Test(enabled = true) + public void testSpecialCharacters() throws Exception { + Assert.assertEquals(swiftCodegen.toEnumVarName("1:1", null), "_1Colon1"); + Assert.assertEquals(swiftCodegen.toEnumVarName("1:One", null), "_1ColonOne"); + Assert.assertEquals(swiftCodegen.toEnumVarName("Apple&Swift", null), "appleAmpersandSwift"); + Assert.assertEquals(swiftCodegen.toEnumVarName("$", null), "dollar"); + Assert.assertEquals(swiftCodegen.toEnumVarName("+1", null), "plus1"); + Assert.assertEquals(swiftCodegen.toEnumVarName(">=", null), "greaterThanOrEqualTo"); + } + @Test(description = "returns Data when response format is binary", enabled = true) public void binaryDataTest() { // TODO update json file From 490377c7b0697f2936081ac87b3d9cffbc1be8d3 Mon Sep 17 00:00:00 2001 From: Hui Yu Date: Fri, 17 Dec 2021 13:01:37 +0800 Subject: [PATCH 104/117] [C][Client] Support custom data type e.g.IntOrString (#11074) --- .../resources/C-libcurl/model-body.mustache | 53 +++++++++++++++++++ .../resources/C-libcurl/model-header.mustache | 10 ++++ .../resources/C-libcurl/model_doc.mustache | 2 +- 3 files changed, 64 insertions(+), 1 deletion(-) 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 3a513e9c2cd5..1f28e05e9099 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 @@ -136,6 +136,11 @@ char* {{name}}{{classname}}_ToString({{projectName}}_{{classVarName}}_{{enumName {{datatype}}_t *{{name}}{{^-last}},{{/-last}} {{/isEnum}} {{/isModel}} + {{^isModel}} + {{^isFreeFormObject}} + {{datatype}}_t *{{name}}{{^-last}},{{/-last}} + {{/isFreeFormObject}} + {{/isModel}} {{#isUuid}} {{datatype}} *{{name}}{{^-last}},{{/-last}} {{/isUuid}} @@ -220,6 +225,14 @@ void {{classname}}_free({{classname}}_t *{{classname}}) { } {{/isEnum}} {{/isModel}} + {{^isModel}} + {{^isFreeFormObject}} + if ({{{classname}}}->{{{name}}}) { + {{{complexType}}}_free({{{classname}}}->{{{name}}}); + {{classname}}->{{name}} = NULL; + } + {{/isFreeFormObject}} + {{/isModel}} {{#isUuid}} if ({{{classname}}}->{{{name}}}) { free({{{classname}}}->{{{name}}}); @@ -398,6 +411,18 @@ cJSON *{{classname}}_convertToJSON({{classname}}_t *{{classname}}) { } {{/isEnum}} {{/isModel}} + {{^isModel}} + {{^isFreeFormObject}} + cJSON *{{{name}}}_local_JSON = {{complexType}}_convertToJSON({{{classname}}}->{{{name}}}); + if({{{name}}}_local_JSON == NULL) { + goto fail; // custom + } + cJSON_AddItemToObject(item, "{{{baseName}}}", {{{name}}}_local_JSON); + if(item->child == NULL) { + goto fail; + } + {{/isFreeFormObject}} + {{/isModel}} {{#isUuid}} if(cJSON_AddStringToObject(item, "{{{baseName}}}", {{{classname}}}->{{{name}}}) == NULL) { goto fail; //uuid @@ -528,6 +553,7 @@ fail: {{classname}}_t *{{classname}}_local_var = NULL; {{#vars}} + {{^isContainer}} {{^isPrimitiveType}} {{#isModel}} {{^isEnum}} @@ -536,7 +562,15 @@ fail: {{/isEnum}} {{/isModel}} + {{^isModel}} + {{^isFreeFormObject}} + // define the local variable for {{{classname}}}->{{{name}}} + {{complexType}}_t *{{name}}_local_nonprim = NULL; + + {{/isFreeFormObject}} + {{/isModel}} {{/isPrimitiveType}} + {{/isContainer}} {{/vars}} {{#vars}} // {{{classname}}}->{{{name}}} @@ -629,6 +663,12 @@ fail: {{{name}}}_local_nonprim = {{complexType}}{{#isFreeFormObject}}object{{/isFreeFormObject}}_parseFromJSON({{{name}}}); //nonprimitive {{/isEnum}} {{/isModel}} + {{^isModel}} + {{^isFreeFormObject}} + {{^required}}if ({{{name}}}) { {{/required}} + {{{name}}}_local_nonprim = {{complexType}}_parseFromJSON({{{name}}}); //custom + {{/isFreeFormObject}} + {{/isModel}} {{#isUuid}} {{^required}}if ({{{name}}}) { {{/required}} if(!cJSON_IsString({{{name}}})) @@ -779,6 +819,11 @@ fail: {{^required}}{{{name}}} ? {{/required}}{{{name}}}_local_nonprim{{^required}} : NULL{{/required}}{{^-last}},{{/-last}} {{/isEnum}} {{/isModel}} + {{^isModel}} + {{^isFreeFormObject}} + {{^required}}{{{name}}} ? {{/required}}{{{name}}}_local_nonprim{{^required}} : NULL{{/required}}{{^-last}},{{/-last}} + {{/isFreeFormObject}} + {{/isModel}} {{#isUuid}} {{^required}}{{{name}}} ? {{/required}}strdup({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{^-last}},{{/-last}} {{/isUuid}} @@ -849,6 +894,14 @@ end: } {{/isEnum}} {{/isModel}} + {{^isModel}} + {{^isFreeFormObject}} + if ({{{name}}}_local_nonprim) { + {{complexType}}_free({{{name}}}_local_nonprim); + {{{name}}}_local_nonprim = NULL; + } + {{/isFreeFormObject}} + {{/isModel}} {{/isPrimitiveType}} {{/isContainer}} {{/vars}} diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/model-header.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/model-header.mustache index 5bdff9f1dbfe..81aee8c17a38 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/model-header.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/model-header.mustache @@ -86,6 +86,11 @@ typedef struct {{classname}}_t { struct {{datatype}}_t *{{name}}; //model {{/isEnum}} {{/isModel}} + {{^isModel}} + {{^isFreeFormObject}} + {{datatype}}_t *{{name}}; // custom + {{/isFreeFormObject}} + {{/isModel}} {{#isUuid}} {{datatype}} *{{name}}; // uuid {{/isUuid}} @@ -156,6 +161,11 @@ typedef struct {{classname}}_t { {{datatype}}_t *{{name}}{{^-last}},{{/-last}} {{/isEnum}} {{/isModel}} + {{^isModel}} + {{^isFreeFormObject}} + {{datatype}}_t *{{name}}{{^-last}},{{/-last}} + {{/isFreeFormObject}} + {{/isModel}} {{#isUuid}} {{datatype}} *{{name}}{{^-last}},{{/-last}} {{/isUuid}} diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/model_doc.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/model_doc.mustache index 77f14ca235c9..823834d7ae3f 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/model_doc.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/model_doc.mustache @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- {{#vars}} -**{{name}}** | {{^isContainer}}{{^isPrimitiveType}}{{#isModel}}{{#isEnum}}**{{projectName}}_{{classVarName}}_{{enumName}}_e**{{/isEnum}}{{^isEnum}}[**{{datatype}}_t**]({{complexType}}.md) \*{{/isEnum}}{{/isModel}}{{#isUuid}}**{{datatype}} \***{{/isUuid}}{{#isEmail}}**{{datatype}} \***{{/isEmail}}{{#isFreeFormObject}}[**{{datatype}}_t**]({{complexType}}.md) \*{{/isFreeFormObject}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isNumeric}}**{{datatype}}**{{/isNumeric}}{{#isBoolean}}**{{datatype}}**{{/isBoolean}}{{#isEnum}}{{#isString}}**{{projectName}}_{{classVarName}}_{{enumName}}_e**{{/isString}}{{/isEnum}}{{^isEnum}}{{#isString}}**{{datatype}} \***{{/isString}}{{/isEnum}}{{#isByteArray}}**{{datatype}} \***{{/isByteArray}}{{#isBinary}}**{{datatype}}**{{/isBinary}}{{#isDate}}**{{datatype}} \***{{/isDate}}{{#isDateTime}}**{{datatype}} \***{{/isDateTime}}{{/isPrimitiveType}}{{/isContainer}}{{#isContainer}}{{#isArray}}{{#isPrimitiveType}}**{{datatype}}_t \***{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{datatype}}_t**]({{complexType}}.md) \*{{/isPrimitiveType}}{{/isArray}}{{#isMap}}**{{datatype}}**{{/isMap}}{{/isContainer}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} +**{{name}}** | {{^isContainer}}{{^isPrimitiveType}}{{#isModel}}{{#isEnum}}**{{projectName}}_{{classVarName}}_{{enumName}}_e**{{/isEnum}}{{^isEnum}}[**{{datatype}}_t**]({{complexType}}.md) \*{{/isEnum}}{{/isModel}}{{^isModel}}{{^isFreeFormObject}}**{{datatype}}_t \***{{/isFreeFormObject}}{{/isModel}}{{#isUuid}}**{{datatype}} \***{{/isUuid}}{{#isEmail}}**{{datatype}} \***{{/isEmail}}{{#isFreeFormObject}}[**{{datatype}}_t**]({{complexType}}.md) \*{{/isFreeFormObject}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isNumeric}}**{{datatype}}**{{/isNumeric}}{{#isBoolean}}**{{datatype}}**{{/isBoolean}}{{#isEnum}}{{#isString}}**{{projectName}}_{{classVarName}}_{{enumName}}_e**{{/isString}}{{/isEnum}}{{^isEnum}}{{#isString}}**{{datatype}} \***{{/isString}}{{/isEnum}}{{#isByteArray}}**{{datatype}} \***{{/isByteArray}}{{#isBinary}}**{{datatype}}**{{/isBinary}}{{#isDate}}**{{datatype}} \***{{/isDate}}{{#isDateTime}}**{{datatype}} \***{{/isDateTime}}{{/isPrimitiveType}}{{/isContainer}}{{#isContainer}}{{#isArray}}{{#isPrimitiveType}}**{{datatype}}_t \***{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{datatype}}_t**]({{complexType}}.md) \*{{/isPrimitiveType}}{{/isArray}}{{#isMap}}**{{datatype}}**{{/isMap}}{{/isContainer}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} {{/vars}} [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) From 7dbcac3b6c0679764dcb9f7dd277e5fde5ab16ba Mon Sep 17 00:00:00 2001 From: Yuriy Belenko Date: Fri, 17 Dec 2021 10:24:21 +0300 Subject: [PATCH 105/117] [php-slim4] Switch to Packaged Body Parsing Middleware (#9562) * Remove custom JSON parsing middleware * Enable packaged Body Parsing Middleware Ref: https://www.slimframework.com/docs/v4/middleware/body-parsing.html * Refresh samples --- .../languages/PhpSlim4ServerCodegen.java | 3 -- .../php-slim4-server/SlimRouter.mustache | 3 +- .../resources/php-slim4-server/index.mustache | 3 ++ .../json_body_parser_middleware.mustache | 51 ------------------- .../php-slim4/.openapi-generator/FILES | 1 - .../petstore/php-slim4/lib/SlimRouter.php | 3 +- .../petstore/php-slim4/public/index.php | 3 ++ 7 files changed, 8 insertions(+), 59 deletions(-) delete mode 100644 modules/openapi-generator/src/main/resources/php-slim4-server/json_body_parser_middleware.mustache diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlim4ServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlim4ServerCodegen.java index 6f0f9e7264c3..088334c55dae 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlim4ServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlim4ServerCodegen.java @@ -213,12 +213,9 @@ public void processOpts() { supportingFiles.add(new SupportingFile("phpunit.xml.mustache", "", "phpunit.xml.dist")); supportingFiles.add(new SupportingFile("phpcs.xml.mustache", "", "phpcs.xml.dist")); - // Slim 4 doesn't parse JSON body anymore we need to add suggested middleware - // ref: https://www.slimframework.com/docs/v4/objects/request.html#the-request-body supportingFiles.add(new SupportingFile("htaccess_deny_all", "config", ".htaccess")); supportingFiles.add(new SupportingFile("config_example.mustache", "config" + File.separator + "dev", "example.inc.php")); supportingFiles.add(new SupportingFile("config_example.mustache", "config" + File.separator + "prod", "example.inc.php")); - supportingFiles.add(new SupportingFile("json_body_parser_middleware.mustache", toSrcPath(invokerPackage + "\\Middleware", srcBasePath), "JsonBodyParserMiddleware.php")); supportingFiles.add(new SupportingFile("base_model.mustache", toSrcPath(invokerPackage, srcBasePath), "BaseModel.php")); supportingFiles.add(new SupportingFile("base_model_test.mustache", toSrcPath(invokerPackage, testBasePath), "BaseModelTest.php")); } diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/SlimRouter.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/SlimRouter.mustache index 84ebd5b2d4d0..ded9ca8cfad3 100644 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/SlimRouter.mustache +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/SlimRouter.mustache @@ -17,7 +17,6 @@ use InvalidArgumentException; use Dyorg\TokenAuthentication; use Dyorg\TokenAuthentication\TokenSearch; use Psr\Http\Message\ServerRequestInterface; -use {{invokerPackage}}\Middleware\JsonBodyParserMiddleware; use OpenAPIServer\Mock\OpenApiDataMocker; use OpenAPIServer\Mock\OpenApiDataMockerRouteMiddleware; {{#isSlimPsr7}} @@ -185,7 +184,7 @@ class SlimRouter $message = "How about extending {$operation['classname']} by {$operation['apiPackage']}\\{$operation['userClassname']} class implementing {$operation['operationId']} as a {$operation['httpMethod']} method?"; throw new HttpNotImplementedException($request, $message); }; - $middlewares = [new JsonBodyParserMiddleware()]; + $middlewares = []; if (class_exists("\\{$operation['apiPackage']}\\{$operation['userClassname']}")) { $callback = "\\{$operation['apiPackage']}\\{$operation['userClassname']}:{$operation['operationId']}"; diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/index.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/index.mustache index 66f3962685e6..305f7cf8b563 100644 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/index.mustache +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/index.mustache @@ -28,6 +28,9 @@ if (is_array($prodConfig = @include(__DIR__ . '/../config/prod/config.inc.php')) $router = new SlimRouter($config); $app = $router->getSlimApp(); +// Parse json, form data and xml +$app->addBodyParsingMiddleware(); + /** * The routing middleware should be added before the ErrorMiddleware * Otherwise exceptions thrown from it will not be handled diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/json_body_parser_middleware.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/json_body_parser_middleware.mustache deleted file mode 100644 index 509ec7247c91..000000000000 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/json_body_parser_middleware.mustache +++ /dev/null @@ -1,51 +0,0 @@ -licenseInfo}} - -/** - * NOTE: This class is auto generated by the openapi generator program. - * https://github.com/openapitools/openapi-generator - * Do not edit the class manually. - */{{#apiInfo}} -namespace {{invokerPackage}}\Middleware; - -use Psr\Http\Message\ResponseInterface; -use Psr\Http\Message\ServerRequestInterface; -use Psr\Http\Server\MiddlewareInterface; -use Psr\Http\Server\RequestHandlerInterface; - -/** - * JsonBodyParserMiddleware Class Doc Comment - * - * @package {{invokerPackage}}\Middleware - * @author OpenAPI Generator team - * @link https://github.com/openapitools/openapi-generator - */ -final class JsonBodyParserMiddleware implements MiddlewareInterface -{ - - /** - * Parse incoming JSON input into a native PHP format - * Copied from Slim4 guide - * @ref https://www.slimframework.com/docs/v4/objects/request.html#the-request-body - * - * @param ServerRequestInterface $request HTTP request - * @param RequestHandlerInterface $handler Request handler - * - * @return ResponseInterface HTTP response - */ - public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface - { - $contentType = $request->getHeaderLine('Content-Type'); - - if (strstr($contentType, 'application/json')) { - $contents = json_decode(file_get_contents('php://input'), true); - if (json_last_error() === JSON_ERROR_NONE) { - $request = $request->withParsedBody($contents); - } - } - - return $handler->handle($request); - } -} -{{/apiInfo}} diff --git a/samples/server/petstore/php-slim4/.openapi-generator/FILES b/samples/server/petstore/php-slim4/.openapi-generator/FILES index 70090586115d..40c7067f1085 100644 --- a/samples/server/petstore/php-slim4/.openapi-generator/FILES +++ b/samples/server/petstore/php-slim4/.openapi-generator/FILES @@ -9,7 +9,6 @@ lib/Api/AbstractStoreApi.php lib/Api/AbstractUserApi.php lib/Auth/AbstractAuthenticator.php lib/BaseModel.php -lib/Middleware/JsonBodyParserMiddleware.php lib/Model/ApiResponse.php lib/Model/Category.php lib/Model/Order.php diff --git a/samples/server/petstore/php-slim4/lib/SlimRouter.php b/samples/server/petstore/php-slim4/lib/SlimRouter.php index c0b9c2bda9f4..1f81b223d2b3 100644 --- a/samples/server/petstore/php-slim4/lib/SlimRouter.php +++ b/samples/server/petstore/php-slim4/lib/SlimRouter.php @@ -30,7 +30,6 @@ use Dyorg\TokenAuthentication; use Dyorg\TokenAuthentication\TokenSearch; use Psr\Http\Message\ServerRequestInterface; -use OpenAPIServer\Middleware\JsonBodyParserMiddleware; use OpenAPIServer\Mock\OpenApiDataMocker; use OpenAPIServer\Mock\OpenApiDataMockerRouteMiddleware; use Slim\Psr7\Factory\ResponseFactory; @@ -890,7 +889,7 @@ public function __construct($settings = []) $message = "How about extending {$operation['classname']} by {$operation['apiPackage']}\\{$operation['userClassname']} class implementing {$operation['operationId']} as a {$operation['httpMethod']} method?"; throw new HttpNotImplementedException($request, $message); }; - $middlewares = [new JsonBodyParserMiddleware()]; + $middlewares = []; if (class_exists("\\{$operation['apiPackage']}\\{$operation['userClassname']}")) { $callback = "\\{$operation['apiPackage']}\\{$operation['userClassname']}:{$operation['operationId']}"; diff --git a/samples/server/petstore/php-slim4/public/index.php b/samples/server/petstore/php-slim4/public/index.php index 07ab220a086e..9993535af751 100644 --- a/samples/server/petstore/php-slim4/public/index.php +++ b/samples/server/petstore/php-slim4/public/index.php @@ -40,6 +40,9 @@ $router = new SlimRouter($config); $app = $router->getSlimApp(); +// Parse json, form data and xml +$app->addBodyParsingMiddleware(); + /** * The routing middleware should be added before the ErrorMiddleware * Otherwise exceptions thrown from it will not be handled From d65bf8d1a6dffafe4389041d9205f11e85c754fa Mon Sep 17 00:00:00 2001 From: Yuriy Belenko Date: Fri, 17 Dec 2021 11:11:06 +0300 Subject: [PATCH 106/117] [php-slim4] Partial generation (#11069) * Update tests folder I forgot to update tests folder in latest PR. Fixing my mistake. * Implement part generation --- .../languages/PhpSlim4ServerCodegen.java | 22 ++++++- .../php-slim4-server/README.mustache | 6 ++ .../php-slim4-server/composer.mustache | 8 +++ .../php-slim4-server/phpunit.xml.mustache | 4 ++ .../Middleware/JsonBodyParserMiddleware.php | 63 ------------------- .../php-slim4/tests/Api/PetApiTest.php | 2 +- .../php-slim4/tests/Api/StoreApiTest.php | 2 +- .../php-slim4/tests/Api/UserApiTest.php | 2 +- .../php-slim4/tests/Model/ApiResponseTest.php | 2 +- .../php-slim4/tests/Model/CategoryTest.php | 2 +- .../php-slim4/tests/Model/OrderTest.php | 2 +- .../php-slim4/tests/Model/PetTest.php | 2 +- .../php-slim4/tests/Model/TagTest.php | 2 +- .../php-slim4/tests/Model/UserTest.php | 2 +- 14 files changed, 46 insertions(+), 75 deletions(-) delete mode 100644 samples/server/petstore/php-slim4/lib/Middleware/JsonBodyParserMiddleware.php diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlim4ServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlim4ServerCodegen.java index 088334c55dae..7e318dee2048 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlim4ServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlim4ServerCodegen.java @@ -158,6 +158,10 @@ public String modelFileFolder() { public void processOpts() { super.processOpts(); + Boolean generateModels = additionalProperties.containsKey(CodegenConstants.GENERATE_MODELS) && Boolean.TRUE.equals(additionalProperties.get(CodegenConstants.GENERATE_MODELS)); + Boolean generateApiTests = additionalProperties.containsKey(CodegenConstants.GENERATE_API_TESTS) && Boolean.TRUE.equals(additionalProperties.get(CodegenConstants.GENERATE_API_TESTS)); + Boolean generateModelTests = additionalProperties.containsKey(CodegenConstants.GENERATE_MODEL_TESTS) && Boolean.TRUE.equals(additionalProperties.get(CodegenConstants.GENERATE_MODEL_TESTS)); + if (additionalProperties.containsKey(CodegenConstants.INVOKER_PACKAGE)) { // Update the invokerPackage for the default authPackage authPackage = invokerPackage + "\\" + authDirName; @@ -210,14 +214,26 @@ public void processOpts() { supportingFiles.add(new SupportingFile("index.mustache", "public", "index.php")); supportingFiles.add(new SupportingFile(".htaccess", "public", ".htaccess")); supportingFiles.add(new SupportingFile("SlimRouter.mustache", toSrcPath(invokerPackage, srcBasePath), "SlimRouter.php")); - supportingFiles.add(new SupportingFile("phpunit.xml.mustache", "", "phpunit.xml.dist")); + + // don't generate phpunit config when tests generation disabled + if (Boolean.TRUE.equals(generateApiTests) || Boolean.TRUE.equals(generateModelTests)) { + supportingFiles.add(new SupportingFile("phpunit.xml.mustache", "", "phpunit.xml.dist")); + additionalProperties.put("generateTests", Boolean.TRUE); + } + supportingFiles.add(new SupportingFile("phpcs.xml.mustache", "", "phpcs.xml.dist")); supportingFiles.add(new SupportingFile("htaccess_deny_all", "config", ".htaccess")); supportingFiles.add(new SupportingFile("config_example.mustache", "config" + File.separator + "dev", "example.inc.php")); supportingFiles.add(new SupportingFile("config_example.mustache", "config" + File.separator + "prod", "example.inc.php")); - supportingFiles.add(new SupportingFile("base_model.mustache", toSrcPath(invokerPackage, srcBasePath), "BaseModel.php")); - supportingFiles.add(new SupportingFile("base_model_test.mustache", toSrcPath(invokerPackage, testBasePath), "BaseModelTest.php")); + + if (Boolean.TRUE.equals(generateModels)) { + supportingFiles.add(new SupportingFile("base_model.mustache", toSrcPath(invokerPackage, srcBasePath), "BaseModel.php")); + } + + if (Boolean.TRUE.equals(generateModelTests)) { + supportingFiles.add(new SupportingFile("base_model_test.mustache", toSrcPath(invokerPackage, testBasePath), "BaseModelTest.php")); + } } @Override diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/README.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/README.mustache index 9435bf7f24a0..d85b12e3bd4b 100644 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/README.mustache +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/README.mustache @@ -46,6 +46,7 @@ $ php -S localhost:8888 -t php-slim-server/public > It may also be useful for testing purposes or for application demonstrations that are run in controlled environments. > It is not intended to be a full-featured web server. It should not be used on a public network. +{{#generateTests}} ## Tests ### PHPUnit @@ -59,9 +60,14 @@ How to write tests read at [2. Writing Tests for PHPUnit - PHPUnit 8.5 Manual](h Command | Target ---- | ---- `$ composer test` | All tests +{{#generateApiTests}} `$ composer test-apis` | Apis tests +{{/generateApiTests}} +{{#generateModelTests}} `$ composer test-models` | Models tests +{{/generateModelTests}} +{{/generateTests}} #### Config Package contains fully functional config `./phpunit.xml.dist` file. Create `./phpunit.xml` in root folder to override it. diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/composer.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/composer.mustache index 803a0c140cde..e514b055f549 100644 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/composer.mustache +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/composer.mustache @@ -29,7 +29,9 @@ {{/isZendDiactoros}} }, "require-dev": { + {{#generateTests}} "phpunit/phpunit": "^8.0 || ^9.0", + {{/generateTests}} "overtrue/phplint": "^2.0.2", "squizlabs/php_codesniffer": "^3.5" }, @@ -43,11 +45,17 @@ "psr-4": { "{{escapedInvokerPackage}}\\": "{{testBasePath}}/" } }, "scripts": { + {{#generateTests}} "test": [ "phpunit" ], + {{#generateApiTests}} "test-apis": "phpunit --testsuite Apis", + {{/generateApiTests}} + {{#generateModelTests}} "test-models": "phpunit --testsuite Models", + {{/generateModelTests}} + {{/generateTests}} "phpcs": "phpcs", "phplint": "phplint ./ --exclude=vendor" } diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/phpunit.xml.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/phpunit.xml.mustache index 026da14ad2e7..ce8680878654 100644 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/phpunit.xml.mustache +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/phpunit.xml.mustache @@ -8,13 +8,17 @@ + {{#generateApiTests}} {{apiTestPath}} + {{/generateApiTests}} + {{#generateModelTests}} ./{{testBasePath}}/BaseModelTest.php {{modelTestPath}} + {{/generateModelTests}} diff --git a/samples/server/petstore/php-slim4/lib/Middleware/JsonBodyParserMiddleware.php b/samples/server/petstore/php-slim4/lib/Middleware/JsonBodyParserMiddleware.php deleted file mode 100644 index b1199ffd84a2..000000000000 --- a/samples/server/petstore/php-slim4/lib/Middleware/JsonBodyParserMiddleware.php +++ /dev/null @@ -1,63 +0,0 @@ -getHeaderLine('Content-Type'); - - if (strstr($contentType, 'application/json')) { - $contents = json_decode(file_get_contents('php://input'), true); - if (json_last_error() === JSON_ERROR_NONE) { - $request = $request->withParsedBody($contents); - } - } - - return $handler->handle($request); - } -} diff --git a/samples/server/petstore/php-slim4/tests/Api/PetApiTest.php b/samples/server/petstore/php-slim4/tests/Api/PetApiTest.php index 2eaed45a504e..57f84475b105 100644 --- a/samples/server/petstore/php-slim4/tests/Api/PetApiTest.php +++ b/samples/server/petstore/php-slim4/tests/Api/PetApiTest.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * PHP version 7.2 + * PHP version 7.4 * * @package OpenAPIServer * @author OpenAPI Generator team diff --git a/samples/server/petstore/php-slim4/tests/Api/StoreApiTest.php b/samples/server/petstore/php-slim4/tests/Api/StoreApiTest.php index b6d114045d8e..6bbf53f33a4f 100644 --- a/samples/server/petstore/php-slim4/tests/Api/StoreApiTest.php +++ b/samples/server/petstore/php-slim4/tests/Api/StoreApiTest.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * PHP version 7.2 + * PHP version 7.4 * * @package OpenAPIServer * @author OpenAPI Generator team diff --git a/samples/server/petstore/php-slim4/tests/Api/UserApiTest.php b/samples/server/petstore/php-slim4/tests/Api/UserApiTest.php index cee6da4398f8..2b22f5a59f50 100644 --- a/samples/server/petstore/php-slim4/tests/Api/UserApiTest.php +++ b/samples/server/petstore/php-slim4/tests/Api/UserApiTest.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * PHP version 7.2 + * PHP version 7.4 * * @package OpenAPIServer * @author OpenAPI Generator team diff --git a/samples/server/petstore/php-slim4/tests/Model/ApiResponseTest.php b/samples/server/petstore/php-slim4/tests/Model/ApiResponseTest.php index 0190bd0490a0..512c9d55aecd 100644 --- a/samples/server/petstore/php-slim4/tests/Model/ApiResponseTest.php +++ b/samples/server/petstore/php-slim4/tests/Model/ApiResponseTest.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * PHP version 7.2 + * PHP version 7.4 * * @package OpenAPIServer * @author OpenAPI Generator team diff --git a/samples/server/petstore/php-slim4/tests/Model/CategoryTest.php b/samples/server/petstore/php-slim4/tests/Model/CategoryTest.php index e951b3673d3e..c97b1ce83394 100644 --- a/samples/server/petstore/php-slim4/tests/Model/CategoryTest.php +++ b/samples/server/petstore/php-slim4/tests/Model/CategoryTest.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * PHP version 7.2 + * PHP version 7.4 * * @package OpenAPIServer * @author OpenAPI Generator team diff --git a/samples/server/petstore/php-slim4/tests/Model/OrderTest.php b/samples/server/petstore/php-slim4/tests/Model/OrderTest.php index 4275ab148c7a..552653291935 100644 --- a/samples/server/petstore/php-slim4/tests/Model/OrderTest.php +++ b/samples/server/petstore/php-slim4/tests/Model/OrderTest.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * PHP version 7.2 + * PHP version 7.4 * * @package OpenAPIServer * @author OpenAPI Generator team diff --git a/samples/server/petstore/php-slim4/tests/Model/PetTest.php b/samples/server/petstore/php-slim4/tests/Model/PetTest.php index d1ef40bc9d21..c7fcbb8251a5 100644 --- a/samples/server/petstore/php-slim4/tests/Model/PetTest.php +++ b/samples/server/petstore/php-slim4/tests/Model/PetTest.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * PHP version 7.2 + * PHP version 7.4 * * @package OpenAPIServer * @author OpenAPI Generator team diff --git a/samples/server/petstore/php-slim4/tests/Model/TagTest.php b/samples/server/petstore/php-slim4/tests/Model/TagTest.php index e5bf71c6221a..a5b8e1355c49 100644 --- a/samples/server/petstore/php-slim4/tests/Model/TagTest.php +++ b/samples/server/petstore/php-slim4/tests/Model/TagTest.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * PHP version 7.2 + * PHP version 7.4 * * @package OpenAPIServer * @author OpenAPI Generator team diff --git a/samples/server/petstore/php-slim4/tests/Model/UserTest.php b/samples/server/petstore/php-slim4/tests/Model/UserTest.php index 563fbaae4a8f..3146ca6f62e2 100644 --- a/samples/server/petstore/php-slim4/tests/Model/UserTest.php +++ b/samples/server/petstore/php-slim4/tests/Model/UserTest.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * PHP version 7.2 + * PHP version 7.4 * * @package OpenAPIServer * @author OpenAPI Generator team From b72eba90cddddafd1def4189215d2bd306901901 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 18 Dec 2021 23:22:55 +0800 Subject: [PATCH 107/117] [java][okhttp-gson-nextgen] better oneOf implementation (#11146) * add validJsonObject method * add check for null * fix list model generation * fix optional fields validation * add tests * fix variable naming * update tests * add fromJson in oneOf, add tests * convert JSON to static * remove trailing space * add fromString methods to all models * add toJson, fix anyOf template * remove workarounds * undo changes to tests * skip file schema test * add new file --- bin/configs/java-okhttp-gson-nextgen.yaml | 3 +- .../okhttp-gson-nextgen/JSON.mustache | 58 +- .../okhttp-gson-nextgen/anyof_model.mustache | 53 +- .../okhttp-gson-nextgen/oneof_model.mustache | 50 +- .../okhttp-gson-nextgen/pojo.mustache | 140 +- .../java/spring/SpringCodegenTest.java | 4 +- ...th-http-signature-okhttp-gson-nextgen.yaml | 2184 +++++++++++++++++ ...sting-with-http-signature-okhttp-gson.yaml | 39 + .../java-micronaut-client/docs/ModelFile.md | 17 + .../java-micronaut-client/docs/ModelList.md | 16 + .../org/openapitools/model/ModelFile.java | 100 + .../org/openapitools/model/ModelList.java | 99 + .../openapitools/model/ModelFileSpec.groovy | 30 + .../openapitools/model/ModelListSpec.groovy | 30 + .../java/apache-httpclient/docs/ModelFile.md | 14 + .../java/apache-httpclient/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 109 + .../openapitools/client/model/ModelList.java | 108 + .../client/model/ModelFileTest.java | 50 + .../client/model/ModelListTest.java | 50 + .../openapitools/client/model/ModelFile.java | 110 + .../openapitools/client/model/ModelList.java | 109 + .../client/model/ModelFileTest.java | 48 + .../client/model/ModelListTest.java | 48 + .../openapitools/client/model/ModelFile.java | 109 + .../openapitools/client/model/ModelList.java | 108 + .../client/model/ModelFileTest.java | 48 + .../client/model/ModelListTest.java | 48 + .../java/google-api-client/docs/ModelFile.md | 14 + .../java/google-api-client/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 109 + .../openapitools/client/model/ModelList.java | 108 + .../client/model/ModelFileTest.java | 50 + .../client/model/ModelListTest.java | 50 + .../petstore/java/jersey1/docs/ModelFile.md | 14 + .../petstore/java/jersey1/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 109 + .../openapitools/client/model/ModelList.java | 108 + .../client/model/ModelFileTest.java | 50 + .../client/model/ModelListTest.java | 50 + .../docs/ModelFile.md | 14 + .../docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 113 + .../openapitools/client/model/ModelList.java | 112 + .../client/model/ModelFileTest.java | 50 + .../client/model/ModelListTest.java | 50 + .../java/jersey2-java8/docs/ModelFile.md | 14 + .../java/jersey2-java8/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 113 + .../openapitools/client/model/ModelList.java | 112 + .../client/model/ModelFileTest.java | 50 + .../client/model/ModelListTest.java | 50 + .../java/native-async/docs/ModelFile.md | 14 + .../java/native-async/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 112 + .../openapitools/client/model/ModelList.java | 111 + .../client/model/ModelFileTest.java | 50 + .../client/model/ModelListTest.java | 50 + .../petstore/java/native/docs/ModelFile.md | 14 + .../petstore/java/native/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 112 + .../openapitools/client/model/ModelList.java | 111 + .../client/model/ModelFileTest.java | 50 + .../client/model/ModelListTest.java | 50 + .../docs/ModelFile.md | 14 + .../docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 101 + .../openapitools/client/model/ModelList.java | 100 + .../client/model/ModelFileTest.java} | 28 +- .../client/model/ModelListTest.java | 51 + .../.openapi-generator/FILES | 4 +- .../java/okhttp-gson-nextgen/README.md | 3 +- .../java/okhttp-gson-nextgen/api/openapi.yaml | 74 +- .../java/okhttp-gson-nextgen/docs/FakeApi.md | 58 - .../okhttp-gson-nextgen/docs/ModelFile.md | 14 + .../okhttp-gson-nextgen/docs/ModelList.md | 13 + .../docs/PetWithRequiredTags.md | 28 + .../java/org/openapitools/client/JSON.java | 48 +- .../org/openapitools/client/api/FakeApi.java | 110 - .../model/AdditionalPropertiesClass.java | 61 +- .../org/openapitools/client/model/Animal.java | 67 + .../org/openapitools/client/model/Apple.java | 61 +- .../openapitools/client/model/AppleReq.java | 75 +- .../model/ArrayOfArrayOfNumberOnly.java | 61 +- .../client/model/ArrayOfNumberOnly.java | 61 +- .../openapitools/client/model/ArrayTest.java | 61 +- .../org/openapitools/client/model/Banana.java | 61 +- .../openapitools/client/model/BananaReq.java | 75 +- .../openapitools/client/model/BasquePig.java | 75 +- .../client/model/Capitalization.java | 61 +- .../org/openapitools/client/model/Cat.java | 75 +- .../openapitools/client/model/CatAllOf.java | 61 +- .../openapitools/client/model/Category.java | 75 +- .../openapitools/client/model/ClassModel.java | 61 +- .../org/openapitools/client/model/Client.java | 61 +- .../client/model/ComplexQuadrilateral.java | 75 +- .../openapitools/client/model/DanishPig.java | 75 +- .../client/model/DeprecatedObject.java | 61 +- .../org/openapitools/client/model/Dog.java | 75 +- .../openapitools/client/model/DogAllOf.java | 61 +- .../openapitools/client/model/Drawing.java | 80 +- .../openapitools/client/model/EnumArrays.java | 61 +- .../openapitools/client/model/EnumTest.java | 75 +- .../client/model/EquilateralTriangle.java | 75 +- .../org/openapitools/client/model/Foo.java | 61 +- .../openapitools/client/model/FormatTest.java | 75 +- .../org/openapitools/client/model/Fruit.java | 59 +- .../openapitools/client/model/FruitReq.java | 59 +- .../openapitools/client/model/GmFruit.java | 64 +- .../client/model/GrandparentAnimal.java | 63 + .../client/model/HasOnlyReadOnly.java | 61 +- .../client/model/HealthCheckResult.java | 61 +- .../client/model/InlineResponseDefault.java | 65 +- .../client/model/IsoscelesTriangle.java | 75 +- .../org/openapitools/client/model/Mammal.java | 70 +- .../openapitools/client/model/MapTest.java | 61 +- ...ropertiesAndAdditionalPropertiesClass.java | 61 +- .../client/model/Model200Response.java | 61 +- .../client/model/ModelApiResponse.java | 61 +- .../openapitools/client/model/ModelFile.java | 204 ++ ...ileSchemaTestClass.java => ModelList.java} | 155 +- .../client/model/ModelReturn.java | 61 +- .../org/openapitools/client/model/Name.java | 75 +- .../client/model/NullableClass.java | 61 +- .../client/model/NullableShape.java | 59 +- .../openapitools/client/model/NumberOnly.java | 61 +- .../model/ObjectWithDeprecatedFields.java | 65 +- .../org/openapitools/client/model/Order.java | 61 +- .../client/model/OuterComposite.java | 61 +- .../openapitools/client/model/ParentPet.java | 75 +- .../org/openapitools/client/model/Pet.java | 86 +- .../client/model/PetWithRequiredTags.java | 437 ++++ .../org/openapitools/client/model/Pig.java | 59 +- .../client/model/Quadrilateral.java | 59 +- .../client/model/QuadrilateralInterface.java | 75 +- .../client/model/ReadOnlyFirst.java | 61 +- .../client/model/ScaleneTriangle.java | 75 +- .../org/openapitools/client/model/Shape.java | 59 +- .../client/model/ShapeInterface.java | 75 +- .../client/model/ShapeOrNull.java | 59 +- .../client/model/SimpleQuadrilateral.java | 75 +- .../client/model/SpecialModelName.java | 61 +- .../org/openapitools/client/model/Tag.java | 61 +- .../openapitools/client/model/Triangle.java | 70 +- .../client/model/TriangleInterface.java | 75 +- .../org/openapitools/client/model/User.java | 61 +- .../org/openapitools/client/model/Whale.java | 75 +- .../org/openapitools/client/model/Zebra.java | 75 +- .../org/openapitools/client/JSONTest.java | 54 +- .../openapitools/client/api/FakeApiTest.java | 16 - .../client/model/ModelFileTest.java | 51 + .../client/model/ModelListTest.java | 51 + .../client/model/PetWithRequiredTagsTest.java | 95 + .../docs/ModelFile.md | 18 + .../docs/ModelList.md | 17 + .../openapitools/client/model/ModelFile.java | 124 + .../openapitools/client/model/ModelList.java | 123 + .../client/model/ModelFileTest.java | 51 + .../client/model/ModelListTest.java | 51 + .../java/okhttp-gson/docs/ModelFile.md | 14 + .../java/okhttp-gson/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 101 + .../openapitools/client/model/ModelList.java | 100 + .../client/model/ModelFileTest.java | 51 + .../client/model/ModelListTest.java | 51 + .../rest-assured-jackson/docs/ModelFile.md | 14 + .../rest-assured-jackson/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 112 + .../openapitools/client/model/ModelList.java | 111 + .../client/model/ModelFileTest.java | 50 + .../client/model/ModelListTest.java | 50 + .../java/rest-assured/docs/ModelFile.md | 14 + .../java/rest-assured/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 104 + .../openapitools/client/model/ModelList.java | 103 + .../client/model/ModelFileTest.java | 51 + .../client/model/ModelListTest.java | 51 + .../petstore/java/resteasy/docs/ModelFile.md | 14 + .../petstore/java/resteasy/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 109 + .../openapitools/client/model/ModelList.java | 108 + .../client/model/ModelFileTest.java | 50 + .../client/model/ModelListTest.java | 50 + .../resttemplate-withXml/docs/ModelFile.md | 14 + .../resttemplate-withXml/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 117 + .../openapitools/client/model/ModelList.java | 116 + .../client/model/ModelFileTest.java | 50 + .../client/model/ModelListTest.java | 50 + .../java/resttemplate/docs/ModelFile.md | 14 + .../java/resttemplate/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 109 + .../openapitools/client/model/ModelList.java | 108 + .../client/model/ModelFileTest.java | 50 + .../client/model/ModelListTest.java | 50 + .../java/retrofit2-play26/docs/ModelFile.md | 14 + .../java/retrofit2-play26/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 111 + .../openapitools/client/model/ModelList.java | 110 + .../client/model/ModelFileTest.java | 50 + .../client/model/ModelListTest.java | 50 + .../petstore/java/retrofit2/docs/ModelFile.md | 14 + .../petstore/java/retrofit2/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 101 + .../openapitools/client/model/ModelList.java | 100 + .../client/model/ModelFileTest.java | 51 + .../client/model/ModelListTest.java | 51 + .../java/retrofit2rx2/docs/ModelFile.md | 14 + .../java/retrofit2rx2/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 101 + .../openapitools/client/model/ModelList.java | 100 + .../client/model/ModelFileTest.java | 51 + .../client/model/ModelListTest.java | 51 + .../java/retrofit2rx3/docs/ModelFile.md | 14 + .../java/retrofit2rx3/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 101 + .../openapitools/client/model/ModelList.java | 100 + .../client/model/ModelFileTest.java | 51 + .../client/model/ModelListTest.java | 51 + .../java/vertx-no-nullable/docs/ModelFile.md | 14 + .../java/vertx-no-nullable/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 109 + .../openapitools/client/model/ModelList.java | 108 + .../client/model/ModelFileTest.java | 50 + .../client/model/ModelListTest.java | 50 + .../petstore/java/vertx/docs/ModelFile.md | 14 + .../petstore/java/vertx/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 109 + .../openapitools/client/model/ModelList.java | 108 + .../client/model/ModelFileTest.java | 50 + .../client/model/ModelListTest.java | 50 + .../petstore/java/webclient/docs/ModelFile.md | 14 + .../petstore/java/webclient/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 109 + .../openapitools/client/model/ModelList.java | 108 + .../client/model/ModelFileTest.java | 50 + .../client/model/ModelListTest.java | 50 + .../java/jersey2-java8/docs/ModelFile.md | 14 + .../java/jersey2-java8/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 113 + .../openapitools/client/model/ModelList.java | 112 + .../client/model/ModelFileTest.java | 50 + .../client/model/ModelListTest.java | 50 + .../org/openapitools/model/ModelFile.java | 75 + .../org/openapitools/model/ModelList.java | 74 + .../app/apimodels/ModelFile.java | 75 + .../app/apimodels/ModelList.java | 75 + 247 files changed, 16330 insertions(+), 1135 deletions(-) create mode 100644 modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson-nextgen.yaml create mode 100644 samples/client/petstore/java-micronaut-client/docs/ModelFile.md create mode 100644 samples/client/petstore/java-micronaut-client/docs/ModelList.md create mode 100644 samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelFile.java create mode 100644 samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelList.java create mode 100644 samples/client/petstore/java-micronaut-client/src/test/groovy/org/openapitools/model/ModelFileSpec.groovy create mode 100644 samples/client/petstore/java-micronaut-client/src/test/groovy/org/openapitools/model/ModelListSpec.groovy create mode 100644 samples/client/petstore/java/apache-httpclient/docs/ModelFile.md create mode 100644 samples/client/petstore/java/apache-httpclient/docs/ModelList.md create mode 100644 samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/feign-no-nullable/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/feign-no-nullable/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/google-api-client/docs/ModelFile.md create mode 100644 samples/client/petstore/java/google-api-client/docs/ModelList.md create mode 100644 samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/jersey1/docs/ModelFile.md create mode 100644 samples/client/petstore/java/jersey1/docs/ModelList.md create mode 100644 samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/jersey2-java8-localdatetime/docs/ModelFile.md create mode 100644 samples/client/petstore/java/jersey2-java8-localdatetime/docs/ModelList.md create mode 100644 samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/jersey2-java8-localdatetime/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/jersey2-java8-localdatetime/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/jersey2-java8/docs/ModelFile.md create mode 100644 samples/client/petstore/java/jersey2-java8/docs/ModelList.md create mode 100644 samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/native-async/docs/ModelFile.md create mode 100644 samples/client/petstore/java/native-async/docs/ModelList.md create mode 100644 samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/native/docs/ModelFile.md create mode 100644 samples/client/petstore/java/native/docs/ModelList.md create mode 100644 samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ModelFile.md create mode 100644 samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ModelList.md create mode 100644 samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelList.java rename samples/client/petstore/java/{okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java => okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/model/ModelFileTest.java} (63%) create mode 100644 samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelFile.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelList.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/PetWithRequiredTags.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelFile.java rename samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/{FileSchemaTestClass.java => ModelList.java} (50%) create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/PetWithRequiredTags.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/PetWithRequiredTagsTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelFile.md create mode 100644 samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelList.md create mode 100644 samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/okhttp-gson/docs/ModelFile.md create mode 100644 samples/client/petstore/java/okhttp-gson/docs/ModelList.md create mode 100644 samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/rest-assured-jackson/docs/ModelFile.md create mode 100644 samples/client/petstore/java/rest-assured-jackson/docs/ModelList.md create mode 100644 samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/rest-assured/docs/ModelFile.md create mode 100644 samples/client/petstore/java/rest-assured/docs/ModelList.md create mode 100644 samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/resteasy/docs/ModelFile.md create mode 100644 samples/client/petstore/java/resteasy/docs/ModelList.md create mode 100644 samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/resttemplate-withXml/docs/ModelFile.md create mode 100644 samples/client/petstore/java/resttemplate-withXml/docs/ModelList.md create mode 100644 samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/resttemplate/docs/ModelFile.md create mode 100644 samples/client/petstore/java/resttemplate/docs/ModelList.md create mode 100644 samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/retrofit2-play26/docs/ModelFile.md create mode 100644 samples/client/petstore/java/retrofit2-play26/docs/ModelList.md create mode 100644 samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/retrofit2/docs/ModelFile.md create mode 100644 samples/client/petstore/java/retrofit2/docs/ModelList.md create mode 100644 samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/retrofit2rx2/docs/ModelFile.md create mode 100644 samples/client/petstore/java/retrofit2rx2/docs/ModelList.md create mode 100644 samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/retrofit2rx3/docs/ModelFile.md create mode 100644 samples/client/petstore/java/retrofit2rx3/docs/ModelList.md create mode 100644 samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/vertx-no-nullable/docs/ModelFile.md create mode 100644 samples/client/petstore/java/vertx-no-nullable/docs/ModelList.md create mode 100644 samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/vertx/docs/ModelFile.md create mode 100644 samples/client/petstore/java/vertx/docs/ModelList.md create mode 100644 samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/webclient/docs/ModelFile.md create mode 100644 samples/client/petstore/java/webclient/docs/ModelList.md create mode 100644 samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/ModelFile.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/ModelList.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ModelFile.java create mode 100644 samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ModelList.java create mode 100644 samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelFile.java create mode 100644 samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelList.java diff --git a/bin/configs/java-okhttp-gson-nextgen.yaml b/bin/configs/java-okhttp-gson-nextgen.yaml index b6b12f86bddc..724edc9d9083 100644 --- a/bin/configs/java-okhttp-gson-nextgen.yaml +++ b/bin/configs/java-okhttp-gson-nextgen.yaml @@ -1,8 +1,7 @@ generatorName: java outputDir: samples/client/petstore/java/okhttp-gson-nextgen library: okhttp-gson-nextgen -#inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -inputSpec: modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson-nextgen.yaml templateDir: modules/openapi-generator/src/main/resources/Java additionalProperties: artifactId: petstore-okhttp-gson-nextgen diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/JSON.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/JSON.mustache index 56477b8dc179..32bef199e1cb 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/JSON.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/JSON.mustache @@ -50,19 +50,19 @@ import java.util.HashMap; * backward-compatibility */ public class JSON { - private Gson gson; - private boolean isLenientOnJson = false; - private DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); - private SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); {{#joda}} - private DateTimeTypeAdapter dateTimeTypeAdapter = new DateTimeTypeAdapter(); - private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static DateTimeTypeAdapter dateTimeTypeAdapter = new DateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); {{/joda}} {{#jsr310}} - private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); - private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); {{/jsr310}} - private ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); @SuppressWarnings("unchecked") public static GsonBuilder createGson() { @@ -116,7 +116,7 @@ public class JSON { return clazz; } - public JSON() { + { gson = createGson() .registerTypeAdapter(Date.class, dateTypeAdapter) .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) @@ -146,7 +146,7 @@ public class JSON { * * @return Gson */ - public Gson getGson() { + public static Gson getGson() { return gson; } @@ -155,11 +155,11 @@ public class JSON { * * @param gson Gson */ - public void setGson(Gson gson) { - this.gson = gson; + public static void setGson(Gson gson) { + JSON.gson = gson; } - public void setLenientOnJson(boolean lenientOnJson) { + public static void setLenientOnJson(boolean lenientOnJson) { isLenientOnJson = lenientOnJson; } @@ -169,7 +169,7 @@ public class JSON { * @param obj Object * @return String representation of the JSON */ - public String serialize(Object obj) { + public static String serialize(Object obj) { return gson.toJson(obj); } @@ -182,7 +182,7 @@ public class JSON { * @return The deserialized Java object */ @SuppressWarnings("unchecked") - public T deserialize(String body, Type returnType) { + public static T deserialize(String body, Type returnType) { try { if (isLenientOnJson) { JsonReader jsonReader = new JsonReader(new StringReader(body)); @@ -206,7 +206,7 @@ public class JSON { /** * Gson TypeAdapter for Byte Array type */ - public class ByteArrayAdapter extends TypeAdapter { + public static class ByteArrayAdapter extends TypeAdapter { @Override public void write(JsonWriter out, byte[] value) throws IOException { @@ -235,7 +235,7 @@ public class JSON { /** * Gson TypeAdapter for Joda DateTime type */ - public class DateTimeTypeAdapter extends TypeAdapter { + public static class DateTimeTypeAdapter extends TypeAdapter { private DateTimeFormatter formatter; @@ -278,7 +278,7 @@ public class JSON { /** * Gson TypeAdapter for Joda LocalDate type */ - public class LocalDateTypeAdapter extends TypeAdapter { + public static class LocalDateTypeAdapter extends TypeAdapter { private DateTimeFormatter formatter; @@ -316,11 +316,11 @@ public class JSON { } } - public void setDateTimeFormat(DateTimeFormatter dateFormat) { + public static void setDateTimeFormat(DateTimeFormatter dateFormat) { dateTimeTypeAdapter.setFormat(dateFormat); } - public void setLocalDateFormat(DateTimeFormatter dateFormat) { + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { localDateTypeAdapter.setFormat(dateFormat); } @@ -329,7 +329,7 @@ public class JSON { /** * Gson TypeAdapter for JSR310 OffsetDateTime type */ - public class OffsetDateTimeTypeAdapter extends TypeAdapter { + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { private DateTimeFormatter formatter; @@ -373,7 +373,7 @@ public class JSON { /** * Gson TypeAdapter for JSR310 LocalDate type */ - public class LocalDateTypeAdapter extends TypeAdapter { + public static class LocalDateTypeAdapter extends TypeAdapter { private DateTimeFormatter formatter; @@ -411,11 +411,11 @@ public class JSON { } } - public void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { offsetDateTimeTypeAdapter.setFormat(dateFormat); } - public void setLocalDateFormat(DateTimeFormatter dateFormat) { + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { localDateTypeAdapter.setFormat(dateFormat); } @@ -425,7 +425,7 @@ public class JSON { * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used * (more efficient than SimpleDateFormat). */ - public class SqlDateTypeAdapter extends TypeAdapter { + public static class SqlDateTypeAdapter extends TypeAdapter { private DateFormat dateFormat; @@ -478,7 +478,7 @@ public class JSON { * Gson TypeAdapter for java.util.Date type * If the dateFormat is null, ISO8601Utils will be used. */ - public class DateTypeAdapter extends TypeAdapter { + public static class DateTypeAdapter extends TypeAdapter { private DateFormat dateFormat; @@ -531,11 +531,11 @@ public class JSON { } } - public void setDateFormat(DateFormat dateFormat) { + public static void setDateFormat(DateFormat dateFormat) { dateTypeAdapter.setFormat(dateFormat); } - public void setSqlDateFormat(DateFormat dateFormat) { + public static void setSqlDateFormat(DateFormat dateFormat) { sqlDateTypeAdapter.setFormat(dateFormat); } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache index 2b41e44940ae..fae56fd2923e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache @@ -90,14 +90,14 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{/discriminator}} {{/useOneOfDiscriminatorLookup}} - {{#anyOf}} // deserialize {{{.}}} try { - deserialized = adapter{{.}}.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + {{.}}.validateJsonObject(jsonObject); log.log(Level.FINER, "Input data matches schema '{{{.}}}'"); {{classname}} ret = new {{classname}}(); - ret.setActualInstance(deserialized); + ret.setActualInstance(adapter{{.}}.fromJsonTree(jsonObject)); return ret; } catch (Exception e) { // deserialization failed, continue @@ -105,7 +105,8 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } {{/anyOf}} - throw new IOException(String.format("Failed deserialization for {{classname}} as data doesn't match anyOf schmeas: {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}. JSON: %s", jsonObject.toString())); + + throw new IOException(String.format("Failed deserialization for {{classname}}: no class matched. JSON: %s", jsonObject.toString())); } }.nullSafe(); } @@ -188,4 +189,48 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } {{/anyOf}} + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to {{classname}} + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate anyOf schemas one by one + int validCount = 0; + {{#anyOf}} + // validate the json string with {{{.}}} + try { + {{{.}}}.validateJsonObject(jsonObj); + return; // return earlier as at least one schema is valid with respect to the Json object + //validCount++; + } catch (Exception e) { + // continue to the next one + } + {{/anyOf}} + if (validCount == 0) { + throw new IOException(String.format("The JSON string is invalid for {{classname}} with anyOf schemas: {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}. JSON: %s", jsonObj.toString())); + } + } + + /** + * Create an instance of {{classname}} given an JSON string + * + * @param jsonString JSON string + * @return An instance of {{classname}} + * @throws IOException if the JSON string is invalid with respect to {{classname}} + */ + public static {{{classname}}} fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, {{{classname}}}.class); + } + + /** + * Convert an instance of {{classname}} to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache index a9300854dead..ce88e9a78ad8 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache @@ -91,11 +91,14 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{/discriminator}} {{/useOneOfDiscriminatorLookup}} int match = 0; + TypeAdapter actualAdapter = elementAdapter; {{#oneOf}} // deserialize {{{.}}} try { - deserialized = adapter{{.}}.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + {{.}}.validateJsonObject(jsonObject); + actualAdapter = adapter{{.}}; match++; log.log(Level.FINER, "Input data matches schema '{{{.}}}'"); } catch (Exception e) { @@ -106,7 +109,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{/oneOf}} if (match == 1) { {{classname}} ret = new {{classname}}(); - ret.setActualInstance(deserialized); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); return ret; } @@ -193,4 +196,47 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } {{/oneOf}} + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to {{classname}} + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + {{#oneOf}} + // validate the json string with {{{.}}} + try { + {{{.}}}.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + {{/oneOf}} + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for {{classname}} with oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}. %d class(es) match the result, expected 1. JSON: %s", validCount, jsonObj.toString())); + } + } + + /** + * Create an instance of {{classname}} given an JSON string + * + * @param jsonString JSON string + * @return An instance of {{classname}} + * @throws IOException if the JSON string is invalid with respect to {{classname}} + */ + public static {{{classname}}} fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, {{{classname}}}.class); + } + + /** + * Convert an instance of {{classname}} to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pojo.mustache index f7ad1e3a05a8..b30ce069f095 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pojo.mustache @@ -1,5 +1,6 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -14,6 +15,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import {{invokerPackage}}.JSON; + /** * {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} * @deprecated{{/isDeprecated}} @@ -379,7 +382,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens } }; {{/parcelableModel}} -{{^hasChildren}} + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -397,6 +400,95 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/requiredVars}} } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to {{classname}} + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if ({{classname}}.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in {{{classname}}} is not found in the empty JSON string", {{classname}}.openapiRequiredFields.toString())); + } + } + {{^hasChildren}} + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!{{classname}}.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `{{classname}}` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + {{#requiredVars}} + {{#-first}} + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : {{classname}}.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + {{/-first}} + {{/requiredVars}} + {{/hasChildren}} + {{^discriminator}} + {{#vars}} + {{#isArray}} + {{#items.isModel}} + JsonArray jsonArray{{name}} = jsonObj.getAsJsonArray("{{{baseName}}}"); + {{#isRequired}} + // validate the required field `{{{baseName}}}` (array) + for (int i = 0; i < jsonArray{{name}}.size(); i++) { + {{{items.dataType}}}.validateJsonObject(jsonArray{{name}}.get(i).getAsJsonObject()); + }; + {{/isRequired}} + {{^isRequired}} + // validate the optional field `{{{baseName}}}` (array) + if (jsonArray{{name}} != null) { + for (int i = 0; i < jsonArray{{name}}.size(); i++) { + {{{items.dataType}}}.validateJsonObject(jsonArray{{name}}.get(i).getAsJsonObject()); + }; + } + {{/isRequired}} + {{/items.isModel}} + {{/isArray}} + {{^isContainer}} + {{#isModel}} + {{#isRequired}} + // validate the required field `{{{baseName}}}` + {{{dataType}}}.validateJsonObject(jsonObj.getAsJsonObject("{{{baseName}}}")); + {{/isRequired}} + {{^isRequired}} + // validate the optional field `{{{baseName}}}` + if (jsonObj.getAsJsonObject("{{{baseName}}}") != null) { + {{{dataType}}}.validateJsonObject(jsonObj.getAsJsonObject("{{{baseName}}}")); + } + {{/isRequired}} + {{/isModel}} + {{/isContainer}} + {{/vars}} + {{/discriminator}} + {{#hasChildren}} + {{#discriminator}} + + String discriminatorValue = jsonObj.get("{{{propertyBaseName}}}").getAsString(); + switch (discriminatorValue) { + {{#mappedModels}} + case "{{mappingName}}": + {{modelName}}.validateJsonObject(jsonObj); + break; + {{/mappedModels}} + default: + throw new IllegalArgumentException(String.format("The value of the `{{{propertyBaseName}}}` field `%s` does not match any key defined in the discriminator's mapping.", discriminatorValue)); + } + {{/discriminator}} + {{/hasChildren}} + } + +{{^hasChildren}} public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -417,31 +509,33 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens @Override public {{classname}} read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!{{classname}}.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `{{classname}}` properties"); - } - } - - {{#requiredVars}} - {{#-first}} - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : {{classname}}.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - {{/-first}} - {{/requiredVars}} - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } {{/hasChildren}} -} \ No newline at end of file + + /** + * Create an instance of {{classname}} given an JSON string + * + * @param jsonString JSON string + * @return An instance of {{classname}} + * @throws IOException if the JSON string is invalid with respect to {{classname}} + */ + public static {{{classname}}} fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, {{{classname}}}.class); + } + + /** + * Convert an instance of {{classname}} to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java index 8ba2950c2d3e..a1d9b8ce8586 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java @@ -542,8 +542,8 @@ public void testMultipartCloud() throws IOException { // Check that the api handles the array and the file final File multipartApi = files.get("MultipartApi.java"); assertFileContains(multipartApi.toPath(), - "List files", - "MultipartFile file"); + "List files", + "MultipartFile file"); } @Test diff --git a/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson-nextgen.yaml b/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson-nextgen.yaml new file mode 100644 index 000000000000..2ea7d82e8c0b --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson-nextgen.yaml @@ -0,0 +1,2184 @@ +openapi: 3.0.0 +info: + description: >- + This spec is mainly for testing Petstore server and contains fake endpoints, + models. Please do not use this for any other purpose. Special characters: " + \ + version: 1.0.0 + title: OpenAPI Petstore + license: + name: Apache-2.0 + url: 'https://www.apache.org/licenses/LICENSE-2.0.html' +tags: + - name: pet + description: Everything about your Pets + - name: store + description: Access to Petstore orders + - name: user + description: Operations about user +paths: + /foo: + get: + responses: + default: + description: response + content: + application/json: + schema: + type: object + properties: + string: + $ref: '#/components/schemas/Foo' + /pet: + servers: + - url: 'http://petstore.swagger.io/v2' + - url: 'http://path-server-test.petstore.local/v2' + post: + tags: + - pet + summary: Add a new pet to the store + description: '' + operationId: addPet + responses: + '405': + description: Invalid input + security: + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + put: + tags: + - pet + summary: Update an existing pet + description: '' + operationId: updatePet + responses: + '400': + description: Invalid ID supplied + '404': + description: Pet not found + '405': + description: Validation exception + security: + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + /pet/findByStatus: + get: + tags: + - pet + summary: Finds Pets by status + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - name: status + in: query + description: Status values that need to be considered for filter + required: true + style: form + explode: false + deprecated: true + schema: + type: array + items: + type: string + enum: + - available + - pending + - sold + default: available + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid status value + security: + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + /pet/findByTags: + get: + tags: + - pet + summary: Finds Pets by tags + description: >- + Multiple tags can be provided with comma separated strings. Use tag1, + tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - name: tags + in: query + description: Tags to filter by + required: true + style: form + explode: false + schema: + type: array + items: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid tag value + security: + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + deprecated: true + '/pet/{petId}': + get: + tags: + - pet + summary: Find pet by ID + description: Returns a single pet + operationId: getPetById + parameters: + - name: petId + in: path + description: ID of pet to return + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid ID supplied + '404': + description: Pet not found + security: + - api_key: [] + post: + tags: + - pet + summary: Updates a pet in the store with form data + description: '' + operationId: updatePetWithForm + parameters: + - name: petId + in: path + description: ID of pet that needs to be updated + required: true + schema: + type: integer + format: int64 + responses: + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + delete: + tags: + - pet + summary: Deletes a pet + description: '' + operationId: deletePet + parameters: + - name: api_key + in: header + required: false + schema: + type: string + - name: petId + in: path + description: Pet id to delete + required: true + schema: + type: integer + format: int64 + responses: + '400': + description: Invalid pet value + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + '/pet/{petId}/uploadImage': + post: + tags: + - pet + summary: uploads an image + description: '' + operationId: uploadFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + type: string + format: binary + /store/inventory: + get: + tags: + - store + summary: Returns pet inventories by status + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + additionalProperties: + type: integer + format: int32 + security: + - api_key: [] + /store/order: + post: + tags: + - store + summary: Place an order for a pet + description: '' + operationId: placeOrder + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid Order + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + '/store/order/{order_id}': + get: + tags: + - store + summary: Find purchase order by ID + description: >- + For valid response try integer IDs with value <= 5 or > 10. Other values + will generated exceptions + operationId: getOrderById + parameters: + - name: order_id + in: path + description: ID of pet that needs to be fetched + required: true + schema: + type: integer + format: int64 + minimum: 1 + maximum: 5 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid ID supplied + '404': + description: Order not found + delete: + tags: + - store + summary: Delete purchase order by ID + description: >- + For valid response try integer IDs with value < 1000. Anything above + 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - name: order_id + in: path + description: ID of the order that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid ID supplied + '404': + description: Order not found + /user: + post: + tags: + - user + summary: Create user + description: This can only be done by the logged in user. + operationId: createUser + responses: + default: + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + /user/createWithArray: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithArrayInput + responses: + default: + description: successful operation + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/createWithList: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithListInput + responses: + default: + description: successful operation + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/login: + get: + tags: + - user + summary: Logs user into the system + description: '' + operationId: loginUser + parameters: + - name: username + in: query + description: The user name for login + required: true + schema: + type: string + - name: password + in: query + description: The password for login in clear text + required: true + schema: + type: string + responses: + '200': + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + type: integer + format: int32 + X-Expires-After: + description: date in UTC when token expires + schema: + type: string + format: date-time + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + '400': + description: Invalid username/password supplied + /user/logout: + get: + tags: + - user + summary: Logs out current logged in user session + description: '' + operationId: logoutUser + responses: + default: + description: successful operation + '/user/{username}': + get: + tags: + - user + summary: Get user by user name + description: '' + operationId: getUserByName + parameters: + - name: username + in: path + description: The name that needs to be fetched. Use user1 for testing. + required: true + schema: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + '400': + description: Invalid username supplied + '404': + description: User not found + put: + tags: + - user + summary: Updated user + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - name: username + in: path + description: name that need to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid user supplied + '404': + description: User not found + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + delete: + tags: + - user + summary: Delete user + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - name: username + in: path + description: The name that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid username supplied + '404': + description: User not found + /fake_classname_test: + patch: + tags: + - 'fake_classname_tags 123#$%^' + summary: To test class name in snake case + description: To test class name in snake case + operationId: testClassname + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + security: + - api_key_query: [] + requestBody: + $ref: '#/components/requestBodies/Client' + /fake: + patch: + tags: + - fake + summary: To test "client" model + description: To test "client" model + operationId: testClientModel + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + requestBody: + $ref: '#/components/requestBodies/Client' + get: + tags: + - fake + summary: To test enum parameters + description: To test enum parameters + operationId: testEnumParameters + parameters: + - name: enum_header_string_array + in: header + description: Header parameter enum test (string array) + schema: + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + - name: enum_header_string + in: header + description: Header parameter enum test (string) + schema: + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + - name: enum_query_string_array + in: query + description: Query parameter enum test (string array) + schema: + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + - name: enum_query_string + in: query + description: Query parameter enum test (string) + schema: + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + - name: enum_query_integer + in: query + description: Query parameter enum test (double) + schema: + type: integer + format: int32 + enum: + - 1 + - -2 + - name: enum_query_double + in: query + description: Query parameter enum test (double) + schema: + type: number + format: double + enum: + - 1.1 + - -1.2 + responses: + '400': + description: Invalid request + '404': + description: Not found + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + enum_form_string: + description: Form parameter enum test (string) + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + post: + tags: + - fake + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + responses: + '400': + description: Invalid username supplied + '404': + description: User not found + security: + - http_basic_test: [] + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + integer: + description: None + type: integer + minimum: 10 + maximum: 100 + int32: + description: None + type: integer + format: int32 + minimum: 20 + maximum: 200 + int64: + description: None + type: integer + format: int64 + number: + description: None + type: number + minimum: 32.1 + maximum: 543.2 + float: + description: None + type: number + format: float + maximum: 987.6 + double: + description: None + type: number + format: double + minimum: 67.8 + maximum: 123.4 + string: + description: None + type: string + pattern: '/[a-z]/i' + pattern_without_delimiter: + description: None + type: string + pattern: '^[A-Z].*' + byte: + description: None + type: string + format: byte + binary: + description: None + type: string + format: binary + date: + description: None + type: string + format: date + dateTime: + description: None + type: string + format: date-time + default: '2010-02-01T10:20:10.11111+01:00' + example: '2020-02-02T20:20:20.22222Z' + password: + description: None + type: string + format: password + minLength: 10 + maxLength: 64 + callback: + description: None + type: string + required: + - number + - double + - pattern_without_delimiter + - byte + delete: + tags: + - fake + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + x-group-parameters: true + parameters: + - name: required_string_group + in: query + description: Required String in group parameters + required: true + schema: + type: integer + - name: required_boolean_group + in: header + description: Required Boolean in group parameters + required: true + schema: + type: boolean + - name: required_int64_group + in: query + description: Required Integer in group parameters + required: true + schema: + type: integer + format: int64 + - name: string_group + in: query + description: String in group parameters + schema: + type: integer + - name: boolean_group + in: header + description: Boolean in group parameters + schema: + type: boolean + - name: int64_group + in: query + description: Integer in group parameters + schema: + type: integer + format: int64 + responses: + '400': + description: Someting wrong + /fake/outer/number: + post: + tags: + - fake + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + responses: + '200': + description: Output number + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + /fake/outer/string: + post: + tags: + - fake + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + responses: + '200': + description: Output string + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + /fake/outer/boolean: + post: + tags: + - fake + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + responses: + '200': + description: Output boolean + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + /fake/outer/composite: + post: + tags: + - fake + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + responses: + '200': + description: Output composite + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + /fake/jsonFormData: + get: + tags: + - fake + summary: test json serialization of form data + description: '' + operationId: testJsonFormData + responses: + '200': + description: successful operation + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + /fake/inline-additionalProperties: + post: + tags: + - fake + summary: test inline additionalProperties + description: '' + operationId: testInlineAdditionalProperties + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: + type: string + description: request body + required: true + /fake/body-with-query-params: + put: + tags: + - fake + operationId: testBodyWithQueryParams + parameters: + - name: query + in: query + required: true + schema: + type: string + responses: + '200': + description: Success + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + /another-fake/dummy: + patch: + tags: + - $another-fake? + summary: To test special tags + description: To test special tags and operation ID starting with number + operationId: '123_test_@#$%_special_tags' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + requestBody: + $ref: '#/components/requestBodies/Client' +# /fake/body-with-file-schema: +# put: +# tags: +# - fake +# description: >- +# For this test, the body for this request much reference a schema named +# `File`. +# operationId: testBodyWithFileSchema +# responses: +# '200': +# description: Success +# requestBody: +# content: +# application/json: +# schema: +# $ref: '#/components/schemas/FileSchemaTestClass' +# required: true + /fake/test-query-parameters: + put: + tags: + - fake + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - name: pipe + in: query + required: true + schema: + type: array + items: + type: string + - name: ioutil + in: query + required: true + style: form + explode: false + schema: + type: array + items: + type: string + - name: http + in: query + required: true + style: spaceDelimited + schema: + type: array + items: + type: string + - name: url + in: query + required: true + style: form + explode: false + schema: + type: array + items: + type: string + - name: context + in: query + required: true + explode: true + schema: + type: array + items: + type: string + responses: + "200": + description: Success + '/fake/{petId}/uploadImageWithRequiredFile': + post: + tags: + - pet + summary: uploads an image (required) + description: '' + operationId: uploadFileWithRequiredFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + type: string + format: binary + required: + - requiredFile + /fake/health: + get: + tags: + - fake + summary: Health check endpoint + responses: + 200: + description: The instance started successfully + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + /fake/array-of-enums: + get: + tags: + - fake + summary: Array of Enums + operationId: getArrayOfEnums + responses: + 200: + description: Got named array of enums + content: + application/json: + schema: + $ref: '#/components/schemas/ArrayOfEnums' +servers: + - url: 'http://{server}.swagger.io:{port}/v2' + description: petstore server + variables: + server: + enum: + - 'petstore' + - 'qa-petstore' + - 'dev-petstore' + default: 'petstore' + port: + enum: + - 80 + - 8080 + default: 80 + - url: https://localhost:8080/{version} + description: The local server + variables: + version: + enum: + - 'v1' + - 'v2' + default: 'v2' + - url: https://127.0.0.1/no_variable + description: The local server without variables +components: + requestBodies: + UserArray: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + examples: + simple-list: + summary: Simple list example + description: Should not get into code examples + value: + - username: foo + - username: bar + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + securitySchemes: + petstore_auth: + type: oauth2 + flows: + implicit: + authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog' + scopes: + 'write:pets': modify pets in your account + 'read:pets': read your pets + api_key: + type: apiKey + name: api_key + in: header + api_key_query: + type: apiKey + name: api_key_query + in: query + http_basic_test: + type: http + scheme: basic + bearer_test: + type: http + scheme: bearer + bearerFormat: JWT + http_signature_test: + # Test the 'HTTP signature' security scheme. + # Each HTTP request is cryptographically signed as specified + # in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ + type: http + scheme: signature + schemas: + Foo: + type: object + properties: + bar: + $ref: '#/components/schemas/Bar' + Bar: + type: string + default: bar + Order: + type: object + properties: + id: + type: integer + format: int64 + petId: + type: integer + format: int64 + quantity: + type: integer + format: int32 + shipDate: + type: string + format: date-time + example: '2020-02-02T20:20:20.000222Z' + status: + type: string + description: Order Status + enum: + - placed + - approved + - delivered + complete: + type: boolean + default: false + xml: + name: Order + Category: + type: object + required: + - name + properties: + id: + type: integer + format: int64 + name: + type: string + default: default-name + xml: + name: Category + User: + type: object + properties: + id: + type: integer + format: int64 + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + type: integer + format: int32 + description: User Status + objectWithNoDeclaredProps: + type: object + # Note: the 'additionalProperties' keyword is not specified, which is + # equivalent to allowing undeclared properties of any type. + description: test code generation for objects + Value must be a map of strings to values. It cannot be the 'null' value. + objectWithNoDeclaredPropsNullable: + type: object + # Note: the 'additionalProperties' keyword is not specified, which is + # equivalent to allowing undeclared properties of any type. + description: test code generation for nullable objects. + Value must be a map of strings to values or the 'null' value. + nullable: true + anyTypeProp: + description: test code generation for any type + Here the 'type' attribute is not specified, which means the value can be anything, + including the null value, string, number, boolean, array or object. + See https://github.com/OAI/OpenAPI-Specification/issues/1389 + # TODO: this should be supported, currently there are some issues in the code generation. + #anyTypeExceptNullProp: + # description: any type except 'null' + # Here the 'type' attribute is not specified, which means the value can be anything, + # including the null value, string, number, boolean, array or object. + # not: + # type: 'null' + anyTypePropNullable: + description: test code generation for any type + Here the 'type' attribute is not specified, which means the value can be anything, + including the null value, string, number, boolean, array or object. + The 'nullable' attribute does not change the allowed values. + nullable: true + xml: + name: User + Tag: + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + xml: + name: Tag + Pet: + type: object + required: + - name + - photoUrls + properties: + id: + type: integer + format: int64 + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + type: string + example: doggie + photoUrls: + type: array + xml: + name: photoUrl + wrapped: true + items: + type: string + tags: + type: array + xml: + name: tag + wrapped: true + items: + $ref: '#/components/schemas/Tag' + status: + type: string + description: pet status in the store + enum: + - available + - pending + - sold + xml: + name: Pet + ApiResponse: + type: object + properties: + code: + type: integer + format: int32 + type: + type: string + message: + type: string + Return: + description: Model for testing reserved words + properties: + return: + type: integer + format: int32 + xml: + name: Return + Name: + description: Model for testing model name same as property name + required: + - name + properties: + name: + type: integer + format: int32 + snake_case: + readOnly: true + type: integer + format: int32 + property: + type: string + 123Number: + type: integer + readOnly: true + xml: + name: Name + 200_response: + description: Model for testing model name starting with number + properties: + name: + type: integer + format: int32 + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - type: object + properties: + breed: + type: string + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Address' + - type: object + properties: + declawed: + type: boolean + Address: + type: object + additionalProperties: + type: integer + Animal: + type: object + discriminator: + propertyName: className + required: + - className + properties: + className: + type: string + color: + type: string + default: red + AnimalFarm: + type: array + items: + $ref: '#/components/schemas/Animal' + format_test: + type: object + required: + - number + - byte + - date + - password + properties: + integer: + type: integer + maximum: 100 + minimum: 10 + multipleOf: 2 + int32: + type: integer + format: int32 + maximum: 200 + minimum: 20 + int64: + type: integer + format: int64 + number: + maximum: 543.2 + minimum: 32.1 + type: number + multipleOf: 32.5 + float: + type: number + format: float + maximum: 987.6 + minimum: 54.3 + double: + type: number + format: double + maximum: 123.4 + minimum: 67.8 + decimal: + type: string + format: number + string: + type: string + pattern: '/[a-z]/i' + byte: + type: string + format: byte + binary: + type: string + format: binary + date: + type: string + format: date + example: '2020-02-02' + dateTime: + type: string + format: date-time + example: '2007-12-03T10:15:30+01:00' + uuid: + type: string + format: uuid + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + password: + type: string + format: password + maxLength: 64 + minLength: 10 + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + type: string + pattern: '^\d{10}$' + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + type: string + pattern: '/^image_\d{1,3}$/i' + EnumClass: + type: string + default: '-efg' + enum: + - _abc + - '-efg' + - (xyz) + Enum_Test: + type: object + required: + - enum_string_required + properties: + enum_string: + type: string + enum: + - UPPER + - lower + - '' + enum_string_required: + type: string + enum: + - UPPER + - lower + - '' + enum_integer: + type: integer + format: int32 + enum: + - 1 + - -1 + enum_integer_only: + type: integer + enum: + - 2 + - -2 + enum_number: + type: number + format: double + enum: + - 1.1 + - -1.2 + outerEnum: + $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' + AdditionalPropertiesClass: + type: object + properties: + map_property: + type: object + additionalProperties: + type: string + map_of_map_property: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + anytype_1: {} + map_with_undeclared_properties_anytype_1: + type: object + map_with_undeclared_properties_anytype_2: + type: object + properties: {} + map_with_undeclared_properties_anytype_3: + type: object + additionalProperties: true + empty_map: + type: object + description: an object with no declared properties and no undeclared + properties, hence it's an empty map. + additionalProperties: false + map_with_undeclared_properties_string: + type: object + additionalProperties: + type: string + MixedPropertiesAndAdditionalPropertiesClass: + type: object + properties: + uuid: + type: string + format: uuid + dateTime: + type: string + format: date-time + map: + type: object + additionalProperties: + $ref: '#/components/schemas/Animal' + List: + type: object + properties: + 123-list: + type: string + Client: + type: object + properties: + client: + type: string + ReadOnlyFirst: + type: object + properties: + bar: + type: string + readOnly: true + baz: + type: string + hasOnlyReadOnly: + type: object + properties: + bar: + type: string + readOnly: true + foo: + type: string + readOnly: true + Capitalization: + type: object + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + MapTest: + type: object + properties: + map_map_of_string: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + map_of_enum_string: + type: object + additionalProperties: + type: string + enum: + - UPPER + - lower + direct_map: + type: object + additionalProperties: + type: boolean + indirect_map: + $ref: '#/components/schemas/StringBooleanMap' + ArrayTest: + type: object + properties: + array_of_string: + type: array + items: + type: string + array_array_of_integer: + type: array + items: + type: array + items: + type: integer + format: int64 + array_array_of_model: + type: array + items: + type: array + items: + $ref: '#/components/schemas/ReadOnlyFirst' + NumberOnly: + type: object + properties: + JustNumber: + type: number + ArrayOfNumberOnly: + type: object + properties: + ArrayNumber: + type: array + items: + type: number + ArrayOfArrayOfNumberOnly: + type: object + properties: + ArrayArrayNumber: + type: array + items: + type: array + items: + type: number + EnumArrays: + type: object + properties: + just_symbol: + type: string + enum: + - '>=' + - $ + array_enum: + type: array + items: + type: string + enum: + - fish + - crab + OuterEnum: + nullable: true + type: string + enum: + - placed + - approved + - delivered + OuterEnumInteger: + type: integer + enum: + - 0 + - 1 + - 2 + OuterEnumDefaultValue: + type: string + enum: + - placed + - approved + - delivered + default: placed + OuterEnumIntegerDefaultValue: + type: integer + enum: + - 0 + - 1 + - 2 + default: 0 + OuterComposite: + type: object + properties: + my_number: + $ref: '#/components/schemas/OuterNumber' + my_string: + $ref: '#/components/schemas/OuterString' + my_boolean: + $ref: '#/components/schemas/OuterBoolean' + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean +# FileSchemaTestClass: +# type: object +# properties: +# file: +# $ref: '#/components/schemas/File' +# files: +# type: array +# items: +# $ref: '#/components/schemas/File' + File: + type: object + description: Must be named `File` for test. + properties: + sourceURI: + description: Test capitalization + type: string + _special_model.name_: + properties: + '$special[property.name]': + type: integer + format: int64 + '_special_model.name_': + type: string + xml: + name: '$special[model.name]' + HealthCheckResult: + type: object + properties: + NullableMessage: + nullable: true + type: string + description: Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + NullableClass: + type: object + properties: + integer_prop: + type: integer + nullable: true + number_prop: + type: number + nullable: true + boolean_prop: + type: boolean + nullable: true + string_prop: + type: string + nullable: true + date_prop: + type: string + format: date + nullable: true + datetime_prop: + type: string + format: date-time + nullable: true + array_nullable_prop: + type: array + nullable: true + items: + type: object + array_and_items_nullable_prop: + type: array + nullable: true + items: + type: object + nullable: true + array_items_nullable: + type: array + items: + type: object + nullable: true + object_nullable_prop: + type: object + nullable: true + additionalProperties: + type: object + object_and_items_nullable_prop: + type: object + nullable: true + additionalProperties: + type: object + nullable: true + object_items_nullable: + type: object + additionalProperties: + type: object + nullable: true + additionalProperties: + type: object + nullable: true + fruit: + properties: + color: + type: string + oneOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + # Below additionalProperties is set to false to validate the use + # case when a composed schema has additionalProperties set to false. + additionalProperties: false + apple: + type: object + properties: + cultivar: + type: string + pattern: ^[a-zA-Z\s]*$ + origin: + type: string + pattern: /^[A-Z\s]*$/i + nullable: true + banana: + type: object + properties: + lengthCm: + type: number + mammal: + oneOf: + - $ref: '#/components/schemas/whale' + - $ref: '#/components/schemas/zebra' + - $ref: '#/components/schemas/Pig' + discriminator: + propertyName: className + whale: + type: object + properties: + hasBaleen: + type: boolean + hasTeeth: + type: boolean + className: + type: string + required: + - className + zebra: + type: object + properties: + type: + type: string + enum: + - plains + - mountain + - grevys + className: + type: string + required: + - className + additionalProperties: true + Pig: + oneOf: + - $ref: '#/components/schemas/BasquePig' + - $ref: '#/components/schemas/DanishPig' + discriminator: + propertyName: className + BasquePig: + type: object + properties: + className: + type: string + required: + - className + DanishPig: + type: object + properties: + className: + type: string + required: + - className + gmFruit: + properties: + color: + type: string + anyOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + additionalProperties: false + fruitReq: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/appleReq' + - $ref: '#/components/schemas/bananaReq' + additionalProperties: false + appleReq: + type: object + properties: + cultivar: + type: string + mealy: + type: boolean + required: + - cultivar + additionalProperties: false + bananaReq: + type: object + properties: + lengthCm: + type: number + sweet: + type: boolean + required: + - lengthCm + additionalProperties: false + # go-experimental is unable to make Triangle and Quadrilateral models + # correctly https://github.com/OpenAPITools/openapi-generator/issues/6149 + Drawing: + type: object + properties: + mainShape: + # A property whose value is a 'oneOf' type, and the type is referenced instead + # of being defined inline. The value cannot be null. + $ref: '#/components/schemas/Shape' + shapeOrNull: + # A property whose value is a 'oneOf' type, and the type is referenced instead + # of being defined inline. The value may be null because ShapeOrNull has 'null' + # type as a child schema of 'oneOf'. + $ref: '#/components/schemas/ShapeOrNull' + nullableShape: + # A property whose value is a 'oneOf' type, and the type is referenced instead + # of being defined inline. The value may be null because NullableShape has the + # 'nullable: true' attribute. For this specific scenario this is exactly the + # same thing as 'shapeOrNull'. + $ref: '#/components/schemas/NullableShape' + shapes: + type: array + items: + $ref: '#/components/schemas/Shape' + additionalProperties: + # Here the additional properties are specified using a referenced schema. + # This is just to validate the generated code works when using $ref + # under 'additionalProperties'. + $ref: '#/components/schemas/fruit' + Shape: + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + discriminator: + propertyName: shapeType + ShapeOrNull: + description: The value may be a shape or the 'null' value. + This is introduced in OAS schema >= 3.1. + oneOf: + - type: 'null' + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + discriminator: + propertyName: shapeType + NullableShape: + description: The value may be a shape or the 'null' value. + The 'nullable' attribute was introduced in OAS schema >= 3.0 + and has been deprecated in OAS schema >= 3.1. + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + discriminator: + propertyName: shapeType + nullable: true + ShapeInterface: + properties: + shapeType: + type: string + required: + - shapeType + TriangleInterface: + properties: + triangleType: + type: string + required: + - triangleType + Triangle: + oneOf: + - $ref: '#/components/schemas/EquilateralTriangle' + - $ref: '#/components/schemas/IsoscelesTriangle' + - $ref: '#/components/schemas/ScaleneTriangle' + discriminator: + propertyName: triangleType + # Note: the 'additionalProperties' keyword is not specified, which is + # equivalent to allowing undeclared properties of any type. + EquilateralTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + IsoscelesTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + additionalProperties: false + ScaleneTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + QuadrilateralInterface: + properties: + quadrilateralType: + type: string + required: + - quadrilateralType + Quadrilateral: + oneOf: + - $ref: '#/components/schemas/SimpleQuadrilateral' + - $ref: '#/components/schemas/ComplexQuadrilateral' + discriminator: + propertyName: quadrilateralType + SimpleQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + ComplexQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + GrandparentAnimal: + type: object + required: + - pet_type + properties: + pet_type: + type: string + discriminator: + propertyName: pet_type + ParentPet: + type: object + allOf: + - $ref: '#/components/schemas/GrandparentAnimal' + #ChildCat: + # allOf: + # - $ref: '#/components/schemas/ParentPet' + # - type: object + # properties: + # name: + # type: string + # pet_type: + # x-enum-as-string: true + # type: string + # enum: + # - ChildCat + # default: ChildCat + ArrayOfEnums: + type: array + items: + $ref: '#/components/schemas/OuterEnum' + DateTimeTest: + type: string + default: '2010-01-01T10:10:10.000111+01:00' + example: '2010-01-01T10:10:10.000111+01:00' + format: date-time + DeprecatedObject: + type: object + deprecated: true + properties: + name: + type: string + ObjectWithDeprecatedFields: + type: object + properties: + uuid: + type: string + id: + type: number + deprecated: true + deprecatedRef: + $ref: '#/components/schemas/DeprecatedObject' + bars: + type: array + deprecated: true + items: + $ref: '#/components/schemas/Bar' + PetWithRequiredTags: + type: object + required: + - name + - photoUrls + - tags + properties: + id: + type: integer + format: int64 + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + type: string + example: doggie + photoUrls: + type: array + xml: + name: photoUrl + wrapped: true + items: + type: string + tags: + type: array + xml: + name: tag + wrapped: true + items: + $ref: '#/components/schemas/Tag' + status: + type: string + description: pet status in the store + enum: + - available + - pending + - sold + xml: + name: Pet diff --git a/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml b/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml index 92b32a47679d..3ae78d049cea 100644 --- a/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml @@ -2143,3 +2143,42 @@ components: deprecated: true items: $ref: '#/components/schemas/Bar' + PetWithRequiredTags: + type: object + required: + - name + - photoUrls + - tags + properties: + id: + type: integer + format: int64 + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + type: string + example: doggie + photoUrls: + type: array + xml: + name: photoUrl + wrapped: true + items: + type: string + tags: + type: array + xml: + name: tag + wrapped: true + items: + $ref: '#/components/schemas/Tag' + status: + type: string + description: pet status in the store + enum: + - available + - pending + - sold + xml: + name: Pet diff --git a/samples/client/petstore/java-micronaut-client/docs/ModelFile.md b/samples/client/petstore/java-micronaut-client/docs/ModelFile.md new file mode 100644 index 000000000000..014716aba6a3 --- /dev/null +++ b/samples/client/petstore/java-micronaut-client/docs/ModelFile.md @@ -0,0 +1,17 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | `String` | Test capitalization | [optional property] + + + + + + diff --git a/samples/client/petstore/java-micronaut-client/docs/ModelList.md b/samples/client/petstore/java-micronaut-client/docs/ModelList.md new file mode 100644 index 000000000000..6468645316ca --- /dev/null +++ b/samples/client/petstore/java-micronaut-client/docs/ModelList.md @@ -0,0 +1,16 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | `String` | | [optional property] + + + + + + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelFile.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelFile.java new file mode 100644 index 000000000000..7112952184c0 --- /dev/null +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelFile.java @@ -0,0 +1,100 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.*; + +import javax.validation.constraints.*; +import javax.validation.Valid; +import io.micronaut.core.annotation.*; +import javax.annotation.Generated; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@JsonTypeName("File") +@Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") +@Introspected +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile sourceURI(String sourceURI) { + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSourceURI() { + return sourceURI; + } + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelList.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelList.java new file mode 100644 index 000000000000..9aa652a72ee4 --- /dev/null +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelList.java @@ -0,0 +1,99 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.*; + +import javax.validation.constraints.*; +import javax.validation.Valid; +import io.micronaut.core.annotation.*; +import javax.annotation.Generated; + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@JsonTypeName("List") +@Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") +@Introspected +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList _123list(String _123list) { + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String get123list() { + return _123list; + } + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/samples/client/petstore/java-micronaut-client/src/test/groovy/org/openapitools/model/ModelFileSpec.groovy b/samples/client/petstore/java-micronaut-client/src/test/groovy/org/openapitools/model/ModelFileSpec.groovy new file mode 100644 index 000000000000..437aa0a889bf --- /dev/null +++ b/samples/client/petstore/java-micronaut-client/src/test/groovy/org/openapitools/model/ModelFileSpec.groovy @@ -0,0 +1,30 @@ +package org.openapitools.model + +import io.swagger.annotations.ApiModel +import io.swagger.annotations.ApiModelProperty +import io.micronaut.test.extensions.spock.annotation.MicronautTest +import spock.lang.Specification +import jakarta.inject.Inject + +/** + * Model tests for ModelFile + */ +@MicronautTest +public class ModelFileSpec extends Specification { + private final ModelFile model = new ModelFile() + + /** + * Model tests for ModelFile + */ + void 'ModelFile test'() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + void 'ModelFile property sourceURI test'() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java-micronaut-client/src/test/groovy/org/openapitools/model/ModelListSpec.groovy b/samples/client/petstore/java-micronaut-client/src/test/groovy/org/openapitools/model/ModelListSpec.groovy new file mode 100644 index 000000000000..90939aa97617 --- /dev/null +++ b/samples/client/petstore/java-micronaut-client/src/test/groovy/org/openapitools/model/ModelListSpec.groovy @@ -0,0 +1,30 @@ +package org.openapitools.model + +import io.swagger.annotations.ApiModel +import io.swagger.annotations.ApiModelProperty +import io.micronaut.test.extensions.spock.annotation.MicronautTest +import spock.lang.Specification +import jakarta.inject.Inject + +/** + * Model tests for ModelList + */ +@MicronautTest +public class ModelListSpec extends Specification { + private final ModelList model = new ModelList() + + /** + * Model tests for ModelList + */ + void 'ModelList test'() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + void 'ModelList property _123list test'() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/apache-httpclient/docs/ModelFile.md b/samples/client/petstore/java/apache-httpclient/docs/ModelFile.md new file mode 100644 index 000000000000..1282785e329d --- /dev/null +++ b/samples/client/petstore/java/apache-httpclient/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/apache-httpclient/docs/ModelList.md b/samples/client/petstore/java/apache-httpclient/docs/ModelList.md new file mode 100644 index 000000000000..c838a6a72e4f --- /dev/null +++ b/samples/client/petstore/java/apache-httpclient/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 000000000000..864728364139 --- /dev/null +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,109 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@JsonTypeName("File") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 000000000000..82abfba9e39d --- /dev/null +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,108 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@JsonTypeName("List") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 000000000000..5b3fde28d4b4 --- /dev/null +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 000000000000..36755ee2bd6a --- /dev/null +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 000000000000..e441f435fba2 --- /dev/null +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,110 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@JsonTypeName("File") +@javax.annotation.concurrent.Immutable +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 000000000000..ea6f66358227 --- /dev/null +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,109 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@JsonTypeName("List") +@javax.annotation.concurrent.Immutable +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/feign-no-nullable/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/feign-no-nullable/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 000000000000..2617cb1bae47 --- /dev/null +++ b/samples/client/petstore/java/feign-no-nullable/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ModelFile + */ +class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/feign-no-nullable/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/feign-no-nullable/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 000000000000..e2c3bb9a1016 --- /dev/null +++ b/samples/client/petstore/java/feign-no-nullable/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ModelList + */ +class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 000000000000..864728364139 --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,109 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@JsonTypeName("File") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 000000000000..82abfba9e39d --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,108 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@JsonTypeName("List") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 000000000000..2617cb1bae47 --- /dev/null +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ModelFile + */ +class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 000000000000..e2c3bb9a1016 --- /dev/null +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ModelList + */ +class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/google-api-client/docs/ModelFile.md b/samples/client/petstore/java/google-api-client/docs/ModelFile.md new file mode 100644 index 000000000000..1282785e329d --- /dev/null +++ b/samples/client/petstore/java/google-api-client/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/google-api-client/docs/ModelList.md b/samples/client/petstore/java/google-api-client/docs/ModelList.md new file mode 100644 index 000000000000..c838a6a72e4f --- /dev/null +++ b/samples/client/petstore/java/google-api-client/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 000000000000..864728364139 --- /dev/null +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,109 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@JsonTypeName("File") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 000000000000..82abfba9e39d --- /dev/null +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,108 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@JsonTypeName("List") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 000000000000..5b3fde28d4b4 --- /dev/null +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 000000000000..36755ee2bd6a --- /dev/null +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/jersey1/docs/ModelFile.md b/samples/client/petstore/java/jersey1/docs/ModelFile.md new file mode 100644 index 000000000000..1282785e329d --- /dev/null +++ b/samples/client/petstore/java/jersey1/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/jersey1/docs/ModelList.md b/samples/client/petstore/java/jersey1/docs/ModelList.md new file mode 100644 index 000000000000..c838a6a72e4f --- /dev/null +++ b/samples/client/petstore/java/jersey1/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 000000000000..864728364139 --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,109 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@JsonTypeName("File") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 000000000000..82abfba9e39d --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,108 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@JsonTypeName("List") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 000000000000..5b3fde28d4b4 --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 000000000000..36755ee2bd6a --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/ModelFile.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/ModelFile.md new file mode 100644 index 000000000000..1282785e329d --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/ModelList.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/ModelList.md new file mode 100644 index 000000000000..c838a6a72e4f --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 000000000000..0de39ec2ab0a --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,113 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.JSON; + + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + /** + * Return true if this File object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 000000000000..19025e8ec4f3 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,112 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.JSON; + + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + + /** + * Return true if this List object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 000000000000..5b3fde28d4b4 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 000000000000..36755ee2bd6a --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/jersey2-java8/docs/ModelFile.md b/samples/client/petstore/java/jersey2-java8/docs/ModelFile.md new file mode 100644 index 000000000000..1282785e329d --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-java8/docs/ModelList.md b/samples/client/petstore/java/jersey2-java8/docs/ModelList.md new file mode 100644 index 000000000000..c838a6a72e4f --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 000000000000..0de39ec2ab0a --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,113 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.JSON; + + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + /** + * Return true if this File object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 000000000000..19025e8ec4f3 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,112 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.JSON; + + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + + /** + * Return true if this List object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 000000000000..5b3fde28d4b4 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 000000000000..36755ee2bd6a --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/native-async/docs/ModelFile.md b/samples/client/petstore/java/native-async/docs/ModelFile.md new file mode 100644 index 000000000000..1282785e329d --- /dev/null +++ b/samples/client/petstore/java/native-async/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/native-async/docs/ModelList.md b/samples/client/petstore/java/native-async/docs/ModelList.md new file mode 100644 index 000000000000..c838a6a72e4f --- /dev/null +++ b/samples/client/petstore/java/native-async/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 000000000000..2a6605d18c8e --- /dev/null +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,112 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + /** + * Return true if this File object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 000000000000..2db90d8dc136 --- /dev/null +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,111 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + + /** + * Return true if this List object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 000000000000..5b3fde28d4b4 --- /dev/null +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 000000000000..36755ee2bd6a --- /dev/null +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/native/docs/ModelFile.md b/samples/client/petstore/java/native/docs/ModelFile.md new file mode 100644 index 000000000000..1282785e329d --- /dev/null +++ b/samples/client/petstore/java/native/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/native/docs/ModelList.md b/samples/client/petstore/java/native/docs/ModelList.md new file mode 100644 index 000000000000..c838a6a72e4f --- /dev/null +++ b/samples/client/petstore/java/native/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 000000000000..2a6605d18c8e --- /dev/null +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,112 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + /** + * Return true if this File object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 000000000000..2db90d8dc136 --- /dev/null +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,111 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + + /** + * Return true if this List object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 000000000000..5b3fde28d4b4 --- /dev/null +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 000000000000..36755ee2bd6a --- /dev/null +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ModelFile.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ModelFile.md new file mode 100644 index 000000000000..1282785e329d --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ModelList.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ModelList.md new file mode 100644 index 000000000000..c838a6a72e4f --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 000000000000..111a748ceff8 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,101 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String SERIALIZED_NAME_SOURCE_U_R_I = "sourceURI"; + @SerializedName(SERIALIZED_NAME_SOURCE_U_R_I) + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + + public String getSourceURI() { + return sourceURI; + } + + + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 000000000000..2ba46fefd4fe --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,100 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * ModelList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String SERIALIZED_NAME_123LIST = "123-list"; + @SerializedName(SERIALIZED_NAME_123LIST) + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String get123list() { + return _123list; + } + + + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/model/ModelFileTest.java similarity index 63% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java rename to samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/model/ModelFileTest.java index 0ca366212088..132012d4c387 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -21,41 +21,31 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; /** - * Model tests for FileSchemaTestClass + * Model tests for ModelFile */ -public class FileSchemaTestClassTest { - private final FileSchemaTestClass model = new FileSchemaTestClass(); +public class ModelFileTest { + private final ModelFile model = new ModelFile(); /** - * Model tests for FileSchemaTestClass + * Model tests for ModelFile */ @Test - public void testFileSchemaTestClass() { - // TODO: test FileSchemaTestClass + public void testModelFile() { + // TODO: test ModelFile } /** - * Test the property 'file' + * Test the property 'sourceURI' */ @Test - public void fileTest() { - // TODO: test file - } - - /** - * Test the property 'files' - */ - @Test - public void filesTest() { - // TODO: test files + public void sourceURITest() { + // TODO: test sourceURI } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 000000000000..d3ed2075e9a4 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/FILES b/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/FILES index 39148a7980a7..4b91a4644222 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/FILES +++ b/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/FILES @@ -34,7 +34,6 @@ docs/EnumTest.md docs/EquilateralTriangle.md docs/FakeApi.md docs/FakeClassnameTags123Api.md -docs/FileSchemaTestClass.md docs/Foo.md docs/FormatTest.md docs/Fruit.md @@ -65,6 +64,7 @@ docs/OuterEnumIntegerDefaultValue.md docs/ParentPet.md docs/Pet.md docs/PetApi.md +docs/PetWithRequiredTags.md docs/Pig.md docs/Quadrilateral.md docs/QuadrilateralInterface.md @@ -147,7 +147,6 @@ src/main/java/org/openapitools/client/model/EnumArrays.java src/main/java/org/openapitools/client/model/EnumClass.java src/main/java/org/openapitools/client/model/EnumTest.java src/main/java/org/openapitools/client/model/EquilateralTriangle.java -src/main/java/org/openapitools/client/model/FileSchemaTestClass.java src/main/java/org/openapitools/client/model/Foo.java src/main/java/org/openapitools/client/model/FormatTest.java src/main/java/org/openapitools/client/model/Fruit.java @@ -177,6 +176,7 @@ src/main/java/org/openapitools/client/model/OuterEnumInteger.java src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java src/main/java/org/openapitools/client/model/ParentPet.java src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/PetWithRequiredTags.java src/main/java/org/openapitools/client/model/Pig.java src/main/java/org/openapitools/client/model/Quadrilateral.java src/main/java/org/openapitools/client/model/QuadrilateralInterface.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/README.md b/samples/client/petstore/java/okhttp-gson-nextgen/README.md index 6110aea0fa04..865b6ae5aa1d 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/README.md +++ b/samples/client/petstore/java/okhttp-gson-nextgen/README.md @@ -121,7 +121,6 @@ Class | Method | HTTP request | Description *FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | *FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | *FakeApi* | [**getArrayOfEnums**](docs/FakeApi.md#getArrayOfEnums) | **GET** /fake/array-of-enums | Array of Enums -*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 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -182,7 +181,6 @@ Class | Method | HTTP request | Description - [EnumClass](docs/EnumClass.md) - [EnumTest](docs/EnumTest.md) - [EquilateralTriangle](docs/EquilateralTriangle.md) - - [FileSchemaTestClass](docs/FileSchemaTestClass.md) - [Foo](docs/Foo.md) - [FormatTest](docs/FormatTest.md) - [Fruit](docs/Fruit.md) @@ -212,6 +210,7 @@ Class | Method | HTTP request | Description - [OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) - [ParentPet](docs/ParentPet.md) - [Pet](docs/Pet.md) + - [PetWithRequiredTags](docs/PetWithRequiredTags.md) - [Pig](docs/Pig.md) - [Quadrilateral](docs/Quadrilateral.md) - [QuadrilateralInterface](docs/QuadrilateralInterface.md) diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml b/samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml index 8e64d05d5f2f..ecee30d7d093 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml +++ b/samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml @@ -1107,24 +1107,6 @@ paths: - $another-fake? 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`. - operationId: testBodyWithFileSchema - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/FileSchemaTestClass' - required: true - responses: - "200": - description: Success - tags: - - fake - x-contentType: application/json - x-accepts: application/json /fake/test-query-parameters: put: description: To test the collection format in query parameters @@ -1934,25 +1916,8 @@ components: additionalProperties: type: boolean type: object - FileSchemaTestClass: - example: - file: - sourceURI: sourceURI - files: - - sourceURI: sourceURI - - sourceURI: sourceURI - properties: - file: - $ref: '#/components/schemas/File' - files: - items: - $ref: '#/components/schemas/File' - type: array - type: object File: description: Must be named `File` for test. - example: - sourceURI: sourceURI properties: sourceURI: description: Test capitalization @@ -2279,6 +2244,45 @@ components: $ref: '#/components/schemas/Bar' type: array type: object + PetWithRequiredTags: + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + - tags + type: object + xml: + name: Pet inline_response_default: example: string: diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeApi.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeApi.md index bee53680247b..505117ba63fa 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeApi.md +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeApi.md @@ -10,7 +10,6 @@ Method | HTTP request | Description [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | [**getArrayOfEnums**](FakeApi.md#getArrayOfEnums) | **GET** /fake/array-of-enums | Array of Enums -[**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | [**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -357,63 +356,6 @@ No authorization required |-------------|-------------|------------------| **200** | Got named array of enums | - | - -# **testBodyWithFileSchema** -> testBodyWithFileSchema(fileSchemaTestClass) - - - -For this test, the body for this request much reference a schema named `File`. - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; -import org.openapitools.client.api.FakeApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - FakeApi apiInstance = new FakeApi(defaultClient); - FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass | - try { - apiInstance.testBodyWithFileSchema(fileSchemaTestClass); - } catch (ApiException e) { - - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Success | - | - # **testBodyWithQueryParams** > testBodyWithQueryParams(query, user) diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelFile.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelFile.md new file mode 100644 index 000000000000..1282785e329d --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelList.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelList.md new file mode 100644 index 000000000000..c838a6a72e4f --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/PetWithRequiredTags.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/PetWithRequiredTags.md new file mode 100644 index 000000000000..16525294ccd8 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/PetWithRequiredTags.md @@ -0,0 +1,28 @@ + + +# PetWithRequiredTags + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**name** | **String** | | +**photoUrls** | **List<String>** | | +**tags** | [**List<Tag>**](Tag.md) | | +**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] + + + +## Enum: StatusEnum + +Name | Value +---- | ----- +AVAILABLE | "available" +PENDING | "pending" +SOLD | "sold" + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java index 40146a3e6f5f..584a6e970c8f 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java @@ -47,13 +47,13 @@ * backward-compatibility */ public class JSON { - private Gson gson; - private boolean isLenientOnJson = false; - private DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); - private SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); - private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); - private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); - private ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); @SuppressWarnings("unchecked") public static GsonBuilder createGson() { @@ -213,7 +213,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri return clazz; } - public JSON() { + { gson = createGson() .registerTypeAdapter(Date.class, dateTypeAdapter) .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) @@ -244,7 +244,6 @@ public JSON() { .registerTypeAdapterFactory(new org.openapitools.client.model.EnumArrays.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.EnumTest.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.EquilateralTriangle.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.FileSchemaTestClass.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.Foo.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.FormatTest.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.Fruit.CustomTypeAdapterFactory()) @@ -269,6 +268,7 @@ public JSON() { .registerTypeAdapterFactory(new org.openapitools.client.model.OuterComposite.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.ParentPet.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.Pet.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.PetWithRequiredTags.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.Pig.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.Quadrilateral.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.QuadrilateralInterface.CustomTypeAdapterFactory()) @@ -293,7 +293,7 @@ public JSON() { * * @return Gson */ - public Gson getGson() { + public static Gson getGson() { return gson; } @@ -302,11 +302,11 @@ public Gson getGson() { * * @param gson Gson */ - public void setGson(Gson gson) { - this.gson = gson; + public static void setGson(Gson gson) { + JSON.gson = gson; } - public void setLenientOnJson(boolean lenientOnJson) { + public static void setLenientOnJson(boolean lenientOnJson) { isLenientOnJson = lenientOnJson; } @@ -316,7 +316,7 @@ public void setLenientOnJson(boolean lenientOnJson) { * @param obj Object * @return String representation of the JSON */ - public String serialize(Object obj) { + public static String serialize(Object obj) { return gson.toJson(obj); } @@ -329,7 +329,7 @@ public String serialize(Object obj) { * @return The deserialized Java object */ @SuppressWarnings("unchecked") - public T deserialize(String body, Type returnType) { + public static T deserialize(String body, Type returnType) { try { if (isLenientOnJson) { JsonReader jsonReader = new JsonReader(new StringReader(body)); @@ -353,7 +353,7 @@ public T deserialize(String body, Type returnType) { /** * Gson TypeAdapter for Byte Array type */ - public class ByteArrayAdapter extends TypeAdapter { + public static class ByteArrayAdapter extends TypeAdapter { @Override public void write(JsonWriter out, byte[] value) throws IOException { @@ -381,7 +381,7 @@ public byte[] read(JsonReader in) throws IOException { /** * Gson TypeAdapter for JSR310 OffsetDateTime type */ - public class OffsetDateTimeTypeAdapter extends TypeAdapter { + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { private DateTimeFormatter formatter; @@ -425,7 +425,7 @@ public OffsetDateTime read(JsonReader in) throws IOException { /** * Gson TypeAdapter for JSR310 LocalDate type */ - public class LocalDateTypeAdapter extends TypeAdapter { + public static class LocalDateTypeAdapter extends TypeAdapter { private DateTimeFormatter formatter; @@ -463,11 +463,11 @@ public LocalDate read(JsonReader in) throws IOException { } } - public void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { offsetDateTimeTypeAdapter.setFormat(dateFormat); } - public void setLocalDateFormat(DateTimeFormatter dateFormat) { + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { localDateTypeAdapter.setFormat(dateFormat); } @@ -476,7 +476,7 @@ public void setLocalDateFormat(DateTimeFormatter dateFormat) { * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used * (more efficient than SimpleDateFormat). */ - public class SqlDateTypeAdapter extends TypeAdapter { + public static class SqlDateTypeAdapter extends TypeAdapter { private DateFormat dateFormat; @@ -529,7 +529,7 @@ public java.sql.Date read(JsonReader in) throws IOException { * Gson TypeAdapter for java.util.Date type * If the dateFormat is null, ISO8601Utils will be used. */ - public class DateTypeAdapter extends TypeAdapter { + public static class DateTypeAdapter extends TypeAdapter { private DateFormat dateFormat; @@ -582,11 +582,11 @@ public Date read(JsonReader in) throws IOException { } } - public void setDateFormat(DateFormat dateFormat) { + public static void setDateFormat(DateFormat dateFormat) { dateTypeAdapter.setFormat(dateFormat); } - public void setSqlDateFormat(DateFormat dateFormat) { + public static void setSqlDateFormat(DateFormat dateFormat) { sqlDateTypeAdapter.setFormat(dateFormat); } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeApi.java index 271df76973e0..50c9b922e985 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeApi.java @@ -30,7 +30,6 @@ import java.math.BigDecimal; import org.openapitools.client.model.Client; import java.io.File; -import org.openapitools.client.model.FileSchemaTestClass; import org.openapitools.client.model.HealthCheckResult; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; @@ -740,115 +739,6 @@ public okhttp3.Call getArrayOfEnumsAsync(final ApiCallback> _cal localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - /** - * Build call for testBodyWithFileSchema - * @param fileSchemaTestClass (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
            Status Code Description Response Headers
            200 Success -
            - */ - public okhttp3.Call testBodyWithFileSchemaCall(FileSchemaTestClass fileSchemaTestClass, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = fileSchemaTestClass; - - // create path and map variables - String localVarPath = "/fake/body-with-file-schema"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call testBodyWithFileSchemaValidateBeforeCall(FileSchemaTestClass fileSchemaTestClass, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'fileSchemaTestClass' is set - if (fileSchemaTestClass == null) { - throw new ApiException("Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema(Async)"); - } - - - okhttp3.Call localVarCall = testBodyWithFileSchemaCall(fileSchemaTestClass, _callback); - return localVarCall; - - } - - /** - * - * For this test, the body for this request much reference a schema named `File`. - * @param fileSchemaTestClass (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
            Status Code Description Response Headers
            200 Success -
            - */ - public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws ApiException { - testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass); - } - - /** - * - * For this test, the body for this request much reference a schema named `File`. - * @param fileSchemaTestClass (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
            Status Code Description Response Headers
            200 Success -
            - */ - public ApiResponse testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass fileSchemaTestClass) throws ApiException { - okhttp3.Call localVarCall = testBodyWithFileSchemaValidateBeforeCall(fileSchemaTestClass, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * (asynchronously) - * For this test, the body for this request much reference a schema named `File`. - * @param fileSchemaTestClass (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
            Status Code Description Response Headers
            200 Success -
            - */ - public okhttp3.Call testBodyWithFileSchemaAsync(FileSchemaTestClass fileSchemaTestClass, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = testBodyWithFileSchemaValidateBeforeCall(fileSchemaTestClass, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } /** * Build call for testBodyWithQueryParams * @param query (required) diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 5c1d5c3fd664..d5f4dc14d804 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -30,6 +30,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -44,6 +45,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * AdditionalPropertiesClass */ @@ -362,6 +365,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -381,6 +385,29 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AdditionalPropertiesClass + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AdditionalPropertiesClass.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalPropertiesClass is not found in the empty JSON string", AdditionalPropertiesClass.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AdditionalPropertiesClass.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesClass` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -401,19 +428,33 @@ public void write(JsonWriter out, AdditionalPropertiesClass value) throws IOExce @Override public AdditionalPropertiesClass read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!AdditionalPropertiesClass.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `AdditionalPropertiesClass` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of AdditionalPropertiesClass given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesClass + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesClass + */ + public static AdditionalPropertiesClass fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdditionalPropertiesClass.class); + } + + /** + * Convert an instance of AdditionalPropertiesClass to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Animal.java index 4d60101ca177..de69f3d6d73c 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Animal.java @@ -28,6 +28,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -42,6 +43,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Animal */ @@ -144,4 +147,68 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("className"); + openapiFields.add("color"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("className"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Animal + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Animal.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Animal is not found in the empty JSON string", Animal.openapiRequiredFields.toString())); + } + } + + String discriminatorValue = jsonObj.get("className").getAsString(); + switch (discriminatorValue) { + case "Cat": + Cat.validateJsonObject(jsonObj); + break; + case "Dog": + Dog.validateJsonObject(jsonObj); + break; + default: + throw new IllegalArgumentException(String.format("The value of the `className` field `%s` does not match any key defined in the discriminator's mapping.", discriminatorValue)); + } + } + + + /** + * Create an instance of Animal given an JSON string + * + * @param jsonString JSON string + * @return An instance of Animal + * @throws IOException if the JSON string is invalid with respect to Animal + */ + public static Animal fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Animal.class); + } + + /** + * Convert an instance of Animal to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Apple.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Apple.java index 03e3cc0f9c8d..650f2483d018 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Apple.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Apple.java @@ -26,6 +26,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Apple */ @@ -141,6 +144,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -154,6 +158,29 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Apple + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Apple.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Apple is not found in the empty JSON string", Apple.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Apple.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Apple` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -174,19 +201,33 @@ public void write(JsonWriter out, Apple value) throws IOException { @Override public Apple read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!Apple.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Apple` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of Apple given an JSON string + * + * @param jsonString JSON string + * @return An instance of Apple + * @throws IOException if the JSON string is invalid with respect to Apple + */ + public static Apple fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Apple.class); + } + + /** + * Convert an instance of Apple to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AppleReq.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AppleReq.java index dbf822795342..9270ce0a1836 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AppleReq.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AppleReq.java @@ -26,6 +26,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * AppleReq */ @@ -141,6 +144,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -155,6 +159,36 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("cultivar"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AppleReq + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AppleReq.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AppleReq is not found in the empty JSON string", AppleReq.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AppleReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AppleReq` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AppleReq.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -175,26 +209,33 @@ public void write(JsonWriter out, AppleReq value) throws IOException { @Override public AppleReq read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!AppleReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `AppleReq` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AppleReq.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of AppleReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of AppleReq + * @throws IOException if the JSON string is invalid with respect to AppleReq + */ + public static AppleReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AppleReq.class); + } + + /** + * Convert an instance of AppleReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 2dc3a6954049..d375bd8a4886 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -29,6 +29,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -43,6 +44,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * ArrayOfArrayOfNumberOnly */ @@ -123,6 +126,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -135,6 +139,29 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ArrayOfArrayOfNumberOnly + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ArrayOfArrayOfNumberOnly.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayOfArrayOfNumberOnly is not found in the empty JSON string", ArrayOfArrayOfNumberOnly.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ArrayOfArrayOfNumberOnly.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayOfArrayOfNumberOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -155,19 +182,33 @@ public void write(JsonWriter out, ArrayOfArrayOfNumberOnly value) throws IOExcep @Override public ArrayOfArrayOfNumberOnly read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!ArrayOfArrayOfNumberOnly.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ArrayOfArrayOfNumberOnly` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of ArrayOfArrayOfNumberOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayOfArrayOfNumberOnly + * @throws IOException if the JSON string is invalid with respect to ArrayOfArrayOfNumberOnly + */ + public static ArrayOfArrayOfNumberOnly fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ArrayOfArrayOfNumberOnly.class); + } + + /** + * Convert an instance of ArrayOfArrayOfNumberOnly to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 384759be851e..9ec157ed1515 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -29,6 +29,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -43,6 +44,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * ArrayOfNumberOnly */ @@ -123,6 +126,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -135,6 +139,29 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ArrayOfNumberOnly + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ArrayOfNumberOnly.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayOfNumberOnly is not found in the empty JSON string", ArrayOfNumberOnly.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ArrayOfNumberOnly.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayOfNumberOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -155,19 +182,33 @@ public void write(JsonWriter out, ArrayOfNumberOnly value) throws IOException { @Override public ArrayOfNumberOnly read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!ArrayOfNumberOnly.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ArrayOfNumberOnly` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of ArrayOfNumberOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayOfNumberOnly + * @throws IOException if the JSON string is invalid with respect to ArrayOfNumberOnly + */ + public static ArrayOfNumberOnly fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ArrayOfNumberOnly.class); + } + + /** + * Convert an instance of ArrayOfNumberOnly to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayTest.java index 23c8d4fbd1b2..66d23d236a84 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -29,6 +29,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -43,6 +44,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * ArrayTest */ @@ -197,6 +200,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -211,6 +215,29 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ArrayTest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ArrayTest.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayTest is not found in the empty JSON string", ArrayTest.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ArrayTest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayTest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -231,19 +258,33 @@ public void write(JsonWriter out, ArrayTest value) throws IOException { @Override public ArrayTest read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!ArrayTest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ArrayTest` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of ArrayTest given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayTest + * @throws IOException if the JSON string is invalid with respect to ArrayTest + */ + public static ArrayTest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ArrayTest.class); + } + + /** + * Convert an instance of ArrayTest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Banana.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Banana.java index e409ac6907a0..7ce5f0328cb4 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Banana.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Banana.java @@ -27,6 +27,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -41,6 +42,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Banana */ @@ -113,6 +116,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -125,6 +129,29 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Banana + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Banana.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Banana is not found in the empty JSON string", Banana.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Banana.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Banana` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -145,19 +172,33 @@ public void write(JsonWriter out, Banana value) throws IOException { @Override public Banana read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!Banana.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Banana` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of Banana given an JSON string + * + * @param jsonString JSON string + * @return An instance of Banana + * @throws IOException if the JSON string is invalid with respect to Banana + */ + public static Banana fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Banana.class); + } + + /** + * Convert an instance of Banana to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/BananaReq.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/BananaReq.java index 7955096b5d3c..9691c1427ab8 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/BananaReq.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/BananaReq.java @@ -27,6 +27,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -41,6 +42,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * BananaReq */ @@ -142,6 +145,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -156,6 +160,36 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("lengthCm"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to BananaReq + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (BananaReq.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in BananaReq is not found in the empty JSON string", BananaReq.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!BananaReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BananaReq` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BananaReq.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -176,26 +210,33 @@ public void write(JsonWriter out, BananaReq value) throws IOException { @Override public BananaReq read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!BananaReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `BananaReq` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : BananaReq.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of BananaReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of BananaReq + * @throws IOException if the JSON string is invalid with respect to BananaReq + */ + public static BananaReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BananaReq.class); + } + + /** + * Convert an instance of BananaReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/BasquePig.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/BasquePig.java index 93fc4cad0b9e..158472221c29 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/BasquePig.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/BasquePig.java @@ -26,6 +26,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * BasquePig */ @@ -112,6 +115,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -125,6 +129,36 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("className"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to BasquePig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (BasquePig.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in BasquePig is not found in the empty JSON string", BasquePig.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!BasquePig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BasquePig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BasquePig.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -145,26 +179,33 @@ public void write(JsonWriter out, BasquePig value) throws IOException { @Override public BasquePig read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!BasquePig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `BasquePig` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : BasquePig.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of BasquePig given an JSON string + * + * @param jsonString JSON string + * @return An instance of BasquePig + * @throws IOException if the JSON string is invalid with respect to BasquePig + */ + public static BasquePig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BasquePig.class); + } + + /** + * Convert an instance of BasquePig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Capitalization.java index eceb83bbfeb0..ce4095ed0e52 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Capitalization.java @@ -26,6 +26,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Capitalization */ @@ -257,6 +260,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -274,6 +278,29 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Capitalization + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Capitalization.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Capitalization is not found in the empty JSON string", Capitalization.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Capitalization.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Capitalization` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -294,19 +321,33 @@ public void write(JsonWriter out, Capitalization value) throws IOException { @Override public Capitalization read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!Capitalization.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Capitalization` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of Capitalization given an JSON string + * + * @param jsonString JSON string + * @return An instance of Capitalization + * @throws IOException if the JSON string is invalid with respect to Capitalization + */ + public static Capitalization fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Capitalization.class); + } + + /** + * Convert an instance of Capitalization to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Cat.java index 426511dc3c0a..a81d5016bf72 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Cat.java @@ -28,6 +28,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -42,6 +43,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Cat */ @@ -117,6 +120,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -132,6 +136,36 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("className"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Cat + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Cat.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Cat is not found in the empty JSON string", Cat.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Cat.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Cat` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Cat.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -152,26 +186,33 @@ public void write(JsonWriter out, Cat value) throws IOException { @Override public Cat read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!Cat.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Cat` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Cat.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of Cat given an JSON string + * + * @param jsonString JSON string + * @return An instance of Cat + * @throws IOException if the JSON string is invalid with respect to Cat + */ + public static Cat fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Cat.class); + } + + /** + * Convert an instance of Cat to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/CatAllOf.java index 8d9affba3dc7..6a2c50e1c046 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -26,6 +26,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * CatAllOf */ @@ -112,6 +115,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -124,6 +128,29 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CatAllOf + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CatAllOf.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CatAllOf is not found in the empty JSON string", CatAllOf.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CatAllOf.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CatAllOf` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -144,19 +171,33 @@ public void write(JsonWriter out, CatAllOf value) throws IOException { @Override public CatAllOf read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!CatAllOf.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `CatAllOf` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of CatAllOf given an JSON string + * + * @param jsonString JSON string + * @return An instance of CatAllOf + * @throws IOException if the JSON string is invalid with respect to CatAllOf + */ + public static CatAllOf fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CatAllOf.class); + } + + /** + * Convert an instance of CatAllOf to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Category.java index 85eb92c71b2a..d23447f518de 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Category.java @@ -26,6 +26,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Category */ @@ -141,6 +144,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -155,6 +159,36 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("name"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Category + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Category.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Category is not found in the empty JSON string", Category.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Category.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Category` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Category.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -175,26 +209,33 @@ public void write(JsonWriter out, Category value) throws IOException { @Override public Category read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!Category.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Category` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Category.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of Category given an JSON string + * + * @param jsonString JSON string + * @return An instance of Category + * @throws IOException if the JSON string is invalid with respect to Category + */ + public static Category fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Category.class); + } + + /** + * Convert an instance of Category to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ClassModel.java index da8517ec7b90..8fb1b2f83d15 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ClassModel.java @@ -26,6 +26,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Model for testing model with \"_class\" property */ @@ -113,6 +116,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -125,6 +129,29 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ClassModel + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ClassModel.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ClassModel is not found in the empty JSON string", ClassModel.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ClassModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ClassModel` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -145,19 +172,33 @@ public void write(JsonWriter out, ClassModel value) throws IOException { @Override public ClassModel read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!ClassModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ClassModel` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of ClassModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ClassModel + * @throws IOException if the JSON string is invalid with respect to ClassModel + */ + public static ClassModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ClassModel.class); + } + + /** + * Convert an instance of ClassModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Client.java index 2a7cf96170ca..a52cc0be31af 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Client.java @@ -26,6 +26,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Client */ @@ -112,6 +115,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -124,6 +128,29 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Client + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Client.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Client is not found in the empty JSON string", Client.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Client.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Client` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -144,19 +171,33 @@ public void write(JsonWriter out, Client value) throws IOException { @Override public Client read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!Client.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Client` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of Client given an JSON string + * + * @param jsonString JSON string + * @return An instance of Client + * @throws IOException if the JSON string is invalid with respect to Client + */ + public static Client fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Client.class); + } + + /** + * Convert an instance of Client to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java index 197a8ca0a229..c604f41f8b72 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java @@ -28,6 +28,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -42,6 +43,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * ComplexQuadrilateral */ @@ -143,6 +146,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -158,6 +162,36 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("quadrilateralType"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ComplexQuadrilateral + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ComplexQuadrilateral.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ComplexQuadrilateral is not found in the empty JSON string", ComplexQuadrilateral.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ComplexQuadrilateral.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ComplexQuadrilateral` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ComplexQuadrilateral.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -178,26 +212,33 @@ public void write(JsonWriter out, ComplexQuadrilateral value) throws IOException @Override public ComplexQuadrilateral read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!ComplexQuadrilateral.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ComplexQuadrilateral` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ComplexQuadrilateral.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of ComplexQuadrilateral given an JSON string + * + * @param jsonString JSON string + * @return An instance of ComplexQuadrilateral + * @throws IOException if the JSON string is invalid with respect to ComplexQuadrilateral + */ + public static ComplexQuadrilateral fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ComplexQuadrilateral.class); + } + + /** + * Convert an instance of ComplexQuadrilateral to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DanishPig.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DanishPig.java index c9bdd6fb478b..6083d1cc0131 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DanishPig.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DanishPig.java @@ -26,6 +26,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * DanishPig */ @@ -112,6 +115,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -125,6 +129,36 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("className"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DanishPig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (DanishPig.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in DanishPig is not found in the empty JSON string", DanishPig.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DanishPig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DanishPig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DanishPig.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -145,26 +179,33 @@ public void write(JsonWriter out, DanishPig value) throws IOException { @Override public DanishPig read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!DanishPig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `DanishPig` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DanishPig.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of DanishPig given an JSON string + * + * @param jsonString JSON string + * @return An instance of DanishPig + * @throws IOException if the JSON string is invalid with respect to DanishPig + */ + public static DanishPig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DanishPig.class); + } + + /** + * Convert an instance of DanishPig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DeprecatedObject.java index 1ebdc75845ba..9bab6c77d617 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -26,6 +26,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * DeprecatedObject * @deprecated @@ -114,6 +117,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -126,6 +130,29 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeprecatedObject + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (DeprecatedObject.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in DeprecatedObject is not found in the empty JSON string", DeprecatedObject.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeprecatedObject.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeprecatedObject` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -146,19 +173,33 @@ public void write(JsonWriter out, DeprecatedObject value) throws IOException { @Override public DeprecatedObject read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!DeprecatedObject.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `DeprecatedObject` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of DeprecatedObject given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeprecatedObject + * @throws IOException if the JSON string is invalid with respect to DeprecatedObject + */ + public static DeprecatedObject fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeprecatedObject.class); + } + + /** + * Convert an instance of DeprecatedObject to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Dog.java index 407d20c326a9..24062284ab56 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Dog.java @@ -28,6 +28,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -42,6 +43,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Dog */ @@ -117,6 +120,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -132,6 +136,36 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("className"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Dog + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Dog.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Dog is not found in the empty JSON string", Dog.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Dog.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Dog` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Dog.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -152,26 +186,33 @@ public void write(JsonWriter out, Dog value) throws IOException { @Override public Dog read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!Dog.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Dog` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Dog.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of Dog given an JSON string + * + * @param jsonString JSON string + * @return An instance of Dog + * @throws IOException if the JSON string is invalid with respect to Dog + */ + public static Dog fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Dog.class); + } + + /** + * Convert an instance of Dog to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DogAllOf.java index 4305b501e06d..6053b9169b79 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -26,6 +26,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * DogAllOf */ @@ -112,6 +115,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -124,6 +128,29 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DogAllOf + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (DogAllOf.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in DogAllOf is not found in the empty JSON string", DogAllOf.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DogAllOf.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DogAllOf` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -144,19 +171,33 @@ public void write(JsonWriter out, DogAllOf value) throws IOException { @Override public DogAllOf read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!DogAllOf.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `DogAllOf` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of DogAllOf given an JSON string + * + * @param jsonString JSON string + * @return An instance of DogAllOf + * @throws IOException if the JSON string is invalid with respect to DogAllOf + */ + public static DogAllOf fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DogAllOf.class); + } + + /** + * Convert an instance of DogAllOf to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Drawing.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Drawing.java index b880f4c49dd7..793d088bad2b 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Drawing.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Drawing.java @@ -35,6 +35,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -49,6 +50,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Drawing */ @@ -229,6 +232,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -244,6 +248,48 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Drawing + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Drawing.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Drawing is not found in the empty JSON string", Drawing.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Drawing.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Drawing` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `mainShape` + if (jsonObj.getAsJsonObject("mainShape") != null) { + Shape.validateJsonObject(jsonObj.getAsJsonObject("mainShape")); + } + // validate the optional field `shapeOrNull` + if (jsonObj.getAsJsonObject("shapeOrNull") != null) { + ShapeOrNull.validateJsonObject(jsonObj.getAsJsonObject("shapeOrNull")); + } + // validate the optional field `nullableShape` + if (jsonObj.getAsJsonObject("nullableShape") != null) { + NullableShape.validateJsonObject(jsonObj.getAsJsonObject("nullableShape")); + } + JsonArray jsonArrayshapes = jsonObj.getAsJsonArray("shapes"); + // validate the optional field `shapes` (array) + if (jsonArrayshapes != null) { + for (int i = 0; i < jsonArrayshapes.size(); i++) { + Shape.validateJsonObject(jsonArrayshapes.get(i).getAsJsonObject()); + }; + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -264,19 +310,33 @@ public void write(JsonWriter out, Drawing value) throws IOException { @Override public Drawing read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!Drawing.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Drawing` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of Drawing given an JSON string + * + * @param jsonString JSON string + * @return An instance of Drawing + * @throws IOException if the JSON string is invalid with respect to Drawing + */ + public static Drawing fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Drawing.class); + } + + /** + * Convert an instance of Drawing to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumArrays.java index 87675e4eef79..6b64ece26660 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -28,6 +28,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -42,6 +43,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * EnumArrays */ @@ -245,6 +248,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -258,6 +262,29 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to EnumArrays + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (EnumArrays.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in EnumArrays is not found in the empty JSON string", EnumArrays.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!EnumArrays.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EnumArrays` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -278,19 +305,33 @@ public void write(JsonWriter out, EnumArrays value) throws IOException { @Override public EnumArrays read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!EnumArrays.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `EnumArrays` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of EnumArrays given an JSON string + * + * @param jsonString JSON string + * @return An instance of EnumArrays + * @throws IOException if the JSON string is invalid with respect to EnumArrays + */ + public static EnumArrays fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EnumArrays.class); + } + + /** + * Convert an instance of EnumArrays to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumTest.java index 8bb57d811f05..b25fad66483e 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumTest.java @@ -31,6 +31,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -45,6 +46,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * EnumTest */ @@ -599,6 +602,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -620,6 +624,36 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("enum_string_required"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to EnumTest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (EnumTest.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in EnumTest is not found in the empty JSON string", EnumTest.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!EnumTest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EnumTest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EnumTest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -640,26 +674,33 @@ public void write(JsonWriter out, EnumTest value) throws IOException { @Override public EnumTest read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!EnumTest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `EnumTest` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EnumTest.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of EnumTest given an JSON string + * + * @param jsonString JSON string + * @return An instance of EnumTest + * @throws IOException if the JSON string is invalid with respect to EnumTest + */ + public static EnumTest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EnumTest.class); + } + + /** + * Convert an instance of EnumTest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EquilateralTriangle.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EquilateralTriangle.java index d0d2a26dab70..a2cf60f6b1c1 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EquilateralTriangle.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EquilateralTriangle.java @@ -28,6 +28,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -42,6 +43,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * EquilateralTriangle */ @@ -143,6 +146,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -158,6 +162,36 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("triangleType"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to EquilateralTriangle + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (EquilateralTriangle.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in EquilateralTriangle is not found in the empty JSON string", EquilateralTriangle.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!EquilateralTriangle.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EquilateralTriangle` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EquilateralTriangle.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -178,26 +212,33 @@ public void write(JsonWriter out, EquilateralTriangle value) throws IOException @Override public EquilateralTriangle read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!EquilateralTriangle.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `EquilateralTriangle` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EquilateralTriangle.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of EquilateralTriangle given an JSON string + * + * @param jsonString JSON string + * @return An instance of EquilateralTriangle + * @throws IOException if the JSON string is invalid with respect to EquilateralTriangle + */ + public static EquilateralTriangle fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EquilateralTriangle.class); + } + + /** + * Convert an instance of EquilateralTriangle to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Foo.java index 61d7be45d63d..574dbb34592c 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Foo.java @@ -26,6 +26,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Foo */ @@ -112,6 +115,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -124,6 +128,29 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Foo + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Foo.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Foo is not found in the empty JSON string", Foo.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Foo.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Foo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -144,19 +171,33 @@ public void write(JsonWriter out, Foo value) throws IOException { @Override public Foo read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!Foo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Foo` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of Foo given an JSON string + * + * @param jsonString JSON string + * @return An instance of Foo + * @throws IOException if the JSON string is invalid with respect to Foo + */ + public static Foo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Foo.class); + } + + /** + * Convert an instance of Foo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FormatTest.java index a5b0cbf197f5..48923c990846 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FormatTest.java @@ -31,6 +31,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -45,6 +46,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * FormatTest */ @@ -562,6 +565,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -593,6 +597,36 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("password"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to FormatTest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (FormatTest.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in FormatTest is not found in the empty JSON string", FormatTest.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!FormatTest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FormatTest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FormatTest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -613,26 +647,33 @@ public void write(JsonWriter out, FormatTest value) throws IOException { @Override public FormatTest read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!FormatTest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `FormatTest` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FormatTest.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of FormatTest given an JSON string + * + * @param jsonString JSON string + * @return An instance of FormatTest + * @throws IOException if the JSON string is invalid with respect to FormatTest + */ + public static FormatTest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FormatTest.class); + } + + /** + * Convert an instance of FormatTest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java index 7ed501ad6df0..b23b5c19d2ba 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java @@ -106,10 +106,13 @@ public Fruit read(JsonReader in) throws IOException { JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); int match = 0; + TypeAdapter actualAdapter = elementAdapter; // deserialize Apple try { - deserialized = adapterApple.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + Apple.validateJsonObject(jsonObject); + actualAdapter = adapterApple; match++; log.log(Level.FINER, "Input data matches schema 'Apple'"); } catch (Exception e) { @@ -119,7 +122,9 @@ public Fruit read(JsonReader in) throws IOException { // deserialize Banana try { - deserialized = adapterBanana.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + Banana.validateJsonObject(jsonObject); + actualAdapter = adapterBanana; match++; log.log(Level.FINER, "Input data matches schema 'Banana'"); } catch (Exception e) { @@ -129,7 +134,7 @@ public Fruit read(JsonReader in) throws IOException { if (match == 1) { Fruit ret = new Fruit(); - ret.setActualInstance(deserialized); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); return ret; } @@ -224,5 +229,53 @@ public Banana getBanana() throws ClassCastException { return (Banana)super.getActualInstance(); } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Fruit + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + // validate the json string with Apple + try { + Apple.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + // validate the json string with Banana + try { + Banana.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for Fruit with oneOf schemas: Apple, Banana. %d class(es) match the result, expected 1. JSON: %s", validCount, jsonObj.toString())); + } + } + + /** + * Create an instance of Fruit given an JSON string + * + * @param jsonString JSON string + * @return An instance of Fruit + * @throws IOException if the JSON string is invalid with respect to Fruit + */ + public static Fruit fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Fruit.class); + } + + /** + * Convert an instance of Fruit to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java index 5c886b122bcb..abaf8b2fc6d8 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java @@ -106,10 +106,13 @@ public FruitReq read(JsonReader in) throws IOException { JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); int match = 0; + TypeAdapter actualAdapter = elementAdapter; // deserialize AppleReq try { - deserialized = adapterAppleReq.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + AppleReq.validateJsonObject(jsonObject); + actualAdapter = adapterAppleReq; match++; log.log(Level.FINER, "Input data matches schema 'AppleReq'"); } catch (Exception e) { @@ -119,7 +122,9 @@ public FruitReq read(JsonReader in) throws IOException { // deserialize BananaReq try { - deserialized = adapterBananaReq.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + BananaReq.validateJsonObject(jsonObject); + actualAdapter = adapterBananaReq; match++; log.log(Level.FINER, "Input data matches schema 'BananaReq'"); } catch (Exception e) { @@ -129,7 +134,7 @@ public FruitReq read(JsonReader in) throws IOException { if (match == 1) { FruitReq ret = new FruitReq(); - ret.setActualInstance(deserialized); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); return ret; } @@ -229,5 +234,53 @@ public BananaReq getBananaReq() throws ClassCastException { return (BananaReq)super.getActualInstance(); } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to FruitReq + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + // validate the json string with AppleReq + try { + AppleReq.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + // validate the json string with BananaReq + try { + BananaReq.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for FruitReq with oneOf schemas: AppleReq, BananaReq. %d class(es) match the result, expected 1. JSON: %s", validCount, jsonObj.toString())); + } + } + + /** + * Create an instance of FruitReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of FruitReq + * @throws IOException if the JSON string is invalid with respect to FruitReq + */ + public static FruitReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FruitReq.class); + } + + /** + * Convert an instance of FruitReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java index 36a4bd8b2489..eec085e78edf 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java @@ -105,13 +105,13 @@ public GmFruit read(JsonReader in) throws IOException { Object deserialized = null; JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); - // deserialize Apple try { - deserialized = adapterApple.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + Apple.validateJsonObject(jsonObject); log.log(Level.FINER, "Input data matches schema 'Apple'"); GmFruit ret = new GmFruit(); - ret.setActualInstance(deserialized); + ret.setActualInstance(adapterApple.fromJsonTree(jsonObject)); return ret; } catch (Exception e) { // deserialization failed, continue @@ -120,17 +120,19 @@ public GmFruit read(JsonReader in) throws IOException { // deserialize Banana try { - deserialized = adapterBanana.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + Banana.validateJsonObject(jsonObject); log.log(Level.FINER, "Input data matches schema 'Banana'"); GmFruit ret = new GmFruit(); - ret.setActualInstance(deserialized); + ret.setActualInstance(adapterBanana.fromJsonTree(jsonObject)); return ret; } catch (Exception e) { // deserialization failed, continue log.log(Level.FINER, "Input data does not match schema 'Banana'", e); } - throw new IOException(String.format("Failed deserialization for GmFruit as data doesn't match anyOf schmeas: Apple, Banana. JSON: %s", jsonObject.toString())); + + throw new IOException(String.format("Failed deserialization for GmFruit: no class matched. JSON: %s", jsonObject.toString())); } }.nullSafe(); } @@ -221,5 +223,55 @@ public Banana getBanana() throws ClassCastException { return (Banana)super.getActualInstance(); } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GmFruit + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate anyOf schemas one by one + int validCount = 0; + // validate the json string with Apple + try { + Apple.validateJsonObject(jsonObj); + return; // return earlier as at least one schema is valid with respect to the Json object + //validCount++; + } catch (Exception e) { + // continue to the next one + } + // validate the json string with Banana + try { + Banana.validateJsonObject(jsonObj); + return; // return earlier as at least one schema is valid with respect to the Json object + //validCount++; + } catch (Exception e) { + // continue to the next one + } + if (validCount == 0) { + throw new IOException(String.format("The JSON string is invalid for GmFruit with anyOf schemas: Apple, Banana. JSON: %s", jsonObj.toString())); + } + } + + /** + * Create an instance of GmFruit given an JSON string + * + * @param jsonString JSON string + * @return An instance of GmFruit + * @throws IOException if the JSON string is invalid with respect to GmFruit + */ + public static GmFruit fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GmFruit.class); + } + + /** + * Convert an instance of GmFruit to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GrandparentAnimal.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GrandparentAnimal.java index 085ccbfbfc1c..a5f1f9ff349f 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GrandparentAnimal.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GrandparentAnimal.java @@ -27,6 +27,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -41,6 +42,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * GrandparentAnimal */ @@ -114,4 +117,64 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("pet_type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("pet_type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GrandparentAnimal + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GrandparentAnimal.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GrandparentAnimal is not found in the empty JSON string", GrandparentAnimal.openapiRequiredFields.toString())); + } + } + + String discriminatorValue = jsonObj.get("pet_type").getAsString(); + switch (discriminatorValue) { + case "ParentPet": + ParentPet.validateJsonObject(jsonObj); + break; + default: + throw new IllegalArgumentException(String.format("The value of the `pet_type` field `%s` does not match any key defined in the discriminator's mapping.", discriminatorValue)); + } + } + + + /** + * Create an instance of GrandparentAnimal given an JSON string + * + * @param jsonString JSON string + * @return An instance of GrandparentAnimal + * @throws IOException if the JSON string is invalid with respect to GrandparentAnimal + */ + public static GrandparentAnimal fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GrandparentAnimal.class); + } + + /** + * Convert an instance of GrandparentAnimal to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 31a4a05a3d5c..ff80990e36a7 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -26,6 +26,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * HasOnlyReadOnly */ @@ -133,6 +136,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -146,6 +150,29 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasOnlyReadOnly + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (HasOnlyReadOnly.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in HasOnlyReadOnly is not found in the empty JSON string", HasOnlyReadOnly.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasOnlyReadOnly.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasOnlyReadOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -166,19 +193,33 @@ public void write(JsonWriter out, HasOnlyReadOnly value) throws IOException { @Override public HasOnlyReadOnly read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!HasOnlyReadOnly.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `HasOnlyReadOnly` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of HasOnlyReadOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasOnlyReadOnly + * @throws IOException if the JSON string is invalid with respect to HasOnlyReadOnly + */ + public static HasOnlyReadOnly fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasOnlyReadOnly.class); + } + + /** + * Convert an instance of HasOnlyReadOnly to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/HealthCheckResult.java index 8af6fca3706a..bc48571626b0 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -27,6 +27,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -41,6 +42,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. */ @@ -125,6 +128,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -137,6 +141,29 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HealthCheckResult + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (HealthCheckResult.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in HealthCheckResult is not found in the empty JSON string", HealthCheckResult.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HealthCheckResult.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HealthCheckResult` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -157,19 +184,33 @@ public void write(JsonWriter out, HealthCheckResult value) throws IOException { @Override public HealthCheckResult read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!HealthCheckResult.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `HealthCheckResult` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of HealthCheckResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of HealthCheckResult + * @throws IOException if the JSON string is invalid with respect to HealthCheckResult + */ + public static HealthCheckResult fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HealthCheckResult.class); + } + + /** + * Convert an instance of HealthCheckResult to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/InlineResponseDefault.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/InlineResponseDefault.java index 925d6c646c99..5f0873c2b157 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/InlineResponseDefault.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/InlineResponseDefault.java @@ -27,6 +27,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -41,6 +42,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * InlineResponseDefault */ @@ -113,6 +116,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -125,6 +129,33 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InlineResponseDefault + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (InlineResponseDefault.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in InlineResponseDefault is not found in the empty JSON string", InlineResponseDefault.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InlineResponseDefault.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InlineResponseDefault` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `string` + if (jsonObj.getAsJsonObject("string") != null) { + Foo.validateJsonObject(jsonObj.getAsJsonObject("string")); + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -145,19 +176,33 @@ public void write(JsonWriter out, InlineResponseDefault value) throws IOExceptio @Override public InlineResponseDefault read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!InlineResponseDefault.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `InlineResponseDefault` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of InlineResponseDefault given an JSON string + * + * @param jsonString JSON string + * @return An instance of InlineResponseDefault + * @throws IOException if the JSON string is invalid with respect to InlineResponseDefault + */ + public static InlineResponseDefault fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InlineResponseDefault.class); + } + + /** + * Convert an instance of InlineResponseDefault to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java index 2c2a44565513..27a25ee3f6e1 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java @@ -28,6 +28,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -42,6 +43,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * IsoscelesTriangle */ @@ -143,6 +146,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -158,6 +162,36 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("triangleType"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to IsoscelesTriangle + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (IsoscelesTriangle.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in IsoscelesTriangle is not found in the empty JSON string", IsoscelesTriangle.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!IsoscelesTriangle.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IsoscelesTriangle` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IsoscelesTriangle.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -178,26 +212,33 @@ public void write(JsonWriter out, IsoscelesTriangle value) throws IOException { @Override public IsoscelesTriangle read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!IsoscelesTriangle.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `IsoscelesTriangle` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : IsoscelesTriangle.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of IsoscelesTriangle given an JSON string + * + * @param jsonString JSON string + * @return An instance of IsoscelesTriangle + * @throws IOException if the JSON string is invalid with respect to IsoscelesTriangle + */ + public static IsoscelesTriangle fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IsoscelesTriangle.class); + } + + /** + * Convert an instance of IsoscelesTriangle to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java index 21834a0903b4..7d10d2dfc1a4 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java @@ -114,10 +114,13 @@ public Mammal read(JsonReader in) throws IOException { JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); int match = 0; + TypeAdapter actualAdapter = elementAdapter; // deserialize Pig try { - deserialized = adapterPig.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + Pig.validateJsonObject(jsonObject); + actualAdapter = adapterPig; match++; log.log(Level.FINER, "Input data matches schema 'Pig'"); } catch (Exception e) { @@ -127,7 +130,9 @@ public Mammal read(JsonReader in) throws IOException { // deserialize Whale try { - deserialized = adapterWhale.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + Whale.validateJsonObject(jsonObject); + actualAdapter = adapterWhale; match++; log.log(Level.FINER, "Input data matches schema 'Whale'"); } catch (Exception e) { @@ -137,7 +142,9 @@ public Mammal read(JsonReader in) throws IOException { // deserialize Zebra try { - deserialized = adapterZebra.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + Zebra.validateJsonObject(jsonObject); + actualAdapter = adapterZebra; match++; log.log(Level.FINER, "Input data matches schema 'Zebra'"); } catch (Exception e) { @@ -147,7 +154,7 @@ public Mammal read(JsonReader in) throws IOException { if (match == 1) { Mammal ret = new Mammal(); - ret.setActualInstance(deserialized); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); return ret; } @@ -265,5 +272,60 @@ public Zebra getZebra() throws ClassCastException { return (Zebra)super.getActualInstance(); } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Mammal + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + // validate the json string with Pig + try { + Pig.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + // validate the json string with Whale + try { + Whale.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + // validate the json string with Zebra + try { + Zebra.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for Mammal with oneOf schemas: Pig, Whale, Zebra. %d class(es) match the result, expected 1. JSON: %s", validCount, jsonObj.toString())); + } + } + + /** + * Create an instance of Mammal given an JSON string + * + * @param jsonString JSON string + * @return An instance of Mammal + * @throws IOException if the JSON string is invalid with respect to Mammal + */ + public static Mammal fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Mammal.class); + } + + /** + * Convert an instance of Mammal to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/MapTest.java index 615d6de35357..51fb198904fe 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/MapTest.java @@ -29,6 +29,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -43,6 +44,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * MapTest */ @@ -281,6 +284,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -296,6 +300,29 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to MapTest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (MapTest.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in MapTest is not found in the empty JSON string", MapTest.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!MapTest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MapTest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -316,19 +343,33 @@ public void write(JsonWriter out, MapTest value) throws IOException { @Override public MapTest read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!MapTest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `MapTest` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of MapTest given an JSON string + * + * @param jsonString JSON string + * @return An instance of MapTest + * @throws IOException if the JSON string is invalid with respect to MapTest + */ + public static MapTest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MapTest.class); + } + + /** + * Convert an instance of MapTest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index ae6e2282c9f9..3bd9f59adbb8 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -32,6 +32,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -46,6 +47,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * MixedPropertiesAndAdditionalPropertiesClass */ @@ -184,6 +187,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -198,6 +202,29 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to MixedPropertiesAndAdditionalPropertiesClass + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (MixedPropertiesAndAdditionalPropertiesClass.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in MixedPropertiesAndAdditionalPropertiesClass is not found in the empty JSON string", MixedPropertiesAndAdditionalPropertiesClass.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!MixedPropertiesAndAdditionalPropertiesClass.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MixedPropertiesAndAdditionalPropertiesClass` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -218,19 +245,33 @@ public void write(JsonWriter out, MixedPropertiesAndAdditionalPropertiesClass va @Override public MixedPropertiesAndAdditionalPropertiesClass read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!MixedPropertiesAndAdditionalPropertiesClass.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `MixedPropertiesAndAdditionalPropertiesClass` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of MixedPropertiesAndAdditionalPropertiesClass given an JSON string + * + * @param jsonString JSON string + * @return An instance of MixedPropertiesAndAdditionalPropertiesClass + * @throws IOException if the JSON string is invalid with respect to MixedPropertiesAndAdditionalPropertiesClass + */ + public static MixedPropertiesAndAdditionalPropertiesClass fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MixedPropertiesAndAdditionalPropertiesClass.class); + } + + /** + * Convert an instance of MixedPropertiesAndAdditionalPropertiesClass to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Model200Response.java index b9ec6bd483df..a6f1720f9e57 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Model200Response.java @@ -26,6 +26,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Model for testing model name starting with number */ @@ -142,6 +145,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -155,6 +159,29 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Model200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Model200Response.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Model200Response is not found in the empty JSON string", Model200Response.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Model200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Model200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -175,19 +202,33 @@ public void write(JsonWriter out, Model200Response value) throws IOException { @Override public Model200Response read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!Model200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Model200Response` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of Model200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of Model200Response + * @throws IOException if the JSON string is invalid with respect to Model200Response + */ + public static Model200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Model200Response.class); + } + + /** + * Convert an instance of Model200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelApiResponse.java index c9f691d64582..9d4ee4fbdf4b 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -26,6 +26,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * ModelApiResponse */ @@ -170,6 +173,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -184,6 +188,29 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ModelApiResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ModelApiResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ModelApiResponse is not found in the empty JSON string", ModelApiResponse.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ModelApiResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelApiResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -204,19 +231,33 @@ public void write(JsonWriter out, ModelApiResponse value) throws IOException { @Override public ModelApiResponse read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!ModelApiResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ModelApiResponse` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of ModelApiResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelApiResponse + * @throws IOException if the JSON string is invalid with respect to ModelApiResponse + */ + public static ModelApiResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ModelApiResponse.class); + } + + /** + * Convert an instance of ModelApiResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 000000000000..4b0921084274 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,204 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String SERIALIZED_NAME_SOURCE_U_R_I = "sourceURI"; + @SerializedName(SERIALIZED_NAME_SOURCE_U_R_I) + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + + public String getSourceURI() { + return sourceURI; + } + + + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sourceURI"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ModelFile + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ModelFile.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ModelFile is not found in the empty JSON string", ModelFile.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ModelFile.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelFile` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ModelFile.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ModelFile' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ModelFile.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ModelFile value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ModelFile read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ModelFile given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelFile + * @throws IOException if the JSON string is invalid with respect to ModelFile + */ + public static ModelFile fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ModelFile.class); + } + + /** + * Convert an instance of ModelFile to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelList.java similarity index 50% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java rename to samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelList.java index 9b7eb55c7484..cffa7fb4f941 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelList.java @@ -23,11 +23,10 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -42,73 +41,40 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** - * FileSchemaTestClass + * ModelList */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FileSchemaTestClass { - public static final String SERIALIZED_NAME_FILE = "file"; - @SerializedName(SERIALIZED_NAME_FILE) - private java.io.File file; - - public static final String SERIALIZED_NAME_FILES = "files"; - @SerializedName(SERIALIZED_NAME_FILES) - private List files = null; +public class ModelList { + public static final String SERIALIZED_NAME_123LIST = "123-list"; + @SerializedName(SERIALIZED_NAME_123LIST) + private String _123list; - public FileSchemaTestClass() { + public ModelList() { } - public FileSchemaTestClass file(java.io.File file) { + public ModelList _123list(String _123list) { - this.file = file; + this._123list = _123list; return this; } /** - * Get file - * @return file + * Get _123list + * @return _123list **/ @javax.annotation.Nullable @ApiModelProperty(value = "") - public java.io.File getFile() { - return file; - } - - - public void setFile(java.io.File file) { - this.file = file; + public String get123list() { + return _123list; } - public FileSchemaTestClass files(List files) { - - this.files = files; - return this; - } - - public FileSchemaTestClass addFilesItem(java.io.File filesItem) { - if (this.files == null) { - this.files = new ArrayList(); - } - this.files.add(filesItem); - return this; - } - - /** - * Get files - * @return files - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public List getFiles() { - return files; - } - - - public void setFiles(List files) { - this.files = files; + public void set123list(String _123list) { + this._123list = _123list; } @@ -120,22 +86,20 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; - return Objects.equals(this.file, fileSchemaTestClass.file) && - Objects.equals(this.files, fileSchemaTestClass.files); + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); } @Override public int hashCode() { - return Objects.hash(file, files); + return Objects.hash(_123list); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class FileSchemaTestClass {\n"); - sb.append(" file: ").append(toIndentedString(file)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); sb.append("}"); return sb.toString(); } @@ -151,52 +115,89 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("file"); - openapiFields.add("files"); + openapiFields.add("123-list"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ModelList + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ModelList.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ModelList is not found in the empty JSON string", ModelList.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ModelList.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelList` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!FileSchemaTestClass.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FileSchemaTestClass' and its subtypes + if (!ModelList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ModelList' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FileSchemaTestClass.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ModelList.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, FileSchemaTestClass value) throws IOException { + public void write(JsonWriter out, ModelList value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public FileSchemaTestClass read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!FileSchemaTestClass.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `FileSchemaTestClass` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + public ModelList read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of ModelList given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelList + * @throws IOException if the JSON string is invalid with respect to ModelList + */ + public static ModelList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ModelList.class); + } + + /** + * Convert an instance of ModelList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelReturn.java index 64aadfb6a824..09a6be5b714a 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -26,6 +26,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Model for testing reserved words */ @@ -113,6 +116,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -125,6 +129,29 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ModelReturn + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ModelReturn.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ModelReturn is not found in the empty JSON string", ModelReturn.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ModelReturn.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelReturn` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -145,19 +172,33 @@ public void write(JsonWriter out, ModelReturn value) throws IOException { @Override public ModelReturn read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!ModelReturn.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ModelReturn` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of ModelReturn given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelReturn + * @throws IOException if the JSON string is invalid with respect to ModelReturn + */ + public static ModelReturn fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ModelReturn.class); + } + + /** + * Convert an instance of ModelReturn to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Name.java index 528c159a8f37..a9f5ca0e1508 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Name.java @@ -26,6 +26,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Model for testing model name same as property name */ @@ -192,6 +195,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -208,6 +212,36 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("name"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Name + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Name.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Name is not found in the empty JSON string", Name.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Name.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Name` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Name.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -228,26 +262,33 @@ public void write(JsonWriter out, Name value) throws IOException { @Override public Name read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!Name.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Name` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Name.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of Name given an JSON string + * + * @param jsonString JSON string + * @return An instance of Name + * @throws IOException if the JSON string is invalid with respect to Name + */ + public static Name fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Name.class); + } + + /** + * Convert an instance of Name to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableClass.java index 5aa141fee0a6..cd29b3cb2ee2 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableClass.java @@ -34,6 +34,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -48,6 +49,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * NullableClass */ @@ -500,6 +503,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -523,6 +527,29 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NullableClass + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NullableClass.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NullableClass is not found in the empty JSON string", NullableClass.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NullableClass.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NullableClass` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -543,19 +570,33 @@ public void write(JsonWriter out, NullableClass value) throws IOException { @Override public NullableClass read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!NullableClass.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `NullableClass` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of NullableClass given an JSON string + * + * @param jsonString JSON string + * @return An instance of NullableClass + * @throws IOException if the JSON string is invalid with respect to NullableClass + */ + public static NullableClass fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NullableClass.class); + } + + /** + * Convert an instance of NullableClass to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java index f2946ec60ecf..c5bb74f006ad 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java @@ -105,10 +105,13 @@ public NullableShape read(JsonReader in) throws IOException { JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); int match = 0; + TypeAdapter actualAdapter = elementAdapter; // deserialize Quadrilateral try { - deserialized = adapterQuadrilateral.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + Quadrilateral.validateJsonObject(jsonObject); + actualAdapter = adapterQuadrilateral; match++; log.log(Level.FINER, "Input data matches schema 'Quadrilateral'"); } catch (Exception e) { @@ -118,7 +121,9 @@ public NullableShape read(JsonReader in) throws IOException { // deserialize Triangle try { - deserialized = adapterTriangle.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + Triangle.validateJsonObject(jsonObject); + actualAdapter = adapterTriangle; match++; log.log(Level.FINER, "Input data matches schema 'Triangle'"); } catch (Exception e) { @@ -128,7 +133,7 @@ public NullableShape read(JsonReader in) throws IOException { if (match == 1) { NullableShape ret = new NullableShape(); - ret.setActualInstance(deserialized); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); return ret; } @@ -228,5 +233,53 @@ public Triangle getTriangle() throws ClassCastException { return (Triangle)super.getActualInstance(); } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NullableShape + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + // validate the json string with Quadrilateral + try { + Quadrilateral.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + // validate the json string with Triangle + try { + Triangle.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for NullableShape with oneOf schemas: Quadrilateral, Triangle. %d class(es) match the result, expected 1. JSON: %s", validCount, jsonObj.toString())); + } + } + + /** + * Create an instance of NullableShape given an JSON string + * + * @param jsonString JSON string + * @return An instance of NullableShape + * @throws IOException if the JSON string is invalid with respect to NullableShape + */ + public static NullableShape fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NullableShape.class); + } + + /** + * Convert an instance of NullableShape to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NumberOnly.java index 7dc78d63d078..180a6db89aac 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -27,6 +27,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -41,6 +42,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * NumberOnly */ @@ -113,6 +116,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -125,6 +129,29 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NumberOnly + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NumberOnly.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NumberOnly is not found in the empty JSON string", NumberOnly.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NumberOnly.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NumberOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -145,19 +172,33 @@ public void write(JsonWriter out, NumberOnly value) throws IOException { @Override public NumberOnly read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!NumberOnly.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `NumberOnly` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of NumberOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of NumberOnly + * @throws IOException if the JSON string is invalid with respect to NumberOnly + */ + public static NumberOnly fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NumberOnly.class); + } + + /** + * Convert an instance of NumberOnly to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index 654a4415afb5..773a079fe4fa 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -30,6 +30,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -44,6 +45,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * ObjectWithDeprecatedFields */ @@ -217,6 +220,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -232,6 +236,33 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ObjectWithDeprecatedFields + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ObjectWithDeprecatedFields.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ObjectWithDeprecatedFields is not found in the empty JSON string", ObjectWithDeprecatedFields.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ObjectWithDeprecatedFields.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ObjectWithDeprecatedFields` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `deprecatedRef` + if (jsonObj.getAsJsonObject("deprecatedRef") != null) { + DeprecatedObject.validateJsonObject(jsonObj.getAsJsonObject("deprecatedRef")); + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -252,19 +283,33 @@ public void write(JsonWriter out, ObjectWithDeprecatedFields value) throws IOExc @Override public ObjectWithDeprecatedFields read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!ObjectWithDeprecatedFields.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ObjectWithDeprecatedFields` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of ObjectWithDeprecatedFields given an JSON string + * + * @param jsonString JSON string + * @return An instance of ObjectWithDeprecatedFields + * @throws IOException if the JSON string is invalid with respect to ObjectWithDeprecatedFields + */ + public static ObjectWithDeprecatedFields fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ObjectWithDeprecatedFields.class); + } + + /** + * Convert an instance of ObjectWithDeprecatedFields to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Order.java index 531e45320f08..82d8a256c0b1 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Order.java @@ -27,6 +27,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -41,6 +42,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Order */ @@ -307,6 +310,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -324,6 +328,29 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Order + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Order.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Order is not found in the empty JSON string", Order.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Order.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Order` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -344,19 +371,33 @@ public void write(JsonWriter out, Order value) throws IOException { @Override public Order read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!Order.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Order` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of Order given an JSON string + * + * @param jsonString JSON string + * @return An instance of Order + * @throws IOException if the JSON string is invalid with respect to Order + */ + public static Order fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Order.class); + } + + /** + * Convert an instance of Order to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterComposite.java index c0f8c964ff91..e86d5bc5ff5e 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -27,6 +27,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -41,6 +42,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * OuterComposite */ @@ -171,6 +174,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -185,6 +189,29 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to OuterComposite + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (OuterComposite.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in OuterComposite is not found in the empty JSON string", OuterComposite.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!OuterComposite.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OuterComposite` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -205,19 +232,33 @@ public void write(JsonWriter out, OuterComposite value) throws IOException { @Override public OuterComposite read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!OuterComposite.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `OuterComposite` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of OuterComposite given an JSON string + * + * @param jsonString JSON string + * @return An instance of OuterComposite + * @throws IOException if the JSON string is invalid with respect to OuterComposite + */ + public static OuterComposite fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OuterComposite.class); + } + + /** + * Convert an instance of OuterComposite to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ParentPet.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ParentPet.java index f96071be437a..392debad35f2 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ParentPet.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ParentPet.java @@ -27,6 +27,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -41,6 +42,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * ParentPet */ @@ -86,6 +89,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -99,6 +103,36 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("pet_type"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ParentPet + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ParentPet.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ParentPet is not found in the empty JSON string", ParentPet.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ParentPet.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ParentPet` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ParentPet.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -119,26 +153,33 @@ public void write(JsonWriter out, ParentPet value) throws IOException { @Override public ParentPet read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!ParentPet.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ParentPet` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ParentPet.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of ParentPet given an JSON string + * + * @param jsonString JSON string + * @return An instance of ParentPet + * @throws IOException if the JSON string is invalid with respect to ParentPet + */ + public static ParentPet fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ParentPet.class); + } + + /** + * Convert an instance of ParentPet to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pet.java index 5d0065de40dd..5d2d5688cb3c 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pet.java @@ -30,6 +30,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -44,6 +45,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Pet */ @@ -323,6 +326,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -342,6 +346,47 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("photoUrls"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Pet + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Pet.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Pet is not found in the empty JSON string", Pet.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Pet.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Pet` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Pet.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `category` + if (jsonObj.getAsJsonObject("category") != null) { + Category.validateJsonObject(jsonObj.getAsJsonObject("category")); + } + JsonArray jsonArraytags = jsonObj.getAsJsonArray("tags"); + // validate the optional field `tags` (array) + if (jsonArraytags != null) { + for (int i = 0; i < jsonArraytags.size(); i++) { + Tag.validateJsonObject(jsonArraytags.get(i).getAsJsonObject()); + }; + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -362,26 +407,33 @@ public void write(JsonWriter out, Pet value) throws IOException { @Override public Pet read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!Pet.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Pet` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Pet.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of Pet given an JSON string + * + * @param jsonString JSON string + * @return An instance of Pet + * @throws IOException if the JSON string is invalid with respect to Pet + */ + public static Pet fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Pet.class); + } + + /** + * Convert an instance of Pet to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/PetWithRequiredTags.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/PetWithRequiredTags.java new file mode 100644 index 000000000000..c7c647842d31 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/PetWithRequiredTags.java @@ -0,0 +1,437 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.Category; +import org.openapitools.client.model.Tag; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * PetWithRequiredTags + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PetWithRequiredTags { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private Long id; + + public static final String SERIALIZED_NAME_CATEGORY = "category"; + @SerializedName(SERIALIZED_NAME_CATEGORY) + private Category category; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_PHOTO_URLS = "photoUrls"; + @SerializedName(SERIALIZED_NAME_PHOTO_URLS) + private List photoUrls = new ArrayList(); + + public static final String SERIALIZED_NAME_TAGS = "tags"; + @SerializedName(SERIALIZED_NAME_TAGS) + private List tags = new ArrayList(); + + /** + * pet status in the store + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + AVAILABLE("available"), + + PENDING("pending"), + + SOLD("sold"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public PetWithRequiredTags() { + } + + public PetWithRequiredTags id(Long id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Long getId() { + return id; + } + + + public void setId(Long id) { + this.id = id; + } + + + public PetWithRequiredTags category(Category category) { + + this.category = category; + return this; + } + + /** + * Get category + * @return category + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Category getCategory() { + return category; + } + + + public void setCategory(Category category) { + this.category = category; + } + + + public PetWithRequiredTags name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nonnull + @ApiModelProperty(example = "doggie", required = true, value = "") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public PetWithRequiredTags photoUrls(List photoUrls) { + + this.photoUrls = photoUrls; + return this; + } + + public PetWithRequiredTags addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get photoUrls + * @return photoUrls + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public List getPhotoUrls() { + return photoUrls; + } + + + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + + public PetWithRequiredTags tags(List tags) { + + this.tags = tags; + return this; + } + + public PetWithRequiredTags addTagsItem(Tag tagsItem) { + this.tags.add(tagsItem); + return this; + } + + /** + * Get tags + * @return tags + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public List getTags() { + return tags; + } + + + public void setTags(List tags) { + this.tags = tags; + } + + + public PetWithRequiredTags status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * pet status in the store + * @return status + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "pet status in the store") + + public StatusEnum getStatus() { + return status; + } + + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PetWithRequiredTags petWithRequiredTags = (PetWithRequiredTags) o; + return Objects.equals(this.id, petWithRequiredTags.id) && + Objects.equals(this.category, petWithRequiredTags.category) && + Objects.equals(this.name, petWithRequiredTags.name) && + Objects.equals(this.photoUrls, petWithRequiredTags.photoUrls) && + Objects.equals(this.tags, petWithRequiredTags.tags) && + Objects.equals(this.status, petWithRequiredTags.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, photoUrls, tags, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PetWithRequiredTags {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("category"); + openapiFields.add("name"); + openapiFields.add("photoUrls"); + openapiFields.add("tags"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("photoUrls"); + openapiRequiredFields.add("tags"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PetWithRequiredTags + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (PetWithRequiredTags.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in PetWithRequiredTags is not found in the empty JSON string", PetWithRequiredTags.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PetWithRequiredTags.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PetWithRequiredTags` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PetWithRequiredTags.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `category` + if (jsonObj.getAsJsonObject("category") != null) { + Category.validateJsonObject(jsonObj.getAsJsonObject("category")); + } + JsonArray jsonArraytags = jsonObj.getAsJsonArray("tags"); + // validate the optional field `tags` (array) + if (jsonArraytags != null) { + for (int i = 0; i < jsonArraytags.size(); i++) { + Tag.validateJsonObject(jsonArraytags.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PetWithRequiredTags.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PetWithRequiredTags' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PetWithRequiredTags.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PetWithRequiredTags value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PetWithRequiredTags read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PetWithRequiredTags given an JSON string + * + * @param jsonString JSON string + * @return An instance of PetWithRequiredTags + * @throws IOException if the JSON string is invalid with respect to PetWithRequiredTags + */ + public static PetWithRequiredTags fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PetWithRequiredTags.class); + } + + /** + * Convert an instance of PetWithRequiredTags to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java index 54982ba3f8ef..7523f9b91672 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java @@ -105,10 +105,13 @@ public Pig read(JsonReader in) throws IOException { JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); int match = 0; + TypeAdapter actualAdapter = elementAdapter; // deserialize BasquePig try { - deserialized = adapterBasquePig.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + BasquePig.validateJsonObject(jsonObject); + actualAdapter = adapterBasquePig; match++; log.log(Level.FINER, "Input data matches schema 'BasquePig'"); } catch (Exception e) { @@ -118,7 +121,9 @@ public Pig read(JsonReader in) throws IOException { // deserialize DanishPig try { - deserialized = adapterDanishPig.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + DanishPig.validateJsonObject(jsonObject); + actualAdapter = adapterDanishPig; match++; log.log(Level.FINER, "Input data matches schema 'DanishPig'"); } catch (Exception e) { @@ -128,7 +133,7 @@ public Pig read(JsonReader in) throws IOException { if (match == 1) { Pig ret = new Pig(); - ret.setActualInstance(deserialized); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); return ret; } @@ -223,5 +228,53 @@ public DanishPig getDanishPig() throws ClassCastException { return (DanishPig)super.getActualInstance(); } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Pig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + // validate the json string with BasquePig + try { + BasquePig.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + // validate the json string with DanishPig + try { + DanishPig.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for Pig with oneOf schemas: BasquePig, DanishPig. %d class(es) match the result, expected 1. JSON: %s", validCount, jsonObj.toString())); + } + } + + /** + * Create an instance of Pig given an JSON string + * + * @param jsonString JSON string + * @return An instance of Pig + * @throws IOException if the JSON string is invalid with respect to Pig + */ + public static Pig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Pig.class); + } + + /** + * Convert an instance of Pig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java index aad102d30574..f6565d05cdf9 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java @@ -105,10 +105,13 @@ public Quadrilateral read(JsonReader in) throws IOException { JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); int match = 0; + TypeAdapter actualAdapter = elementAdapter; // deserialize ComplexQuadrilateral try { - deserialized = adapterComplexQuadrilateral.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + ComplexQuadrilateral.validateJsonObject(jsonObject); + actualAdapter = adapterComplexQuadrilateral; match++; log.log(Level.FINER, "Input data matches schema 'ComplexQuadrilateral'"); } catch (Exception e) { @@ -118,7 +121,9 @@ public Quadrilateral read(JsonReader in) throws IOException { // deserialize SimpleQuadrilateral try { - deserialized = adapterSimpleQuadrilateral.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + SimpleQuadrilateral.validateJsonObject(jsonObject); + actualAdapter = adapterSimpleQuadrilateral; match++; log.log(Level.FINER, "Input data matches schema 'SimpleQuadrilateral'"); } catch (Exception e) { @@ -128,7 +133,7 @@ public Quadrilateral read(JsonReader in) throws IOException { if (match == 1) { Quadrilateral ret = new Quadrilateral(); - ret.setActualInstance(deserialized); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); return ret; } @@ -223,5 +228,53 @@ public SimpleQuadrilateral getSimpleQuadrilateral() throws ClassCastException { return (SimpleQuadrilateral)super.getActualInstance(); } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Quadrilateral + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + // validate the json string with ComplexQuadrilateral + try { + ComplexQuadrilateral.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + // validate the json string with SimpleQuadrilateral + try { + SimpleQuadrilateral.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for Quadrilateral with oneOf schemas: ComplexQuadrilateral, SimpleQuadrilateral. %d class(es) match the result, expected 1. JSON: %s", validCount, jsonObj.toString())); + } + } + + /** + * Create an instance of Quadrilateral given an JSON string + * + * @param jsonString JSON string + * @return An instance of Quadrilateral + * @throws IOException if the JSON string is invalid with respect to Quadrilateral + */ + public static Quadrilateral fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Quadrilateral.class); + } + + /** + * Convert an instance of Quadrilateral to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java index e6fc7e3d3484..2c5e5ff914d9 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java @@ -26,6 +26,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * QuadrilateralInterface */ @@ -112,6 +115,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -125,6 +129,36 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("quadrilateralType"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to QuadrilateralInterface + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (QuadrilateralInterface.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in QuadrilateralInterface is not found in the empty JSON string", QuadrilateralInterface.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!QuadrilateralInterface.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `QuadrilateralInterface` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : QuadrilateralInterface.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -145,26 +179,33 @@ public void write(JsonWriter out, QuadrilateralInterface value) throws IOExcepti @Override public QuadrilateralInterface read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!QuadrilateralInterface.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `QuadrilateralInterface` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : QuadrilateralInterface.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of QuadrilateralInterface given an JSON string + * + * @param jsonString JSON string + * @return An instance of QuadrilateralInterface + * @throws IOException if the JSON string is invalid with respect to QuadrilateralInterface + */ + public static QuadrilateralInterface fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, QuadrilateralInterface.class); + } + + /** + * Convert an instance of QuadrilateralInterface to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index d842df280faf..14b28a610665 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -26,6 +26,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * ReadOnlyFirst */ @@ -140,6 +143,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -153,6 +157,29 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ReadOnlyFirst + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ReadOnlyFirst.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ReadOnlyFirst is not found in the empty JSON string", ReadOnlyFirst.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ReadOnlyFirst.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ReadOnlyFirst` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -173,19 +200,33 @@ public void write(JsonWriter out, ReadOnlyFirst value) throws IOException { @Override public ReadOnlyFirst read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!ReadOnlyFirst.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ReadOnlyFirst` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of ReadOnlyFirst given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReadOnlyFirst + * @throws IOException if the JSON string is invalid with respect to ReadOnlyFirst + */ + public static ReadOnlyFirst fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReadOnlyFirst.class); + } + + /** + * Convert an instance of ReadOnlyFirst to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ScaleneTriangle.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ScaleneTriangle.java index f7dec655276a..0c0de34386fc 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ScaleneTriangle.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ScaleneTriangle.java @@ -28,6 +28,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -42,6 +43,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * ScaleneTriangle */ @@ -143,6 +146,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -158,6 +162,36 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("triangleType"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ScaleneTriangle + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ScaleneTriangle.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ScaleneTriangle is not found in the empty JSON string", ScaleneTriangle.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ScaleneTriangle.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ScaleneTriangle` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ScaleneTriangle.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -178,26 +212,33 @@ public void write(JsonWriter out, ScaleneTriangle value) throws IOException { @Override public ScaleneTriangle read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!ScaleneTriangle.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ScaleneTriangle` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ScaleneTriangle.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of ScaleneTriangle given an JSON string + * + * @param jsonString JSON string + * @return An instance of ScaleneTriangle + * @throws IOException if the JSON string is invalid with respect to ScaleneTriangle + */ + public static ScaleneTriangle fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ScaleneTriangle.class); + } + + /** + * Convert an instance of ScaleneTriangle to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java index 23b4c43b002c..dc6334a97822 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java @@ -105,10 +105,13 @@ public Shape read(JsonReader in) throws IOException { JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); int match = 0; + TypeAdapter actualAdapter = elementAdapter; // deserialize Quadrilateral try { - deserialized = adapterQuadrilateral.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + Quadrilateral.validateJsonObject(jsonObject); + actualAdapter = adapterQuadrilateral; match++; log.log(Level.FINER, "Input data matches schema 'Quadrilateral'"); } catch (Exception e) { @@ -118,7 +121,9 @@ public Shape read(JsonReader in) throws IOException { // deserialize Triangle try { - deserialized = adapterTriangle.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + Triangle.validateJsonObject(jsonObject); + actualAdapter = adapterTriangle; match++; log.log(Level.FINER, "Input data matches schema 'Triangle'"); } catch (Exception e) { @@ -128,7 +133,7 @@ public Shape read(JsonReader in) throws IOException { if (match == 1) { Shape ret = new Shape(); - ret.setActualInstance(deserialized); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); return ret; } @@ -223,5 +228,53 @@ public Triangle getTriangle() throws ClassCastException { return (Triangle)super.getActualInstance(); } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Shape + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + // validate the json string with Quadrilateral + try { + Quadrilateral.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + // validate the json string with Triangle + try { + Triangle.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for Shape with oneOf schemas: Quadrilateral, Triangle. %d class(es) match the result, expected 1. JSON: %s", validCount, jsonObj.toString())); + } + } + + /** + * Create an instance of Shape given an JSON string + * + * @param jsonString JSON string + * @return An instance of Shape + * @throws IOException if the JSON string is invalid with respect to Shape + */ + public static Shape fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Shape.class); + } + + /** + * Convert an instance of Shape to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeInterface.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeInterface.java index 628c2f7af2b2..3aa6fadf9ef2 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeInterface.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeInterface.java @@ -26,6 +26,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * ShapeInterface */ @@ -112,6 +115,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -125,6 +129,36 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("shapeType"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ShapeInterface + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ShapeInterface.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ShapeInterface is not found in the empty JSON string", ShapeInterface.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ShapeInterface.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ShapeInterface` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ShapeInterface.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -145,26 +179,33 @@ public void write(JsonWriter out, ShapeInterface value) throws IOException { @Override public ShapeInterface read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!ShapeInterface.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ShapeInterface` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ShapeInterface.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of ShapeInterface given an JSON string + * + * @param jsonString JSON string + * @return An instance of ShapeInterface + * @throws IOException if the JSON string is invalid with respect to ShapeInterface + */ + public static ShapeInterface fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ShapeInterface.class); + } + + /** + * Convert an instance of ShapeInterface to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java index 871b88812982..b48a29b873b7 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java @@ -105,10 +105,13 @@ public ShapeOrNull read(JsonReader in) throws IOException { JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); int match = 0; + TypeAdapter actualAdapter = elementAdapter; // deserialize Quadrilateral try { - deserialized = adapterQuadrilateral.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + Quadrilateral.validateJsonObject(jsonObject); + actualAdapter = adapterQuadrilateral; match++; log.log(Level.FINER, "Input data matches schema 'Quadrilateral'"); } catch (Exception e) { @@ -118,7 +121,9 @@ public ShapeOrNull read(JsonReader in) throws IOException { // deserialize Triangle try { - deserialized = adapterTriangle.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + Triangle.validateJsonObject(jsonObject); + actualAdapter = adapterTriangle; match++; log.log(Level.FINER, "Input data matches schema 'Triangle'"); } catch (Exception e) { @@ -128,7 +133,7 @@ public ShapeOrNull read(JsonReader in) throws IOException { if (match == 1) { ShapeOrNull ret = new ShapeOrNull(); - ret.setActualInstance(deserialized); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); return ret; } @@ -228,5 +233,53 @@ public Triangle getTriangle() throws ClassCastException { return (Triangle)super.getActualInstance(); } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ShapeOrNull + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + // validate the json string with Quadrilateral + try { + Quadrilateral.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + // validate the json string with Triangle + try { + Triangle.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for ShapeOrNull with oneOf schemas: Quadrilateral, Triangle. %d class(es) match the result, expected 1. JSON: %s", validCount, jsonObj.toString())); + } + } + + /** + * Create an instance of ShapeOrNull given an JSON string + * + * @param jsonString JSON string + * @return An instance of ShapeOrNull + * @throws IOException if the JSON string is invalid with respect to ShapeOrNull + */ + public static ShapeOrNull fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ShapeOrNull.class); + } + + /** + * Convert an instance of ShapeOrNull to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java index 064c5f0996ce..9a87c62f5965 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java @@ -28,6 +28,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -42,6 +43,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * SimpleQuadrilateral */ @@ -143,6 +146,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -158,6 +162,36 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("quadrilateralType"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SimpleQuadrilateral + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (SimpleQuadrilateral.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in SimpleQuadrilateral is not found in the empty JSON string", SimpleQuadrilateral.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SimpleQuadrilateral.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SimpleQuadrilateral` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SimpleQuadrilateral.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -178,26 +212,33 @@ public void write(JsonWriter out, SimpleQuadrilateral value) throws IOException @Override public SimpleQuadrilateral read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!SimpleQuadrilateral.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `SimpleQuadrilateral` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : SimpleQuadrilateral.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of SimpleQuadrilateral given an JSON string + * + * @param jsonString JSON string + * @return An instance of SimpleQuadrilateral + * @throws IOException if the JSON string is invalid with respect to SimpleQuadrilateral + */ + public static SimpleQuadrilateral fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SimpleQuadrilateral.class); + } + + /** + * Convert an instance of SimpleQuadrilateral to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/SpecialModelName.java index dfdbc850f430..9b26d894f051 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -26,6 +26,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * SpecialModelName */ @@ -141,6 +144,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -154,6 +158,29 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SpecialModelName + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (SpecialModelName.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in SpecialModelName is not found in the empty JSON string", SpecialModelName.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SpecialModelName.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SpecialModelName` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -174,19 +201,33 @@ public void write(JsonWriter out, SpecialModelName value) throws IOException { @Override public SpecialModelName read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!SpecialModelName.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `SpecialModelName` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of SpecialModelName given an JSON string + * + * @param jsonString JSON string + * @return An instance of SpecialModelName + * @throws IOException if the JSON string is invalid with respect to SpecialModelName + */ + public static SpecialModelName fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SpecialModelName.class); + } + + /** + * Convert an instance of SpecialModelName to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Tag.java index 78ea45ac8617..0aae4c29af96 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Tag.java @@ -26,6 +26,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Tag */ @@ -141,6 +144,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -154,6 +158,29 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Tag + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Tag.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Tag is not found in the empty JSON string", Tag.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Tag.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Tag` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -174,19 +201,33 @@ public void write(JsonWriter out, Tag value) throws IOException { @Override public Tag read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!Tag.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Tag` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of Tag given an JSON string + * + * @param jsonString JSON string + * @return An instance of Tag + * @throws IOException if the JSON string is invalid with respect to Tag + */ + public static Tag fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Tag.class); + } + + /** + * Convert an instance of Tag to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java index 9311228bf044..0bbf11f06445 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java @@ -114,10 +114,13 @@ public Triangle read(JsonReader in) throws IOException { JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); int match = 0; + TypeAdapter actualAdapter = elementAdapter; // deserialize EquilateralTriangle try { - deserialized = adapterEquilateralTriangle.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + EquilateralTriangle.validateJsonObject(jsonObject); + actualAdapter = adapterEquilateralTriangle; match++; log.log(Level.FINER, "Input data matches schema 'EquilateralTriangle'"); } catch (Exception e) { @@ -127,7 +130,9 @@ public Triangle read(JsonReader in) throws IOException { // deserialize IsoscelesTriangle try { - deserialized = adapterIsoscelesTriangle.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + IsoscelesTriangle.validateJsonObject(jsonObject); + actualAdapter = adapterIsoscelesTriangle; match++; log.log(Level.FINER, "Input data matches schema 'IsoscelesTriangle'"); } catch (Exception e) { @@ -137,7 +142,9 @@ public Triangle read(JsonReader in) throws IOException { // deserialize ScaleneTriangle try { - deserialized = adapterScaleneTriangle.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + ScaleneTriangle.validateJsonObject(jsonObject); + actualAdapter = adapterScaleneTriangle; match++; log.log(Level.FINER, "Input data matches schema 'ScaleneTriangle'"); } catch (Exception e) { @@ -147,7 +154,7 @@ public Triangle read(JsonReader in) throws IOException { if (match == 1) { Triangle ret = new Triangle(); - ret.setActualInstance(deserialized); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); return ret; } @@ -265,5 +272,60 @@ public ScaleneTriangle getScaleneTriangle() throws ClassCastException { return (ScaleneTriangle)super.getActualInstance(); } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Triangle + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + // validate the json string with EquilateralTriangle + try { + EquilateralTriangle.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + // validate the json string with IsoscelesTriangle + try { + IsoscelesTriangle.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + // validate the json string with ScaleneTriangle + try { + ScaleneTriangle.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for Triangle with oneOf schemas: EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle. %d class(es) match the result, expected 1. JSON: %s", validCount, jsonObj.toString())); + } + } + + /** + * Create an instance of Triangle given an JSON string + * + * @param jsonString JSON string + * @return An instance of Triangle + * @throws IOException if the JSON string is invalid with respect to Triangle + */ + public static Triangle fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Triangle.class); + } + + /** + * Convert an instance of Triangle to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/TriangleInterface.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/TriangleInterface.java index a03456d2a064..24615e15889b 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/TriangleInterface.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/TriangleInterface.java @@ -26,6 +26,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * TriangleInterface */ @@ -112,6 +115,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -125,6 +129,36 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("triangleType"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TriangleInterface + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (TriangleInterface.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in TriangleInterface is not found in the empty JSON string", TriangleInterface.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TriangleInterface.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TriangleInterface` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TriangleInterface.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -145,26 +179,33 @@ public void write(JsonWriter out, TriangleInterface value) throws IOException { @Override public TriangleInterface read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!TriangleInterface.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `TriangleInterface` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TriangleInterface.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of TriangleInterface given an JSON string + * + * @param jsonString JSON string + * @return An instance of TriangleInterface + * @throws IOException if the JSON string is invalid with respect to TriangleInterface + */ + public static TriangleInterface fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TriangleInterface.class); + } + + /** + * Convert an instance of TriangleInterface to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/User.java index 4f60e1ecd730..d1b54e47fe4e 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/User.java @@ -27,6 +27,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -41,6 +42,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * User */ @@ -443,6 +446,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -466,6 +470,29 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to User + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (User.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in User is not found in the empty JSON string", User.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!User.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `User` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -486,19 +513,33 @@ public void write(JsonWriter out, User value) throws IOException { @Override public User read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!User.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `User` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of User given an JSON string + * + * @param jsonString JSON string + * @return An instance of User + * @throws IOException if the JSON string is invalid with respect to User + */ + public static User fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, User.class); + } + + /** + * Convert an instance of User to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Whale.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Whale.java index c84faf2790bd..b7d11108b28f 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Whale.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Whale.java @@ -26,6 +26,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Whale */ @@ -170,6 +173,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -185,6 +189,36 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("className"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Whale + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Whale.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Whale is not found in the empty JSON string", Whale.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Whale.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Whale` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Whale.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -205,26 +239,33 @@ public void write(JsonWriter out, Whale value) throws IOException { @Override public Whale read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!Whale.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Whale` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Whale.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of Whale given an JSON string + * + * @param jsonString JSON string + * @return An instance of Whale + * @throws IOException if the JSON string is invalid with respect to Whale + */ + public static Whale fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Whale.class); + } + + /** + * Convert an instance of Whale to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Zebra.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Zebra.java index 7821c21caccf..260cde0f44b9 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Zebra.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Zebra.java @@ -28,6 +28,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -42,6 +43,8 @@ import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Zebra */ @@ -194,6 +197,7 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -208,6 +212,36 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("className"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Zebra + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Zebra.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Zebra is not found in the empty JSON string", Zebra.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Zebra.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Zebra` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Zebra.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -228,26 +262,33 @@ public void write(JsonWriter out, Zebra value) throws IOException { @Override public Zebra read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!Zebra.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Zebra` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Zebra.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of Zebra given an JSON string + * + * @param jsonString JSON string + * @return An instance of Zebra + * @throws IOException if the JSON string is invalid with respect to Zebra + */ + public static Zebra fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Zebra.class); + } + + /** + * Convert an instance of Zebra to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java index 6b631a5a9805..9d56087899b3 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java @@ -245,10 +245,46 @@ public void testCustomDeserializer() { assertEquals(t2.getId(), null); // with all required fields - String json3 = "{\"id\": 5847, \"name\":\"pet test 1\", \"photoUrls\": [\"https://a.com\", \"https://b.com\"]}"; // missing photoUrls (required field) + String json3 = "{\"id\": 5847, \"name\":\"pet test 1\", \"photoUrls\": [\"https://a.com\", \"https://b.com\"]}"; Pet t3 = gson.fromJson(json3, Pet.class); assertEquals(t3.getName(), "pet test 1"); assertEquals(t3.getId(), Long.valueOf(5847)); + + // with all required fields and tags (optional) + String json4 = "{\"id\": 5847, \"name\":\"pet test 1\", \"photoUrls\": [\"https://a.com\", \"https://b.com\"],\"tags\":[{\"id\":\"tag 123\"}]}"; + Pet t4 = gson.fromJson(json3, Pet.class); + assertEquals(t4.getName(), "pet test 1"); + assertEquals(t4.getId(), Long.valueOf(5847)); + + // test Tag + String json5 = "{\"unknown_field\": 543, \"id\":\"tag 123\"}"; + Exception exception5 = assertThrows(java.lang.IllegalArgumentException.class, () -> { + Tag t5 = gson.fromJson(json5, Tag.class); + }); + assertTrue(exception5.getMessage().contains("The field `unknown_field` in the JSON string is not defined in the `Tag` properties. JSON: {\"unknown_field\":543,\"id\":\"tag 123\"}")); + + // test Pet with invalid tags + String json6 = "{\"id\": 5847, \"name\":\"pet test 1\", \"photoUrls\": [\"https://a.com\", \"https://b.com\"],\"tags\":[{\"unknown_field\": 543, \"id\":\"tag 123\"}]}"; + Exception exception6 = assertThrows(java.lang.IllegalArgumentException.class, () -> { + Pet t6 = gson.fromJson(json6, Pet.class); + }); + assertTrue(exception6.getMessage().contains("The field `unknown_field` in the JSON string is not defined in the `Tag` properties. JSON: {\"unknown_field\":543,\"id\":\"tag 123\"}")); + + // test Pet with invalid tags (required) + String json7 = "{\"id\": 5847, \"name\":\"pet test 1\", \"photoUrls\": [\"https://a.com\", \"https://b.com\"],\"tags\":[{\"unknown_field\": 543, \"id\":\"tag 123\"}]}"; + Exception exception7 = assertThrows(java.lang.IllegalArgumentException.class, () -> { + PetWithRequiredTags t7 = gson.fromJson(json7, PetWithRequiredTags.class); + }); + assertTrue(exception7.getMessage().contains("The field `unknown_field` in the JSON string is not defined in the `Tag` properties. JSON: {\"unknown_field\":543,\"id\":\"tag 123\"}")); + + // test Pet with invalid tags (missing reqired) + String json8 = "{\"id\": 5847, \"name\":\"pet test 1\", \"photoUrls\": [\"https://a.com\", \"https://b.com\"]}"; + Exception exception8 = assertThrows(java.lang.IllegalArgumentException.class, () -> { + PetWithRequiredTags t8 = gson.fromJson(json8, PetWithRequiredTags.class); + }); + assertTrue(exception8.getMessage().contains("The required field `tags` is not found in the JSON string: {\"id\":5847,\"name\":\"pet test 1\",\"photoUrls\":[\"https://a.com\",\"https://b.com\"]}")); + + } /** Model tests for Pet */ @@ -306,7 +342,9 @@ public void testAnyOfSchemaWithoutDiscriminator() throws Exception { assertEquals(inst.getCultivar(), "golden delicious"); assertEquals(inst.getOrigin(), "japan"); assertEquals(json.getGson().toJson(inst), "{\"cultivar\":\"golden delicious\",\"origin\":\"japan\"}"); + assertEquals(inst.toJson(), "{\"cultivar\":\"golden delicious\",\"origin\":\"japan\"}"); assertEquals(json.getGson().toJson(o), "{\"cultivar\":\"golden delicious\",\"origin\":\"japan\"}"); + assertEquals(o.toJson(), "{\"cultivar\":\"golden delicious\",\"origin\":\"japan\"}"); String str2 = "{ \"origin_typo\": \"japan\" }"; // no match @@ -348,18 +386,32 @@ public void testOneOfSchemaWithoutDiscriminator() throws Exception { assertEquals(inst.getCultivar(), "golden delicious"); assertEquals(inst.getMealy(), false); assertEquals(json.getGson().toJson(inst), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); + assertEquals(inst.toJson(), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); assertEquals(json.getGson().toJson(o), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); + assertEquals(o.toJson(), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); AppleReq inst2 = o.getAppleReq(); assertEquals(inst2.getCultivar(), "golden delicious"); assertEquals(inst2.getMealy(), false); assertEquals(json.getGson().toJson(inst2), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); + assertEquals(inst2.toJson(), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); + + // test fromJson + FruitReq o3 = FruitReq.fromJson(str); + assertTrue(o3.getActualInstance() instanceof AppleReq); + AppleReq inst3 = (AppleReq) o3.getActualInstance(); + assertEquals(inst3.getCultivar(), "golden delicious"); + assertEquals(inst3.getMealy(), false); + assertEquals(json.getGson().toJson(inst3), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); + assertEquals(inst3.toJson(), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); + assertEquals(o3.toJson(), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); } { // test to ensure the oneOf object can be serialized to "null" correctly FruitReq o = new FruitReq(); assertEquals(o.getActualInstance(), null); assertEquals(json.getGson().toJson(o), "null"); + assertEquals(o.toJson(), "null"); assertEquals(json.getGson().toJson(null), "null"); } { diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/FakeApiTest.java index 54eb3e8e090f..471887d2611e 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -17,7 +17,6 @@ import java.math.BigDecimal; import org.openapitools.client.model.Client; import java.io.File; -import org.openapitools.client.model.FileSchemaTestClass; import org.openapitools.client.model.HealthCheckResult; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; @@ -129,21 +128,6 @@ public void getArrayOfEnumsTest() throws ApiException { // TODO: test validations } - /** - * - * - * For this test, the body for this request much reference a schema named `File`. - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void testBodyWithFileSchemaTest() throws ApiException { - FileSchemaTestClass fileSchemaTestClass = null; - api.testBodyWithFileSchema(fileSchemaTestClass); - // TODO: test validations - } - /** * * diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 000000000000..132012d4c387 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 000000000000..d3ed2075e9a4 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/PetWithRequiredTagsTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/PetWithRequiredTagsTest.java new file mode 100644 index 000000000000..4d78953915e2 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/PetWithRequiredTagsTest.java @@ -0,0 +1,95 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.Category; +import org.openapitools.client.model.Tag; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for PetWithRequiredTags + */ +public class PetWithRequiredTagsTest { + private final PetWithRequiredTags model = new PetWithRequiredTags(); + + /** + * Model tests for PetWithRequiredTags + */ + @Test + public void testPetWithRequiredTags() { + // TODO: test PetWithRequiredTags + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'category' + */ + @Test + public void categoryTest() { + // TODO: test category + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'photoUrls' + */ + @Test + public void photoUrlsTest() { + // TODO: test photoUrls + } + + /** + * Test the property 'tags' + */ + @Test + public void tagsTest() { + // TODO: test tags + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelFile.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelFile.md new file mode 100644 index 000000000000..37ad0cfd8e93 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelFile.md @@ -0,0 +1,18 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + +## Implemented Interfaces + +* Parcelable + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelList.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelList.md new file mode 100644 index 000000000000..232bbf2e0a8c --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelList.md @@ -0,0 +1,17 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + +## Implemented Interfaces + +* Parcelable + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 000000000000..99e3a6b454df --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,124 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import android.os.Parcelable; +import android.os.Parcel; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile implements Parcelable { + public static final String SERIALIZED_NAME_SOURCE_U_R_I = "sourceURI"; + @SerializedName(SERIALIZED_NAME_SOURCE_U_R_I) + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + + public String getSourceURI() { + return sourceURI; + } + + + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public void writeToParcel(Parcel out, int flags) { + out.writeValue(sourceURI); + } + + ModelFile(Parcel in) { + sourceURI = (String)in.readValue(null); + } + + public int describeContents() { + return 0; + } + + public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { + public ModelFile createFromParcel(Parcel in) { + return new ModelFile(in); + } + public ModelFile[] newArray(int size) { + return new ModelFile[size]; + } + }; +} + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 000000000000..3c03ba17da0a --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,123 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import android.os.Parcelable; +import android.os.Parcel; + +/** + * ModelList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList implements Parcelable { + public static final String SERIALIZED_NAME_123LIST = "123-list"; + @SerializedName(SERIALIZED_NAME_123LIST) + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String get123list() { + return _123list; + } + + + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public void writeToParcel(Parcel out, int flags) { + out.writeValue(_123list); + } + + ModelList(Parcel in) { + _123list = (String)in.readValue(null); + } + + public int describeContents() { + return 0; + } + + public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { + public ModelList createFromParcel(Parcel in) { + return new ModelList(in); + } + public ModelList[] newArray(int size) { + return new ModelList[size]; + } + }; +} + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 000000000000..132012d4c387 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 000000000000..d3ed2075e9a4 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/okhttp-gson/docs/ModelFile.md b/samples/client/petstore/java/okhttp-gson/docs/ModelFile.md new file mode 100644 index 000000000000..1282785e329d --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson/docs/ModelList.md b/samples/client/petstore/java/okhttp-gson/docs/ModelList.md new file mode 100644 index 000000000000..c838a6a72e4f --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 000000000000..111a748ceff8 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,101 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String SERIALIZED_NAME_SOURCE_U_R_I = "sourceURI"; + @SerializedName(SERIALIZED_NAME_SOURCE_U_R_I) + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + + public String getSourceURI() { + return sourceURI; + } + + + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 000000000000..2ba46fefd4fe --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,100 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * ModelList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String SERIALIZED_NAME_123LIST = "123-list"; + @SerializedName(SERIALIZED_NAME_123LIST) + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String get123list() { + return _123list; + } + + + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 000000000000..132012d4c387 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 000000000000..d3ed2075e9a4 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/rest-assured-jackson/docs/ModelFile.md b/samples/client/petstore/java/rest-assured-jackson/docs/ModelFile.md new file mode 100644 index 000000000000..1282785e329d --- /dev/null +++ b/samples/client/petstore/java/rest-assured-jackson/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/rest-assured-jackson/docs/ModelList.md b/samples/client/petstore/java/rest-assured-jackson/docs/ModelList.md new file mode 100644 index 000000000000..c838a6a72e4f --- /dev/null +++ b/samples/client/petstore/java/rest-assured-jackson/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 000000000000..6197afe89186 --- /dev/null +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,112 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@JsonTypeName("File") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 000000000000..b68373d3d8a5 --- /dev/null +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,111 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@JsonTypeName("List") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 000000000000..5b3fde28d4b4 --- /dev/null +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 000000000000..36755ee2bd6a --- /dev/null +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/rest-assured/docs/ModelFile.md b/samples/client/petstore/java/rest-assured/docs/ModelFile.md new file mode 100644 index 000000000000..1282785e329d --- /dev/null +++ b/samples/client/petstore/java/rest-assured/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/rest-assured/docs/ModelList.md b/samples/client/petstore/java/rest-assured/docs/ModelList.md new file mode 100644 index 000000000000..c838a6a72e4f --- /dev/null +++ b/samples/client/petstore/java/rest-assured/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 000000000000..44f900da9832 --- /dev/null +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,104 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String SERIALIZED_NAME_SOURCE_U_R_I = "sourceURI"; + @SerializedName(SERIALIZED_NAME_SOURCE_U_R_I) + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + + public String getSourceURI() { + return sourceURI; + } + + + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 000000000000..d3a2c8150740 --- /dev/null +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,103 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; + +/** + * ModelList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String SERIALIZED_NAME_123LIST = "123-list"; + @SerializedName(SERIALIZED_NAME_123LIST) + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String get123list() { + return _123list; + } + + + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 000000000000..132012d4c387 --- /dev/null +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 000000000000..d3ed2075e9a4 --- /dev/null +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/resteasy/docs/ModelFile.md b/samples/client/petstore/java/resteasy/docs/ModelFile.md new file mode 100644 index 000000000000..1282785e329d --- /dev/null +++ b/samples/client/petstore/java/resteasy/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/resteasy/docs/ModelList.md b/samples/client/petstore/java/resteasy/docs/ModelList.md new file mode 100644 index 000000000000..c838a6a72e4f --- /dev/null +++ b/samples/client/petstore/java/resteasy/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 000000000000..864728364139 --- /dev/null +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,109 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@JsonTypeName("File") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 000000000000..82abfba9e39d --- /dev/null +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,108 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@JsonTypeName("List") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 000000000000..5b3fde28d4b4 --- /dev/null +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 000000000000..36755ee2bd6a --- /dev/null +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/ModelFile.md b/samples/client/petstore/java/resttemplate-withXml/docs/ModelFile.md new file mode 100644 index 000000000000..1282785e329d --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/ModelList.md b/samples/client/petstore/java/resttemplate-withXml/docs/ModelList.md new file mode 100644 index 000000000000..c838a6a72e4f --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 000000000000..c87bc9199422 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,117 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@JsonTypeName("File") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@XmlRootElement(name = "ModelFile") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ModelFile") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + @XmlElement(name = "sourceURI") + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "sourceURI") + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "sourceURI") + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 000000000000..32aadcded838 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,116 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@JsonTypeName("List") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@XmlRootElement(name = "ModelList") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ModelList") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + @XmlElement(name = "123-list") + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "123-list") + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "123-list") + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 000000000000..5b3fde28d4b4 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 000000000000..36755ee2bd6a --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/resttemplate/docs/ModelFile.md b/samples/client/petstore/java/resttemplate/docs/ModelFile.md new file mode 100644 index 000000000000..1282785e329d --- /dev/null +++ b/samples/client/petstore/java/resttemplate/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/resttemplate/docs/ModelList.md b/samples/client/petstore/java/resttemplate/docs/ModelList.md new file mode 100644 index 000000000000..c838a6a72e4f --- /dev/null +++ b/samples/client/petstore/java/resttemplate/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 000000000000..864728364139 --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,109 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@JsonTypeName("File") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 000000000000..82abfba9e39d --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,108 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@JsonTypeName("List") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 000000000000..5b3fde28d4b4 --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 000000000000..36755ee2bd6a --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/retrofit2-play26/docs/ModelFile.md b/samples/client/petstore/java/retrofit2-play26/docs/ModelFile.md new file mode 100644 index 000000000000..1282785e329d --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play26/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2-play26/docs/ModelList.md b/samples/client/petstore/java/retrofit2-play26/docs/ModelList.md new file mode 100644 index 000000000000..c838a6a72e4f --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play26/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 000000000000..42060439bffc --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,111 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@JsonTypeName("File") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 000000000000..6eb2c7833726 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,110 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@JsonTypeName("List") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 000000000000..5b3fde28d4b4 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 000000000000..36755ee2bd6a --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/retrofit2/docs/ModelFile.md b/samples/client/petstore/java/retrofit2/docs/ModelFile.md new file mode 100644 index 000000000000..1282785e329d --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2/docs/ModelList.md b/samples/client/petstore/java/retrofit2/docs/ModelList.md new file mode 100644 index 000000000000..c838a6a72e4f --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 000000000000..111a748ceff8 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,101 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String SERIALIZED_NAME_SOURCE_U_R_I = "sourceURI"; + @SerializedName(SERIALIZED_NAME_SOURCE_U_R_I) + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + + public String getSourceURI() { + return sourceURI; + } + + + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 000000000000..2ba46fefd4fe --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,100 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * ModelList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String SERIALIZED_NAME_123LIST = "123-list"; + @SerializedName(SERIALIZED_NAME_123LIST) + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String get123list() { + return _123list; + } + + + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 000000000000..132012d4c387 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 000000000000..d3ed2075e9a4 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/retrofit2rx2/docs/ModelFile.md b/samples/client/petstore/java/retrofit2rx2/docs/ModelFile.md new file mode 100644 index 000000000000..1282785e329d --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/ModelList.md b/samples/client/petstore/java/retrofit2rx2/docs/ModelList.md new file mode 100644 index 000000000000..c838a6a72e4f --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 000000000000..111a748ceff8 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,101 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String SERIALIZED_NAME_SOURCE_U_R_I = "sourceURI"; + @SerializedName(SERIALIZED_NAME_SOURCE_U_R_I) + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + + public String getSourceURI() { + return sourceURI; + } + + + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 000000000000..2ba46fefd4fe --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,100 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * ModelList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String SERIALIZED_NAME_123LIST = "123-list"; + @SerializedName(SERIALIZED_NAME_123LIST) + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String get123list() { + return _123list; + } + + + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 000000000000..132012d4c387 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 000000000000..d3ed2075e9a4 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/retrofit2rx3/docs/ModelFile.md b/samples/client/petstore/java/retrofit2rx3/docs/ModelFile.md new file mode 100644 index 000000000000..1282785e329d --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx3/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2rx3/docs/ModelList.md b/samples/client/petstore/java/retrofit2rx3/docs/ModelList.md new file mode 100644 index 000000000000..c838a6a72e4f --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx3/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 000000000000..111a748ceff8 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,101 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String SERIALIZED_NAME_SOURCE_U_R_I = "sourceURI"; + @SerializedName(SERIALIZED_NAME_SOURCE_U_R_I) + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + + public String getSourceURI() { + return sourceURI; + } + + + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 000000000000..2ba46fefd4fe --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,100 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * ModelList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String SERIALIZED_NAME_123LIST = "123-list"; + @SerializedName(SERIALIZED_NAME_123LIST) + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String get123list() { + return _123list; + } + + + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 000000000000..132012d4c387 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 000000000000..d3ed2075e9a4 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/vertx-no-nullable/docs/ModelFile.md b/samples/client/petstore/java/vertx-no-nullable/docs/ModelFile.md new file mode 100644 index 000000000000..1282785e329d --- /dev/null +++ b/samples/client/petstore/java/vertx-no-nullable/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/vertx-no-nullable/docs/ModelList.md b/samples/client/petstore/java/vertx-no-nullable/docs/ModelList.md new file mode 100644 index 000000000000..c838a6a72e4f --- /dev/null +++ b/samples/client/petstore/java/vertx-no-nullable/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 000000000000..864728364139 --- /dev/null +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,109 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@JsonTypeName("File") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 000000000000..82abfba9e39d --- /dev/null +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,108 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@JsonTypeName("List") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 000000000000..5b3fde28d4b4 --- /dev/null +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 000000000000..36755ee2bd6a --- /dev/null +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/vertx/docs/ModelFile.md b/samples/client/petstore/java/vertx/docs/ModelFile.md new file mode 100644 index 000000000000..1282785e329d --- /dev/null +++ b/samples/client/petstore/java/vertx/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/vertx/docs/ModelList.md b/samples/client/petstore/java/vertx/docs/ModelList.md new file mode 100644 index 000000000000..c838a6a72e4f --- /dev/null +++ b/samples/client/petstore/java/vertx/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 000000000000..864728364139 --- /dev/null +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,109 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@JsonTypeName("File") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 000000000000..82abfba9e39d --- /dev/null +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,108 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@JsonTypeName("List") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 000000000000..5b3fde28d4b4 --- /dev/null +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 000000000000..36755ee2bd6a --- /dev/null +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/webclient/docs/ModelFile.md b/samples/client/petstore/java/webclient/docs/ModelFile.md new file mode 100644 index 000000000000..1282785e329d --- /dev/null +++ b/samples/client/petstore/java/webclient/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/webclient/docs/ModelList.md b/samples/client/petstore/java/webclient/docs/ModelList.md new file mode 100644 index 000000000000..c838a6a72e4f --- /dev/null +++ b/samples/client/petstore/java/webclient/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 000000000000..864728364139 --- /dev/null +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,109 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@JsonTypeName("File") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 000000000000..82abfba9e39d --- /dev/null +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,108 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@JsonTypeName("List") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 000000000000..5b3fde28d4b4 --- /dev/null +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 000000000000..36755ee2bd6a --- /dev/null +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/ModelFile.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ModelFile.md new file mode 100644 index 000000000000..1282785e329d --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/ModelList.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ModelList.md new file mode 100644 index 000000000000..c838a6a72e4f --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 000000000000..0de39ec2ab0a --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,113 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.JSON; + + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + /** + * Return true if this File object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 000000000000..19025e8ec4f3 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,112 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.JSON; + + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + + /** + * Return true if this List object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 000000000000..5b3fde28d4b4 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 000000000000..36755ee2bd6a --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ModelFile.java new file mode 100644 index 000000000000..ce611a313c61 --- /dev/null +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ModelFile.java @@ -0,0 +1,75 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaMSF4JServerCodegen") +public class ModelFile { + @JsonProperty("sourceURI") + private String sourceURI; + + public ModelFile sourceURI(String sourceURI) { + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @ApiModelProperty(value = "Test capitalization") + public String getSourceURI() { + return sourceURI; + } + + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ModelList.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ModelList.java new file mode 100644 index 000000000000..101752a80d3b --- /dev/null +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ModelList.java @@ -0,0 +1,74 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * ModelList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaMSF4JServerCodegen") +public class ModelList { + @JsonProperty("123-list") + private String _123list; + + public ModelList _123list(String _123list) { + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @ApiModelProperty(value = "") + public String get123list() { + return _123list; + } + + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelFile.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelFile.java new file mode 100644 index 000000000000..16c242ddf5a4 --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelFile.java @@ -0,0 +1,75 @@ +package apimodels; + +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * Must be named `File` for test. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaPlayFrameworkCodegen") +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class ModelFile { + @JsonProperty("sourceURI") + + private String sourceURI; + + public ModelFile sourceURI(String sourceURI) { + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + public String getSourceURI() { + return sourceURI; + } + + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelList.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelList.java new file mode 100644 index 000000000000..6b6d4a3913ed --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelList.java @@ -0,0 +1,75 @@ +package apimodels; + +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * ModelList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaPlayFrameworkCodegen") +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class ModelList { + @JsonProperty("123-list") + + private String _123list; + + public ModelList _123list(String _123list) { + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + public String get123list() { + return _123list; + } + + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(_123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + From 0de482da2b3016a0dfd4a7fd1c8bd2b523d370ab Mon Sep 17 00:00:00 2001 From: alisters Date: Mon, 20 Dec 2021 17:59:11 +1100 Subject: [PATCH 108/117] Kotlin client: add volley library support (#10253) * Add basic jvm-volley folder to enable it as a library * Add JVM_VOLLEY to the KotlinClientCodegen as a library option (using Retrofit2 processing for now) * Temporary checkin of generated code and kotlinfied version for use in new template * Added Kotlin-ified api invoker and request objects, update Kotlin client codgen for volley * Add Android specific build.gradle mustache file to jvm-volley library * Hardcode SDK version and build tools version in build.gradle template, add extra repository for Android Gradle build tools * Add Android manifest to generated code * Add Kotlin dependencies and plugins to build gradle template * WIP: Create basic API templating for jvm-volley * Add ApiException and parameter validation, create path variable using ApiInvoker * Build queryParams and headerParams * Add VolleyRequest template * WIP: Injecting context and default API invoker into APIs (non compiling) * Add DefaultInvoker stub and update API to inject context * Add request queue generation to the DefaultInvoker * Fix up compile errors in the invoker * Cleanup unrequired templates * Update templates * Add constructor overloads to inject stack or network into request queue * Fix compile errors with request queue generation * Fix compile errors * Al'll fix it for you..... * WIP compile fixes * More compile fixes * Generate to java directory and kotlin-ify auth code * More syntax fixes in templates * Almost left it in a working state, fixing that .... now... * Switch builder method based on model existence constraints - body and response * Add coroutine logic to APIs and pass through listeners to the requests, various other fixes. * Use reflection and type tokens to work around clazz issues on generics * Add POST, PATCH and PUT to RequestFactory * More templating magic * Fix Steve, the human compiler's errors again ! * Add CLI option for generating room models * Configure the room model package * Add initial room model templating and generation * Add room model generation implementation * Implement toRoom function on models to convert model to room model * Bug fixes, transformers to and from room models * Add query parameters to URL generation * Fix issues with gson type conversion, add type adapters to gson instance * Fix issues with older API versions and Java8 libraries, * Add request factory interface * API template tidy up * Update IRequestFactory to include companion object, minor tidy ups * Remove @Keep annotations from room templates * Rename toRoomModel and toApiModel functions * Add empty companion object to generated room model * Add ITransformStorage interface to allow polymorphic transforms to room models * Add content type into GsonRequest * Move gson serialization of request body into GsonRequest * Update request factory to take header factories * Remove the generated comparision code * Move the generateRoomModels switch into the KotlinClientCodegen class * Move room model generation out of default generator * Updates for auth * Finalise removal of kotlin elements from default generator * Hoist room model logic out of abstractKotlin into kotlin client codegen * Revert AbstractKotlinCodegen * Revert Codegen constants to remove base generator changes out of our new library * Revert data class template changes, add data class body check to Kotlin Client codegen * Add sample generation yaml file for jvm-volley library * Update JVM-Volley readme for generateRoomModels flag * Remove unused template files, get auth compiling but non functional, clean build of warnings * Generate sample generated code * Add not implemented method for oauth * Add unit test for KotlinClientCodegen generateRoomModel flag * Remove accidental hard coding of src/main/java source folder * Push changed generated sample files * Move and rename IStorable inside the volley library * Inject retry policy into API definition, re-run sample and doc scripts * Add generic post processors * Update samples after generator changes * Fix some compile errors with the pet store sample * Fix duplicate auth companion object and import generation * Reinstate query and form parameter code generation * Add check for unsupported serialization libraries * Fix broken unit tests * Regenerate samples * AN-233 Update request factory to allow custom gsonadapters * update `GsonRequest.mustache` and `RequestFactoy.mustache` to use `Map` instead of `Map` to better fit kotlin conventions * Update readme with better examples and design notes * Update readme with info about gson serializers and adapters for polymorphic types * Updated samples * Merge from upstream * Address review comments * Update samples * Samples * Update docs * Remove DateAdapter generated file, template and it's inclusion as a supporting file in favour of localDateTime * Review comment cleanup for initial PR #10253 - cleaner auth key in parameter string handling * Review comment - add a kotlin version parameter to the build scripts * Updated samples * Missing changes from build.mustache * Regenerate samples for build.gradle changes * Merge from master and generate samples * Remove serializer as a supporting file from jvm-volley - it's serialisation is not a singleton and configured differently via gson request and dependency injection * Remove singleton serializer from jvm-volley generation as it's not used Co-authored-by: Alister Shipman Co-authored-by: Steve Telford Co-authored-by: Leigh Cooper Co-authored-by: Michael Hewett --- bin/configs/kotlin-jvm-volley.yaml | 9 + docs/generators/kotlin.md | 3 +- .../languages/KotlinClientCodegen.java | 115 +++- .../kotlin-client/data_class.mustache | 14 +- .../libraries/jvm-volley/README.mustache | 232 +++++++ .../libraries/jvm-volley/api.mustache | 129 ++++ .../libraries/jvm-volley/api_doc.mustache | 83 +++ .../jvm-volley/auth/apikeyauth.mustache | 16 + .../jvm-volley/auth/authentication.mustache | 15 + .../jvm-volley/auth/httpbasicauth.mustache | 3 + .../libraries/jvm-volley/auth/oauth.mustache | 5 + .../libraries/jvm-volley/bodyParams.mustache | 1 + .../libraries/jvm-volley/build.mustache | 129 ++++ .../libraries/jvm-volley/formParams.mustache | 1 + .../jvm-volley/gradle.properties.mustache | 4 + .../jvm-volley/headerParams.mustache | 1 + .../CollectionFormats.kt.mustache | 56 ++ .../ITransformForStorage.mustache | 9 + .../libraries/jvm-volley/manifest.mustache | 5 + .../libraries/jvm-volley/pathParams.mustache | 1 + .../libraries/jvm-volley/queryParams.mustache | 1 + .../jvm-volley/request/GsonRequest.mustache | 119 ++++ .../request/IRequestFactory.mustache | 64 ++ .../request/RequestFactory.mustache | 69 +++ .../kotlin-client/model_room.mustache | 38 ++ .../model_room_init_var.mustache | 1 + .../org/openapitools/codegen/TestUtils.java | 10 + .../KotlinJvmVolleyModelCodegenTest.java | 83 +++ .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 43 ++ .../.openapi-generator/VERSION | 1 + .../petstore/kotlin-jvm-volley/README.md | 230 +++++++ .../petstore/kotlin-jvm-volley/build.gradle | 95 +++ .../kotlin-jvm-volley/docs/ApiResponse.md | 12 + .../kotlin-jvm-volley/docs/Category.md | 11 + .../petstore/kotlin-jvm-volley/docs/Order.md | 22 + .../petstore/kotlin-jvm-volley/docs/Pet.md | 22 + .../petstore/kotlin-jvm-volley/docs/PetApi.md | 320 ++++++++++ .../kotlin-jvm-volley/docs/StoreApi.md | 158 +++++ .../petstore/kotlin-jvm-volley/docs/Tag.md | 11 + .../petstore/kotlin-jvm-volley/docs/User.md | 17 + .../kotlin-jvm-volley/docs/UserApi.md | 310 +++++++++ .../kotlin-jvm-volley/gradle.properties | 2 + .../gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 59203 bytes .../gradle/wrapper/gradle-wrapper.properties | 5 + .../client/petstore/kotlin-jvm-volley/gradlew | 185 ++++++ .../petstore/kotlin-jvm-volley/gradlew.bat | 89 +++ .../kotlin-jvm-volley/settings.gradle | 2 + .../src/main/AndroidManifest.xml | 5 + .../org/openapitools/client/apis/PetApi.kt | 586 ++++++++++++++++++ .../org/openapitools/client/apis/StoreApi.kt | 300 +++++++++ .../org/openapitools/client/apis/UserApi.kt | 578 +++++++++++++++++ .../client/infrastructure/ByteArrayAdapter.kt | 33 + .../infrastructure/CollectionFormats.kt | 56 ++ .../infrastructure/ITransformForStorage.kt | 28 + .../client/infrastructure/LocalDateAdapter.kt | 35 ++ .../infrastructure/LocalDateTimeAdapter.kt | 35 ++ .../infrastructure/OffsetDateTimeAdapter.kt | 35 ++ .../openapitools/client/models/ApiResponse.kt | 57 ++ .../openapitools/client/models/Category.kt | 52 ++ .../client/models/ModelApiResponse.kt | 57 ++ .../org/openapitools/client/models/Order.kt | 83 +++ .../org/openapitools/client/models/Pet.kt | 85 +++ .../org/openapitools/client/models/Tag.kt | 52 ++ .../org/openapitools/client/models/User.kt | 83 +++ .../models/room/ApiResponseRoomModel.kt | 52 ++ .../client/models/room/CategoryRoomModel.kt | 49 ++ .../models/room/ModelApiResponseRoomModel.kt | 52 ++ .../client/models/room/OrderRoomModel.kt | 61 ++ .../client/models/room/PetRoomModel.kt | 63 ++ .../client/models/room/TagRoomModel.kt | 49 ++ .../client/models/room/UserRoomModel.kt | 67 ++ .../client/request/GsonRequest.kt | 119 ++++ .../client/request/IRequestFactory.kt | 64 ++ .../client/request/RequestFactory.kt | 87 +++ 75 files changed, 5591 insertions(+), 6 deletions(-) create mode 100644 bin/configs/kotlin-jvm-volley.yaml create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/README.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/api.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/api_doc.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/apikeyauth.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/authentication.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/httpbasicauth.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/oauth.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/bodyParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/build.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/formParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/gradle.properties.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/headerParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/infrastructure/CollectionFormats.kt.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/infrastructure/ITransformForStorage.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/manifest.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/pathParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/queryParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/GsonRequest.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/IRequestFactory.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/RequestFactory.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/model_room.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/model_room_init_var.mustache create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/jvm_volley/KotlinJvmVolleyModelCodegenTest.java create mode 100644 samples/client/petstore/kotlin-jvm-volley/.openapi-generator-ignore create mode 100644 samples/client/petstore/kotlin-jvm-volley/.openapi-generator/FILES create mode 100644 samples/client/petstore/kotlin-jvm-volley/.openapi-generator/VERSION create mode 100644 samples/client/petstore/kotlin-jvm-volley/README.md create mode 100644 samples/client/petstore/kotlin-jvm-volley/build.gradle create mode 100644 samples/client/petstore/kotlin-jvm-volley/docs/ApiResponse.md create mode 100644 samples/client/petstore/kotlin-jvm-volley/docs/Category.md create mode 100644 samples/client/petstore/kotlin-jvm-volley/docs/Order.md create mode 100644 samples/client/petstore/kotlin-jvm-volley/docs/Pet.md create mode 100644 samples/client/petstore/kotlin-jvm-volley/docs/PetApi.md create mode 100644 samples/client/petstore/kotlin-jvm-volley/docs/StoreApi.md create mode 100644 samples/client/petstore/kotlin-jvm-volley/docs/Tag.md create mode 100644 samples/client/petstore/kotlin-jvm-volley/docs/User.md create mode 100644 samples/client/petstore/kotlin-jvm-volley/docs/UserApi.md create mode 100644 samples/client/petstore/kotlin-jvm-volley/gradle.properties create mode 100644 samples/client/petstore/kotlin-jvm-volley/gradle/wrapper/gradle-wrapper.jar create mode 100644 samples/client/petstore/kotlin-jvm-volley/gradle/wrapper/gradle-wrapper.properties create mode 100644 samples/client/petstore/kotlin-jvm-volley/gradlew create mode 100644 samples/client/petstore/kotlin-jvm-volley/gradlew.bat create mode 100644 samples/client/petstore/kotlin-jvm-volley/settings.gradle create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/AndroidManifest.xml create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/apis/PetApi.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/apis/StoreApi.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/apis/UserApi.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ByteArrayAdapter.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/CollectionFormats.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ITransformForStorage.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateAdapter.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/ApiResponse.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Category.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/ModelApiResponse.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Order.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Pet.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Tag.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/User.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/ApiResponseRoomModel.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/CategoryRoomModel.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/ModelApiResponseRoomModel.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/OrderRoomModel.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/PetRoomModel.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/TagRoomModel.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/UserRoomModel.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/request/GsonRequest.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/request/IRequestFactory.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/request/RequestFactory.kt diff --git a/bin/configs/kotlin-jvm-volley.yaml b/bin/configs/kotlin-jvm-volley.yaml new file mode 100644 index 000000000000..cdb8ac51a9b4 --- /dev/null +++ b/bin/configs/kotlin-jvm-volley.yaml @@ -0,0 +1,9 @@ +generatorName: kotlin +outputDir: samples/client/petstore/kotlin-jvm-volley +library: jvm-volley +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-client +additionalProperties: + artifactId: kotlin-petstore-jvm-volley + generateRoomModels: "true" + serializationLibrary: "gson" diff --git a/docs/generators/kotlin.md b/docs/generators/kotlin.md index cbf43a3a1e9e..786ff7013ebb 100644 --- a/docs/generators/kotlin.md +++ b/docs/generators/kotlin.md @@ -13,8 +13,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl |collectionType|Option. Collection type to use|
            **array**
            kotlin.Array
            **list**
            kotlin.collections.List
            |list| |dateLibrary|Option. Date library to use|
            **threetenbp-localdatetime**
            Threetenbp - Backport of JSR310 (jvm only, for legacy app only)
            **string**
            String
            **java8-localdatetime**
            Java 8 native JSR310 (jvm only, for legacy app only)
            **java8**
            Java 8 native JSR310 (jvm only, preferred for jdk 1.8+)
            **threetenbp**
            Threetenbp - Backport of JSR310 (jvm only, preferred for jdk < 1.8)
            |java8| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |camelCase| +|generateRoomModels|Generate Android Room database models in addition to API models (JVM Volley library only)| |false| |groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools| -|library|Library template (sub-template) to use|
            **jvm-okhttp4**
            [DEFAULT] Platform: Java Virtual Machine. HTTP client: OkHttp 4.2.0 (Android 5.0+ and Java 8+). JSON processing: Moshi 1.8.0.
            **jvm-okhttp3**
            Platform: Java Virtual Machine. HTTP client: OkHttp 3.12.4 (Android 2.3+ and Java 7+). JSON processing: Moshi 1.8.0.
            **jvm-retrofit2**
            Platform: Java Virtual Machine. HTTP client: Retrofit 2.6.2.
            **multiplatform**
            Platform: Kotlin multiplatform. HTTP client: Ktor 1.6.0. JSON processing: Kotlinx Serialization: 1.2.1.
            |jvm-okhttp4| +|library|Library template (sub-template) to use|
            **jvm-okhttp4**
            [DEFAULT] Platform: Java Virtual Machine. HTTP client: OkHttp 4.2.0 (Android 5.0+ and Java 8+). JSON processing: Moshi 1.8.0.
            **jvm-okhttp3**
            Platform: Java Virtual Machine. HTTP client: OkHttp 3.12.4 (Android 2.3+ and Java 7+). JSON processing: Moshi 1.8.0.
            **jvm-retrofit2**
            Platform: Java Virtual Machine. HTTP client: Retrofit 2.6.2.
            **multiplatform**
            Platform: Kotlin multiplatform. HTTP client: Ktor 1.6.0. JSON processing: Kotlinx Serialization: 1.2.1.
            **jvm-volley**
            Platform: JVM for Android. HTTP client: Volley 1.2.1. JSON processing: gson 2.8.9
            |jvm-okhttp4| |modelMutable|Create mutable models| |false| |moshiCodeGen|Whether to enable codegen with the Moshi library. Refer to the [official Moshi doc](https://github.com/square/moshi#codegen) for more info.| |false| |omitGradlePluginVersions|Whether to declare Gradle plugin versions in build files.| |false| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java index c8d7a87716d0..b0d272d075b4 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java @@ -57,12 +57,15 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { protected static final String JVM_OKHTTP3 = "jvm-okhttp3"; protected static final String JVM_RETROFIT2 = "jvm-retrofit2"; protected static final String MULTIPLATFORM = "multiplatform"; + protected static final String JVM_VOLLEY = "jvm-volley"; public static final String USE_RX_JAVA = "useRxJava"; public static final String USE_RX_JAVA2 = "useRxJava2"; public static final String USE_RX_JAVA3 = "useRxJava3"; public static final String USE_COROUTINES = "useCoroutines"; public static final String DO_NOT_USE_RX_AND_COROUTINES = "doNotUseRxAndCoroutines"; + public static final String GENERATE_ROOM_MODELS = "generateRoomModels"; + public static final String ROOM_MODEL_PACKAGE = "roomModelPackage"; public static final String OMIT_GRADLE_PLUGIN_VERSIONS = "omitGradlePluginVersions"; public static final String DATE_LIBRARY = "dateLibrary"; @@ -85,6 +88,9 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { // backwards compatibility for openapi configs that specify neither rx1 nor rx2 // (mustache does not allow for boolean operators so we need this extra field) protected boolean doNotUseRxAndCoroutines = true; + protected boolean generateRoomModels = false; + protected String roomModelPackage = ""; + protected String authFolder; @@ -167,6 +173,9 @@ public KotlinClientCodegen() { outputFolder = "generated-code" + File.separator + "kotlin-client"; modelTemplateFiles.put("model.mustache", ".kt"); + if (generateRoomModels) { + modelTemplateFiles.put("model_room.mustache", ".kt"); + } apiTemplateFiles.put("api.mustache", ".kt"); modelDocTemplateFiles.put("model_doc.mustache", ".md"); apiDocTemplateFiles.put("api_doc.mustache", ".md"); @@ -197,6 +206,7 @@ public KotlinClientCodegen() { supportedLibraries.put(JVM_OKHTTP3, "Platform: Java Virtual Machine. HTTP client: OkHttp 3.12.4 (Android 2.3+ and Java 7+). JSON processing: Moshi 1.8.0."); supportedLibraries.put(JVM_RETROFIT2, "Platform: Java Virtual Machine. HTTP client: Retrofit 2.6.2."); supportedLibraries.put(MULTIPLATFORM, "Platform: Kotlin multiplatform. HTTP client: Ktor 1.6.0. JSON processing: Kotlinx Serialization: 1.2.1."); + supportedLibraries.put(JVM_VOLLEY, "Platform: JVM for Android. HTTP client: Volley 1.2.1. JSON processing: gson 2.8.9"); CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "Library template (sub-template) to use"); libraryOption.setEnum(supportedLibraries); @@ -220,6 +230,8 @@ public KotlinClientCodegen() { cliOptions.add(CliOption.newBoolean(MOSHI_CODE_GEN, "Whether to enable codegen with the Moshi library. Refer to the [official Moshi doc](https://github.com/square/moshi#codegen) for more info.")); + cliOptions.add(CliOption.newBoolean(GENERATE_ROOM_MODELS, "Generate Android Room database models in addition to API models (JVM Volley library only)", false)); + cliOptions.add(CliOption.newBoolean(SUPPORT_ANDROID_API_LEVEL_25_AND_BELLOW, "[WARNING] This flag will generate code that has a known security vulnerability. It uses `kotlin.io.createTempFile` instead of `java.nio.file.Files.createTempFile` in oder to support Android API level 25 and bellow. For more info, please check the following links https://github.com/OpenAPITools/openapi-generator/security/advisories/GHSA-23x4-m842-fmwf, https://github.com/OpenAPITools/openapi-generator/pull/9284")); } @@ -235,6 +247,12 @@ public String getHelp() { return "Generates a Kotlin client."; } + public boolean getGenerateRoomModels() { return generateRoomModels; } + + public void setGenerateRoomModels(Boolean generateRoomModels) { + this.generateRoomModels = generateRoomModels; + } + public void setUseRxJava(boolean useRxJava) { if (useRxJava) { this.useRxJava2 = false; @@ -298,14 +316,45 @@ public void setCollectionType(String collectionType) { this.collectionType = collectionType; } + public void setRoomModelPackage(String roomModelPackage) { + this.roomModelPackage = roomModelPackage; + } + @Override - public void processOpts() { - super.processOpts(); + public String modelFilename(String templateName, String modelName) { + String suffix = modelTemplateFiles().get(templateName); + // If this was a proper template method, i wouldn't have to make myself throw up by doing this.... + if (getGenerateRoomModels() && suffix.startsWith("RoomModel")) { + return roomModelFileFolder() + File.separator + toModelFilename(modelName) + suffix; + } else { + return modelFileFolder() + File.separator + toModelFilename(modelName) + suffix; + } + } + + public String roomModelFileFolder() { + return outputFolder + File.separator + sourceFolder + File.separator + roomModelPackage.replace('.', File.separatorChar); + } - if (MULTIPLATFORM.equals(getLibrary())) { - sourceFolder = "src/commonMain/kotlin"; + @Override + public void processOpts() { + if (additionalProperties.containsKey(CodegenConstants.SOURCE_FOLDER)) { + setSourceFolder((String) additionalProperties.get(CodegenConstants.SOURCE_FOLDER)); + } else { + // Set the value to defaults if we haven't overridden + if (MULTIPLATFORM.equals(getLibrary())) { + setSourceFolder("src/commonMain/kotlin"); + } + else if (JVM_VOLLEY.equals(getLibrary())){ + // Android plugin wants it's source in java + setSourceFolder("src/main/java"); + } + else { + setSourceFolder(super.sourceFolder); + } + additionalProperties.put(CodegenConstants.SOURCE_FOLDER, this.sourceFolder); } + super.processOpts(); boolean hasRx = additionalProperties.containsKey(USE_RX_JAVA); boolean hasRx2 = additionalProperties.containsKey(USE_RX_JAVA2); @@ -348,6 +397,12 @@ public void processOpts() { final String infrastructureFolder = (sourceFolder + File.separator + packageName + File.separator + "infrastructure").replace(".", "/"); authFolder = (sourceFolder + File.separator + packageName + File.separator + "auth").replace(".", "/"); + // request destination folder + final String requestFolder = (sourceFolder + File.separator + packageName + File.separator + "request").replace(".", "/"); + + // auth destination folder + final String authFolder = (sourceFolder + File.separator + packageName + File.separator + "auth").replace(".", "/"); + // additional properties if (additionalProperties.containsKey(DATE_LIBRARY)) { setDateLibrary(additionalProperties.get(DATE_LIBRARY).toString()); @@ -364,6 +419,9 @@ public void processOpts() { case JVM_OKHTTP4: processJVMOkHttpLibrary(infrastructureFolder); break; + case JVM_VOLLEY: + processJVMVolleyLibrary(infrastructureFolder, requestFolder, authFolder); + break; case JVM_RETROFIT2: processJVMRetrofit2Library(infrastructureFolder); break; @@ -477,6 +535,47 @@ private void processJVMRetrofit2Library(String infrastructureFolder) { addSupportingSerializerAdapters(infrastructureFolder); } + private void processJVMVolleyLibrary(String infrastructureFolder, String requestFolder, String authFolder) { + + additionalProperties.put(JVM, true); + additionalProperties.put(JVM_VOLLEY, true); + + if (additionalProperties.containsKey(GENERATE_ROOM_MODELS)) { + this.setGenerateRoomModels(convertPropertyToBooleanAndWriteBack(GENERATE_ROOM_MODELS)); + // Hide this option behind a property getter and setter in case we need to check it elsewhere + if (getGenerateRoomModels()) { + modelTemplateFiles.put("model_room.mustache", "RoomModel.kt"); + supportingFiles.add(new SupportingFile("infrastructure/ITransformForStorage.mustache", infrastructureFolder, "ITransformForStorage.kt")); + + } + } else { + additionalProperties.put(GENERATE_ROOM_MODELS, generateRoomModels); + } + + if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) { + if (!additionalProperties.containsKey(ROOM_MODEL_PACKAGE)) + this.setRoomModelPackage(packageName + ".models.room"); + else + this.setRoomModelPackage(additionalProperties.get(ROOM_MODEL_PACKAGE).toString()); + } + additionalProperties.put(ROOM_MODEL_PACKAGE, roomModelPackage); + + supportingFiles.add(new SupportingFile("infrastructure/CollectionFormats.kt.mustache", infrastructureFolder, "CollectionFormats.kt")); + + // We have auth related partial files, so they can be overridden, but don't generate them explicitly + supportingFiles.add(new SupportingFile("request/GsonRequest.mustache", requestFolder, "GsonRequest.kt")); + supportingFiles.add(new SupportingFile("request/IRequestFactory.mustache", requestFolder, "IRequestFactory.kt")); + supportingFiles.add(new SupportingFile("request/RequestFactory.mustache", requestFolder, "RequestFactory.kt")); + supportingFiles.add(new SupportingFile("infrastructure/CollectionFormats.kt.mustache", infrastructureFolder, "CollectionFormats.kt")); + + if (getSerializationLibrary() != SERIALIZATION_LIBRARY_TYPE.gson) { + throw new RuntimeException("This library currently only supports gson serialization. Try adding '--additional-properties serializationLibrary=gson' to your command."); + } + addSupportingSerializerAdapters(infrastructureFolder); + supportingFiles.remove(new SupportingFile("jvm-common/infrastructure/Serializer.kt.mustache", infrastructureFolder, "Serializer.kt")); + + } + private void addSupportingSerializerAdapters(final String infrastructureFolder) { supportingFiles.add(new SupportingFile("jvm-common/infrastructure/Serializer.kt.mustache", infrastructureFolder, "Serializer.kt")); supportingFiles.add(new SupportingFile("jvm-common/infrastructure/ByteArrayAdapter.kt.mustache", infrastructureFolder, "ByteArrayAdapter.kt")); @@ -605,6 +704,11 @@ private void commonSupportingFiles() { if (getLibrary().equals(MULTIPLATFORM)) { supportingFiles.add(new SupportingFile("build.gradle.kts.mustache", "", "build.gradle.kts")); supportingFiles.add(new SupportingFile("settings.gradle.kts.mustache", "", "settings.gradle.kts")); + } else if (getLibrary().equals(JVM_VOLLEY)) { + supportingFiles.add(new SupportingFile("build.mustache", "", "build.gradle")); + supportingFiles.add(new SupportingFile("gradle.properties.mustache", "", "gradle.properties")); + supportingFiles.add(new SupportingFile("settings.gradle.mustache", "", "settings.gradle")); + supportingFiles.add(new SupportingFile("manifest.mustache", "", "src/main/AndroidManifest.xml")); } else { supportingFiles.add(new SupportingFile("build.gradle.mustache", "", "build.gradle")); supportingFiles.add(new SupportingFile("settings.gradle.mustache", "", "settings.gradle")); @@ -625,6 +729,9 @@ public Map postProcessModels(Map objs) { for (Object model : models) { @SuppressWarnings("unchecked") Map mo = (Map) model; CodegenModel cm = (CodegenModel) mo.get("model"); + if (getGenerateRoomModels()) { + cm.vendorExtensions.put("x-has-data-class-body", true); + } // escape the variable base name for use as a string literal List vars = Stream.of( diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache index c5289a46fadc..5f5b4da03ca8 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache @@ -35,6 +35,10 @@ import kotlinx.serialization.encoding.* {{#serializableModel}} import java.io.Serializable {{/serializableModel}} +{{#generateRoomModels}} +import {{roomModelPackage}}.{{classname}}RoomModel +import {{packageName}}.infrastructure.ITransformForStorage +{{/generateRoomModels}} /** * {{{description}}} @@ -56,8 +60,16 @@ import java.io.Serializable {{#required}}{{>data_class_req_var}}{{/required}}{{^required}}{{>data_class_opt_var}}{{/required}}{{^-last}},{{/-last}} {{/allVars}} -){{/discriminator}}{{#parent}}{{^serializableModel}}{{^parcelizeModels}} : {{{parent}}}{{#isMap}}(){{/isMap}}{{#isArray}}(){{/isArray}}{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#parent}}{{#serializableModel}}{{^parcelizeModels}} : {{{parent}}}{{#isMap}}(){{/isMap}}{{#isArray}}(){{/isArray}}, Serializable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#parent}}{{^serializableModel}}{{#parcelizeModels}} : {{{parent}}}{{#isMap}}(){{/isMap}}{{#isArray}}(){{/isArray}}, Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#parent}}{{#serializableModel}}{{#parcelizeModels}} : {{{parent}}}{{#isMap}}(){{/isMap}}{{#isArray}}(){{/isArray}}, Serializable, Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{^parent}}{{#serializableModel}}{{^parcelizeModels}} : Serializable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{^parent}}{{^serializableModel}}{{#parcelizeModels}} : Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{^parent}}{{#serializableModel}}{{#parcelizeModels}} : Serializable, Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#vendorExtensions.x-has-data-class-body}} { +){{/discriminator}}{{#parent}}{{^serializableModel}}{{^parcelizeModels}} : {{{parent}}}{{#isMap}}(){{/isMap}}{{#isArray}}(){{/isArray}}{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#parent}}{{#serializableModel}}{{^parcelizeModels}} : {{{parent}}}{{#isMap}}(){{/isMap}}{{#isArray}}(){{/isArray}}, Serializable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#parent}}{{^serializableModel}}{{#parcelizeModels}} : {{{parent}}}{{#isMap}}(){{/isMap}}{{#isArray}}(){{/isArray}}, Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#parent}}{{#serializableModel}}{{#parcelizeModels}} : {{{parent}}}{{#isMap}}(){{/isMap}}{{#isArray}}(){{/isArray}}, Serializable, Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{^parent}}{{#serializableModel}}{{^parcelizeModels}} : Serializable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{^parent}}{{^serializableModel}}{{#parcelizeModels}} : Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{^parent}}{{#serializableModel}}{{#parcelizeModels}} : Serializable, Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#generateRoomModels}}{{#parent}}, {{/parent}}{{^discriminator}}{{^parent}}:{{/parent}} ITransformForStorage<{{classname}}RoomModel>{{/discriminator}}{{/generateRoomModels}}{{#vendorExtensions.x-has-data-class-body}} { {{/vendorExtensions.x-has-data-class-body}} +{{#generateRoomModels}} + companion object { } + {{^discriminator}}override fun toRoomModel(): {{classname}}RoomModel = + {{classname}}RoomModel(roomTableId = 0, + {{#allVars}}{{#items.isPrimitiveType}}{{#isArray}}{{#isList}}{{name}} = this.{{name}},{{/isList}}{{/isArray}}{{/items.isPrimitiveType}}{{^isEnum}}{{^isArray}}{{name}} = this.{{name}},{{/isArray}}{{/isEnum}}{{#isEnum}}{{^isArray}}{{name}} = this.{{name}},{{/isArray}}{{/isEnum}} + {{/allVars}} + ){{/discriminator}} +{{/generateRoomModels}} {{#serializableModel}} {{#nonPublicApi}}internal {{/nonPublicApi}}companion object { private const val serialVersionUID: Long = 123 diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/README.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/README.mustache new file mode 100644 index 000000000000..ea684b998481 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/README.mustache @@ -0,0 +1,232 @@ +# {{packageName}} - Kotlin client library for {{appName}} + + +A kotlin client for Android using the currently recommended http client, Volley. See https://developer.android.com/training/volley + +- Currently sends GsonRequests +- Currently only supports Gson as a serializer - will throw an exception if a different serializer is chosen +- Defaults the source location to src/main/java as per standard Android builds + + +## Design + +Volley is a queue/request based layer on top of http url stack specific to Android. Android favours dependency injection and +a layered architecture, and IO performed off the main thread to maintain UI responsiveness, with a preferred technique of +kotlin co-routines. The code gen library reflects these factors. + +- Api calls use co-routines, and execute them using volley callbacks to avoid tying up a thread. +- Facilitate dependency injection, with default implementations available. +- Generate a requestFactory that can be overridden +- Allow the passing of the RequestFactory per tag (api client) or per operation (an extra parameter is created on operations with non-global security), with per operation auth overriding global security. +- DI scoping of the Request Factory and pre-generated auth header factories allow for thread safe and secure setting of credentials. +- Lazy header factories allow for refreshing tokens etc +- Factoring of header factories to the Request Factory allow ambient provision of credentials. Code gen library is credential storage agnostic. +- Header factories allow the merging of generated headers from open api spec with dynamically added headers + +- Injection of http url stack to allow custom http stacks. Default implementation is best practice singleton +- Data classes used for serialisation to reflect volley's preference - an immutable request that once queued can't be tampered with. + +- Reuse model class and other jvm common infrastructure + +- Optional generation of room database models, and transform methods to these from open api models +- Room and api models can be extended with additional extension properties. + +## Future improvements +- Option to generate image requests on certain conditionals e.g content-type gif etc +- Support for kotlin serialization. +- Multi part form parameters and support for file inputs + +## Usage +Hilt Dependency injection example - with default values for parameters overridden. +``` + @Provides + internal fun provideSomeApi( + context: Context, + restService: IRestService, + configurationService: IConfigurationService, + sessionService: ISessionService + ): SomeApi { + return SomeApi( + context = context, + requestQueue = restService.getRequestQueue(), + requestFactory = RequestFactory(listOf(createSessionHeaderFactory(sessionService), createTraceHeaderFactory()), + postProcessors = listOf(retryPolicySetter)), + basePath = configurationService.getBaseUrl() + ) + } +``` +Here is the constructor so you can see the defaults +```class SomeApi ( +val context: Context, +val requestQueue: Lazy = lazy(initializer = { + Volley.newRequestQueue(context.applicationContext) + }), + val requestFactory: IRequestFactory = RequestFactory(), + val basePath: String = "https://yourbasepath.from_input_parameter.com/api", + private val postProcessors :List <(Request<*>) -> Unit> = listOf()) { +``` + +### Overriding defaults +The above constructor for each api allows the following to be customized +- A custom context, so either a singleton request queue or different scope can be created - see +https://developer.android.com/training/volley/requestqueue#singleton +- An overrideable request queue - which in turn can have a custom http url stack passed to it +- An overrideable request factory constructor call, or a request factory that can be overridden by a custom template, with +custom header factory, request post processors and custom gson adapters injected. + +#### Overriding request generation +Request generation can be overridden by +- Overriding the entire request factory template +- Supplying custom header factories - methods that take any possible parameters but return a map of headers +- Supplying custom request post processors - methods that take and return the request object + +Header factory examples can be found in the auth section, as these are implemented as header factories. eg +``` +val basicAuthHeaderFactoryBuilder = { username: String?, password: String? -> +{ mapOf("Authorization" to "Basic " + Base64.encodeToString("${username ?: ""}:${password ?: ""}".toByteArray(), Base64.DEFAULT))} +} +``` +In this case it's a lambda function (a factory method) that takes an username and password, and returns a map of headers. Other +generated code will supply the username and password. In this case it results in a map of just one key/value pair, but +it could be multiple. The important part is it's returning a map - and that the surrounding code +will can bind the inputs to it at some point. + +Here is a different example that supplies tracing header values +``` +/** + * Create a lambda of tracing headers to be injected into an API's [RequestFactory]. + */ +private fun createTraceHeaderFactory(): () -> Map = { + mapOf( + HttpHeaderType.b3_traceId.rawValue to UUIDExtensions.asTraceId(UUID.randomUUID()), + HttpHeaderType.b3_spanId.rawValue to UUIDExtensions.asSpanId(UUID.randomUUID()), + HttpHeaderType.b3_sampled.rawValue to "1" + ) +} +``` +Finally a post processor example +``` + /** + * Configure a [DefaultRetryPolicy] to be injected into the [RequestFactory] with a maximum number of retries of zero. + */ + private val retryPolicySetter = { request: Request<*> -> + Unit.apply { + request.setRetryPolicy( + DefaultRetryPolicy( + RestService.DEFAULT_TIMEOUT_MS, + 0, + DefaultRetryPolicy.DEFAULT_BACKOFF_MULT + ) + ) + } + } +``` + +### Serialization +#### Gson and Polymorphic types +The GsonRequest object can be passed custom type adapters +``` +class GsonRequest( + method: Int, + url: String, + private val body: Any?, + private val headers: Map?, + private val params: MutableMap?, + private val contentTypeForBody: String?, + private val encodingForParams: String?, + private val gsonAdapters: Map?, + private val type: Type, + private val listener: Response.Listener, + errorListener: Response.ErrorListener +) : Request(method, url, errorListener) { + + val gsonBuilder: GsonBuilder = GsonBuilder() + .registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter()) + .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) + .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) + .registerTypeAdapter(ByteArray::class.java, ByteArrayAdapter()) + +``` +## Requires + +{{#jvm}} +* Kotlin 1.4.30 +* Gradle 6.8.3 +{{/jvm}} +{{#multiplatform}} +* Kotlin 1.5.10 +{{/multiplatform}} + +## Build + +{{#jvm}} +First, create the gradle wrapper script: + +``` +gradle wrapper +``` + +Then, run: + +{{/jvm}} +``` +./gradlew check assemble +``` + +This runs all tests and packages the library. + +{{#generateApiDocs}} + +## Documentation for API Endpoints + +All URIs are relative to *{{{basePath}}}* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{{summary}}}{{/summary}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} +{{/generateApiDocs}} + +{{#generateModelDocs}} + +## Documentation for Models + +{{#modelPackage}} +{{#models}}{{#model}} - [{{{modelPackage}}}.{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) +{{/model}}{{/models}} +{{/modelPackage}} +{{^modelPackage}} +No model defined in this package +{{/modelPackage}} +{{/generateModelDocs}} + +{{! TODO: optional documentation for authorization? }} +## Documentation for Authorization + +{{^authMethods}} +All endpoints do not require authorization. +{{/authMethods}} +{{#authMethods}} +{{#last}} +Authentication schemes defined for the API: +{{/last}} +{{/authMethods}} +{{#authMethods}} + +### {{name}} + +{{#isApiKey}}- **Type**: API key +- **API key parameter name**: {{keyParamName}} +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} +{{/isApiKey}} +{{#isBasic}}- **Type**: HTTP basic authentication +{{/isBasic}} +{{#isOAuth}}- **Type**: OAuth +- **Flow**: {{flow}} +- **Authorization URL**: {{authorizationUrl}} +- **Scopes**: {{^scopes}}N/A{{/scopes}} +{{#scopes}} - {{scope}}: {{description}} +{{/scopes}} +{{/isOAuth}} + +{{/authMethods}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/api.mustache new file mode 100644 index 000000000000..6262fb5b53e0 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/api.mustache @@ -0,0 +1,129 @@ +package {{apiPackage}} + +import android.content.Context +import com.android.volley.DefaultRetryPolicy +import com.android.volley.Request +import com.android.volley.RequestQueue +import com.android.volley.Response +import com.android.volley.toolbox.BaseHttpStack +import com.android.volley.toolbox.Volley +import java.util.*; +import kotlin.coroutines.resume +import kotlin.coroutines.resumeWithException +import kotlin.coroutines.suspendCoroutine +import com.google.gson.reflect.TypeToken + +import {{packageName}}.request.IRequestFactory +import {{packageName}}.request.RequestFactory +import {{packageName}}.infrastructure.CollectionFormats.* + +{{#imports}}import {{import}} +{{/imports}} + +{{#operations}} +/* +* If you wish to use a custom http stack with your client you +* can pass that to the request queue like: +* Volley.newRequestQueue(context.applicationContext, myCustomHttpStack) +*/ +class {{classname}} ( + private val context: Context, + private val requestQueue: Lazy = lazy(initializer = { + Volley.newRequestQueue(context.applicationContext) + }), + private val requestFactory: IRequestFactory = RequestFactory(), + private val basePath: String = "{{{basePath}}}", + private val postProcessors :List <(Request<*>) -> Unit> = listOf()) { + + {{#operation}} + /** + * {{summary}} + * {{notes}} + {{#allParams}} * @param {{paramName}} {{description}} + {{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} + */ + {{#isDeprecated}} + @Deprecated("This api was deprecated") + {{/isDeprecated}} + suspend fun {{operationId}}({{^allParams}}){{/allParams}}{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{#-last}}{{#operationAuthMethod}}, opAuthHeaderFactory = () -> map{{/operationAuthMethod}}){{/-last}}{{/allParams}}: {{#returnType}}{{{returnType}}}?{{/returnType}}{{^returnType}}Unit{{/returnType}} { + {{#bodyParam}} + val body: Any? = {{paramName}} + {{/bodyParam}} + {{^bodyParam}} + val body: Any? = null + {{/bodyParam}} + {{#allParams}} + {{#required}} + // verify the required parameter '{{paramName}}' is set + // This is probably taken care of by non-null types anyway + requireNotNull({{paramName}}) + {{/required}} + {{/allParams}} + + val contentTypes : Array = arrayOf({{#consumes}}"{{{mediaType}}}"{{^-last}},{{/-last}}{{/consumes}}) + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "{{{path}}}"{{#pathParams}}.replace("{" + "{{baseName}}" + "}", IRequestFactory.escapeString({{{paramName}}}.toString())){{/pathParams}}; + + // form params + val formParams = mapOf( + {{#formParams}} + "{{baseName}}" to IRequestFactory.parameterToString({{paramName}}), + {{/formParams}} + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + {{#queryParams}} + "{{baseName}}" to IRequestFactory.parameterToString({{paramName}}), + {{/queryParams}} + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + {{#headerParams}} + "{{baseName}}" to IRequestFactory.parameterToString({{paramName}}), + {{/headerParams}} + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Unit{{/returnType}}> { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Unit{{/returnType}}>() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Unit{{/returnType}}> = requestFactory.build( + Request.Method.{{httpMethod}}, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + {{/operation}} +} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/api_doc.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/api_doc.mustache new file mode 100644 index 000000000000..f7bf73ae31d0 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/api_doc.mustache @@ -0,0 +1,83 @@ +# {{classname}}{{#description}} +{{description}}{{/description}} + +All URIs are relative to *{{basePath}}* + +Method | HTTP request | Description +------------- | ------------- | ------------- +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{/operation}}{{/operations}} + +{{#operations}} +{{#operation}} + +{{summary}}{{#notes}} + +{{notes}}{{/notes}} + +### Example +```kotlin +// Import classes: +//import {{{packageName}}}.* +//import {{{packageName}}}.infrastructure.* +//import {{{modelPackage}}}.* + +val apiClient = ApiClient() +{{#authMethods}} +{{#isBasic}} +{{#isBasicBasic}} +apiClient.setCredentials("USERNAME", "PASSWORD") +{{/isBasicBasic}} +{{#isBasicBearer}} +apiClient.setBearerToken("TOKEN") +{{/isBasicBearer}} +{{/isBasic}} +{{/authMethods}} +val webService = apiClient.createWebservice({{{classname}}}::class.java) +{{#allParams}} +val {{{paramName}}} : {{{dataType}}} = {{{example}}} // {{{dataType}}} | {{{description}}} +{{/allParams}} + +{{#useCoroutines}} +launch(Dispatchers.IO) { +{{/useCoroutines}} +{{#useCoroutines}} {{/useCoroutines}}{{#returnType}}val result : {{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}} = {{/returnType}}webService.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) +{{#useCoroutines}} +} +{{/useCoroutines}} +``` + +### Parameters +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} +Name | Type | Description | Notes +------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#generateModelDocs}}[**{{dataType}}**]({{baseType}}.md){{/generateModelDocs}}{{^generateModelDocs}}**{{dataType}}**{{/generateModelDocs}}{{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +{{/allParams}} + +### Return type + +{{#returnType}}{{#returnTypeIsPrimitive}}**{{returnType}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}{{#generateModelDocs}}[**{{returnType}}**]({{returnBaseType}}.md){{/generateModelDocs}}{{^generateModelDocs}}**{{returnType}}**{{/generateModelDocs}}{{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}null (empty response body){{/returnType}} + +### Authorization + +{{^authMethods}}No authorization required{{/authMethods}} +{{#authMethods}} +{{#isBasic}} +{{#isBasicBasic}} +Configure {{name}}: + ApiClient().setCredentials("USERNAME", "PASSWORD") +{{/isBasicBasic}} +{{#isBasicBearer}} +Configure {{name}}: + ApiClient().setBearerToken("TOKEN") +{{/isBasicBearer}} +{{/isBasic}} +{{/authMethods}} + +### HTTP request headers + + - **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} + - **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} + +{{/operation}} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/apikeyauth.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/apikeyauth.mustache new file mode 100644 index 000000000000..919da64ce3de --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/apikeyauth.mustache @@ -0,0 +1,16 @@ + // Api Key auth supports query header and cookie. + // Query is supported in the path generation only with a hardcoded value. + // TODO: Not sure about cookie auth form + // If implementing api key in query parameter use the ^isKeyInHeader property + + val apiKeyAuthHeaderFactoryBuilder = { + paramName: String, apiKeyPrefix: String?, apiKey: String? -> { + mapOf(paramName to + if (apiKeyPrefix != null) { + "$apiKeyPrefix $apiKey" + } else { + apiKey!! + } + ) + } + } diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/authentication.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/authentication.mustache new file mode 100644 index 000000000000..707a8c25fe34 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/authentication.mustache @@ -0,0 +1,15 @@ +companion object Authentication { + // Where a header factory requires parameters a client will need to bind these + // TODO Generate appropriate header factories based on settings + {{#authMethods}} +{{#isApiKey}} +{{>auth/apikeyauth}} +{{/isApiKey}} +{{#isBasic}} +{{>auth/httpbasicauth}} +{{/isBasic}} +{{#isOAuth}} + // TODO: Oauth not implemented yet - comment out below as OAuth does not exist +{{/isOAuth}} + {{/authMethods}} + } diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/httpbasicauth.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/httpbasicauth.mustache new file mode 100644 index 000000000000..f4cf1e11fe6b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/httpbasicauth.mustache @@ -0,0 +1,3 @@ +val basicAuthHeaderFactoryBuilder = { username: String?, password: String? -> + { mapOf("Authorization" to "Basic " + Base64.encodeToString("${username ?: ""}:${password ?: ""}".toByteArray(), Base64.DEFAULT))} +} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/oauth.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/oauth.mustache new file mode 100644 index 000000000000..78ffc6a2d7c5 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/oauth.mustache @@ -0,0 +1,5 @@ +val basicAuthHeaderFactoryBuilder = { username: String?, password: String? -> +{ + throw NotImplementedError("OAuth security scheme header factory not impemented yet - see open api generator auth/oauth.mustache") + mapOf("" to "")} +} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/bodyParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/bodyParams.mustache new file mode 100644 index 000000000000..886aecf65e30 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/bodyParams.mustache @@ -0,0 +1 @@ +{{#isBodyParam}}{{{paramName}}}: {{{dataType}}}{{^required}}? = null{{/required}}{{/isBodyParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/build.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/build.mustache new file mode 100644 index 000000000000..341884176a93 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/build.mustache @@ -0,0 +1,129 @@ +{{#useAndroidMavenGradlePlugin}} +group = '{{groupId}}' +project.version = '{{artifactVersion}}' +{{/useAndroidMavenGradlePlugin}} + +buildscript { + + ext.kotlin_version = '1.5.10' + + ext.swagger_annotations_version = "1.6.2" + + ext.gson_version = "2.8.6" + + ext.volley_version = "1.2.0" + + ext.junit_version = "4.13.2" + + ext.robolectric_version = "4.5.1" + + ext.concurrent_unit_version = "0.4.6" + + repositories { + mavenLocal() + google() + maven { + url 'https://dl.google.com/dl/android/maven2' + } + mavenCentral() + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath 'com.android.tools.build:gradle:4.0.2' + {{#useAndroidMavenGradlePlugin}} + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' + {{/useAndroidMavenGradlePlugin}} + } +} + +allprojects { + repositories { + google() + mavenCentral() + } +} + +apply plugin: 'com.android.library' +apply plugin: 'kotlin-android' +{{#useAndroidMavenGradlePlugin}} +apply plugin: 'com.github.dcendents.android-maven' +{{/useAndroidMavenGradlePlugin}} + +android { + compileSdkVersion 30 + defaultConfig { + minSdkVersion 21 + targetSdkVersion 30 + } + compileOptions { + coreLibraryDesugaringEnabled true + {{#supportJava6}} + sourceCompatibility JavaVersion.VERSION_1_6 + targetCompatibility JavaVersion.VERSION_1_6 + {{/supportJava6}} + {{^supportJava6}} + {{#java8}} + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + {{/java8}} + {{^java8}} + sourceCompatibility JavaVersion.VERSION_1_7 + targetCompatibility JavaVersion.VERSION_1_7 + {{/java8}} + {{/supportJava6}} + } + lintOptions { + abortOnError false + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.all { output -> + if (outputFile != null && outputFileName.endsWith('.aar')) { + outputFileName = "${archivesBaseName}-${version}.aar" + } + } + } + + testOptions { + unitTests.returnDefaultValues = true + } +} + +dependencies { + coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' + implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + implementation "io.swagger:swagger-annotations:$swagger_annotations_version" + implementation "com.google.code.gson:gson:$gson_version" + implementation "com.android.volley:volley:${volley_version}" + testImplementation "junit:junit:$junit_version" + testImplementation "org.robolectric:robolectric:${robolectric_version}" + testImplementation "net.jodah:concurrentunit:${concurrent_unit_version}" + {{#generateRoomModels}} + annotationProcessor "androidx.room:room-runtime:2.3.0" + implementation "androidx.room:room-runtime:2.3.0" + {{/generateRoomModels}} +} + +afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task); + } +} + +{{#useAndroidMavenGradlePlugin}} +task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' +} + +artifacts { + archives sourcesJar +} +{{/useAndroidMavenGradlePlugin}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/formParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/formParams.mustache new file mode 100644 index 000000000000..62de9c638183 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/formParams.mustache @@ -0,0 +1 @@ +{{#isFormParam}}{{{paramName}}}: {{{dataType}}}{{#required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/gradle.properties.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/gradle.properties.mustache new file mode 100644 index 000000000000..8cbe6270192c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/gradle.properties.mustache @@ -0,0 +1,4 @@ +{{#generateRoomModels}} +android.useAndroidX=true +android.enableJetifier=true +{{/generateRoomModels}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/headerParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/headerParams.mustache new file mode 100644 index 000000000000..4226cf9b4b9a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/headerParams.mustache @@ -0,0 +1 @@ +{{#isHeaderParam}}{{{paramName}}}: {{{dataType}}}{{#required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/infrastructure/CollectionFormats.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/infrastructure/CollectionFormats.kt.mustache new file mode 100644 index 000000000000..659f2df4851a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/infrastructure/CollectionFormats.kt.mustache @@ -0,0 +1,56 @@ +package {{packageName}}.infrastructure + +class CollectionFormats { + + open class CSVParams { + + var params: List + + constructor(params: List) { + this.params = params + } + + constructor(vararg params: String) { + this.params = listOf(*params) + } + + override fun toString(): String { + return params.joinToString(",") + } + } + + open class SSVParams : CSVParams { + + constructor(params: List) : super(params) + + constructor(vararg params: String) : super(*params) + + override fun toString(): String { + return params.joinToString(" ") + } + } + + class TSVParams : CSVParams { + + constructor(params: List) : super(params) + + constructor(vararg params: String) : super(*params) + + override fun toString(): String { + return params.joinToString("\t") + } + } + + class PIPESParams : CSVParams { + + constructor(params: List) : super(params) + + constructor(vararg params: String) : super(*params) + + override fun toString(): String { + return params.joinToString("|") + } + } + + class SPACEParams : SSVParams() +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/infrastructure/ITransformForStorage.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/infrastructure/ITransformForStorage.mustache new file mode 100644 index 000000000000..83b5fa369ab8 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/infrastructure/ITransformForStorage.mustache @@ -0,0 +1,9 @@ +{{>licenseInfo}} +package {{packageName}}.infrastructure + +import {{roomModelPackage}}.* + +// TODO ITransformForStorage +interface ITransformForStorage { + fun toRoomModel(): T +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/manifest.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/manifest.mustache new file mode 100644 index 000000000000..1ea918bad732 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/manifest.mustache @@ -0,0 +1,5 @@ + + + + + diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/pathParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/pathParams.mustache new file mode 100644 index 000000000000..12deb9aac19c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/pathParams.mustache @@ -0,0 +1 @@ +{{#isPathParam}}{{{paramName}}}: {{{dataType}}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/queryParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/queryParams.mustache new file mode 100644 index 000000000000..9ab185315111 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/queryParams.mustache @@ -0,0 +1 @@ +{{#isQueryParam}}{{{paramName}}}: {{#collectionFormat}}{{#isCollectionFormatMulti}}{{{dataType}}}{{/isCollectionFormatMulti}}{{^isCollectionFormatMulti}}{{{collectionFormat.toUpperCase}}}Params{{/isCollectionFormatMulti}}{{/collectionFormat}}{{^collectionFormat}}{{{dataType}}}{{/collectionFormat}}{{^required}}? = null{{/required}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/GsonRequest.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/GsonRequest.mustache new file mode 100644 index 000000000000..e87f7413aab3 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/GsonRequest.mustache @@ -0,0 +1,119 @@ +package {{packageName}}.request + +import com.android.volley.NetworkResponse +import com.android.volley.ParseError +import com.android.volley.Request +import com.android.volley.Response +import com.android.volley.toolbox.HttpHeaderParser +import com.google.gson.Gson +import com.google.gson.GsonBuilder +import com.google.gson.JsonSyntaxException +import java.io.UnsupportedEncodingException +import java.nio.charset.Charset +import java.net.HttpURLConnection +import java.lang.reflect.Type +import java.time.LocalDate +import java.time.LocalDateTime +import java.time.OffsetDateTime + +import {{packageName}}.infrastructure.OffsetDateTimeAdapter +import {{packageName}}.infrastructure.LocalDateTimeAdapter +import {{packageName}}.infrastructure.LocalDateAdapter +import {{packageName}}.infrastructure.ByteArrayAdapter + +class GsonRequest( + method: Int, + url: String, + private val body: Any?, + private val headers: Map?, + private val params: MutableMap?, + private val contentTypeForBody: String?, + private val encodingForParams: String?, + private val gsonAdapters: Map?, + private val type: Type, + private val listener: Response.Listener, + errorListener: Response.ErrorListener +) : Request(method, url, errorListener) { + + val gsonBuilder: GsonBuilder = GsonBuilder() + .registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter()) + .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) + .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) + .registerTypeAdapter(ByteArray::class.java, ByteArrayAdapter()) + .apply { + gsonAdapters?.forEach { + this.registerTypeAdapter(it.key, it.value) + } + } + + val gson: Gson by lazy { + gsonBuilder.create() + } + + private var response: NetworkResponse? = null + + override fun deliverResponse(response: T?) { + listener.onResponse(response) + } + + override fun getParams(): MutableMap? = params ?: super.getParams() + + override fun getBodyContentType(): String = contentTypeForBody ?: super.getBodyContentType() + + override fun getParamsEncoding(): String = encodingForParams ?: super.getParamsEncoding() + + override fun getHeaders(): MutableMap { + val combined = HashMap() + combined.putAll(super.getHeaders()) + if (headers != null) { + combined.putAll(headers) + } + return combined + } + + override fun getBody(): ByteArray? { + if (body != null) { + return gson.toJson(body).toByteArray(Charsets.UTF_8) + } + return super.getBody() + } + + override fun parseNetworkResponse(response: NetworkResponse?): Response { + return try { + this.response = copyTo(response) + val json = String( + response?.data ?: ByteArray(0), + Charset.forName(HttpHeaderParser.parseCharset(response?.headers)) + ) + Response.success( + gson.fromJson(json, type), + HttpHeaderParser.parseCacheHeaders(response) + ) + } catch (e: UnsupportedEncodingException) { + Response.error(ParseError(e)) + } catch (e: JsonSyntaxException) { + Response.error(ParseError(e)) + } + } + + private fun copyTo(response: NetworkResponse?): NetworkResponse { + return if (response != null) { + NetworkResponse( + response.statusCode, + response.data, + response.notModified, + response.networkTimeMs, + response.allHeaders + ) + } else { + // Return an empty response. + NetworkResponse( + HttpURLConnection.HTTP_BAD_METHOD, + ByteArray(0), + false, + 0, + emptyList() + ) + } + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/IRequestFactory.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/IRequestFactory.mustache new file mode 100644 index 000000000000..d46fe90c6202 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/IRequestFactory.mustache @@ -0,0 +1,64 @@ +package {{packageName}}.request + +import com.android.volley.Request +import com.android.volley.Response +import java.io.UnsupportedEncodingException +import java.lang.reflect.Type +import java.net.URLEncoder +import java.text.ParseException +import java.text.SimpleDateFormat +import java.util.* +import java.time.format.DateTimeFormatter +import java.time.OffsetDateTime +import java.time.LocalDate + + +interface IRequestFactory { + + companion object { + /** + * ISO 8601 date time format. + * @see https://en.wikipedia.org/wiki/ISO_8601 + */ + fun formatDateTime(datetime: OffsetDateTime) = DateTimeFormatter.ISO_INSTANT.format(datetime) + fun formatDate(date: LocalDate) = DateTimeFormatter.ISO_LOCAL_DATE.format(date) + + fun escapeString(str: String): String { + return try { + URLEncoder.encode(str, "UTF-8") + } catch (e: UnsupportedEncodingException) { + str + } + } + + fun parameterToString(param: Any?) = + when (param) { + null -> "" + is OffsetDateTime -> formatDateTime(param) + is Collection<*> -> { + val b = StringBuilder() + for (o in param) { + if (b.isNotEmpty()) { + b.append(",") + } + b.append(o.toString()) + } + b.toString() + } + else -> param.toString() + } + } + + + fun build( + method: Int, + url : String, + body: Any?, + headers: Map?, + queryParams: Map?, + formParams: Map?, + contentTypeForBody: String?, + type: Type, + responseListener: Response.Listener, + errorListener: Response.ErrorListener): Request +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/RequestFactory.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/RequestFactory.mustache new file mode 100644 index 000000000000..e9bc5d21283a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/RequestFactory.mustache @@ -0,0 +1,69 @@ +// Knowing the details of an operation it will produce a call to a Volley Request constructor +package {{packageName}}.request + + +import com.android.volley.Request +import com.android.volley.Response +{{#hasAuthMethods}} +import android.util.Base64 +{{/hasAuthMethods}} +import {{packageName}}.request.IRequestFactory.Companion.escapeString +import java.lang.reflect.Type +import java.util.Locale +import java.util.UUID + +class RequestFactory(private val headerFactories : List<() -> Map> = listOf(), private val postProcessors :List <(Request<*>) -> Unit> = listOf(), private val gsonAdapters: Map = mapOf()): IRequestFactory { +{{#hasAuthMethods}} + + {{>auth/authentication}} +{{/hasAuthMethods}} + + /** + * {@inheritDoc} + */ + @Suppress("UNCHECKED_CAST") + override fun build( + method: Int, + url: String, + body: Any?, + headers: Map?, + queryParams: Map?, + formParams: Map?, + contentTypeForBody: String?, + type: Type, + responseListener: Response.Listener, + errorListener: Response.ErrorListener + ): Request { + val afterMarketHeaders = (headers?.toMutableMap() ?: mutableMapOf()) + // Factory built and aftermarket + // Merge the after market headers on top of the base ones in case we are overriding per call auth + val allHeaders = headerFactories.fold(afterMarketHeaders) { acc, factory -> (acc + factory.invoke()).toMutableMap() } + + // If we decide to support auth parameters in the url, then you will reference them by supplying a url string + // with known variable name refernces in the string. We will then apply + val updatedUrl = if (!queryParams.isNullOrEmpty()) { + queryParams.asSequence().fold("$url?") {acc, param -> + "$acc${escapeString(param.key)}=${escapeString(param.value)}&" + }.trimEnd('&') + } else { + url + } + + val request = GsonRequest( + method, + updatedUrl, + body, + allHeaders, + formParams?.toMutableMap(), + contentTypeForBody, + null, + gsonAdapters, + type, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + return request + } +} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/model_room.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/model_room.mustache new file mode 100644 index 000000000000..bb43e6bf87ec --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/model_room.mustache @@ -0,0 +1,38 @@ +{{>licenseInfo}} +package {{roomModelPackage}} + +import androidx.room.Entity +import androidx.room.Ignore +import androidx.room.PrimaryKey +import {{modelPackage}}.* + +{{#models}} +{{#model}} + +@Entity(tableName = "{{classname}}") +/** +* Room model for {{{description}}} +{{#allVars}} +* @param {{{name}}} {{{description}}} +{{/allVars}} +*/ +data class {{classname}}RoomModel ( + @PrimaryKey(autoGenerate = true) var roomTableId: Int, + {{#allVars}}{{#items.isPrimitiveType}}var {{{name}}}: {{#isArray}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{^items.isEnum}}{{{items.dataType}}}{{/items.isEnum}}{{#items.isEnum}}{{classname}}.{{{nameInCamelCase}}}{{/items.isEnum}}>{{>model_room_init_var}}{{/isArray}}, + {{/items.isPrimitiveType}}{{/allVars}} + {{#allVars}}{{^isEnum}}{{^isArray}}var {{{name}}}: {{{dataType}}}{{>model_room_init_var}}, + {{/isArray}}{{/isEnum}}{{/allVars}} + {{#allVars}}{{#isEnum}}{{^isArray}}var {{{name}}}: {{classname}}.{{{nameInCamelCase}}}{{>model_room_init_var}}, + {{/isArray}}{{/isEnum}}{{/allVars}}) { +{{#allVars}}{{#isArray}}{{#isList}}{{^items.isPrimitiveType}} + @Ignore + {{^isNullable}}{{#required}}lateinit {{/required}}{{/isNullable}}var {{{name}}}: {{#isArray}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{^items.isEnum}}{{^items.isPrimitiveType}}{{^items.isModel}}{{/items.isModel}}{{/items.isPrimitiveType}}{{{items.dataType}}}{{/items.isEnum}}{{#items.isEnum}}{{classname}}.{{{nameInCamelCase}}}{{/items.isEnum}}>{{>model_room_init_var}}{{/isArray}} +{{/items.isPrimitiveType}}{{/isList}}{{/isArray}}{{/allVars}} + {{^discriminator}}companion object { } + + fun toApiModel(): {{classname}} = {{classname}}( + {{#allVars}}{{name}} = this.{{name}}, + {{/allVars}}){{/discriminator}} +} +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/model_room_init_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/model_room_init_var.mustache new file mode 100644 index 000000000000..01896d2439f6 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/model_room_init_var.mustache @@ -0,0 +1 @@ +{{#isNullable}}?{{/isNullable}}{{^required}}?{{/required}}{{#defaultvalue}} = {{defaultvalue}}{{/defaultvalue}}{{^defaultvalue}}{{#isNullable}} = null{{/isNullable}}{{^required}} = null{{/required}}{{/defaultvalue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtils.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtils.java index e82c584a4c59..7c7ee64361d4 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtils.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtils.java @@ -187,4 +187,14 @@ public static void assertFileNotContains(Path path, String... lines) { for (String line : lines) assertFalse(file.contains(linearize(line))); } + + public static void assertFileNotExists(Path path) { + try { + new String(Files.readAllBytes(path), StandardCharsets.UTF_8); + fail("File exists when it should not: " + path); + } catch (IOException e) { + // File exists, pass. + assertTrue(true); + } + } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/jvm_volley/KotlinJvmVolleyModelCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/jvm_volley/KotlinJvmVolleyModelCodegenTest.java new file mode 100644 index 000000000000..6473e036d4d7 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/jvm_volley/KotlinJvmVolleyModelCodegenTest.java @@ -0,0 +1,83 @@ +package org.openapitools.codegen.kotlin.jvm_volley; + +import io.swagger.parser.OpenAPIParser; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.parser.core.models.ParseOptions; +import org.openapitools.codegen.ClientOptInput; +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.DefaultGenerator; +import org.openapitools.codegen.languages.AbstractKotlinCodegen; +import org.openapitools.codegen.languages.KotlinClientCodegen; +import org.testng.annotations.Test; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; + +import static org.openapitools.codegen.TestUtils.*; + +public class KotlinJvmVolleyModelCodegenTest { + + @Test + public void modelsWithRoomModels() throws IOException { + KotlinClientCodegen codegen = new KotlinClientCodegen(); + codegen.additionalProperties().put(KotlinClientCodegen.GENERATE_ROOM_MODELS, true); + codegen.additionalProperties().put(KotlinClientCodegen.ROOM_MODEL_PACKAGE, "models.room"); + codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, AbstractKotlinCodegen.SERIALIZATION_LIBRARY_TYPE.gson.name()); + + String outputPath = checkModel(codegen, false); + + assertFileContains(Paths.get(outputPath + "/src/main/java/models/room/BigDogRoomModel.kt"), "toApiModel()"); + assertFileContains(Paths.get(outputPath + "/src/main/java/models/BigDog.kt"), "toRoomModel()"); + } + + @Test + public void modelsWithoutRoomModels() throws IOException { + KotlinClientCodegen codegen = new KotlinClientCodegen(); + codegen.additionalProperties().put(KotlinClientCodegen.GENERATE_ROOM_MODELS, false); + codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, AbstractKotlinCodegen.SERIALIZATION_LIBRARY_TYPE.gson.name()); + + String outputPath = checkModel(codegen, false); + + assertFileNotExists(Paths.get(outputPath + "/src/main/java/models/room/BigDogRoomModel.kt")); + assertFileContains(Paths.get(outputPath + "/src/main/java/models/BigDog.kt")); + assertFileNotContains(Paths.get(outputPath + "/src/main/java/models/BigDog.kt"), "toRoomModel()"); + } + + private String checkModel(AbstractKotlinCodegen codegen, boolean mutable, String... props) throws IOException { + String outputPath = generateModels(codegen, "src/test/resources/3_0/generic.yaml", mutable); + assertFileContains(Paths.get(outputPath + "/src/main/java/models/Animal.kt"), props); + return outputPath; + } + + private String generateModels(AbstractKotlinCodegen codegen, String fileName, boolean mutable) throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + String outputPath = output.getAbsolutePath().replace('\\', '/'); + + OpenAPI openAPI = new OpenAPIParser() + .readLocation(fileName, null, new ParseOptions()).getOpenAPI(); + codegen.setOutputDir(output.getAbsolutePath()); + codegen.setLibrary("jvm-volley"); + + codegen.additionalProperties().put(CodegenConstants.MODEL_PACKAGE, "models"); + codegen.additionalProperties().put(AbstractKotlinCodegen.MODEL_MUTABLE, mutable); + + ClientOptInput input = new ClientOptInput() + .openAPI(openAPI) + .config(codegen); + + DefaultGenerator generator = new DefaultGenerator(); + + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "true"); + + generator.opts(input).generate(); + + return outputPath; + } +} diff --git a/samples/client/petstore/kotlin-jvm-volley/.openapi-generator-ignore b/samples/client/petstore/kotlin-jvm-volley/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/kotlin-jvm-volley/.openapi-generator/FILES b/samples/client/petstore/kotlin-jvm-volley/.openapi-generator/FILES new file mode 100644 index 000000000000..1de427bbcb2f --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/.openapi-generator/FILES @@ -0,0 +1,43 @@ +README.md +build.gradle +docs/ApiResponse.md +docs/Category.md +docs/Order.md +docs/Pet.md +docs/PetApi.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/apis/PetApi.kt +src/main/java/org/openapitools/client/apis/StoreApi.kt +src/main/java/org/openapitools/client/apis/UserApi.kt +src/main/java/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +src/main/java/org/openapitools/client/infrastructure/CollectionFormats.kt +src/main/java/org/openapitools/client/infrastructure/CollectionFormats.kt +src/main/java/org/openapitools/client/infrastructure/ITransformForStorage.kt +src/main/java/org/openapitools/client/infrastructure/LocalDateAdapter.kt +src/main/java/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +src/main/java/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +src/main/java/org/openapitools/client/models/Category.kt +src/main/java/org/openapitools/client/models/ModelApiResponse.kt +src/main/java/org/openapitools/client/models/Order.kt +src/main/java/org/openapitools/client/models/Pet.kt +src/main/java/org/openapitools/client/models/Tag.kt +src/main/java/org/openapitools/client/models/User.kt +src/main/java/org/openapitools/client/models/room/CategoryRoomModel.kt +src/main/java/org/openapitools/client/models/room/ModelApiResponseRoomModel.kt +src/main/java/org/openapitools/client/models/room/OrderRoomModel.kt +src/main/java/org/openapitools/client/models/room/PetRoomModel.kt +src/main/java/org/openapitools/client/models/room/TagRoomModel.kt +src/main/java/org/openapitools/client/models/room/UserRoomModel.kt +src/main/java/org/openapitools/client/request/GsonRequest.kt +src/main/java/org/openapitools/client/request/IRequestFactory.kt +src/main/java/org/openapitools/client/request/RequestFactory.kt diff --git a/samples/client/petstore/kotlin-jvm-volley/.openapi-generator/VERSION b/samples/client/petstore/kotlin-jvm-volley/.openapi-generator/VERSION new file mode 100644 index 000000000000..4077803655c0 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-volley/README.md b/samples/client/petstore/kotlin-jvm-volley/README.md new file mode 100644 index 000000000000..9350405a0f57 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/README.md @@ -0,0 +1,230 @@ +# org.openapitools.client - Kotlin client library for OpenAPI Petstore + + +A kotlin client for Android using the currently recommended http client, Volley. See https://developer.android.com/training/volley + +- Currently sends GsonRequests +- Currently only supports Gson as a serializer - will throw an exception if a different serializer is chosen +- Defaults the source location to src/main/java as per standard Android builds + + +## Design + +Volley is a queue/request based layer on top of http url stack specific to Android. Android favours dependency injection and +a layered architecture, and IO performed off the main thread to maintain UI responsiveness, with a preferred technique of +kotlin co-routines. The code gen library reflects these factors. + +- Api calls use co-routines, and execute them using volley callbacks to avoid tying up a thread. +- Facilitate dependency injection, with default implementations available. +- Generate a requestFactory that can be overridden +- Allow the passing of the RequestFactory per tag (api client) or per operation (an extra parameter is created on operations with non-global security), with per operation auth overriding global security. +- DI scoping of the Request Factory and pre-generated auth header factories allow for thread safe and secure setting of credentials. +- Lazy header factories allow for refreshing tokens etc +- Factoring of header factories to the Request Factory allow ambient provision of credentials. Code gen library is credential storage agnostic. +- Header factories allow the merging of generated headers from open api spec with dynamically added headers + +- Injection of http url stack to allow custom http stacks. Default implementation is best practice singleton +- Data classes used for serialisation to reflect volley's preference - an immutable request that once queued can't be tampered with. + +- Reuse model class and other jvm common infrastructure + +- Optional generation of room database models, and transform methods to these from open api models +- Room and api models can be extended with additional extension properties. + +## Future improvements +- Option to generate image requests on certain conditionals e.g content-type gif etc +- Support for kotlin serialization. +- Multi part form parameters and support for file inputs + +## Usage +Hilt Dependency injection example - with default values for parameters overridden. +``` + @Provides + internal fun provideSomeApi( + context: Context, + restService: IRestService, + configurationService: IConfigurationService, + sessionService: ISessionService + ): SomeApi { + return SomeApi( + context = context, + requestQueue = restService.getRequestQueue(), + requestFactory = RequestFactory(listOf(createSessionHeaderFactory(sessionService), createTraceHeaderFactory()), + postProcessors = listOf(retryPolicySetter)), + basePath = configurationService.getBaseUrl() + ) + } +``` +Here is the constructor so you can see the defaults +```class SomeApi ( +val context: Context, +val requestQueue: Lazy = lazy(initializer = { + Volley.newRequestQueue(context.applicationContext) + }), + val requestFactory: IRequestFactory = RequestFactory(), + val basePath: String = "https://yourbasepath.from_input_parameter.com/api", + private val postProcessors :List <(Request<*>) -> Unit> = listOf()) { +``` + +### Overriding defaults +The above constructor for each api allows the following to be customized +- A custom context, so either a singleton request queue or different scope can be created - see +https://developer.android.com/training/volley/requestqueue#singleton +- An overrideable request queue - which in turn can have a custom http url stack passed to it +- An overrideable request factory constructor call, or a request factory that can be overridden by a custom template, with +custom header factory, request post processors and custom gson adapters injected. + +#### Overriding request generation +Request generation can be overridden by +- Overriding the entire request factory template +- Supplying custom header factories - methods that take any possible parameters but return a map of headers +- Supplying custom request post processors - methods that take and return the request object + +Header factory examples can be found in the auth section, as these are implemented as header factories. eg +``` +val basicAuthHeaderFactoryBuilder = { username: String?, password: String? -> +{ mapOf("Authorization" to "Basic " + Base64.encodeToString("${username ?: ""}:${password ?: ""}".toByteArray(), Base64.DEFAULT))} +} +``` +In this case it's a lambda function (a factory method) that takes an username and password, and returns a map of headers. Other +generated code will supply the username and password. In this case it results in a map of just one key/value pair, but +it could be multiple. The important part is it's returning a map - and that the surrounding code +will can bind the inputs to it at some point. + +Here is a different example that supplies tracing header values +``` +/** + * Create a lambda of tracing headers to be injected into an API's [RequestFactory]. + */ +private fun createTraceHeaderFactory(): () -> Map = { + mapOf( + HttpHeaderType.b3_traceId.rawValue to UUIDExtensions.asTraceId(UUID.randomUUID()), + HttpHeaderType.b3_spanId.rawValue to UUIDExtensions.asSpanId(UUID.randomUUID()), + HttpHeaderType.b3_sampled.rawValue to "1" + ) +} +``` +Finally a post processor example +``` + /** + * Configure a [DefaultRetryPolicy] to be injected into the [RequestFactory] with a maximum number of retries of zero. + */ + private val retryPolicySetter = { request: Request<*> -> + Unit.apply { + request.setRetryPolicy( + DefaultRetryPolicy( + RestService.DEFAULT_TIMEOUT_MS, + 0, + DefaultRetryPolicy.DEFAULT_BACKOFF_MULT + ) + ) + } + } +``` + +### Serialization +#### Gson and Polymorphic types +The GsonRequest object can be passed custom type adapters +``` +class GsonRequest( + method: Int, + url: String, + private val body: Any?, + private val headers: Map?, + private val params: MutableMap?, + private val contentTypeForBody: String?, + private val encodingForParams: String?, + private val gsonAdapters: Map?, + private val type: Type, + private val listener: Response.Listener, + errorListener: Response.ErrorListener +) : Request(method, url, errorListener) { + + val gsonBuilder: GsonBuilder = GsonBuilder() + .registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter()) + .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) + .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) + .registerTypeAdapter(ByteArray::class.java, ByteArrayAdapter()) + +``` +## Requires + +* Kotlin 1.4.30 +* Gradle 6.8.3 + +## Build + +First, create the gradle wrapper script: + +``` +gradle wrapper +``` + +Then, run: + +``` +./gradlew check assemble +``` + +This runs all tests and packages the library. + + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + + +## Documentation for Models + + - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) + - [org.openapitools.client.models.Order](docs/Order.md) + - [org.openapitools.client.models.Pet](docs/Pet.md) + - [org.openapitools.client.models.Tag](docs/Tag.md) + - [org.openapitools.client.models.User](docs/User.md) + + + +## Documentation for Authorization + + +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + + +### petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - write:pets: modify pets in your account + - read:pets: read your pets + diff --git a/samples/client/petstore/kotlin-jvm-volley/build.gradle b/samples/client/petstore/kotlin-jvm-volley/build.gradle new file mode 100644 index 000000000000..6a369e599487 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/build.gradle @@ -0,0 +1,95 @@ + +buildscript { + + ext.kotlin_version = '1.5.10' + + ext.swagger_annotations_version = "1.6.2" + + ext.gson_version = "2.8.6" + + ext.volley_version = "1.2.0" + + ext.junit_version = "4.13.2" + + ext.robolectric_version = "4.5.1" + + ext.concurrent_unit_version = "0.4.6" + + repositories { + mavenLocal() + google() + maven { + url 'https://dl.google.com/dl/android/maven2' + } + mavenCentral() + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath 'com.android.tools.build:gradle:4.0.2' + } +} + +allprojects { + repositories { + google() + mavenCentral() + } +} + +apply plugin: 'com.android.library' +apply plugin: 'kotlin-android' + +android { + compileSdkVersion 30 + defaultConfig { + minSdkVersion 21 + targetSdkVersion 30 + } + compileOptions { + coreLibraryDesugaringEnabled true + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + lintOptions { + abortOnError false + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.all { output -> + if (outputFile != null && outputFileName.endsWith('.aar')) { + outputFileName = "${archivesBaseName}-${version}.aar" + } + } + } + + testOptions { + unitTests.returnDefaultValues = true + } +} + +dependencies { + coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' + implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + implementation "io.swagger:swagger-annotations:$swagger_annotations_version" + implementation "com.google.code.gson:gson:$gson_version" + implementation "com.android.volley:volley:${volley_version}" + testImplementation "junit:junit:$junit_version" + testImplementation "org.robolectric:robolectric:${robolectric_version}" + testImplementation "net.jodah:concurrentunit:${concurrent_unit_version}" + annotationProcessor "androidx.room:room-runtime:2.3.0" + implementation "androidx.room:room-runtime:2.3.0" +} + +afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task); + } +} + diff --git a/samples/client/petstore/kotlin-jvm-volley/docs/ApiResponse.md b/samples/client/petstore/kotlin-jvm-volley/docs/ApiResponse.md new file mode 100644 index 000000000000..12f08d5cdef0 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/docs/ApiResponse.md @@ -0,0 +1,12 @@ + +# ModelApiResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **kotlin.Int** | | [optional] +**type** | **kotlin.String** | | [optional] +**message** | **kotlin.String** | | [optional] + + + diff --git a/samples/client/petstore/kotlin-jvm-volley/docs/Category.md b/samples/client/petstore/kotlin-jvm-volley/docs/Category.md new file mode 100644 index 000000000000..2c28a670fc79 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/docs/Category.md @@ -0,0 +1,11 @@ + +# Category + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**name** | **kotlin.String** | | [optional] + + + diff --git a/samples/client/petstore/kotlin-jvm-volley/docs/Order.md b/samples/client/petstore/kotlin-jvm-volley/docs/Order.md new file mode 100644 index 000000000000..94ab0d537e54 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/docs/Order.md @@ -0,0 +1,22 @@ + +# Order + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**petId** | **kotlin.Long** | | [optional] +**quantity** | **kotlin.Int** | | [optional] +**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] +**status** | [**inline**](#Status) | Order Status | [optional] +**complete** | **kotlin.Boolean** | | [optional] + + + +## Enum: status +Name | Value +---- | ----- +status | placed, approved, delivered + + + diff --git a/samples/client/petstore/kotlin-jvm-volley/docs/Pet.md b/samples/client/petstore/kotlin-jvm-volley/docs/Pet.md new file mode 100644 index 000000000000..bc3dd89718f0 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/docs/Pet.md @@ -0,0 +1,22 @@ + +# Pet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.String** | | +**photoUrls** | **kotlin.collections.List<kotlin.String>** | | +**id** | **kotlin.Long** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] +**status** | [**inline**](#Status) | pet status in the store | [optional] + + + +## Enum: status +Name | Value +---- | ----- +status | available, pending, sold + + + diff --git a/samples/client/petstore/kotlin-jvm-volley/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-volley/docs/PetApi.md new file mode 100644 index 000000000000..529441d7dfd9 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/docs/PetApi.md @@ -0,0 +1,320 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store +[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet +[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID +[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet +[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image + + + +Add a new pet to the store + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(PetApi::class.java) +val body : Pet = // Pet | Pet object that needs to be added to the store + +webService.addPet(body) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +null (empty response body) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +Deletes a pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(PetApi::class.java) +val petId : kotlin.Long = 789 // kotlin.Long | Pet id to delete +val apiKey : kotlin.String = apiKey_example // kotlin.String | + +webService.deletePet(petId, apiKey) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| Pet id to delete | + **apiKey** | **kotlin.String**| | [optional] + +### Return type + +null (empty response body) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(PetApi::class.java) +val status : kotlin.collections.List = // kotlin.collections.List | Status values that need to be considered for filter + +val result : kotlin.collections.List = webService.findPetsByStatus(status) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + +### Return type + +[**kotlin.collections.List<Pet>**](Pet.md) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(PetApi::class.java) +val tags : kotlin.collections.List = // kotlin.collections.List | Tags to filter by + +val result : kotlin.collections.List = webService.findPetsByTags(tags) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | + +### Return type + +[**kotlin.collections.List<Pet>**](Pet.md) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +Find pet by ID + +Returns a single pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(PetApi::class.java) +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to return + +val result : Pet = webService.getPetById(petId) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +Update an existing pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(PetApi::class.java) +val body : Pet = // Pet | Pet object that needs to be added to the store + +webService.updatePet(body) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +null (empty response body) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +Updates a pet in the store with form data + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(PetApi::class.java) +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be updated +val name : kotlin.String = name_example // kotlin.String | Updated name of the pet +val status : kotlin.String = status_example // kotlin.String | Updated status of the pet + +webService.updatePetWithForm(petId, name, status) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet that needs to be updated | + **name** | **kotlin.String**| Updated name of the pet | [optional] + **status** | **kotlin.String**| Updated status of the pet | [optional] + +### Return type + +null (empty response body) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +uploads an image + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(PetApi::class.java) +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update +val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server +val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload + +val result : ModelApiResponse = webService.uploadFile(petId, additionalMetadata, file) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to update | + **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] + **file** | **java.io.File**| file to upload | [optional] + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + diff --git a/samples/client/petstore/kotlin-jvm-volley/docs/StoreApi.md b/samples/client/petstore/kotlin-jvm-volley/docs/StoreApi.md new file mode 100644 index 000000000000..168afd9b9c07 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/docs/StoreApi.md @@ -0,0 +1,158 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet + + + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(StoreApi::class.java) +val orderId : kotlin.String = orderId_example // kotlin.String | ID of the order that needs to be deleted + +webService.deleteOrder(orderId) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **kotlin.String**| ID of the order that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(StoreApi::class.java) + +val result : kotlin.collections.Map = webService.getInventory() +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**kotlin.collections.Map<kotlin.String, kotlin.Int>** + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(StoreApi::class.java) +val orderId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be fetched + +val result : Order = webService.getOrderById(orderId) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +Place an order for a pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(StoreApi::class.java) +val body : Order = // Order | order placed for purchasing the pet + +val result : Order = webService.placeOrder(body) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + diff --git a/samples/client/petstore/kotlin-jvm-volley/docs/Tag.md b/samples/client/petstore/kotlin-jvm-volley/docs/Tag.md new file mode 100644 index 000000000000..60ce1bcdbad3 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/docs/Tag.md @@ -0,0 +1,11 @@ + +# Tag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**name** | **kotlin.String** | | [optional] + + + diff --git a/samples/client/petstore/kotlin-jvm-volley/docs/User.md b/samples/client/petstore/kotlin-jvm-volley/docs/User.md new file mode 100644 index 000000000000..e801729b5ed1 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/docs/User.md @@ -0,0 +1,17 @@ + +# User + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**username** | **kotlin.String** | | [optional] +**firstName** | **kotlin.String** | | [optional] +**lastName** | **kotlin.String** | | [optional] +**email** | **kotlin.String** | | [optional] +**password** | **kotlin.String** | | [optional] +**phone** | **kotlin.String** | | [optional] +**userStatus** | **kotlin.Int** | User Status | [optional] + + + diff --git a/samples/client/petstore/kotlin-jvm-volley/docs/UserApi.md b/samples/client/petstore/kotlin-jvm-volley/docs/UserApi.md new file mode 100644 index 000000000000..b26ede410044 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/docs/UserApi.md @@ -0,0 +1,310 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserApi.md#createUser) | **POST** /user | Create user +[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + + +Create user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(UserApi::class.java) +val body : User = // User | Created user object + +webService.createUser(body) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**User**](User.md)| Created user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +Creates list of users with given input array + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(UserApi::class.java) +val body : kotlin.collections.List = // kotlin.collections.List | List of user object + +webService.createUsersWithArrayInput(body) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +Creates list of users with given input array + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(UserApi::class.java) +val body : kotlin.collections.List = // kotlin.collections.List | List of user object + +webService.createUsersWithListInput(body) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +Delete user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(UserApi::class.java) +val username : kotlin.String = username_example // kotlin.String | The name that needs to be deleted + +webService.deleteUser(username) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The name that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +Get user by user name + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(UserApi::class.java) +val username : kotlin.String = username_example // kotlin.String | The name that needs to be fetched. Use user1 for testing. + +val result : User = webService.getUserByName(username) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +Logs user into the system + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(UserApi::class.java) +val username : kotlin.String = username_example // kotlin.String | The user name for login +val password : kotlin.String = password_example // kotlin.String | The password for login in clear text + +val result : kotlin.String = webService.loginUser(username, password) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The user name for login | + **password** | **kotlin.String**| The password for login in clear text | + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +Logs out current logged in user session + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(UserApi::class.java) + +webService.logoutUser() +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +Updated user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(UserApi::class.java) +val username : kotlin.String = username_example // kotlin.String | name that need to be deleted +val body : User = // User | Updated user object + +webService.updateUser(username, body) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| name that need to be deleted | + **body** | [**User**](User.md)| Updated user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + diff --git a/samples/client/petstore/kotlin-jvm-volley/gradle.properties b/samples/client/petstore/kotlin-jvm-volley/gradle.properties new file mode 100644 index 000000000000..646c51b977f3 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/gradle.properties @@ -0,0 +1,2 @@ +android.useAndroidX=true +android.enableJetifier=true diff --git a/samples/client/petstore/kotlin-jvm-volley/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-jvm-volley/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..e708b1c023ec8b20f512888fe07c5bd3ff77bb8f GIT binary patch literal 59203 zcma&O1CT9Y(k9%tZQHhO+qUh#ZQHhO+qmuS+qP|E@9xZO?0h@l{(r>DQ>P;GjjD{w zH}lENr;dU&FbEU?00aa80D$0M0RRB{U*7-#kbjS|qAG&4l5%47zyJ#WrfA#1$1Ctx zf&Z_d{GW=lf^w2#qRJ|CvSJUi(^E3iv~=^Z(zH}F)3Z%V3`@+rNB7gTVU{Bb~90p|f+0(v;nz01EG7yDMX9@S~__vVgv%rS$+?IH+oZ03D5zYrv|^ zC1J)SruYHmCki$jLBlTaE5&dFG9-kq3!^i>^UQL`%gn6)jz54$WDmeYdsBE9;PqZ_ zoGd=P4+|(-u4U1dbAVQrFWoNgNd;0nrghPFbQrJctO>nwDdI`Q^i0XJDUYm|T|RWc zZ3^Qgo_Qk$%Fvjj-G}1NB#ZJqIkh;kX%V{THPqOyiq)d)0+(r9o(qKlSp*hmK#iIY zA^)Vr$-Hz<#SF=0@tL@;dCQsm`V9s1vYNq}K1B)!XSK?=I1)tX+bUV52$YQu*0%fnWEukW>mxkz+%3-S!oguE8u#MGzST8_Dy^#U?fA@S#K$S@9msUiX!gd_ow>08w5)nX{-KxqMOo7d?k2&?Vf z&diGDtZr(0cwPe9z9FAUSD9KC)7(n^lMWuayCfxzy8EZsns%OEblHFSzP=cL6}?J| z0U$H!4S_TVjj<`6dy^2j`V`)mC;cB%* z8{>_%E1^FH!*{>4a7*C1v>~1*@TMcLK{7nEQ!_igZC}ikJ$*<$yHy>7)oy79A~#xE zWavoJOIOC$5b6*q*F_qN1>2#MY)AXVyr$6x4b=$x^*aqF*L?vmj>Mgv+|ITnw_BoW zO?jwHvNy^prH{9$rrik1#fhyU^MpFqF2fYEt(;4`Q&XWOGDH8k6M=%@fics4ajI;st# zCU^r1CK&|jzUhRMv;+W~6N;u<;#DI6cCw-otsc@IsN3MoSD^O`eNflIoR~l4*&-%RBYk@gb^|-JXs&~KuSEmMxB}xSb z@K76cXD=Y|=I&SNC2E+>Zg?R6E%DGCH5J1nU!A|@eX9oS(WPaMm==k2s_ueCqdZw| z&hqHp)47`c{BgwgvY2{xz%OIkY1xDwkw!<0veB#yF4ZKJyabhyyVS`gZepcFIk%e2 zTcrmt2@-8`7i-@5Nz>oQWFuMC_KlroCl(PLSodswHqJ3fn<;gxg9=}~3x_L3P`9Sn zChIf}8vCHvTriz~T2~FamRi?rh?>3bX1j}%bLH+uFX+p&+^aXbOK7clZxdU~6Uxgy z8R=obwO4dL%pmVo*Ktf=lH6hnlz_5k3cG;m8lgaPp~?eD!Yn2kf)tU6PF{kLyn|oI@eQ`F z3IF7~Blqg8-uwUuWZScRKn%c2_}dXB6Dx_&xR*n9M9LXasJhtZdr$vBY!rP{c@=)& z#!?L$2UrkvClwQO>U*fSMs67oSj2mxiJ$t;E|>q%Kh_GzzWWO&3;ufU%2z%ucBU8H z3WIwr$n)cfCXR&>tyB7BcSInK>=ByZA%;cVEJhcg<#6N{aZC4>K41XF>ZgjG`z_u& zGY?;Ad?-sgiOnI`oppF1o1Gurqbi*;#x2>+SSV6|1^G@ooVy@fg?wyf@0Y!UZ4!}nGuLeC^l)6pwkh|oRY`s1Pm$>zZ3u-83T|9 zGaKJIV3_x+u1>cRibsaJpJqhcm%?0-L;2 zitBrdRxNmb0OO2J%Y&Ym(6*`_P3&&5Bw157{o7LFguvxC$4&zTy#U=W*l&(Q2MNO} zfaUwYm{XtILD$3864IA_nn34oVa_g^FRuHL5wdUd)+W-p-iWCKe8m_cMHk+=? zeKX)M?Dt(|{r5t7IenkAXo%&EXIb-i^w+0CX0D=xApC=|Xy(`xy+QG^UyFe z+#J6h_&T5i#sV)hj3D4WN%z;2+jJcZxcI3*CHXGmOF3^)JD5j&wfX)e?-|V0GPuA+ zQFot%aEqGNJJHn$!_}#PaAvQ^{3-Ye7b}rWwrUmX53(|~i0v{}G_sI9uDch_brX&6 zWl5Ndj-AYg(W9CGfQf<6!YmY>Ey)+uYd_JNXH=>|`OH-CDCmcH(0%iD_aLlNHKH z7bcW-^5+QV$jK?R*)wZ>r9t}loM@XN&M-Pw=F#xn(;u3!(3SXXY^@=aoj70;_=QE9 zGghsG3ekq#N||u{4We_25U=y#T*S{4I{++Ku)> zQ!DZW;pVcn>b;&g2;YE#+V`v*Bl&Y-i@X6D*OpNA{G@JAXho&aOk(_j^weW{#3X5Y z%$q_wpb07EYPdmyH(1^09i$ca{O<}7) zRWncXdSPgBE%BM#by!E>tdnc$8RwUJg1*x($6$}ae$e9Knj8gvVZe#bLi!<+&BkFj zg@nOpDneyc+hU9P-;jmOSMN|*H#>^Ez#?;%C3hg_65leSUm;iz)UkW)jX#p)e&S&M z1|a?wDzV5NVnlhRBCd_;F87wp>6c<&nkgvC+!@KGiIqWY4l}=&1w7|r6{oBN8xyzh zG$b#2=RJp_iq6)#t5%yLkKx(0@D=C3w+oiXtSuaQ%I1WIb-eiE$d~!)b@|4XLy!CZ z9p=t=%3ad@Ep+<9003D2KZ5VyP~_n$=;~r&YUg5UZ0KVD&tR1DHy9x)qWtKJp#Kq# zP*8p#W(8JJ_*h_3W}FlvRam?<4Z+-H77^$Lvi+#vmhL9J zJ<1SV45xi;SrO2f=-OB(7#iNA5)x1uNC-yNxUw|!00vcW2PufRm>e~toH;M0Q85MQLWd?3O{i8H+5VkR@l9Dg-ma ze2fZ%>G(u5(k9EHj2L6!;(KZ8%8|*-1V|B#EagbF(rc+5iL_5;Eu)L4Z-V;0HfK4d z*{utLse_rvHZeQ>V5H=f78M3Ntg1BPxFCVD{HbNA6?9*^YIq;B-DJd{Ca2L#)qWP? zvX^NhFmX?CTWw&Ns}lgs;r3i+Bq@y}Ul+U%pzOS0Fcv9~aB(0!>GT0)NO?p=25LjN z2bh>6RhgqD7bQj#k-KOm@JLgMa6>%-ok1WpOe)FS^XOU{c?d5shG(lIn3GiVBxmg`u%-j=)^v&pX1JecJics3&jvPI)mDut52? z3jEA)DM%}BYbxxKrizVYwq?(P&19EXlwD9^-6J+4!}9{ywR9Gk42jjAURAF&EO|~N z)?s>$Da@ikI4|^z0e{r`J8zIs>SpM~Vn^{3fArRu;?+43>lD+^XtUcY1HidJwnR6+ z!;oG2=B6Z_=M%*{z-RaHc(n|1RTKQdNjjV!Pn9lFt^4w|AeN06*j}ZyhqZ^!-=cyGP_ShV1rGxkx8t zB;8`h!S{LD%ot``700d0@Grql(DTt4Awgmi+Yr0@#jbe=2#UkK%rv=OLqF)9D7D1j z!~McAwMYkeaL$~kI~90)5vBhBzWYc3Cj1WI0RS`z000R8-@ET0dA~*r(gSiCJmQMN&4%1D zyVNf0?}sBH8zNbBLn>~(W{d3%@kL_eQ6jEcR{l>C|JK z(R-fA!z|TTRG40|zv}7E@PqCAXP3n`;%|SCQ|ZS%ym$I{`}t3KPL&^l5`3>yah4*6 zifO#{VNz3)?ZL$be;NEaAk9b#{tV?V7 zP|wf5YA*1;s<)9A4~l3BHzG&HH`1xNr#%){4xZ!jq%o=7nN*wMuXlFV{HaiQLJ`5G zBhDi#D(m`Q1pLh@Tq+L;OwuC52RdW7b8}~60WCOK5iYMUad9}7aWBuILb({5=z~YF zt?*Jr5NG+WadM{mDL>GyiByCuR)hd zA=HM?J6l1Xv0Dl+LW@w$OTcEoOda^nFCw*Sy^I@$sSuneMl{4ys)|RY#9&NxW4S)9 zq|%83IpslTLoz~&vTo!Ga@?rj_kw{|k{nv+w&Ku?fyk4Ki4I?);M|5Axm)t+BaE)D zm(`AQ#k^DWrjbuXoJf2{Aj^KT zFb1zMSqxq|vceV+Mf-)$oPflsO$@*A0n0Z!R{&(xh8s}=;t(lIy zv$S8x>m;vQNHuRzoaOo?eiWFe{0;$s`Bc+Osz~}Van${u;g(su`3lJ^TEfo~nERfP z)?aFzpDgnLYiERsKPu|0tq4l2wT)Atr6Qb%m-AUn6HnCue*yWICp7TjW$@sO zm5rm4aTcPQ(rfi7a`xP7cKCFrJD}*&_~xgLyr^-bmsL}y;A5P|al8J3WUoBSjqu%v zxC;mK!g(7r6RRJ852Z~feoC&sD3(6}^5-uLK8o)9{8L_%%rItZK9C){UxB|;G>JbP zsRRtS4-3B*5c+K2kvmgZK8472%l>3cntWUOVHxB|{Ay~aOg5RN;{PJgeVD*H%ac+y!h#wi%o2bF2Ca8IyMyH{>4#{E_8u^@+l-+n=V}Sq?$O z{091@v%Bd*3pk0^2UtiF9Z+(a@wy6 zUdw8J*ze$K#=$48IBi1U%;hmhO>lu!uU;+RS}p&6@rQila7WftH->*A4=5W|Fmtze z)7E}jh@cbmr9iup^i%*(uF%LG&!+Fyl@LFA-}Ca#bxRfDJAiR2dt6644TaYw1Ma79 zt8&DYj31j^5WPNf5P&{)J?WlCe@<3u^78wnd(Ja4^a>{^Tw}W>|Cjt^If|7l^l)^Q zbz|7~CF(k_9~n|h;ysZ+jHzkXf(*O*@5m zLzUmbHp=x!Q|!9NVXyipZ3)^GuIG$k;D)EK!a5=8MFLI_lpf`HPKl=-Ww%z8H_0$j ztJ||IfFG1lE9nmQ0+jPQy zCBdKkjArH@K7jVcMNz);Q(Q^R{d5G?-kk;Uu_IXSyWB)~KGIizZL(^&qF;|1PI7!E zTP`%l)gpX|OFn&)M%txpQ2F!hdA~hX1Cm5)IrdljqzRg!f{mN%G~H1&oqe`5eJCIF zHdD7O;AX-{XEV(a`gBFJ9ews#CVS2y!&>Cm_dm3C8*n3MA*e67(WC?uP@8TXuMroq z{#w$%z@CBIkRM7?}Xib+>hRjy?%G!fiw8! z8(gB+8J~KOU}yO7UGm&1g_MDJ$IXS!`+*b*QW2x)9>K~Y*E&bYMnjl6h!{17_8d!%&9D`a7r&LKZjC<&XOvTRaKJ1 zUY@hl5^R&kZl3lU3njk`3dPzxj$2foOL26r(9zsVF3n_F#v)s5vv3@dgs|lP#eylq62{<-vczqP!RpVBTgI>@O6&sU>W|do17+#OzQ7o5A$ICH z?GqwqnK^n2%LR;$^oZM;)+>$X3s2n}2jZ7CdWIW0lnGK-b#EG01)P@aU`pg}th&J-TrU`tIpb5t((0eu|!u zQz+3ZiOQ^?RxxK4;zs=l8q!-n7X{@jSwK(iqNFiRColuEOg}!7cyZi`iBX4g1pNBj zAPzL?P^Ljhn;1$r8?bc=#n|Ed7wB&oHcw()&*k#SS#h}jO?ZB246EGItsz*;^&tzp zu^YJ0=lwsi`eP_pU8}6JA7MS;9pfD;DsSsLo~ogzMNP70@@;Fm8f0^;>$Z>~}GWRw!W5J3tNX*^2+1f3hz{~rIzJo z6W%J(H!g-eI_J1>0juX$X4Cl6i+3wbc~k146UIX&G22}WE>0ga#WLsn9tY(&29zBvH1$`iWtTe zG2jYl@P!P)eb<5DsR72BdI7-zP&cZNI{7q3e@?N8IKc4DE#UVr->|-ryuJXk^u^>4 z$3wE~=q390;XuOQP~TNoDR?#|NSPJ%sTMInA6*rJ%go|=YjGe!B>z6u$IhgQSwoV* zjy3F2#I>uK{42{&IqP59)Y(1*Z>>#W8rCf4_eVsH)`v!P#^;BgzKDR`ARGEZzkNX+ zJUQu=*-ol=Xqqt5=`=pA@BIn@6a9G8C{c&`i^(i+BxQO9?YZ3iu%$$da&Kb?2kCCo zo7t$UpSFWqmydXf@l3bVJ=%K?SSw)|?srhJ-1ZdFu*5QhL$~-IQS!K1s@XzAtv6*Y zl8@(5BlWYLt1yAWy?rMD&bwze8bC3-GfNH=p zynNFCdxyX?K&G(ZZ)afguQ2|r;XoV^=^(;Cku#qYn4Lus`UeKt6rAlFo_rU`|Rq z&G?~iWMBio<78of-2X(ZYHx~=U0Vz4btyXkctMKdc9UM!vYr~B-(>)(Hc|D zMzkN4!PBg%tZoh+=Gba!0++d193gbMk2&krfDgcbx0jI92cq?FFESVg0D$>F+bil} zY~$)|>1HZsX=5sAZ2WgPB5P=8X#TI+NQ(M~GqyVB53c6IdX=k>Wu@A0Svf5#?uHaF zsYn|koIi3$(%GZ2+G+7Fv^lHTb#5b8sAHSTnL^qWZLM<(1|9|QFw9pnRU{svj}_Al zL)b9>fN{QiA($8peNEJyy`(a{&uh-T4_kdZFIVsKKVM(?05}76EEz?#W za^fiZOAd14IJ4zLX-n7Lq0qlQ^lW8Cvz4UKkV9~P}>sq0?xD3vg+$4vLm~C(+ zM{-3Z#qnZ09bJ>}j?6ry^h+@PfaD7*jZxBEY4)UG&daWb??6)TP+|3#Z&?GL?1i+280CFsE|vIXQbm| zM}Pk!U`U5NsNbyKzkrul-DzwB{X?n3E6?TUHr{M&+R*2%yOiXdW-_2Yd6?38M9Vy^ z*lE%gA{wwoSR~vN0=no}tP2Ul5Gk5M(Xq`$nw#ndFk`tcpd5A=Idue`XZ!FS>Q zG^0w#>P4pPG+*NC9gLP4x2m=cKP}YuS!l^?sHSFftZy{4CoQrb_ z^20(NnG`wAhMI=eq)SsIE~&Gp9Ne0nD4%Xiu|0Fj1UFk?6avDqjdXz{O1nKao*46y zT8~iA%Exu=G#{x=KD;_C&M+Zx4+n`sHT>^>=-1YM;H<72k>$py1?F3#T1*ef9mLZw z5naLQr?n7K;2l+{_uIw*_1nsTn~I|kkCgrn;|G~##hM;9l7Jy$yJfmk+&}W@JeKcF zx@@Woiz8qdi|D%aH3XTx5*wDlbs?dC1_nrFpm^QbG@wM=i2?Zg;$VK!c^Dp8<}BTI zyRhAq@#%2pGV49*Y5_mV4+OICP|%I(dQ7x=6Ob}>EjnB_-_18*xrY?b%-yEDT(wrO z9RY2QT0`_OpGfMObKHV;QLVnrK%mc?$WAdIT`kJQT^n%GuzE7|9@k3ci5fYOh(287 zuIbg!GB3xLg$YN=n)^pHGB0jH+_iIiC=nUcD;G6LuJsjn2VI1cyZx=a?ShCsF==QK z;q~*m&}L<-cb+mDDXzvvrRsybcgQ;Vg21P(uLv5I+eGc7o7tc6`;OA9{soHFOz zT~2?>Ts}gprIX$wRBb4yE>ot<8+*Bv`qbSDv*VtRi|cyWS>)Fjs>fkNOH-+PX&4(~ z&)T8Zam2L6puQl?;5zg9h<}k4#|yH9czHw;1jw-pwBM*O2hUR6yvHATrI%^mvs9q_ z&ccT0>f#eDG<^WG^q@oVqlJrhxH)dcq2cty@l3~|5#UDdExyXUmLQ}f4#;6fI{f^t zDCsgIJ~0`af%YR%Ma5VQq-p21k`vaBu6WE?66+5=XUd%Ay%D$irN>5LhluRWt7 zov-=f>QbMk*G##&DTQyou$s7UqjjW@k6=!I@!k+S{pP8R(2=e@io;N8E`EOB;OGoI zw6Q+{X1_I{OO0HPpBz!X!@`5YQ2)t{+!?M_iH25X(d~-Zx~cXnS9z>u?+If|iNJbx zyFU2d1!ITX64D|lE0Z{dLRqL1Ajj=CCMfC4lD3&mYR_R_VZ>_7_~|<^o*%_&jevU+ zQ4|qzci=0}Jydw|LXLCrOl1_P6Xf@c0$ieK2^7@A9UbF{@V_0p%lqW|L?5k>bVM8|p5v&2g;~r>B8uo<4N+`B zH{J)h;SYiIVx@#jI&p-v3dwL5QNV1oxPr8J%ooezTnLW>i*3Isb49%5i!&ac_dEXv zvXmVUck^QHmyrF8>CGXijC_R-y(Qr{3Zt~EmW)-nC!tiH`wlw5D*W7Pip;T?&j%kX z6DkZX4&}iw>hE(boLyjOoupf6JpvBG8}jIh!!VhnD0>}KSMMo{1#uU6kiFcA04~|7 zVO8eI&x1`g4CZ<2cYUI(n#wz2MtVFHx47yE5eL~8bot~>EHbevSt}LLMQX?odD{Ux zJMnam{d)W4da{l7&y-JrgiU~qY3$~}_F#G7|MxT)e;G{U`In&?`j<5D->}cb{}{T(4DF0BOk-=1195KB-E*o@c?`>y#4=dMtYtSY=&L{!TAjFVcq0y@AH`vH! z$41+u!Ld&}F^COPgL(EE{0X7LY&%D7-(?!kjFF7=qw<;`V{nwWBq<)1QiGJgUc^Vz ztMUlq1bZqKn17|6x6iAHbWc~l1HcmAxr%$Puv!znW)!JiukwIrqQ00|H$Z)OmGG@= zv%A8*4cq}(?qn4rN6o`$Y))(MyXr8R<2S^J+v(wmFmtac!%VOfN?&(8Nr!T@kV`N; z*Q33V3t`^rN&aBiHet)18wy{*wi1=W!B%B-Q6}SCrUl$~Hl{@!95ydml@FK8P=u4s z4e*7gV2s=YxEvskw2Ju!2%{8h01rx-3`NCPc(O zH&J0VH5etNB2KY6k4R@2Wvl^Ck$MoR3=)|SEclT2ccJ!RI9Nuter7u9@;sWf-%um;GfI!=eEIQ2l2p_YWUd{|6EG ze{yO6;lMc>;2tPrsNdi@&1K6(1;|$xe8vLgiouj%QD%gYk`4p{Ktv9|j+!OF-P?@p z;}SV|oIK)iwlBs+`ROXkhd&NK zzo__r!B>tOXpBJMDcv!Mq54P+n4(@dijL^EpO1wdg~q+!DT3lB<>9AANSe!T1XgC=J^)IP0XEZ()_vpu!!3HQyJhwh?r`Ae%Yr~b% zO*NY9t9#qWa@GCPYOF9aron7thfWT`eujS4`t2uG6)~JRTI;f(ZuoRQwjZjp5Pg34 z)rp$)Kr?R+KdJ;IO;pM{$6|2y=k_siqvp%)2||cHTe|b5Ht8&A{wazGNca zX$Ol?H)E_R@SDi~4{d-|8nGFhZPW;Cts1;08TwUvLLv&_2$O6Vt=M)X;g%HUr$&06 zISZb(6)Q3%?;3r~*3~USIg=HcJhFtHhIV(siOwV&QkQe#J%H9&E21!C*d@ln3E@J* zVqRO^<)V^ky-R|%{(9`l-(JXq9J)1r$`uQ8a}$vr9E^nNiI*thK8=&UZ0dsFN_eSl z(q~lnD?EymWLsNa3|1{CRPW60>DSkY9YQ;$4o3W7Ms&@&lv9eH!tk~N&dhqX&>K@} zi1g~GqglxkZ5pEFkllJ)Ta1I^c&Bt6#r(QLQ02yHTaJB~- zCcE=5tmi`UA>@P=1LBfBiqk)HB4t8D?02;9eXj~kVPwv?m{5&!&TFYhu>3=_ zsGmYZ^mo*-j69-42y&Jj0cBLLEulNRZ9vXE)8~mt9C#;tZs;=#M=1*hebkS;7(aGf zcs7zH(I8Eui9UU4L--))yy`&d&$In&VA2?DAEss4LAPCLd>-$i?lpXvn!gu^JJ$(DoUlc6wE98VLZ*z`QGQov5l4Fm_h?V-;mHLYDVOwKz7>e4+%AzeO>P6v}ndPW| zM>m#6Tnp7K?0mbK=>gV}=@k*0Mr_PVAgGMu$j+pWxzq4MAa&jpCDU&-5eH27Iz>m^ zax1?*HhG%pJ((tkR(V(O(L%7v7L%!_X->IjS3H5kuXQT2!ow(;%FDE>16&3r){!ex zhf==oJ!}YU89C9@mfDq!P3S4yx$aGB?rbtVH?sHpg?J5C->!_FHM%Hl3#D4eplxzQ zRA+<@LD%LKSkTk2NyWCg7u=$%F#;SIL44~S_OGR}JqX}X+=bc@swpiClB`Zbz|f!4 z7Ysah7OkR8liXfI`}IIwtEoL}(URrGe;IM8%{>b1SsqXh)~w}P>yiFRaE>}rEnNkT z!HXZUtxUp1NmFm)Dm@-{FI^aRQqpSkz}ZSyKR%Y}YHNzBk)ZIp} zMtS=aMvkgWKm9&oTcU0?S|L~CDqA+sHpOxwnswF-fEG)cXCzUR?ps@tZa$=O)=L+5 zf%m58cq8g_o}3?Bhh+c!w4(7AjxwQ3>WnVi<{{38g7yFboo>q|+7qs<$8CPXUFAN< zG&}BHbbyQ5n|qqSr?U~GY{@GJ{(Jny{bMaOG{|IkUj7tj^9pa9|FB_<+KHLxSxR;@ zHpS$4V)PP+tx}22fWx(Ku9y+}Ap;VZqD0AZW4gCDTPCG=zgJmF{|x;(rvdM|2|9a}cex6xrMkERnkE;}jvU-kmzd%_J50$M`lIPCKf+^*zL=@LW`1SaEc%=m zQ+lT06Gw+wVwvQ9fZ~#qd430v2HndFsBa9WjD0P}K(rZYdAt^5WQIvb%D^Q|pkVE^ zte$&#~zmULFACGfS#g=2OLOnIf2Of-k!(BIHjs77nr!5Q1*I9 z1%?=~#Oss!rV~?-6Gm~BWJiA4mJ5TY&iPm_$)H1_rTltuU1F3I(qTQ^U$S>%$l z)Wx1}R?ij0idp@8w-p!Oz{&*W;v*IA;JFHA9%nUvVDy7Q8woheC#|8QuDZb-L_5@R zOqHwrh|mVL9b=+$nJxM`3eE{O$sCt$UK^2@L$R(r^-_+z?lOo+me-VW=Zw z-Bn>$4ovfWd%SPY`ab-u9{INc*k2h+yH%toDHIyqQ zO68=u`N}RIIs7lsn1D){)~%>ByF<>i@qFb<-axvu(Z+6t7v<^z&gm9McRB~BIaDn$ z#xSGT!rzgad8o>~kyj#h1?7g96tOcCJniQ+*#=b7wPio>|6a1Z?_(TS{)KrPe}(8j z!#&A=k(&Pj^F;r)CI=Z{LVu>uj!_W1q4b`N1}E(i%;BWjbEcnD=mv$FL$l?zS6bW!{$7j1GR5ocn94P2u{ z70tAAcpqtQo<@cXw~@i-@6B23;317|l~S>CB?hR5qJ%J3EFgyBdJd^fHZu7AzHF(BQ!tyAz^L0`X z23S4Fe{2X$W0$zu9gm%rg~A>ijaE#GlYlrF9$ds^QtaszE#4M(OLVP2O-;XdT(XIC zatwzF*)1c+t~c{L=fMG8Z=k5lv>U0;C{caN1NItnuSMp)6G3mbahu>E#sj&oy94KC zpH}8oEw{G@N3pvHhp{^-YaZeH;K+T_1AUv;IKD<=mv^&Ueegrb!yf`4VlRl$M?wsl zZyFol(2|_QM`e_2lYSABpKR{{NlxlDSYQNkS;J66aT#MSiTx~;tUmvs-b*CrR4w=f z8+0;*th6kfZ3|5!Icx3RV11sp=?`0Jy3Fs0N4GZQMN=8HmT6%x9@{Dza)k}UwL6JT zHRDh;%!XwXr6yuuy`4;Xsn0zlR$k%r%9abS1;_v?`HX_hI|+EibVnlyE@3aL5vhQq zlIG?tN^w@0(v9M*&L+{_+RQZw=o|&BRPGB>e5=ys7H`nc8nx)|-g;s7mRc7hg{GJC zAe^vCIJhajmm7C6g! zL&!WAQ~5d_5)00?w_*|*H>3$loHrvFbitw#WvLB!JASO?#5Ig5$Ys10n>e4|3d;tS zELJ0|R4n3Az(Fl3-r^QiV_C;)lQ1_CW{5bKS15U|E9?ZgLec@%kXr84>5jV2a5v=w z?pB1GPdxD$IQL4)G||B_lI+A=08MUFFR4MxfGOu07vfIm+j=z9tp~5i_6jb`tR>qV z$#`=BQ*jpCjm$F0+F)L%xRlnS%#&gro6PiRfu^l!EVan|r3y}AHJQOORGx4~ z&<)3=K-tx518DZyp%|!EqpU!+X3Et7n2AaC5(AtrkW>_57i}$eqs$rupubg0a1+WO zGHZKLN2L0D;ab%{_S1Plm|hx8R?O14*w*f&2&bB050n!R2by zw!@XOQx$SqZ5I<(Qu$V6g>o#A!JVwErWv#(Pjx=KeS0@hxr4?13zj#oWwPS(7Ro|v z>Mp@Kmxo79q|}!5qtX2-O@U&&@6s~!I&)1WQIl?lTnh6UdKT_1R640S4~f=_xoN3- zI+O)$R@RjV$F=>Ti7BlnG1-cFKCC(t|Qjm{SalS~V-tX#+2ekRhwmN zZr`8{QF6y~Z!D|{=1*2D-JUa<(1Z=;!Ei!KiRNH?o{p5o3crFF=_pX9O-YyJchr$~ zRC`+G+8kx~fD2k*ZIiiIGR<8r&M@3H?%JVOfE>)})7ScOd&?OjgAGT@WVNSCZ8N(p zuQG~76GE3%(%h1*vUXg$vH{ua0b`sQ4f0*y=u~lgyb^!#CcPJa2mkSEHGLsnO^kb$ zru5_l#nu=Y{rSMWiYx?nO{8I!gH+?wEj~UM?IrG}E|bRIBUM>UlY<`T1EHpRr36vv zBi&dG8oxS|J$!zoaq{+JpJy+O^W(nt*|#g32bd&K^w-t>!Vu9N!k9eA8r!Xc{utY> zg9aZ(D2E0gL#W0MdjwES-7~Wa8iubPrd?8-$C4BP?*wok&O8+ykOx{P=Izx+G~hM8 z*9?BYz!T8~dzcZr#ux8kS7u7r@A#DogBH8km8Ry4slyie^n|GrTbO|cLhpqgMdsjX zJ_LdmM#I&4LqqsOUIXK8gW;V0B(7^$y#h3h>J0k^WJfAMeYek%Y-Dcb_+0zPJez!GM zAmJ1u;*rK=FNM0Nf}Y!!P9c4)HIkMnq^b;JFd!S3?_Qi2G#LIQ)TF|iHl~WKK6JmK zbv7rPE6VkYr_%_BT}CK8h=?%pk@3cz(UrZ{@h40%XgThP*-Oeo`T0eq9 zA8BnWZKzCy5e&&_GEsU4*;_k}(8l_&al5K-V*BFM=O~;MgRkYsOs%9eOY6s6AtE*<7GQAR2ulC3RAJrG_P1iQK5Z~&B z&f8X<>yJV6)oDGIlS$Y*D^Rj(cszTy5c81a5IwBr`BtnC6_e`ArI8CaTX_%rx7;cn zR-0?J_LFg*?(#n~G8cXut(1nVF0Oka$A$1FGcERU<^ggx;p@CZc?3UB41RY+wLS`LWFNSs~YP zuw1@DNN3lTd|jDL7gjBsd9}wIw}4xT2+8dBQzI00m<@?c2L%>}QLfK5%r!a-iII`p zX@`VEUH)uj^$;7jVUYdADQ2k*!1O3WdfgF?OMtUXNpQ1}QINamBTKDuv19^{$`8A1 zeq%q*O0mi@(%sZU>Xdb0Ru96CFqk9-L3pzLVsMQ`Xpa~N6CR{9Rm2)A|CI21L(%GW zh&)Y$BNHa=FD+=mBw3{qTgw)j0b!Eahs!rZnpu)z!!E$*eXE~##yaXz`KE5(nQM`s zD!$vW9XH)iMxu9R>r$VlLk9oIR%HxpUiW=BK@4U)|1WNQ=mz9a z^!KkO=>GaJ!GBXm{KJj^;kh-MkUlEQ%lza`-G&}C5y1>La1sR6hT=d*NeCnuK%_LV zOXt$}iP6(YJKc9j-Fxq~*ItVUqljQ8?oaysB-EYtFQp9oxZ|5m0^Hq(qV!S+hq#g( z?|i*H2MIr^Kxgz+3vIljQ*Feejy6S4v~jKEPTF~Qhq!(ms5>NGtRgO5vfPPc4Z^AM zTj!`5xEreIN)vaNxa|q6qWdg>+T`Ol0Uz)ckXBXEGvPNEL3R8hB3=C5`@=SYgAju1 z!)UBr{2~=~xa{b8>x2@C7weRAEuatC)3pkRhT#pMPTpSbA|tan%U7NGMvzmF?c!V8 z=pEWxbdXbTAGtWTyI?Fml%lEr-^AE}w#l(<7OIw;ctw}imYax&vR4UYNJZK6P7ZOd zP87XfhnUHxCUHhM@b*NbTi#(-8|wcv%3BGNs#zRCVV(W?1Qj6^PPQa<{yaBwZ`+<`w|;rqUY_C z&AeyKwwf*q#OW-F()lir=T^<^wjK65Lif$puuU5+tk$;e_EJ;Lu+pH>=-8=PDhkBg z8cWt%@$Sc#C6F$Vd+0507;{OOyT7Hs%nKS88q-W!$f~9*WGBpHGgNp}=C*7!RiZ5s zn1L_DbKF@B8kwhDiLKRB@lsXVVLK|ph=w%_`#owlf@s@V(pa`GY$8h%;-#h@TsO|Y8V=n@*!Rog7<7Cid%apR|x zOjhHCyfbIt%+*PCveTEcuiDi%Wx;O;+K=W?OFUV%)%~6;gl?<0%)?snDDqIvkHF{ zyI02)+lI9ov42^hL>ZRrh*HhjF9B$A@=H94iaBESBF=eC_KT$8A@uB^6$~o?3Wm5t1OIaqF^~><2?4e3c&)@wKn9bD? zoeCs;H>b8DL^F&>Xw-xjZEUFFTv>JD^O#1E#)CMBaG4DX9bD(Wtc8Rzq}9soQ8`jf zeSnHOL}<+WVSKp4kkq&?SbETjq6yr@4%SAqOG=9E(3YeLG9dtV+8vmzq+6PFPk{L; z(&d++iu=^F%b+ea$i2UeTC{R*0Isk;vFK!no<;L+(`y`3&H-~VTdKROkdyowo1iqR zbVW(3`+(PQ2>TKY>N!jGmGo7oeoB8O|P_!Ic@ zZ^;3dnuXo;WJ?S+)%P>{Hcg!Jz#2SI(s&dY4QAy_vRlmOh)QHvs_7c&zkJCmJGVvV zX;Mtb>QE+xp`KyciG$Cn*0?AK%-a|=o!+7x&&yzHQOS>8=B*R=niSnta^Pxp1`=md z#;$pS$4WCT?mbiCYU?FcHGZ#)kHVJTTBt^%XE(Q};aaO=Zik0UgLcc0I(tUpt(>|& zcxB_|fxCF7>&~5eJ=Dpn&5Aj{A^cV^^}(7w#p;HG&Q)EaN~~EqrE1qKrMAc&WXIE;>@<&)5;gD2?={Xf@Mvn@OJKw=8Mgn z!JUFMwD+s==JpjhroT&d{$kQAy%+d`a*XxDEVxy3`NHzmITrE`o!;5ClXNPb4t*8P zzAivdr{j_v!=9!^?T3y?gzmqDWX6mkzhIzJ-3S{T5bcCFMr&RPDryMcdwbBuZbsgN zGrp@^i?rcfN7v0NKGzDPGE#4yszxu=I_`MI%Z|10nFjU-UjQXXA?k8Pk|OE<(?ae) zE%vG#eZAlj*E7_3dx#Zz4kMLj>H^;}33UAankJiDy5ZvEhrjr`!9eMD8COp}U*hP+ zF}KIYx@pkccIgyxFm#LNw~G&`;o&5)2`5aogs`1~7cMZQ7zj!%L4E`2yzlQN6REX20&O<9 zKV6fyr)TScJPPzNTC2gL+0x#=u>(({{D7j)c-%tvqls3#Y?Z1m zV5WUE)zdJ{$p>yX;^P!UcXP?UD~YM;IRa#Rs5~l+*$&nO(;Ers`G=0D!twR(0GF@c zHl9E5DQI}Oz74n zfKP>&$q0($T4y$6w(p=ERAFh+>n%iaeRA%!T%<^+pg?M)@ucY<&59$x9M#n+V&>}=nO9wCV{O~lg&v#+jcUj(tQ z`0u1YH)-`U$15a{pBkGyPL0THv1P|4e@pf@3IBZS4dVJPo#H>pWq%Lr0YS-SeWash z8R7=jb28KPMI|_lo#GEO|5B?N_e``H*23{~a!AmUJ+fb4HX-%QI@lSEUxKlGV7z7Q zSKw@-TR>@1RL%w{x}dW#k1NgW+q4yt2Xf1J62Bx*O^WG8OJ|FqI4&@d3_o8Id@*)4 zYrk=>@!wv~mh7YWv*bZhxqSmFh2Xq)o=m;%n$I?GSz49l1$xRpPu_^N(vZ>*>Z<04 z2+rP70oM=NDysd!@fQdM2OcyT?3T^Eb@lIC-UG=Bw{BjQ&P`KCv$AcJ;?`vdZ4){d z&gkoUK{$!$$K`3*O-jyM1~p-7T*qb)Ys>Myt^;#1&a%O@x8A+E>! zY8=eD`ZG)LVagDLBeHg>=atOG?Kr%h4B%E6m@J^C+U|y)XX@f z8oyJDW|9g=<#f<{JRr{y#~euMnv)`7j=%cHWLc}ngjq~7k**6%4u>Px&W%4D94(r* z+akunK}O0DC2A%Xo9jyF;DobX?!1I(7%}@7F>i%&nk*LMO)bMGg2N+1iqtg+r(70q zF5{Msgsm5GS7DT`kBsjMvOrkx&|EU!{{~gL4d2MWrAT=KBQ-^zQCUq{5PD1orxlIL zq;CvlWx#f1NWvh`hg011I%?T_s!e38l*lWVt|~z-PO4~~1g)SrJ|>*tXh=QfXT)%( z+ex+inPvD&O4Ur;JGz>$sUOnWdpSLcm1X%aQDw4{dB!cnj`^muI$CJ2%p&-kULVCE z>$eMR36kN$wCPR+OFDM3-U(VOrp9k3)lI&YVFqd;Kpz~K)@Fa&FRw}L(SoD z9B4a+hQzZT-BnVltst&=kq6Y(f^S4hIGNKYBgMxGJ^;2yrO}P3;r)(-I-CZ)26Y6? z&rzHI_1GCvGkgy-t1E;r^3Le30|%$ebDRu2+gdLG)r=A~Qz`}~&L@aGJ{}vVs_GE* zVUjFnzHiXfKQbpv&bR&}l2bzIjAooB)=-XNcYmrGmBh(&iu@o!^hn0^#}m2yZZUK8 zufVm7Gq0y`Mj;9b>`c?&PZkU0j4>IL=UL&-Lp3j&47B5pAW4JceG{!XCA)kT<%2nqCxj<)uy6XR_uws~>_MEKPOpAQ!H zkn>FKh)<9DwwS*|Y(q?$^N!6(51O0 z^JM~Ax{AI1Oj$fs-S5d4T7Z_i1?{%0SsIuQ&r8#(JA=2iLcTN+?>wOL532%&dMYkT z*T5xepC+V6zxhS@vNbMoi|i)=rpli@R9~P!39tWbSSb904ekv7D#quKbgFEMTb48P zuq(VJ+&L8aWU(_FCD$3^uD!YM%O^K(dvy~Wm2hUuh6bD|#(I39Xt>N1Y{ZqXL`Fg6 zKQ?T2htHN!(Bx;tV2bfTtIj7e)liN-29s1kew>v(D^@)#v;}C4-G=7x#;-dM4yRWm zyY`cS21ulzMK{PoaQ6xChEZ}o_#}X-o}<&0)$1#3we?+QeLt;aVCjeA)hn!}UaKt< zat1fHEx13y-rXNMvpUUmCVzocPmN~-Y4(YJvQ#db)4|%B!rBsgAe+*yor~}FrNH08 z3V!97S}D7d$zbSD{$z;@IYMxM6aHdypIuS*pr_U6;#Y!_?0i|&yU*@16l z*dcMqDQgfNBf}?quiu4e>H)yTVfsp#f+Du0@=Kc41QockXkCkvu>FBd6Q+@FL!(Yx z2`YuX#eMEiLEDhp+9uFqME_E^faV&~9qjBHJkIp~%$x^bN=N)K@kvSVEMdDuzA0sn z88CBG?`RX1@#hQNd`o^V{37)!w|nA)QfiYBE^m=yQKv-fQF+UCMcuEe1d4BH7$?>b zJl-r9@0^Ie=)guO1vOd=i$_4sz>y3x^R7n4ED!5oXL3@5**h(xr%Hv)_gILarO46q+MaDOF%ChaymKoI6JU5Pg;7#2n9-18|S1;AK+ zgsn6;k6-%!QD>D?cFy}8F;r@z8H9xN1jsOBw2vQONVqBVEbkiNUqgw~*!^##ht>w0 zUOykwH=$LwX2j&nLy=@{hr)2O&-wm-NyjW7n~Zs9UlH;P7iP3 zI}S(r0YFVYacnKH(+{*)Tbw)@;6>%=&Th=+Z6NHo_tR|JCI8TJiXv2N7ei7M^Q+RM z?9o`meH$5Yi;@9XaNR#jIK^&{N|DYNNbtdb)XW1Lv2k{E>;?F`#Pq|&_;gm~&~Zc9 zf+6ZE%{x4|{YdtE?a^gKyzr}dA>OxQv+pq|@IXL%WS0CiX!V zm$fCePA%lU{%pTKD7|5NJHeXg=I0jL@$tOF@K*MI$)f?om)D63K*M|r`gb9edD1~Y zc|w7N)Y%do7=0{RC|AziW7#am$)9jciRJ?IWl9PE{G3U+$%FcyKs_0Cgq`=K3@ttV z9g;M!3z~f_?P%y3-ph%vBMeS@p7P&Ea8M@97+%XEj*(1E6vHj==d zjsoviB>j^$_^OI_DEPvFkVo(BGRo%cJeD){6Uckei=~1}>sp299|IRjhXe)%?uP0I zF5+>?0#Ye}T^Y$u_rc4=lPcq4K^D(TZG-w30-YiEM=dcK+4#o*>lJ8&JLi+3UcpZk z!^?95S^C0ja^jwP`|{<+3cBVog$(mRdQmadS+Vh~z zS@|P}=|z3P6uS+&@QsMp0no9Od&27O&14zHXGAOEy zh~OKpymK5C%;LLb467@KgIiVwYbYd6wFxI{0-~MOGfTq$nBTB!{SrWmL9Hs}C&l&l#m?s*{tA?BHS4mVKHAVMqm63H<|c5n0~k)-kbg zXidai&9ZUy0~WFYYKT;oe~rytRk?)r8bptITsWj(@HLI;@=v5|XUnSls7$uaxFRL+ zRVMGuL3w}NbV1`^=Pw*0?>bm8+xfeY(1PikW*PB>>Tq(FR`91N0c2&>lL2sZo5=VD zQY{>7dh_TX98L2)n{2OV=T10~*YzX27i2Q7W86M4$?gZIXZaBq#sA*{PH8){|GUi;oM>e?ua7eF4WFuFYZSG| zze?srg|5Ti8Og{O zeFxuw9!U+zhyk?@w zjsA6(oKD=Ka;A>Ca)oPORxK+kxH#O@zhC!!XS4@=swnuMk>t+JmLmFiE^1aX3f<)D@`%K0FGK^gg1a1j>zi z2KhV>sjU7AX3F$SEqrXSC}fRx64GDoc%!u2Yag68Lw@w9v;xOONf@o)Lc|Uh3<21ctTYu-mFZuHk*+R{GjXHIGq3p)tFtQp%TYqD=j1&y)>@zxoxUJ!G@ zgI0XKmP6MNzw>nRxK$-Gbzs}dyfFzt>#5;f6oR27ql!%+{tr+(`(>%51|k`ML} zY4eE)Lxq|JMas(;JibNQds1bUB&r}ydMQXBY4x(^&fY_&LlQC)3hylc$~8&~|06-D z#T+%66rYbHX%^KuqJED_wuGB+=h`nWA!>1n0)3wZrBG3%`b^Ozv6__dNa@%V14|!D zQ?o$z5u0^8`giv%qE!BzZ!3j;BlDlJDk)h@9{nSQeEk!z9RGW) z${RSF3phEM*ce*>Xdp}585vj$|40=&S{S-GTiE?Op*vY&Lvr9}BO$XWy80IF+6@%n z5*2ueT_g@ofP#u5pxb7n*fv^Xtt7&?SRc{*2Ka-*!BuOpf}neHGCiHy$@Ka1^Dint z;DkmIL$-e)rj4o2WQV%Gy;Xg(_Bh#qeOsTM2f@KEe~4kJ8kNLQ+;(!j^bgJMcNhvklP5Z6I+9Fq@c&D~8Fb-4rmDT!MB5QC{Dsb;BharP*O;SF4& zc$wj-7Oep7#$WZN!1nznc@Vb<_Dn%ga-O#J(l=OGB`dy=Sy&$(5-n3zzu%d7E#^8`T@}V+5B;PP8J14#4cCPw-SQTdGa2gWL0*zKM z#DfSXs_iWOMt)0*+Y>Lkd=LlyoHjublNLefhKBv@JoC>P7N1_#> zv=mLWe96%EY;!ZGSQDbZWb#;tzqAGgx~uk+-$+2_8U`!ypbwXl z^2E-FkM1?lY@yt8=J3%QK+xaZ6ok=-y%=KXCD^0r!5vUneW>95PzCkOPO*t}p$;-> ze5j-BLT_;)cZQzR2CEsm@rU7GZfFtdp*a|g4wDr%8?2QkIGasRfDWT-Dvy*U{?IHT z*}wGnzdlSptl#ZF^sf)KT|BJs&kLG91^A6ls{CzFprZ6-Y!V0Xysh%9p%iMd7HLsS zN+^Un$tDV)T@i!v?3o0Fsx2qI(AX_$dDkBzQ@fRM%n zRXk6hb9Py#JXUs+7)w@eo;g%QQ95Yq!K_d=z{0dGS+pToEI6=Bo8+{k$7&Z zo4>PH(`ce8E-Ps&uv`NQ;U$%t;w~|@E3WVOCi~R4oj5wP?%<*1C%}Jq%a^q~T7u>K zML5AKfQDv6>PuT`{SrKHRAF+^&edg6+5R_#H?Lz3iGoWo#PCEd0DS;)2U({{X#zU^ zw_xv{4x7|t!S)>44J;KfA|DC?;uQ($l+5Vp7oeqf7{GBF9356nx|&B~gs+@N^gSdd zvb*>&W)|u#F{Z_b`f#GVtQ`pYv3#||N{xj1NgB<#=Odt6{eB%#9RLt5v zIi|0u70`#ai}9fJjKv7dE!9ZrOIX!3{$z_K5FBd-Kp-&e4(J$LD-)NMTp^_pB`RT; zftVVlK2g@+1Ahv2$D){@Y#cL#dUj9*&%#6 zd2m9{1NYp>)6=oAvqdCn5#cx{AJ%S8skUgMglu2*IAtd+z1>B&`MuEAS(D(<6X#Lj z?f4CFx$)M&$=7*>9v1ER4b6!SIz-m0e{o0BfkySREchp?WdVPpQCh!q$t>?rL!&Jg zd#heM;&~A}VEm8Dvy&P|J*eAV&w!&Nx6HFV&B8jJFVTmgLaswn!cx$&%JbTsloz!3 zMEz1d`k==`Ueub_JAy_&`!ogbwx27^ZXgFNAbx=g_I~5nO^r)}&myw~+yY*cJl4$I znNJ32M&K=0(2Dj_>@39`3=FX!v3nZHno_@q^!y}%(yw0PqOo=);6Y@&ylVe>nMOZ~ zd>j#QQSBn3oaWd;qy$&5(5H$Ayi)0haAYO6TH>FR?rhqHmNOO+(})NB zLI@B@v0)eq!ug`>G<@htRlp3n!EpU|n+G+AvXFrWSUsLMBfL*ZB`CRsIVHNTR&b?K zxBgsN0BjfB>UVcJ|x%=-zb%OV7lmZc& zxiupadZVF7)6QuhoY;;FK2b*qL0J-Rn-8!X4ZY$-ZSUXV5DFd7`T41c(#lAeLMoeT z4%g655v@7AqT!i@)Edt5JMbN(=Q-6{=L4iG8RA%}w;&pKmtWvI4?G9pVRp|RTw`g0 zD5c12B&A2&P6Ng~8WM2eIW=wxd?r7A*N+&!Be7PX3s|7~z=APxm=A?5 zt>xB4WG|*Td@VX{Rs)PV0|yK`oI3^xn(4c_j&vgxk_Y3o(-`_5o`V zRTghg6%l@(qodXN;dB#+OKJEEvhfcnc#BeO2|E(5df-!fKDZ!%9!^BJ_4)9P+9Dq5 zK1=(v?KmIp34r?z{NEWnLB3Px{XYwy-akun4F7xTRr2^zeYW{gcK9)>aJDdU5;w5@ zak=<+-PLH-|04pelTb%ULpuuuJC7DgyT@D|p{!V!0v3KpDnRjANN12q6SUR3mb9<- z>2r~IApQGhstZ!3*?5V z8#)hJ0TdZg0M-BK#nGFP>$i=qk82DO z7h;Ft!D5E15OgW)&%lej*?^1~2=*Z5$2VX>V{x8SC+{i10BbtUk9@I#Vi&hX)q
            Q!LwySI{Bnv%Sm)yh{^sSVJ8&h_D-BJ_YZe5eCaAWU9b$O2c z$T|{vWVRtOL!xC0DTc(Qbe`ItNtt5hr<)VijD0{U;T#bUEp381_y`%ZIav?kuYG{iyYdEBPW=*xNSc;Rlt6~F4M`5G+VtOjc z*0qGzCb@gME5udTjJA-9O<&TWd~}ysBd(eVT1-H82-doyH9RST)|+Pb{o*;$j9Tjs zhU!IlsPsj8=(x3bAKJTopW3^6AKROHR^7wZ185wJGVhA~hEc|LP;k7NEz-@4p5o}F z`AD6naG3(n=NF9HTH81=F+Q|JOz$7wm9I<+#BSmB@o_cLt2GkW9|?7mM;r!JZp89l zbo!Hp8=n!XH1{GwaDU+k)pGp`C|cXkCU5%vcH)+v@0eK>%7gWxmuMu9YLlChA|_D@ zi#5zovN_!a-0?~pUV-Rj*1P)KwdU-LguR>YM&*Nen+ln8Q$?WFCJg%DY%K}2!!1FE zDv-A%Cbwo^p(lzac&_TZ-l#9kq`mhLcY3h9ZTUVCM(Ad&=EriQY5{jJv<5K&g|*Lk zgV%ILnf1%8V2B0E&;Sp4sYbYOvvMebLwYwzkRQ#F8GpTQq#uv=J`uaSJ34OWITeSGo6+-8Xw znCk*n{kdDEi)Hi&u^)~cs@iyCkFWB2SWZU|Uc%^43ZIZQ-vWNExCCtDWjqHs;;tWf$v{}0{p0Rvxkq``)*>+Akq%|Na zA`@~-Vfe|+(AIlqru+7Ceh4nsVmO9p9jc8}HX^W&ViBDXT+uXbT#R#idPn&L>+#b6 zflC-4C5-X;kUnR~L>PSLh*gvL68}RBsu#2l`s_9KjUWRhiqF`j)`y`2`YU(>3bdBj z?>iyjEhe-~$^I5!nn%B6Wh+I`FvLNvauve~eX<+Ipl&04 zT}};W&1a3%W?dJ2=N#0t?e+aK+%t}5q%jSLvp3jZ%?&F}nOOWr>+{GFIa%wO_2`et z=JzoRR~}iKuuR+azPI8;Gf9)z3kyA4EIOSl!sRR$DlW}0>&?GbgPojmjmnln;cTqCt=ADbE zZ8GAnoM+S1(5$i8^O4t`ue;vO4i}z0wz-QEIVe5_u03;}-!G1NyY8;h^}y;tzY}i5 zqQr#Ur3Fy8sSa$Q0ys+f`!`+>9WbvU_I`Sj;$4{S>O3?#inLHCrtLy~!s#WXV=oVP zeE93*Nc`PBi4q@%Ao$x4lw9vLHM!6mn3-b_cebF|n-2vt-zYVF_&sDE--J-P;2WHo z+@n2areE0o$LjvjlV2X7ZU@j+`{*8zq`JR3gKF#EW|#+{nMyo-a>nFFTg&vhyT=b} zDa8+v0(Dgx0yRL@ZXOYIlVSZ0|MFizy0VPW8;AfA5|pe!#j zX}Py^8fl5SyS4g1WSKKtnyP+_PoOwMMwu`(i@Z)diJp~U54*-miOchy7Z35eL>^M z4p<-aIxH4VUZgS783@H%M7P9hX>t{|RU7$n4T(brCG#h9e9p! z+o`i;EGGq3&pF;~5V~eBD}lC)>if$w%Vf}AFxGqO88|ApfHf&Bvu+xdG)@vuF}Yvk z)o;~k-%+0K0g+L`Wala!$=ZV|z$e%>f0%XoLib%)!R^RoS+{!#X?h-6uu zF&&KxORdZU&EwQFITIRLo(7TA3W}y6X{?Y%y2j0It!ekU#<)$qghZtpcS>L3uh`Uj z7GY;6f$9qKynP#oS3$$a{p^{D+0oJQ71`1?OAn_m8)UGZmj3l*ZI)`V-a>MKGGFG< z&^jg#Ok%(hhm>hSrZ5;Qga4u(?^i>GiW_j9%_7M>j(^|Om$#{k+^*ULnEgzW_1gCICtAD^WpC`A z{9&DXkG#01Xo)U$OC(L5Y$DQ|Q4C6CjUKk1UkPj$nXH##J{c8e#K|&{mA*;b$r0E4 zUNo0jthwA(c&N1l=PEe8Rw_8cEl|-eya9z&H3#n`B$t#+aJ03RFMzrV@gowbe8v(c zIFM60^0&lCFO10NU4w@|61xiZ4CVXeaKjd;d?sv52XM*lS8XiVjgWpRB;&U_C0g+`6B5V&w|O6B*_q zsATxL!M}+$He)1eOWECce#eS@2n^xhlB4<_Nn?yCVEQWDs(r`|@2GqLe<#(|&P0U? z$7V5IgpWf09uIf_RazRwC?qEqRaHyL?iiS05UiGesJy%^>-C{{ypTBI&B0-iUYhk> zIk<5xpsuV@g|z(AZD+C-;A!fTG=df1=<%nxy(a(IS+U{ME4ZbDEBtcD_3V=icT6*_ z)>|J?>&6%nvHhZERBtjK+s4xnut*@>GAmA5m*OTp$!^CHTr}vM4n(X1Q*;{e-Rd2BCF-u@1ZGm z!S8hJ6L=Gl4T_SDa7Xx|-{4mxveJg=ctf`BJ*fy!yF6Dz&?w(Q_6B}WQVtNI!BVBC zKfX<>7vd6C96}XAQmF-Jd?1Q4eTfRB3q7hCh0f!(JkdWT5<{iAE#dKy*Jxq&3a1@~ z8C||Dn2mFNyrUV|<-)C^_y7@8c2Fz+2jrae9deBDu;U}tJ{^xAdxCD248(k;dCJ%o z`y3sADe>U%suxwwv~8A1+R$VB=Q?%U?4joI$um;aH+eCrBqpn- z%79D_7rb;R-;-9RTrwi9dPlg8&@tfWhhZ(Vx&1PQ+6(huX`;M9x~LrW~~#3{j0Bh2kDU$}@!fFQej4VGkJv?M4rU^x!RU zEwhu$!CA_iDjFjrJa`aocySDX16?~;+wgav;}Zut6Mg%C4>}8FL?8)Kgwc(Qlj{@#2Pt0?G`$h7P#M+qoXtlV@d}%c&OzO+QYKK`kyXaK{U(O^2DyIXCZlNQjt0^8~8JzNGrIxhj}}M z&~QZlbx%t;MJ(Vux;2tgNKGlAqphLq%pd}JG9uoVHUo?|hN{pLQ6Em%r*+7t^<);X zm~6=qChlNAVXNN*Sow->*4;}T;l;D1I-5T{Bif@4_}=>l`tK;qqDdt5zvisCKhMAH z#r}`)7VW?LZqfdmXQ%zo5bJ00{Xb9^YKrk0Nf|oIW*K@(=`o2Vndz}ZDyk{!u}PVx zzd--+_WC*U{~DH3{?GI64IB+@On&@9X>EUAo&L+G{L^dozaI4C3G#2wr~hseW@K&g zKWs{uHu-9Je!3;4pE>eBltKUXb^*hG8I&413)$J&{D4N%7PcloU6bn%jPxJyQL?g* z9g+YFFEDiE`8rW^laCNzQmi7CTnPfwyg3VDHRAl>h=In6jeaVOP@!-CP60j3+#vpL zEYmh_oP0{-gTe7Or`L6x)6w?77QVi~jD8lWN@3RHcm80iV%M1A!+Y6iHM)05iC64tb$X2lV_%Txk@0l^hZqi^%Z?#- zE;LE0uFx)R08_S-#(wC=dS&}vj6P4>5ZWjhthP=*Hht&TdLtKDR;rXEX4*z0h74FA zMCINqrh3Vq;s%3MC1YL`{WjIAPkVL#3rj^9Pj9Ss7>7duy!9H0vYF%>1jh)EPqvlr6h%R%CxDsk| z!BACz7E%j?bm=pH6Eaw{+suniuY7C9Ut~1cWfOX9KW9=H><&kQlinPV3h9R>3nJvK z4L9(DRM=x;R&d#a@oFY7mB|m8h4692U5eYfcw|QKwqRsshN(q^v$4$)HgPpAJDJ`I zkqjq(8Cd!K!+wCd=d@w%~e$=gdUgD&wj$LQ1r>-E=O@c ze+Z$x{>6(JA-fNVr)X;*)40Eym1TtUZI1Pwwx1hUi+G1Jlk~vCYeXMNYtr)1?qwyg zsX_e*$h?380O00ou?0R@7-Fc59o$UvyVs4cUbujHUA>sH!}L54>`e` zHUx#Q+Hn&Og#YVOuo*niy*GU3rH;%f``nk#NN5-xrZ34NeH$l`4@t);4(+0|Z#I>Y z)~Kzs#exIAaf--65L0UHT_SvV8O2WYeD>Mq^Y6L!Xu8%vnpofG@w!}R7M28?i1*T&zp3X4^OMCY6(Dg<-! zXmcGQrRgHXGYre7GfTJ)rhl|rs%abKT_Nt24_Q``XH{88NVPW+`x4ZdrMuO0iZ0g` z%p}y};~T5gbb9SeL8BSc`SO#ixC$@QhXxZ=B}L`tP}&k?1oSPS=4%{UOHe0<_XWln zwbl5cn(j-qK`)vGHY5B5C|QZd5)W7c@{bNVXqJ!!n$^ufc?N9C-BF2QK1(kv++h!>$QbAjq)_b$$PcJdV+F7hz0Hu@ zqj+}m0qn{t^tD3DfBb~0B36|Q`bs*xs|$i^G4uNUEBl4g;op-;Wl~iThgga?+dL7s zUP(8lMO?g{GcYpDS{NM!UA8Hco?#}eNEioRBHy4`mq!Pd-9@-97|k$hpEX>xoX+dY zDr$wfm^P&}Wu{!%?)U_(%Mn79$(ywvu*kJ9r4u|MyYLI_67U7%6Gd_vb##Nerf@>& z8W11z$$~xEZt$dPG}+*IZky+os5Ju2eRi;1=rUEeIn>t-AzC_IGM-IXWK3^6QNU+2pe=MBn4I*R@A%-iLDCOHTE-O^wo$sL_h{dcPl=^muAQb`_BRm};=cy{qSkui;`WSsj9%c^+bIDQ z0`_?KX0<-=o!t{u(Ln)v>%VGL z0pC=GB7*AQ?N7N{ut*a%MH-tdtNmNC+Yf$|KS)BW(gQJ*z$d{+{j?(e&hgTy^2|AR9vx1Xre2fagGv0YXWqtNkg*v%40v?BJBt|f9wX5 z{QTlCM}b-0{mV?IG>TW_BdviUKhtosrBqdfq&Frdz>cF~yK{P@(w{Vr7z2qKFwLhc zQuogKO@~YwyS9%+d-zD7mJG~@?EFJLSn!a&mhE5$_4xBl&6QHMzL?CdzEnC~C3$X@ zvY!{_GR06ep5;<#cKCSJ%srxX=+pn?ywDwtJ2{TV;0DKBO2t++B(tIO4)Wh`rD13P z4fE$#%zkd=UzOB74gi=-*CuID&Z3zI^-`4U^S?dHxK8fP*;fE|a(KYMgMUo`THIS1f!*6dOI2 zFjC3O=-AL`6=9pp;`CYPTdVX z8(*?V&%QoipuH0>WKlL8A*zTKckD!paN@~hh zmXzm~qZhMGVdQGd=AG8&20HW0RGV8X{$9LldFZYm zE?}`Q3i?xJRz43S?VFMmqRyvWaS#(~Lempg9nTM$EFDP(Gzx#$r)W&lpFKqcAoJh-AxEw$-bjW>`_+gEi z2w`99#UbFZGiQjS8kj~@PGqpsPX`T{YOj`CaEqTFag;$jY z8_{Wzz>HXx&G*Dx<5skhpETxIdhKH?DtY@b9l8$l?UkM#J-Snmts7bd7xayKTFJ(u zyAT&@6cAYcs{PBfpqZa%sxhJ5nSZBPji?Zlf&}#L?t)vC4X5VLp%~fz2Sx<*oN<7` z?ge=k<=X7r<~F7Tvp9#HB{!mA!QWBOf%EiSJ6KIF8QZNjg&x~-%e*tflL(ji_S^sO ztmib1rp09uon}RcsFi#k)oLs@$?vs(i>5k3YN%$T(5Or(TZ5JW9mA6mIMD08=749$ z!d+l*iu{Il7^Yu}H;lgw=En1sJpCKPSqTCHy4(f&NPelr31^*l%KHq^QE>z>Ks_bH zjbD?({~8Din7IvZeJ>8Ey=e;I?thpzD=zE5UHeO|neioJwG;IyLk?xOz(yO&0DTU~ z^#)xcs|s>Flgmp;SmYJ4g(|HMu3v7#;c*Aa8iF#UZo7CvDq4>8#qLJ|YdZ!AsH%^_7N1IQjCro

            K7UpUK$>l@ zw`1S}(D?mUXu_C{wupRS-jiX~w=Uqqhf|Vb3Cm9L=T+w91Cu^ z*&Ty%sN?x*h~mJc4g~k{xD4ZmF%FXZNC;oVDwLZ_WvrnzY|{v8hc1nmx4^}Z;yriXsAf+Lp+OFLbR!&Ox?xABwl zu8w&|5pCxmu#$?Cv2_-Vghl2LZ6m7}VLEfR5o2Ou$x02uA-%QB2$c(c1rH3R9hesc zfpn#oqpbKuVsdfV#cv@5pV4^f_!WS+F>SV6N0JQ9E!T90EX((_{bSSFv9ld%I0&}9 zH&Jd4MEX1e0iqDtq~h?DBrxQX1iI0lIs<|kB$Yrh&cpeK0-^K%=FBsCBT46@h#yi!AyDq1V(#V}^;{{V*@T4WJ&U-NTq43w=|K>z8%pr_nC>%C(Wa_l78Ufib$r8Od)IIN=u>417 z`Hl{9A$mI5A(;+-Q&$F&h-@;NR>Z<2U;Y21>>Z;s@0V@SbkMQQj%_;~+qTuQ?c|AV zcWm3XZQHhP&R%QWarS%mJ!9R^&!_)*s(v+VR@I#QrAT}`17Y+l<`b-nvmDNW`De%y zrwTZ9EJrj1AFA>B`1jYDow}~*dfPs}IZMO3=a{Fy#IOILc8F0;JS4x(k-NSpbN@qM z`@aE_e}5{!$v3+qVs7u?sOV(y@1Os*Fgu`fCW9=G@F_#VQ%xf$hj0~wnnP0$hFI+@ zkQj~v#V>xn)u??YutKsX>pxKCl^p!C-o?+9;!Nug^ z{rP!|+KsP5%uF;ZCa5F;O^9TGac=M|=V z_H(PfkV1rz4jl?gJ(ArXMyWT4y(86d3`$iI4^l9`vLdZkzpznSd5Ikfrs8qcSy&>z zTIZgWZGXw0n9ibQxYWE@gI0(3#KA-dAdPcsL_|hg2@~C!VZDM}5;v_Nykfq!*@*Zf zE_wVgx82GMDryKO{U{D>vSzSc%B~|cjDQrt5BN=Ugpsf8H8f1lR4SGo#hCuXPL;QQ z#~b?C4MoepT3X`qdW2dNn& zo8)K}%Lpu>0tQei+{>*VGErz|qjbK#9 zvtd8rcHplw%YyQCKR{kyo6fgg!)6tHUYT(L>B7er5)41iG`j$qe*kSh$fY!PehLcD zWeKZHn<492B34*JUQh=CY1R~jT9Jt=k=jCU2=SL&&y5QI2uAG2?L8qd2U(^AW#{(x zThSy=C#>k+QMo^7caQcpU?Qn}j-`s?1vXuzG#j8(A+RUAY})F@=r&F(8nI&HspAy4 z4>(M>hI9c7?DCW8rw6|23?qQMSq?*Vx?v30U%luBo)B-k2mkL)Ljk5xUha3pK>EEj z@(;tH|M@xkuN?gsz;*bygizwYR!6=(Xgcg^>WlGtRYCozY<rFX2E>kaZo)O<^J7a`MX8Pf`gBd4vrtD|qKn&B)C&wp0O-x*@-|m*0egT=-t@%dD zgP2D+#WPptnc;_ugD6%zN}Z+X4=c61XNLb7L1gWd8;NHrBXwJ7s0ce#lWnnFUMTR& z1_R9Fin4!d17d4jpKcfh?MKRxxQk$@)*hradH2$3)nyXep5Z;B z?yX+-Bd=TqO2!11?MDtG0n(*T^!CIiF@ZQymqq1wPM_X$Iu9-P=^}v7npvvPBu!d$ z7K?@CsA8H38+zjA@{;{kG)#AHME>Ix<711_iQ@WWMObXyVO)a&^qE1GqpP47Q|_AG zP`(AD&r!V^MXQ^e+*n5~Lp9!B+#y3#f8J^5!iC@3Y@P`;FoUH{G*pj*q7MVV)29+j z>BC`a|1@U_v%%o9VH_HsSnM`jZ-&CDvbiqDg)tQEnV>b%Ptm)T|1?TrpIl)Y$LnG_ zzKi5j2Fx^K^PG1=*?GhK;$(UCF-tM~^=Z*+Wp{FSuy7iHt9#4n(sUuHK??@v+6*|10Csdnyg9hAsC5_OrSL;jVkLlf zHXIPukLqbhs~-*oa^gqgvtpgTk_7GypwH><53riYYL*M=Q@F-yEPLqQ&1Sc zZB%w}T~RO|#jFjMWcKMZccxm-SL)s_ig?OC?y_~gLFj{n8D$J_Kw%{r0oB8?@dWzn zB528d-wUBQzrrSSLq?fR!K%59Zv9J4yCQhhDGwhptpA5O5U?Hjqt>8nOD zi{)0CI|&Gu%zunGI*XFZh(ix)q${jT8wnnzbBMPYVJc4HX*9d^mz|21$=R$J$(y7V zo0dxdbX3N#=F$zjstTf*t8vL)2*{XH!+<2IJ1VVFa67|{?LP&P41h$2i2;?N~RA30LV`BsUcj zfO9#Pg1$t}7zpv#&)8`mis3~o+P(DxOMgz-V*(?wWaxi?R=NhtW}<#^Z?(BhSwyar zG|A#Q7wh4OfK<|DAcl9THc-W4*>J4nTevsD%dkj`U~wSUCh15?_N@uMdF^Kw+{agk zJ`im^wDqj`Ev)W3k3stasP`88-M0ZBs7;B6{-tSm3>I@_e-QfT?7|n0D~0RRqDb^G zyHb=is;IwuQ&ITzL4KsP@Z`b$d%B0Wuhioo1CWttW8yhsER1ZUZzA{F*K=wmi-sb#Ju+j z-l@In^IKnb{bQG}Ps>+Vu_W#grNKNGto+yjA)?>0?~X`4I3T@5G1)RqGUZuP^NJCq&^HykuYtMDD8qq+l8RcZNJsvN(10{ zQ1$XcGt}QH-U^WU!-wRR1d--{B$%vY{JLWIV%P4-KQuxxDeJaF#{eu&&r!3Qu{w}0f--8^H|KwE>)ORrcR+2Qf zb})DRcH>k0zWK8@{RX}NYvTF;E~phK{+F;MkIP$)T$93Ba2R2TvKc>`D??#mv9wg$ zd~|-`Qx5LwwsZ2hb*Rt4S9dsF%Cny5<1fscy~)d;0m2r$f=83<->c~!GNyb!U)PA; zq^!`@@)UaG)Ew(9V?5ZBq#c%dCWZrplmuM`o~TyHjAIMh0*#1{B>K4po-dx$Tk-Cq z=WZDkP5x2W&Os`N8KiYHRH#UY*n|nvd(U>yO=MFI-2BEp?x@=N<~CbLJBf6P)}vLS?xJXYJ2^<3KJUdrwKnJnTp{ zjIi|R=L7rn9b*D#Xxr4*R<3T5AuOS+#U8hNlfo&^9JO{VbH!v9^JbK=TCGR-5EWR@ zN8T-_I|&@A}(hKeL4_*eb!1G8p~&_Im8|wc>Cdir+gg90n1dw?QaXcx6Op_W1r=axRw>4;rM*UOpT#Eb9xU1IiWo@h?|5uP zka>-XW0Ikp@dIe;MN8B01a7+5V@h3WN{J=HJ*pe0uwQ3S&MyWFni47X32Q7SyCTNQ z+sR!_9IZa5!>f&V$`q!%H8ci!a|RMx5}5MA_kr+bhtQy{-^)(hCVa@I!^TV4RBi zAFa!Nsi3y37I5EK;0cqu|9MRj<^r&h1lF}u0KpKQD^5Y+LvFEwM zLU@@v4_Na#Axy6tn3P%sD^5P#<7F;sd$f4a7LBMk zGU^RZHBcxSA%kCx*eH&wgA?Qwazm8>9SCSz_!;MqY-QX<1@p$*T8lc?@`ikEqJ>#w zcG``^CoFMAhdEXT9qt47g0IZkaU)4R7wkGs^Ax}usqJ5HfDYAV$!=6?>J6+Ha1I<5 z|6=9soU4>E))tW$<#>F ziZ$6>KJf0bPfbx_)7-}tMINlc=}|H+$uX)mhC6-Hz+XZxsKd^b?RFB6et}O#+>Wmw9Ec9) z{q}XFWp{3@qmyK*Jvzpyqv57LIR;hPXKsrh{G?&dRjF%Zt5&m20Ll?OyfUYC3WRn{cgQ?^V~UAv+5 z&_m#&nIwffgX1*Z2#5^Kl4DbE#NrD&Hi4|7SPqZ}(>_+JMz=s|k77aEL}<=0Zfb)a z%F(*L3zCA<=xO)2U3B|pcTqDbBoFp>QyAEU(jMu8(jLA61-H!ucI804+B!$E^cQQa z)_ERrW3g!B9iLb3nn3dlkvD7KsY?sRvls3QC0qPi>o<)GHx%4Xb$5a3GBTJ(k@`e@ z$RUa^%S15^1oLEmA=sayrP5;9qtf!Z1*?e$ORVPsXpL{jL<6E)0sj&swP3}NPmR%FM?O>SQgN5XfHE< zo(4#Cv11(%Nnw_{_Ro}r6=gKd{k?NebJ~<~Kv0r(r0qe4n3LFx$5%x(BKvrz$m?LG zjLIc;hbj0FMdb9aH9Lpsof#yG$(0sG2%RL;d(n>;#jb!R_+dad+K;Ccw!|RY?uS(a zj~?=&M!4C(5LnlH6k%aYvz@7?xRa^2gml%vn&eKl$R_lJ+e|xsNfXzr#xuh(>`}9g zLHSyiFwK^-p!;p$yt7$F|3*IfO3Mlu9e>Dpx8O`37?fA`cj`C0B-m9uRhJjs^mRp# zWB;Aj6|G^1V6`jg7#7V9UFvnB4((nIwG?k%c7h`?0tS8J3Bn0t#pb#SA}N-|45$-j z$R>%7cc2ebAClXc(&0UtHX<>pd)akR3Kx_cK+n<}FhzmTx!8e9^u2e4%x{>T6pQ`6 zO182bh$-W5A3^wos0SV_TgPmF4WUP-+D25KjbC{y_6W_9I2_vNKwU(^qSdn&>^=*t z&uvp*@c8#2*paD!ZMCi3;K{Na;I4Q35zw$YrW5U@Kk~)&rw;G?d7Q&c9|x<Hg|CNMsxovmfth*|E*GHezPTWa^Hd^F4!B3sF;)? z(NaPyAhocu1jUe(!5Cy|dh|W2=!@fNmuNOzxi^tE_jAtzNJ0JR-avc_H|ve#KO}#S z#a(8secu|^Tx553d4r@3#6^MHbH)vmiBpn0X^29xEv!Vuh1n(Sr5I0V&`jA2;WS|Y zbf0e}X|)wA-Pf5gBZ>r4YX3Mav1kKY(ulAJ0Q*jB)YhviHK)w!TJsi3^dMa$L@^{` z_De`fF4;M87vM3Ph9SzCoCi$#Fsd38u!^0#*sPful^p5oI(xGU?yeYjn;Hq1!wzFk zG&2w}W3`AX4bxoVm03y>ts{KaDf!}b&7$(P4KAMP=vK5?1In^-YYNtx1f#}+2QK@h zeSeAI@E6Z8a?)>sZ`fbq9_snl6LCu6g>o)rO;ijp3|$vig+4t} zylEo7$SEW<_U+qgVcaVhk+4k+C9THI5V10qV*dOV6pPtAI$)QN{!JRBKh-D zk2^{j@bZ}yqW?<#VVuI_27*cI-V~sJiqQv&m07+10XF+#ZnIJdr8t`9s_EE;T2V;B z4UnQUH9EdX%zwh-5&wflY#ve!IWt0UE-My3?L#^Bh%kcgP1q{&26eXLn zTkjJ*w+(|_>Pq0v8{%nX$QZbf)tbJaLY$03;MO=Ic-uqYUmUCuXD>J>o6BCRF=xa% z3R4SK9#t1!K4I_d>tZgE>&+kZ?Q}1qo4&h%U$GfY058s%*=!kac{0Z+4Hwm!)pFLR zJ+5*OpgWUrm0FPI2ib4NPJ+Sk07j(`diti^i#kh&f}i>P4~|d?RFb#!JN)~D@)beox}bw?4VCf^y*`2{4`-@%SFTry2h z>9VBc9#JxEs1+0i2^LR@B1J`B9Ac=#FW=(?2;5;#U$0E0UNag_!jY$&2diQk_n)bT zl5Me_SUvqUjwCqmVcyb`igygB_4YUB*m$h5oeKv3uIF0sk}~es!{D>4r%PC*F~FN3owq5e0|YeUTSG#Vq%&Gk7uwW z0lDo#_wvflqHeRm*}l?}o;EILszBt|EW*zNPmq#?4A+&i0xx^?9obLyY4xx=Y9&^G;xYXYPxG)DOpPg!i_Ccl#3L}6xAAZzNhPK1XaC_~ z!A|mlo?Be*8Nn=a+FhgpOj@G7yYs(Qk(8&|h@_>w8Y^r&5nCqe0V60rRz?b5%J;GYeBqSAjo|K692GxD4` zRZyM2FdI+-jK2}WAZTZ()w_)V{n5tEb@>+JYluDozCb$fA4H)$bzg(Ux{*hXurjO^ zwAxc+UXu=&JV*E59}h3kzQPG4M)X8E*}#_&}w*KEgtX)cU{vm9b$atHa;s>| z+L6&cn8xUL*OSjx4YGjf6{Eq+Q3{!ZyhrL&^6Vz@jGbI%cAM9GkmFlamTbcQGvOlL zmJ?(FI)c86=JEs|*;?h~o)88>12nXlpMR4@yh%qdwFNpct;vMlc=;{FSo*apJ;p}! zAX~t;3tb~VuP|ZW;z$=IHf->F@Ml)&-&Bnb{iQyE#;GZ@C$PzEf6~q}4D>9jic@mTO5x76ulDz@+XAcm35!VSu zT*Gs>;f0b2TNpjU_BjHZ&S6Sqk6V1370+!eppV2H+FY!q*n=GHQ!9Rn6MjY!Jc77A zG7Y!lFp8?TIHN!LXO?gCnsYM-gQxsm=Ek**VmZu7vnuufD7K~GIxfxbsQ@qv2T zPa`tvHB$fFCyZl>3oYg?_wW)C>^_iDOc^B7klnTOoytQH18WkOk)L2BSD0r%xgRSW zQS9elF^?O=_@|58zKLK;(f77l-Zzu}4{fXed2saq!5k#UZAoDBqYQS{sn@j@Vtp|$ zG%gnZ$U|9@u#w1@11Sjl8ze^Co=)7yS(}=;68a3~g;NDe_X^}yJj;~s8xq9ahQ5_r zxAlTMnep*)w1e(TG%tWsjo3RR;yVGPEO4V{Zp?=a_0R#=V^ioQu4YL=BO4r0$$XTX zZfnw#_$V}sDAIDrezGQ+h?q24St0QNug_?{s-pI(^jg`#JRxM1YBV;a@@JQvH8*>> zIJvku74E0NlXkYe_624>znU0J@L<-c=G#F3k4A_)*;ky!C(^uZfj%WB3-*{*B$?9+ zDm$WFp=0(xnt6`vDQV3Jl5f&R(Mp};;q8d3I%Kn>Kx=^;uSVCw0L=gw53%Bp==8Sw zxtx=cs!^-_+i{2OK`Q;913+AXc_&Z5$@z3<)So0CU3;JAv=H?@Zpi~riQ{z-zLtVL z!oF<}@IgJp)Iyz1zVJ42!SPHSkjYNS4%ulVVIXdRuiZ@5Mx8LJS}J#qD^Zi_xQ@>DKDr-_e#>5h3dtje*NcwH_h;i{Sx7}dkdpuW z(yUCjckQsagv*QGMSi9u1`Z|V^}Wjf7B@q%j2DQXyd0nOyqg%m{CK_lAoKlJ7#8M} z%IvR?Vh$6aDWK2W!=i?*<77q&B8O&3?zP(Cs@kapc)&p7En?J;t-TX9abGT#H?TW? ztO5(lPKRuC7fs}zwcUKbRh=7E8wzTsa#Z{a`WR}?UZ%!HohN}d&xJ=JQhpO1PI#>X zHkb>pW04pU%Bj_mf~U}1F1=wxdBZu1790>3Dm44bQ#F=T4V3&HlOLsGH)+AK$cHk6 zia$=$kog?)07HCL*PI6}DRhpM^*%I*kHM<#1Se+AQ!!xyhcy6j7`iDX7Z-2i73_n# zas*?7LkxS-XSqv;YBa zW_n*32D(HTYQ0$feV_Fru1ZxW0g&iwqixPX3=9t4o)o|kOo79V$?$uh?#8Q8e>4e)V6;_(x&ViUVxma+i25qea;d-oK7ouuDsB^ab{ zu1qjQ%`n56VtxBE#0qAzb7lph`Eb-}TYpXB!H-}3Ykqyp`otprp7{VEuW*^IR2n$Fb99*nAtqT&oOFIf z@w*6>YvOGw@Ja?Pp1=whZqydzx@9X4n^2!n83C5{C?G@|E?&$?p*g68)kNvUTJ)I6 z1Q|(#UuP6pj78GUxq11m-GSszc+)X{C2eo-?8ud9sB=3(D47v?`JAa{V(IF zPZQ_0AY*9M97>Jf<o%#O_%Wq}8>YM=q0|tGY+hlXcpE=Z4Od z`NT7Hu2hnvRoqOw@g1f=bv`+nba{GwA$Ak0INlqI1k<9!x_!sL()h?hEWoWrdU3w` zZ%%)VR+Bc@_v!C#koM1p-3v_^L6)_Ktj4HE>aUh%2XZE@JFMOn)J~c`_7VWNb9c-N z2b|SZMR4Z@E7j&q&9(6H3yjEu6HV7{2!1t0lgizD;mZ9$r(r7W5G$ky@w(T_dFnOD z*p#+z$@pKE+>o@%eT(2-p_C}wbQ5s(%Sn_{$HDN@MB+Ev?t@3dPy`%TZ!z}AThZSu zN<1i$siJhXFdjV zP*y|V<`V8t=h#XTRUR~5`c`Z9^-`*BZf?WAehGdg)E2Je)hqFa!k{V(u+(hTf^Yq& zoruUh2(^3pe)2{bvt4&4Y9CY3js)PUHtd4rVG57}uFJL)D(JfSIo^{P=7liFXG zq5yqgof0V8paQcP!gy+;^pp-DA5pj=gbMN0eW=-eY+N8~y+G>t+x}oa!5r>tW$xhI zPQSv=pi;~653Gvf6~*JcQ%t1xOrH2l3Zy@8AoJ+wz@daW@m7?%LXkr!bw9GY@ns3e zSfuWF_gkWnesv?s3I`@}NgE2xwgs&rj?kH-FEy82=O8`+szN ziHch`vvS`zNfap14!&#i9H@wF7}yIPm=UB%(o(}F{wsZ(wA0nJ2aD^@B41>>o-_U6 zUqD~vdo48S8~FTb^+%#zcbQiiYoDKYcj&$#^;Smmb+Ljp(L=1Kt_J!;0s%1|JK}Wi z;={~oL!foo5n8=}rs6MmUW~R&;SIJO3TL4Ky?kh+b2rT9B1Jl4>#Uh-Bec z`Hsp<==#UEW6pGPhNk8H!!DUQR~#F9jEMI6T*OWfN^Ze&X(4nV$wa8QUJ>oTkruH# zm~O<`J7Wxseo@FqaZMl#Y(mrFW9AHM9Kb|XBMqaZ2a)DvJgYipkDD_VUF_PKd~dT7 z#02}bBfPn9a!X!O#83=lbJSK#E}K&yx-HI#T6ua)6o0{|={*HFusCkHzs|Fn&|C3H zBck1cmfcWVUN&i>X$YU^Sn6k2H;r3zuXbJFz)r5~3$d$tUj(l1?o={MM){kjgqXRO zc5R*#{;V7AQh|G|)jLM@wGAK&rm2~@{Pewv#06pHbKn#wL0P6F1!^qw9g&cW3Z=9} zj)POhOlwsh@eF=>z?#sIs*C-Nl(yU!#DaiaxhEs#iJqQ8w%(?+6lU02MYSeDkr!B- zPjMv+on6OLXgGnAtl(ao>|X2Y8*Hb}GRW5}-IzXnoo-d0!m4Vy$GS!XOLy>3_+UGs z2D|YcQx@M#M|}TDOetGi{9lGo9m-=0-^+nKE^*?$^uHkxZh}I{#UTQd;X!L+W@jm( zDg@N4+lUqI92o_rNk{3P>1gxAL=&O;x)ZT=q1mk0kLlE$WeWuY_$0`0jY-Kkt zP*|m3AF}Ubd=`<>(Xg0har*_@x2YH}bn0Wk*OZz3*e5;Zc;2uBdnl8?&XjupbkOeNZsNh6pvsq_ydmJI+*z**{I{0K)-;p1~k8cpJXL$^t!-`E}=*4G^-E8>H!LjTPxSx zcF+cS`ommfKMhNSbas^@YbTpH1*RFrBuATUR zt{oFWSk^$xU&kbFQ;MCX22RAN5F6eq9UfR$ut`Jw--p2YX)A*J69m^!oYfj2y7NYcH6&r+0~_sH^c^nzeN1AU4Ga7=FlR{S|Mm~MpzY0$Z+p2W(a={b-pR9EO1Rs zB%KY|@wLcAA@)KXi!d2_BxrkhDn`DT1=Dec}V!okd{$+wK z4E{n8R*xKyci1(CnNdhf$Dp2(Jpof0-0%-38X=Dd9PQgT+w%Lshx9+loPS~MOm%ZT zt%2B2iL_KU_ita%N>xjB!#71_3=3c}o zgeW~^U_ZTJQ2!PqXulQd=3b=XOQhwATK$y(9$#1jOQ4}4?~l#&nek)H(04f(Sr=s| zWv7Lu1=%WGk4FSw^;;!8&YPM)pQDCY9DhU`hMty1@sq1=Tj7bFsOOBZOFlpR`W>-J$-(kezWJj;`?x-v>ev{*8V z8p|KXJPV$HyQr1A(9LVrM47u-XpcrIyO`yWvx1pVYc&?154aneRpLqgx)EMvRaa#|9?Wwqs2+W8n5~79G z(}iCiLk;?enn}ew`HzhG+tu+Ru@T+K5juvZN)wY;x6HjvqD!&!)$$;1VAh~7fg0K| zEha#aN=Yv|3^~YFH}cc38ovVb%L|g@9W6fo(JtT6$fa?zf@Ct88e}m?i)b*Jgc{fl zExfdvw-BYDmH6>(4QMt#p0;FUIQqkhD}aH?a7)_%JtA~soqj{ppP_82yi9kaxuK>~ ze_)Zt>1?q=ZH*kF{1iq9sr*tVuy=u>Zev}!gEZx@O6-fjyu9X00gpIl-fS_pzjpqJ z1yqBmf9NF!jaF<+YxgH6oXBdK)sH(>VZ)1siyA$P<#KDt;8NT*l_0{xit~5j1P)FN zI8hhYKhQ)i z37^aP13B~u65?sg+_@2Kr^iWHN=U;EDSZ@2W2!5ALhGNWXnFBY%7W?1 z=HI9JzQ-pLKZDYTv<0-lt|6c-RwhxZ)mU2Os{bsX_i^@*fKUj8*aDO5pks=qn3Dv6 zwggpKLuyRCTVPwmw1r}B#AS}?X7b837UlXwp~E2|PJw2SGVueL7){Y&z!jL!XN=0i zU^Eig`S2`{+gU$68aRdWx?BZ{sU_f=8sn~>s~M?GU~`fH5kCc; z8ICp+INM3(3{#k32RZdv6b9MQYdZXNuk7ed8;G?S2nT+NZBG=Tar^KFl2SvhW$bGW#kdWL-I)s_IqVnCDDM9fm8g;P;8 z7t4yZn3^*NQfx7SwmkzP$=fwdC}bafQSEF@pd&P8@H#`swGy_rz;Z?Ty5mkS%>m#% zp_!m9e<()sfKiY(nF<1zBz&&`ZlJf6QLvLhl`_``%RW&{+O>Xhp;lwSsyRqGf=RWd zpftiR`={2(siiPAS|p}@q=NhVc0ELprt%=fMXO3B)4ryC2LT(o=sLM7hJC!}T1@)E zA3^J$3&1*M6Xq>03FX`R&w*NkrZE?FwU+Muut;>qNhj@bX17ZJxnOlPSZ=Zeiz~T_ zOu#yc3t6ONHB;?|r4w+pI)~KGN;HOGC)txxiUN8#mexj+W(cz%9a4sx|IRG=}ia zuEBuba3AHsV2feqw-3MvuL`I+2|`Ud4~7ZkN=JZ;L20|Oxna5vx1qbIh#k2O4$RQF zo`tL()zxaqibg^GbB+BS5#U{@K;WWQj~GcB1zb}zJkPwH|5hZ9iH2308!>_;%msji zJHSL~s)YHBR=Koa1mLEOHos*`gp=s8KA-C zu0aE+W!#iJ*0xqKm3A`fUGy#O+X+5W36myS>Uh2!R*s$aCU^`K&KKLCCDkejX2p=5 z%o7-fl03x`gaSNyr?3_JLv?2RLS3F*8ub>Jd@^Cc17)v8vYEK4aqo?OS@W9mt%ITJ z9=S2%R8M){CugT@k~~0x`}Vl!svYqX=E)c_oU6o}#Hb^%G1l3BudxA{F*tbjG;W_>=xV73pKY53v%>I)@D36I_@&p$h|Aw zonQS`07z_F#@T-%@-Tb|)7;;anoD_WH>9ewFy(ZcEOM$#Y)8>qi7rCnsH9GO-_7zF zu*C87{Df1P4TEOsnzZ@H%&lvV(3V@;Q!%+OYRp`g05PjY^gL$^$-t0Y>H*CDDs?FZly*oZ&dxvsxaUWF!{em4{A>n@vpXg$dwvt@_rgmHF z-MER`ABa8R-t_H*kv>}CzOpz;!>p^^9ztHMsHL|SRnS<-y5Z*r(_}c4=fXF`l^-i}>e7v!qs_jv zqvWhX^F=2sDNWA9c@P0?lUlr6ecrTKM%pNQ^?*Lq?p-0~?_j50xV%^(+H>sMul#Tw zeciF*1=?a7cI(}352%>LO96pD+?9!fNyl^9v3^v&Y4L)mNGK0FN43&Xf8jUlxW1Bw zyiu2;qW-aGNhs=zbuoxnxiwZ3{PFZM#Kw)9H@(hgX23h(`Wm~m4&TvoZoYp{plb^> z_#?vXcxd>r7K+1HKJvhed>gtK`TAbJUazUWQY6T~t2af%#<+Veyr%7-#*A#@&*;@g58{i|E%6yC_InGXCOd{L0;$)z#?n7M`re zh!kO{6=>7I?*}czyF7_frt#)s1CFJ_XE&VrDA?Dp3XbvF{qsEJgb&OLSNz_5g?HpK z9)8rsr4JN!Af3G9!#Qn(6zaUDqLN(g2g8*M)Djap?WMK9NKlkC)E2|-g|#-rp%!Gz zAHd%`iq|81efi93m3yTBw3g0j#;Yb2X{mhRAI?&KDmbGqou(2xiRNb^sV}%%Wu0?< z?($L>(#BO*)^)rSgyNRni$i`R4v;GhlCZ8$@e^ROX(p=2_v6Y!%^As zu022)fHdv_-~Yu_H6WVPLpHQx!W%^6j)cBhS`O3QBW#x(eX54d&I22op(N59b*&$v zFiSRY6rOc^(dgSV1>a7-5C;(5S5MvKcM2Jm-LD9TGqDpP097%52V+0>Xqq!! zq4e3vj53SE6i8J`XcQB|MZPP8j;PAOnpGnllH6#Ku~vS42xP*Nz@~y%db7Xi8s09P z1)e%8ys6&M8D=Dt6&t`iKG_4X=!kgRQoh%Z`dc&mlOUqXk-k`jKv9@(a^2-Upw>?< zt5*^DV~6Zedbec4NVl($2T{&b)zA@b#dUyd>`2JC0=xa_fIm8{5um zr-!ApXZhC8@=vC2WyxO|!@0Km)h8ep*`^he92$@YwP>VcdoS5OC^s38e#7RPsg4j+ zbVGG}WRSET&ZfrcR(x~k8n1rTP%CnfUNKUonD$P?FtNFF#cn!wEIab-;jU=B1dHK@ z(;(yAQJ`O$sMn>h;pf^8{JISW%d+@v6@CnXh9n5TXGC}?FI9i-D0OMaIg&mAg=0Kn zNJ7oz5*ReJukD55fUsMuaP+H4tDN&V9zfqF@ zr=#ecUk9wu{0;!+gl;3Bw=Vn^)z$ahVhhw)io!na&9}LmWurLb0zubxK=UEnU*{5P z+SP}&*(iBKSO4{alBHaY^)5Q=mZ+2OwIooJ7*Q5XJ+2|q`9#f?6myq!&oz?klihLq z4C)$XP!BNS0G_Z1&TM>?Jk{S~{F3n83ioli=IO6f%wkvCl(RFFw~j0tb{GvXTx>*sB0McY0s&SNvj4+^h`9nJ_wM>F!Uc>X}9PifQekn0sKI2SAJP!a4h z5cyGTuCj3ZBM^&{dRelIlT^9zcfaAuL5Y~bl!ppSf`wZbK$z#6U~rdclk``e+!qhe z6Qspo*%<)eu6?C;Bp<^VuW6JI|Ncvyn+LlSl;Mp22Bl7ARQ0Xc24%29(ZrdsIPw&-=yHQ7_Vle|5h>AST0 zUGX2Zk34vp?U~IHT|;$U86T+UUHl_NE4m|}>E~6q``7hccCaT^#y+?wD##Q%HwPd8 zV3x4L4|qqu`B$4(LXqDJngNy-{&@aFBvVsywt@X^}iH7P%>bR?ciC$I^U-4Foa`YKI^qDyGK7k%E%c_P=yzAi`YnxGA%DeNd++j3*h^ z=rn>oBd0|~lZ<6YvmkKY*ZJlJ;Im0tqgWu&E92eqt;+NYdxx`eS(4Hw_Jb5|yVvBg z*tbdY^!AN;luEyN4VRhS@-_DC{({ziH{&Z}iGElSV~qvT>L-8G%+yEL zX#MFOhj{InyKG=mvW-<1B@c-}x$vA(nU?>S>0*eN#!SLzQ)Ex7fvQ)S4D<8|I#N$3 zT5Ei`Z?cxBODHX8(Xp73v`IsAYC@9b;t}z0wxVuQSY1J^GRwDPN@qbM-ZF48T$GZ< z8WU+;Pqo?{ghI-KZ-i*ydXu`Ep0Xw^McH_KE9J0S7G;x8Fe`DVG?j3Pv=0YzJ}yZR z%2=oqHiUjvuk0~Ca>Kol4CFi0_xQT~;_F?=u+!kIDl-9g`#ZNZ9HCy17Ga1v^Jv9# z{T4Kb1-AzUxq*MutfOWWZgD*HnFfyYg0&e9f(5tZ>krPF6{VikNeHoc{linPPt#Si z&*g>(c54V8rT_AX!J&bNm-!umPvOR}vDai#`CX___J#=zeB*{4<&2WpaDncZsOkp* zsg<%@@rbrMkR_ux9?LsQxzoBa1s%$BBn6vk#{&&zUwcfzeCBJUwFYSF$08qDsB;gWQN*g!p8pxjofWbqNSZOEKOaTx@+* zwdt5*Q47@EOZ~EZL9s?1o?A%9TJT=Ob_13yyugvPg*e&ZU(r6^k4=2+D-@n=Hv5vu zSXG|hM(>h9^zn=eQ=$6`JO&70&2|%V5Lsx>)(%#;pcOfu>*nk_3HB_BNaH$`jM<^S zcSftDU1?nL;jy)+sfonQN}(}gUW?d_ikr*3=^{G)=tjBtEPe>TO|0ddVB zTklrSHiW+!#26frPXQQ(YN8DG$PZo?(po(QUCCf_OJC`pw*uey00%gmH!`WJkrKXj2!#6?`T25mTu9OJp2L8z3! z=arrL$ZqxuE{%yV)14Kd>k}j7pxZ6#$Dz8$@WV5p8kTqN<-7W)Q7Gt2{KoOPK_tZ| zf2WG~O5@{qPI+W<4f_;reuFVdO^5`ADC1!JQE|N`s3cq@(0WB!n0uh@*c{=LAd;~} zyGK@hbF-Oo+!nN)@i*O(`@FA#u?o=~e{`4O#5}z&=UkU*50fOrzi11D^&FOqe>wii z?*k+2|EcUs;Gx{!@KBT~>PAwLrIDT7Th=Utu?~?np@t^gFs?zgX=D${RwOY^WGh-+ z+#4$066ISh8eYW#FXWp~S`<*%O^ZuItL1Tyqt8#tZ zY120E;^VG`!lZn&3sPd$RkdHpU#|w+bYV)pJC|SH9g%|5IkxVTQcBA4CL0}$&}ef@ zW^Vtj%M;;_1xxP9x#ex17&4N*{ksO*_4O}xYu(p*JkL#yr}@7b)t5X?%CY<+s5_MJ zuiqt+N_;A(_)%lumoyRFixWa-M7qK_9s6<1X?JDa9fP!+_6u~~M$5L=ipB=7(j#f< zZ34J%=bs549%~_mA(|={uZNs_0?o7;-LBP(ZRnkd{-^|2|=4vUTmtByHL8 zEph`(LSEzQj68a+`d$V<45J7cyv^#|^|%fD#si1Nx!4NW*`l*{->HEWNh6-|g>-=r zXmQ|-i}Ku$ndUeHQ^&ieT!Lf}vf6GaqW9$DJ2NWrqwPY%%4nip$@vK$nRp*_C-v<| zuKz~ZyN&<%!NS26&x?jhy+@awJipMQ-8(X4#Ae5??U<1QMt1l9R=w9fAnEF}NYu$2 z>6}Vkc zIb*A?G*z8^IvibmBKn_u^5&T_1oey0gZS2~obf(#xk=erZGTEdQnt3DMGM+0oPwss zj5zXD;(oWhB_T@~Ig#9@v)AKtXu3>Inmgf@A|-lD-1U>cNyl3h?ADD9)GG4}zUGPk zZzaXe!~Kf?<~@$G?Uql3t8jy9{2!doq4=J}j9ktTxss{p6!9UdjyDERlA*xZ!=Q)KDs5O)phz>Vq3BNGoM(H|=1*Q4$^2fTZw z(%nq1P|5Rt81}SYJpEEzMPl5VJsV5&4e)ZWKDyoZ>1EwpkHx-AQVQc8%JMz;{H~p{=FXV>jIxvm4X*qv52e?Y-f%DJ zxEA165GikEASQ^fH6K#d!Tpu2HP{sFs%E=e$gYd$aj$+xue6N+Wc(rAz~wUsk2`(b z8Kvmyz%bKQxpP}~baG-rwYcYCvkHOi zlkR<=>ZBTU*8RF_d#Bl@zZsRIhx<%~Z@Z=ik z>adw3!DK(8R|q$vy{FTxw%#xliD~6qXmY^7_9kthVPTF~Xy1CfBqbU~?1QmxmU=+k z(ggxvEuA;0e&+ci-zQR{-f7aO{O(Pz_OsEjLh_K>MbvoZ4nxtk5u{g@nPv)cgW_R} z9}EA4K4@z0?7ue}Z(o~R(X&FjejUI2g~08PH1E4w>9o{)S(?1>Z0XMvTb|;&EuyOE zGvWNpYX)Nv<8|a^;1>bh#&znEcl-r!T#pn= z4$?Yudha6F%4b>*8@=BdtXXY4N+`U4Dmx$}>HeVJk-QdTG@t!tVT#0(LeV0gvqyyw z2sEp^9eY0N`u10Tm4n8No&A=)IeEC|gnmEXoNSzu!1<4R<%-9kY_8~5Ej?zRegMn78wuMs#;i&eUA0Zk_RXQ3b&TT} z;SCI=7-FUB@*&;8|n>(_g^HGf3@QODE3LpmX~ELnymQm{Sx9xrKS zK29p~?v@R$0=v6Dr5aW>-!{+h@?Q58|Kz8{{W`%J+lDAdb&M5VHrX_mDY;1-JLnf)ezmPau$)1;=`-FU=-r-83tX=C`S#}GZufju zQ>sXNT0Ny=k@nc%cFnvA_i4SC)?_ORXHq8B4D%el1uPX`c~uG#S1M7C+*MMqLw78E zhY2dI8@+N^qrMI1+;TUda(vGqGSRyU{Fnm`aqrr7bz42c5xsOO-~oZpkzorD1g}Y<6rk&3>PsSGy}W?MtqFky@A(X# zIuNZK0cK?^=;PUAu>j0#HtjbHCV*6?jzA&OoE$*Jlga*}LF`SF?WLhv1O|zqC<>*> zYB;#lsYKx0&kH@BFpW8n*yDcc6?;_zaJs<-jPSkCsSX-!aV=P5kUgF@Nu<{a%#K*F z134Q{9|YX7X(v$62_cY3^G%t~rD>Q0z@)1|zs)vjJ6Jq9;7#Ki`w+eS**En?7;n&7 zu==V3T&eFboN3ZiMx3D8qYc;VjFUk_H-WWCau(VFXSQf~viH0L$gwD$UfFHqNcgN`x}M+YQ6RnN<+@t>JUp#)9YOkqst-Ga?{FsDpEeX0(5v{0J~SEbWiL zXC2}M4?UH@u&|;%0y`eb33ldo4~z-x8zY!oVmV=c+f$m?RfDC35mdQ2E>Pze7KWP- z>!Bh<&57I+O_^s}9Tg^k)h7{xx@0a0IA~GAOt2yy!X%Q$1rt~LbTB6@Du!_0%HV>N zlf)QI1&gvERKwso23mJ!Ou6ZS#zCS5W`gxE5T>C#E|{i<1D35C222I33?Njaz`On7 zi<+VWFP6D{e-{yiN#M|Jgk<44u1TiMI78S5W`Sdb5f+{zu34s{CfWN7a3Cf^@L%!& zN$?|!!9j2c)j$~+R6n#891w-z8(!oBpL2K=+%a$r2|~8-(vQj5_XT`<0Ksf;oP+tz z9CObS!0m)Tgg`K#xBM8B(|Z)Wb&DYL{WTYv`;A=q6~Nnx2+!lTIXtj8J7dZE!P_{z z#f8w6F}^!?^KE#+ZDv+xd5O&3EmomZzsv?>E-~ygGum45fk!SBN&|eo1rKw^?aZJ4 E2O(~oYXATM literal 0 HcmV?d00001 diff --git a/samples/client/petstore/kotlin-jvm-volley/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-jvm-volley/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 000000000000..8cf6eb5ad222 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-jvm-volley/gradlew b/samples/client/petstore/kotlin-jvm-volley/gradlew new file mode 100644 index 000000000000..4f906e0c811f --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jvm-volley/gradlew.bat b/samples/client/petstore/kotlin-jvm-volley/gradlew.bat new file mode 100644 index 000000000000..107acd32c4e6 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/samples/client/petstore/kotlin-jvm-volley/settings.gradle b/samples/client/petstore/kotlin-jvm-volley/settings.gradle new file mode 100644 index 000000000000..4e9ddfce002b --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/settings.gradle @@ -0,0 +1,2 @@ + +rootProject.name = 'kotlin-petstore-jvm-volley' \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/AndroidManifest.xml b/samples/client/petstore/kotlin-jvm-volley/src/main/AndroidManifest.xml new file mode 100644 index 000000000000..90fc37cd8912 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/AndroidManifest.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/apis/PetApi.kt new file mode 100644 index 000000000000..8f17db8b84de --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/apis/PetApi.kt @@ -0,0 +1,586 @@ +package org.openapitools.client.apis + +import android.content.Context +import com.android.volley.DefaultRetryPolicy +import com.android.volley.Request +import com.android.volley.RequestQueue +import com.android.volley.Response +import com.android.volley.toolbox.BaseHttpStack +import com.android.volley.toolbox.Volley +import java.util.*; +import kotlin.coroutines.resume +import kotlin.coroutines.resumeWithException +import kotlin.coroutines.suspendCoroutine +import com.google.gson.reflect.TypeToken + +import org.openapitools.client.request.IRequestFactory +import org.openapitools.client.request.RequestFactory +import org.openapitools.client.infrastructure.CollectionFormats.* + +import org.openapitools.client.models.ModelApiResponse +import org.openapitools.client.models.Pet + +/* +* If you wish to use a custom http stack with your client you +* can pass that to the request queue like: +* Volley.newRequestQueue(context.applicationContext, myCustomHttpStack) +*/ +class PetApi ( + private val context: Context, + private val requestQueue: Lazy = lazy(initializer = { + Volley.newRequestQueue(context.applicationContext) + }), + private val requestFactory: IRequestFactory = RequestFactory(), + private val basePath: String = "http://petstore.swagger.io/v2", + private val postProcessors :List <(Request<*>) -> Unit> = listOf()) { + + /** + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store + * @return void + */ + suspend fun addPet(body: Pet): Unit { + val body: Any? = body + // verify the required parameter 'body' is set + // This is probably taken care of by non-null types anyway + requireNotNull(body) + + val contentTypes : Array = arrayOf("application/json","application/xml") + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/pet"; + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request = requestFactory.build( + Request.Method.POST, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + /** + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey + * @return void + */ + suspend fun deletePet(petId: kotlin.Long, apiKey: kotlin.String? = null): Unit { + val body: Any? = null + // verify the required parameter 'petId' is set + // This is probably taken care of by non-null types anyway + requireNotNull(petId) + + val contentTypes : Array = arrayOf() + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/pet/{petId}".replace("{" + "petId" + "}", IRequestFactory.escapeString(petId.toString())); + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + "api_key" to IRequestFactory.parameterToString(apiKey), + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request = requestFactory.build( + Request.Method.DELETE, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter + * @return kotlin.collections.List + */ + suspend fun findPetsByStatus(status: CSVParams): kotlin.collections.List? { + val body: Any? = null + // verify the required parameter 'status' is set + // This is probably taken care of by non-null types anyway + requireNotNull(status) + + val contentTypes : Array = arrayOf() + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/pet/findByStatus"; + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + "status" to IRequestFactory.parameterToString(status), + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener> { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken>() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request> = requestFactory.build( + Request.Method.GET, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + * @return kotlin.collections.List + */ + @Deprecated("This api was deprecated") + suspend fun findPetsByTags(tags: CSVParams): kotlin.collections.List? { + val body: Any? = null + // verify the required parameter 'tags' is set + // This is probably taken care of by non-null types anyway + requireNotNull(tags) + + val contentTypes : Array = arrayOf() + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/pet/findByTags"; + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + "tags" to IRequestFactory.parameterToString(tags), + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener> { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken>() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request> = requestFactory.build( + Request.Method.GET, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @return Pet + */ + suspend fun getPetById(petId: kotlin.Long): Pet? { + val body: Any? = null + // verify the required parameter 'petId' is set + // This is probably taken care of by non-null types anyway + requireNotNull(petId) + + val contentTypes : Array = arrayOf() + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/pet/{petId}".replace("{" + "petId" + "}", IRequestFactory.escapeString(petId.toString())); + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request = requestFactory.build( + Request.Method.GET, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + /** + * Update an existing pet + * + * @param body Pet object that needs to be added to the store + * @return void + */ + suspend fun updatePet(body: Pet): Unit { + val body: Any? = body + // verify the required parameter 'body' is set + // This is probably taken care of by non-null types anyway + requireNotNull(body) + + val contentTypes : Array = arrayOf("application/json","application/xml") + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/pet"; + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request = requestFactory.build( + Request.Method.PUT, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet + * @param status Updated status of the pet + * @return void + */ + suspend fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String? = null, status: kotlin.String? = null): Unit { + val body: Any? = null + // verify the required parameter 'petId' is set + // This is probably taken care of by non-null types anyway + requireNotNull(petId) + + val contentTypes : Array = arrayOf("application/x-www-form-urlencoded") + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/pet/{petId}".replace("{" + "petId" + "}", IRequestFactory.escapeString(petId.toString())); + + // form params + val formParams = mapOf( + "name" to IRequestFactory.parameterToString(name), + "status" to IRequestFactory.parameterToString(status), + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request = requestFactory.build( + Request.Method.POST, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server + * @param file file to upload + * @return ModelApiResponse + */ + suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String? = null, file: java.io.File? = null): ModelApiResponse? { + val body: Any? = null + // verify the required parameter 'petId' is set + // This is probably taken care of by non-null types anyway + requireNotNull(petId) + + val contentTypes : Array = arrayOf("multipart/form-data") + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/pet/{petId}/uploadImage".replace("{" + "petId" + "}", IRequestFactory.escapeString(petId.toString())); + + // form params + val formParams = mapOf( + "additionalMetadata" to IRequestFactory.parameterToString(additionalMetadata), + "file" to IRequestFactory.parameterToString(file), + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request = requestFactory.build( + Request.Method.POST, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } +} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/apis/StoreApi.kt new file mode 100644 index 000000000000..0d2d7af60d66 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/apis/StoreApi.kt @@ -0,0 +1,300 @@ +package org.openapitools.client.apis + +import android.content.Context +import com.android.volley.DefaultRetryPolicy +import com.android.volley.Request +import com.android.volley.RequestQueue +import com.android.volley.Response +import com.android.volley.toolbox.BaseHttpStack +import com.android.volley.toolbox.Volley +import java.util.*; +import kotlin.coroutines.resume +import kotlin.coroutines.resumeWithException +import kotlin.coroutines.suspendCoroutine +import com.google.gson.reflect.TypeToken + +import org.openapitools.client.request.IRequestFactory +import org.openapitools.client.request.RequestFactory +import org.openapitools.client.infrastructure.CollectionFormats.* + +import org.openapitools.client.models.Order + +/* +* If you wish to use a custom http stack with your client you +* can pass that to the request queue like: +* Volley.newRequestQueue(context.applicationContext, myCustomHttpStack) +*/ +class StoreApi ( + private val context: Context, + private val requestQueue: Lazy = lazy(initializer = { + Volley.newRequestQueue(context.applicationContext) + }), + private val requestFactory: IRequestFactory = RequestFactory(), + private val basePath: String = "http://petstore.swagger.io/v2", + private val postProcessors :List <(Request<*>) -> Unit> = listOf()) { + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + * @return void + */ + suspend fun deleteOrder(orderId: kotlin.String): Unit { + val body: Any? = null + // verify the required parameter 'orderId' is set + // This is probably taken care of by non-null types anyway + requireNotNull(orderId) + + val contentTypes : Array = arrayOf() + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/store/order/{orderId}".replace("{" + "orderId" + "}", IRequestFactory.escapeString(orderId.toString())); + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request = requestFactory.build( + Request.Method.DELETE, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return kotlin.collections.Map + */ + suspend fun getInventory(): kotlin.collections.Map? { + val body: Any? = null + + val contentTypes : Array = arrayOf() + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/store/inventory"; + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener> { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken>() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request> = requestFactory.build( + Request.Method.GET, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched + * @return Order + */ + suspend fun getOrderById(orderId: kotlin.Long): Order? { + val body: Any? = null + // verify the required parameter 'orderId' is set + // This is probably taken care of by non-null types anyway + requireNotNull(orderId) + + val contentTypes : Array = arrayOf() + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/store/order/{orderId}".replace("{" + "orderId" + "}", IRequestFactory.escapeString(orderId.toString())); + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request = requestFactory.build( + Request.Method.GET, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + /** + * Place an order for a pet + * + * @param body order placed for purchasing the pet + * @return Order + */ + suspend fun placeOrder(body: Order): Order? { + val body: Any? = body + // verify the required parameter 'body' is set + // This is probably taken care of by non-null types anyway + requireNotNull(body) + + val contentTypes : Array = arrayOf() + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/store/order"; + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request = requestFactory.build( + Request.Method.POST, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } +} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/apis/UserApi.kt new file mode 100644 index 000000000000..bb7b4e24b153 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/apis/UserApi.kt @@ -0,0 +1,578 @@ +package org.openapitools.client.apis + +import android.content.Context +import com.android.volley.DefaultRetryPolicy +import com.android.volley.Request +import com.android.volley.RequestQueue +import com.android.volley.Response +import com.android.volley.toolbox.BaseHttpStack +import com.android.volley.toolbox.Volley +import java.util.*; +import kotlin.coroutines.resume +import kotlin.coroutines.resumeWithException +import kotlin.coroutines.suspendCoroutine +import com.google.gson.reflect.TypeToken + +import org.openapitools.client.request.IRequestFactory +import org.openapitools.client.request.RequestFactory +import org.openapitools.client.infrastructure.CollectionFormats.* + +import org.openapitools.client.models.User + +/* +* If you wish to use a custom http stack with your client you +* can pass that to the request queue like: +* Volley.newRequestQueue(context.applicationContext, myCustomHttpStack) +*/ +class UserApi ( + private val context: Context, + private val requestQueue: Lazy = lazy(initializer = { + Volley.newRequestQueue(context.applicationContext) + }), + private val requestFactory: IRequestFactory = RequestFactory(), + private val basePath: String = "http://petstore.swagger.io/v2", + private val postProcessors :List <(Request<*>) -> Unit> = listOf()) { + + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object + * @return void + */ + suspend fun createUser(body: User): Unit { + val body: Any? = body + // verify the required parameter 'body' is set + // This is probably taken care of by non-null types anyway + requireNotNull(body) + + val contentTypes : Array = arrayOf() + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/user"; + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request = requestFactory.build( + Request.Method.POST, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return void + */ + suspend fun createUsersWithArrayInput(body: kotlin.collections.List): Unit { + val body: Any? = body + // verify the required parameter 'body' is set + // This is probably taken care of by non-null types anyway + requireNotNull(body) + + val contentTypes : Array = arrayOf() + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/user/createWithArray"; + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request = requestFactory.build( + Request.Method.POST, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return void + */ + suspend fun createUsersWithListInput(body: kotlin.collections.List): Unit { + val body: Any? = body + // verify the required parameter 'body' is set + // This is probably taken care of by non-null types anyway + requireNotNull(body) + + val contentTypes : Array = arrayOf() + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/user/createWithList"; + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request = requestFactory.build( + Request.Method.POST, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return void + */ + suspend fun deleteUser(username: kotlin.String): Unit { + val body: Any? = null + // verify the required parameter 'username' is set + // This is probably taken care of by non-null types anyway + requireNotNull(username) + + val contentTypes : Array = arrayOf() + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/user/{username}".replace("{" + "username" + "}", IRequestFactory.escapeString(username.toString())); + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request = requestFactory.build( + Request.Method.DELETE, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return User + */ + suspend fun getUserByName(username: kotlin.String): User? { + val body: Any? = null + // verify the required parameter 'username' is set + // This is probably taken care of by non-null types anyway + requireNotNull(username) + + val contentTypes : Array = arrayOf() + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/user/{username}".replace("{" + "username" + "}", IRequestFactory.escapeString(username.toString())); + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request = requestFactory.build( + Request.Method.GET, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @return kotlin.String + */ + suspend fun loginUser(username: kotlin.String, password: kotlin.String): kotlin.String? { + val body: Any? = null + // verify the required parameter 'username' is set + // This is probably taken care of by non-null types anyway + requireNotNull(username) + // verify the required parameter 'password' is set + // This is probably taken care of by non-null types anyway + requireNotNull(password) + + val contentTypes : Array = arrayOf() + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/user/login"; + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + "username" to IRequestFactory.parameterToString(username), + "password" to IRequestFactory.parameterToString(password), + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request = requestFactory.build( + Request.Method.GET, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + /** + * Logs out current logged in user session + * + * @return void + */ + suspend fun logoutUser(): Unit { + val body: Any? = null + + val contentTypes : Array = arrayOf() + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/user/logout"; + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request = requestFactory.build( + Request.Method.GET, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param body Updated user object + * @return void + */ + suspend fun updateUser(username: kotlin.String, body: User): Unit { + val body: Any? = body + // verify the required parameter 'username' is set + // This is probably taken care of by non-null types anyway + requireNotNull(username) + // verify the required parameter 'body' is set + // This is probably taken care of by non-null types anyway + requireNotNull(body) + + val contentTypes : Array = arrayOf() + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/user/{username}".replace("{" + "username" + "}", IRequestFactory.escapeString(username.toString())); + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request = requestFactory.build( + Request.Method.PUT, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } +} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ByteArrayAdapter.kt new file mode 100644 index 000000000000..6120b081929d --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -0,0 +1,33 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException + +class ByteArrayAdapter : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: ByteArray?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(String(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): ByteArray? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return out.nextString().toByteArray() + } + } + } +} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/CollectionFormats.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/CollectionFormats.kt new file mode 100644 index 000000000000..001e99325d2e --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/CollectionFormats.kt @@ -0,0 +1,56 @@ +package org.openapitools.client.infrastructure + +class CollectionFormats { + + open class CSVParams { + + var params: List + + constructor(params: List) { + this.params = params + } + + constructor(vararg params: String) { + this.params = listOf(*params) + } + + override fun toString(): String { + return params.joinToString(",") + } + } + + open class SSVParams : CSVParams { + + constructor(params: List) : super(params) + + constructor(vararg params: String) : super(*params) + + override fun toString(): String { + return params.joinToString(" ") + } + } + + class TSVParams : CSVParams { + + constructor(params: List) : super(params) + + constructor(vararg params: String) : super(*params) + + override fun toString(): String { + return params.joinToString("\t") + } + } + + class PIPESParams : CSVParams { + + constructor(params: List) : super(params) + + constructor(vararg params: String) : super(*params) + + override fun toString(): String { + return params.joinToString("|") + } + } + + class SPACEParams : SSVParams() +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ITransformForStorage.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ITransformForStorage.kt new file mode 100644 index 000000000000..21e96af43d9f --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ITransformForStorage.kt @@ -0,0 +1,28 @@ +/** + * OpenAPI 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 + * + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.infrastructure + +import org.openapitools.client.models.room.* + +// TODO ITransformForStorage +interface ITransformForStorage { + fun toRoomModel(): T +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateAdapter.kt new file mode 100644 index 000000000000..30ef6697183a --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateAdapter.kt @@ -0,0 +1,35 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.time.LocalDate +import java.time.format.DateTimeFormatter + +class LocalDateAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: LocalDate?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): LocalDate? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return LocalDate.parse(out.nextString(), formatter) + } + } + } +} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt new file mode 100644 index 000000000000..3ad781c66ca1 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt @@ -0,0 +1,35 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.time.LocalDateTime +import java.time.format.DateTimeFormatter + +class LocalDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: LocalDateTime?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): LocalDateTime? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return LocalDateTime.parse(out.nextString(), formatter) + } + } + } +} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt new file mode 100644 index 000000000000..e615135c9cc0 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt @@ -0,0 +1,35 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.time.OffsetDateTime +import java.time.format.DateTimeFormatter + +class OffsetDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: OffsetDateTime?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): OffsetDateTime? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return OffsetDateTime.parse(out.nextString(), formatter) + } + } + } +} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/ApiResponse.kt new file mode 100644 index 000000000000..d2569559c1aa --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/ApiResponse.kt @@ -0,0 +1,57 @@ +/** + * OpenAPI 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 + * + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import org.openapitools.client.models.room.ApiResponseRoomModel +import org.openapitools.client.infrastructure.ITransformForStorage + +/** + * Describes the result of uploading an image resource + * + * @param code + * @param type + * @param message + */ + +data class ApiResponse ( + + @SerializedName("code") + val code: kotlin.Int? = null, + + @SerializedName("type") + val type: kotlin.String? = null, + + @SerializedName("message") + val message: kotlin.String? = null + +): ITransformForStorage { + companion object { } + override fun toRoomModel(): ApiResponseRoomModel = + ApiResponseRoomModel(roomTableId = 0, + code = this.code, +type = this.type, +message = this.message, + ) + +} + diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Category.kt new file mode 100644 index 000000000000..8bd167529e18 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Category.kt @@ -0,0 +1,52 @@ +/** + * OpenAPI 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 + * + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import org.openapitools.client.models.room.CategoryRoomModel +import org.openapitools.client.infrastructure.ITransformForStorage + +/** + * A category for a pet + * + * @param id + * @param name + */ + +data class Category ( + + @SerializedName("id") + val id: kotlin.Long? = null, + + @SerializedName("name") + val name: kotlin.String? = null + +): ITransformForStorage { + companion object { } + override fun toRoomModel(): CategoryRoomModel = + CategoryRoomModel(roomTableId = 0, + id = this.id, +name = this.name, + ) + +} + diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/ModelApiResponse.kt new file mode 100644 index 000000000000..9f81f502ed3c --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/ModelApiResponse.kt @@ -0,0 +1,57 @@ +/** + * OpenAPI 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 + * + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import org.openapitools.client.models.room.ModelApiResponseRoomModel +import org.openapitools.client.infrastructure.ITransformForStorage + +/** + * Describes the result of uploading an image resource + * + * @param code + * @param type + * @param message + */ + +data class ModelApiResponse ( + + @SerializedName("code") + val code: kotlin.Int? = null, + + @SerializedName("type") + val type: kotlin.String? = null, + + @SerializedName("message") + val message: kotlin.String? = null + +): ITransformForStorage { + companion object { } + override fun toRoomModel(): ModelApiResponseRoomModel = + ModelApiResponseRoomModel(roomTableId = 0, + code = this.code, +type = this.type, +message = this.message, + ) + +} + diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Order.kt new file mode 100644 index 000000000000..cb48557cd279 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Order.kt @@ -0,0 +1,83 @@ +/** + * OpenAPI 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 + * + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import org.openapitools.client.models.room.OrderRoomModel +import org.openapitools.client.infrastructure.ITransformForStorage + +/** + * An order for a pets from the pet store + * + * @param id + * @param petId + * @param quantity + * @param shipDate + * @param status Order Status + * @param complete + */ + +data class Order ( + + @SerializedName("id") + val id: kotlin.Long? = null, + + @SerializedName("petId") + val petId: kotlin.Long? = null, + + @SerializedName("quantity") + val quantity: kotlin.Int? = null, + + @SerializedName("shipDate") + val shipDate: java.time.OffsetDateTime? = null, + + /* Order Status */ + @SerializedName("status") + val status: Order.Status? = null, + + @SerializedName("complete") + val complete: kotlin.Boolean? = false + +): ITransformForStorage { + companion object { } + override fun toRoomModel(): OrderRoomModel = + OrderRoomModel(roomTableId = 0, + id = this.id, +petId = this.petId, +quantity = this.quantity, +shipDate = this.shipDate, +status = this.status, +complete = this.complete, + ) + + /** + * Order Status + * + * Values: placed,approved,delivered + */ + enum class Status(val value: kotlin.String) { + @SerializedName(value = "placed") placed("placed"), + @SerializedName(value = "approved") approved("approved"), + @SerializedName(value = "delivered") delivered("delivered"); + } +} + diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Pet.kt new file mode 100644 index 000000000000..83edfb9c4f4f --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Pet.kt @@ -0,0 +1,85 @@ +/** + * OpenAPI 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 + * + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import org.openapitools.client.models.Category +import org.openapitools.client.models.Tag + +import com.google.gson.annotations.SerializedName +import org.openapitools.client.models.room.PetRoomModel +import org.openapitools.client.infrastructure.ITransformForStorage + +/** + * A pet for sale in the pet store + * + * @param name + * @param photoUrls + * @param id + * @param category + * @param tags + * @param status pet status in the store + */ + +data class Pet ( + + @SerializedName("name") + val name: kotlin.String, + + @SerializedName("photoUrls") + val photoUrls: kotlin.collections.List, + + @SerializedName("id") + val id: kotlin.Long? = null, + + @SerializedName("category") + val category: Category? = null, + + @SerializedName("tags") + val tags: kotlin.collections.List? = null, + + /* pet status in the store */ + @SerializedName("status") + val status: Pet.Status? = null + +): ITransformForStorage { + companion object { } + override fun toRoomModel(): PetRoomModel = + PetRoomModel(roomTableId = 0, + name = this.name, +photoUrls = this.photoUrls, +id = this.id, +category = this.category, + +status = this.status, + ) + + /** + * pet status in the store + * + * Values: available,pending,sold + */ + enum class Status(val value: kotlin.String) { + @SerializedName(value = "available") available("available"), + @SerializedName(value = "pending") pending("pending"), + @SerializedName(value = "sold") sold("sold"); + } +} + diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Tag.kt new file mode 100644 index 000000000000..03dcdbbaf04f --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Tag.kt @@ -0,0 +1,52 @@ +/** + * OpenAPI 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 + * + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import org.openapitools.client.models.room.TagRoomModel +import org.openapitools.client.infrastructure.ITransformForStorage + +/** + * A tag for a pet + * + * @param id + * @param name + */ + +data class Tag ( + + @SerializedName("id") + val id: kotlin.Long? = null, + + @SerializedName("name") + val name: kotlin.String? = null + +): ITransformForStorage { + companion object { } + override fun toRoomModel(): TagRoomModel = + TagRoomModel(roomTableId = 0, + id = this.id, +name = this.name, + ) + +} + diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/User.kt new file mode 100644 index 000000000000..c35a2df394fb --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/User.kt @@ -0,0 +1,83 @@ +/** + * OpenAPI 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 + * + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import org.openapitools.client.models.room.UserRoomModel +import org.openapitools.client.infrastructure.ITransformForStorage + +/** + * A User who is purchasing from the pet store + * + * @param id + * @param username + * @param firstName + * @param lastName + * @param email + * @param password + * @param phone + * @param userStatus User Status + */ + +data class User ( + + @SerializedName("id") + val id: kotlin.Long? = null, + + @SerializedName("username") + val username: kotlin.String? = null, + + @SerializedName("firstName") + val firstName: kotlin.String? = null, + + @SerializedName("lastName") + val lastName: kotlin.String? = null, + + @SerializedName("email") + val email: kotlin.String? = null, + + @SerializedName("password") + val password: kotlin.String? = null, + + @SerializedName("phone") + val phone: kotlin.String? = null, + + /* User Status */ + @SerializedName("userStatus") + val userStatus: kotlin.Int? = null + +): ITransformForStorage { + companion object { } + override fun toRoomModel(): UserRoomModel = + UserRoomModel(roomTableId = 0, + id = this.id, +username = this.username, +firstName = this.firstName, +lastName = this.lastName, +email = this.email, +password = this.password, +phone = this.phone, +userStatus = this.userStatus, + ) + +} + diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/ApiResponseRoomModel.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/ApiResponseRoomModel.kt new file mode 100644 index 000000000000..aa00942c3977 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/ApiResponseRoomModel.kt @@ -0,0 +1,52 @@ +/** + * OpenAPI 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 + * + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models.room + +import androidx.room.Entity +import androidx.room.Ignore +import androidx.room.PrimaryKey +import org.openapitools.client.models.* + + +@Entity(tableName = "ApiResponse") +/** +* Room model for Describes the result of uploading an image resource +* @param code +* @param type +* @param message +*/ +data class ApiResponseRoomModel ( + @PrimaryKey(autoGenerate = true) var roomTableId: Int, + + var code: kotlin.Int? = null, + var type: kotlin.String? = null, + var message: kotlin.String? = null, + + ) { + + companion object { } + + fun toApiModel(): ApiResponse = ApiResponse( + code = this.code, + type = this.type, + message = this.message, + ) +} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/CategoryRoomModel.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/CategoryRoomModel.kt new file mode 100644 index 000000000000..896589516aba --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/CategoryRoomModel.kt @@ -0,0 +1,49 @@ +/** + * OpenAPI 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 + * + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models.room + +import androidx.room.Entity +import androidx.room.Ignore +import androidx.room.PrimaryKey +import org.openapitools.client.models.* + + +@Entity(tableName = "Category") +/** +* Room model for A category for a pet +* @param id +* @param name +*/ +data class CategoryRoomModel ( + @PrimaryKey(autoGenerate = true) var roomTableId: Int, + + var id: kotlin.Long? = null, + var name: kotlin.String? = null, + + ) { + + companion object { } + + fun toApiModel(): Category = Category( + id = this.id, + name = this.name, + ) +} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/ModelApiResponseRoomModel.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/ModelApiResponseRoomModel.kt new file mode 100644 index 000000000000..87c211434958 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/ModelApiResponseRoomModel.kt @@ -0,0 +1,52 @@ +/** + * OpenAPI 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 + * + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models.room + +import androidx.room.Entity +import androidx.room.Ignore +import androidx.room.PrimaryKey +import org.openapitools.client.models.* + + +@Entity(tableName = "ModelApiResponse") +/** +* Room model for Describes the result of uploading an image resource +* @param code +* @param type +* @param message +*/ +data class ModelApiResponseRoomModel ( + @PrimaryKey(autoGenerate = true) var roomTableId: Int, + + var code: kotlin.Int? = null, + var type: kotlin.String? = null, + var message: kotlin.String? = null, + + ) { + + companion object { } + + fun toApiModel(): ModelApiResponse = ModelApiResponse( + code = this.code, + type = this.type, + message = this.message, + ) +} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/OrderRoomModel.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/OrderRoomModel.kt new file mode 100644 index 000000000000..5367a0e35436 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/OrderRoomModel.kt @@ -0,0 +1,61 @@ +/** + * OpenAPI 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 + * + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models.room + +import androidx.room.Entity +import androidx.room.Ignore +import androidx.room.PrimaryKey +import org.openapitools.client.models.* + + +@Entity(tableName = "Order") +/** +* Room model for An order for a pets from the pet store +* @param id +* @param petId +* @param quantity +* @param shipDate +* @param status Order Status +* @param complete +*/ +data class OrderRoomModel ( + @PrimaryKey(autoGenerate = true) var roomTableId: Int, + + var id: kotlin.Long? = null, + var petId: kotlin.Long? = null, + var quantity: kotlin.Int? = null, + var shipDate: java.time.OffsetDateTime? = null, + var complete: kotlin.Boolean? = null, + + var status: Order.Status? = null, + ) { + + companion object { } + + fun toApiModel(): Order = Order( + id = this.id, + petId = this.petId, + quantity = this.quantity, + shipDate = this.shipDate, + status = this.status, + complete = this.complete, + ) +} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/PetRoomModel.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/PetRoomModel.kt new file mode 100644 index 000000000000..81296bb2f9da --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/PetRoomModel.kt @@ -0,0 +1,63 @@ +/** + * OpenAPI 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 + * + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models.room + +import androidx.room.Entity +import androidx.room.Ignore +import androidx.room.PrimaryKey +import org.openapitools.client.models.* + + +@Entity(tableName = "Pet") +/** +* Room model for A pet for sale in the pet store +* @param name +* @param photoUrls +* @param id +* @param category +* @param tags +* @param status pet status in the store +*/ +data class PetRoomModel ( + @PrimaryKey(autoGenerate = true) var roomTableId: Int, + var photoUrls: kotlin.collections.List, + + var name: kotlin.String, + var id: kotlin.Long? = null, + var category: Category? = null, + + var status: Pet.Status? = null, + ) { + + @Ignore + var tags: kotlin.collections.List? = null + + companion object { } + + fun toApiModel(): Pet = Pet( + name = this.name, + photoUrls = this.photoUrls, + id = this.id, + category = this.category, + tags = this.tags, + status = this.status, + ) +} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/TagRoomModel.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/TagRoomModel.kt new file mode 100644 index 000000000000..42f255a11f11 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/TagRoomModel.kt @@ -0,0 +1,49 @@ +/** + * OpenAPI 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 + * + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models.room + +import androidx.room.Entity +import androidx.room.Ignore +import androidx.room.PrimaryKey +import org.openapitools.client.models.* + + +@Entity(tableName = "Tag") +/** +* Room model for A tag for a pet +* @param id +* @param name +*/ +data class TagRoomModel ( + @PrimaryKey(autoGenerate = true) var roomTableId: Int, + + var id: kotlin.Long? = null, + var name: kotlin.String? = null, + + ) { + + companion object { } + + fun toApiModel(): Tag = Tag( + id = this.id, + name = this.name, + ) +} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/UserRoomModel.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/UserRoomModel.kt new file mode 100644 index 000000000000..f0c067fc19f1 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/UserRoomModel.kt @@ -0,0 +1,67 @@ +/** + * OpenAPI 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 + * + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models.room + +import androidx.room.Entity +import androidx.room.Ignore +import androidx.room.PrimaryKey +import org.openapitools.client.models.* + + +@Entity(tableName = "User") +/** +* Room model for A User who is purchasing from the pet store +* @param id +* @param username +* @param firstName +* @param lastName +* @param email +* @param password +* @param phone +* @param userStatus User Status +*/ +data class UserRoomModel ( + @PrimaryKey(autoGenerate = true) var roomTableId: Int, + + var id: kotlin.Long? = null, + var username: kotlin.String? = null, + var firstName: kotlin.String? = null, + var lastName: kotlin.String? = null, + var email: kotlin.String? = null, + var password: kotlin.String? = null, + var phone: kotlin.String? = null, + var userStatus: kotlin.Int? = null, + + ) { + + companion object { } + + fun toApiModel(): User = User( + id = this.id, + username = this.username, + firstName = this.firstName, + lastName = this.lastName, + email = this.email, + password = this.password, + phone = this.phone, + userStatus = this.userStatus, + ) +} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/request/GsonRequest.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/request/GsonRequest.kt new file mode 100644 index 000000000000..965eeae66e25 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/request/GsonRequest.kt @@ -0,0 +1,119 @@ +package org.openapitools.client.request + +import com.android.volley.NetworkResponse +import com.android.volley.ParseError +import com.android.volley.Request +import com.android.volley.Response +import com.android.volley.toolbox.HttpHeaderParser +import com.google.gson.Gson +import com.google.gson.GsonBuilder +import com.google.gson.JsonSyntaxException +import java.io.UnsupportedEncodingException +import java.nio.charset.Charset +import java.net.HttpURLConnection +import java.lang.reflect.Type +import java.time.LocalDate +import java.time.LocalDateTime +import java.time.OffsetDateTime + +import org.openapitools.client.infrastructure.OffsetDateTimeAdapter +import org.openapitools.client.infrastructure.LocalDateTimeAdapter +import org.openapitools.client.infrastructure.LocalDateAdapter +import org.openapitools.client.infrastructure.ByteArrayAdapter + +class GsonRequest( + method: Int, + url: String, + private val body: Any?, + private val headers: Map?, + private val params: MutableMap?, + private val contentTypeForBody: String?, + private val encodingForParams: String?, + private val gsonAdapters: Map?, + private val type: Type, + private val listener: Response.Listener, + errorListener: Response.ErrorListener +) : Request(method, url, errorListener) { + + val gsonBuilder: GsonBuilder = GsonBuilder() + .registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter()) + .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) + .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) + .registerTypeAdapter(ByteArray::class.java, ByteArrayAdapter()) + .apply { + gsonAdapters?.forEach { + this.registerTypeAdapter(it.key, it.value) + } + } + + val gson: Gson by lazy { + gsonBuilder.create() + } + + private var response: NetworkResponse? = null + + override fun deliverResponse(response: T?) { + listener.onResponse(response) + } + + override fun getParams(): MutableMap? = params ?: super.getParams() + + override fun getBodyContentType(): String = contentTypeForBody ?: super.getBodyContentType() + + override fun getParamsEncoding(): String = encodingForParams ?: super.getParamsEncoding() + + override fun getHeaders(): MutableMap { + val combined = HashMap() + combined.putAll(super.getHeaders()) + if (headers != null) { + combined.putAll(headers) + } + return combined + } + + override fun getBody(): ByteArray? { + if (body != null) { + return gson.toJson(body).toByteArray(Charsets.UTF_8) + } + return super.getBody() + } + + override fun parseNetworkResponse(response: NetworkResponse?): Response { + return try { + this.response = copyTo(response) + val json = String( + response?.data ?: ByteArray(0), + Charset.forName(HttpHeaderParser.parseCharset(response?.headers)) + ) + Response.success( + gson.fromJson(json, type), + HttpHeaderParser.parseCacheHeaders(response) + ) + } catch (e: UnsupportedEncodingException) { + Response.error(ParseError(e)) + } catch (e: JsonSyntaxException) { + Response.error(ParseError(e)) + } + } + + private fun copyTo(response: NetworkResponse?): NetworkResponse { + return if (response != null) { + NetworkResponse( + response.statusCode, + response.data, + response.notModified, + response.networkTimeMs, + response.allHeaders + ) + } else { + // Return an empty response. + NetworkResponse( + HttpURLConnection.HTTP_BAD_METHOD, + ByteArray(0), + false, + 0, + emptyList() + ) + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/request/IRequestFactory.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/request/IRequestFactory.kt new file mode 100644 index 000000000000..599db0bc0de6 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/request/IRequestFactory.kt @@ -0,0 +1,64 @@ +package org.openapitools.client.request + +import com.android.volley.Request +import com.android.volley.Response +import java.io.UnsupportedEncodingException +import java.lang.reflect.Type +import java.net.URLEncoder +import java.text.ParseException +import java.text.SimpleDateFormat +import java.util.* +import java.time.format.DateTimeFormatter +import java.time.OffsetDateTime +import java.time.LocalDate + + +interface IRequestFactory { + + companion object { + /** + * ISO 8601 date time format. + * @see https://en.wikipedia.org/wiki/ISO_8601 + */ + fun formatDateTime(datetime: OffsetDateTime) = DateTimeFormatter.ISO_INSTANT.format(datetime) + fun formatDate(date: LocalDate) = DateTimeFormatter.ISO_LOCAL_DATE.format(date) + + fun escapeString(str: String): String { + return try { + URLEncoder.encode(str, "UTF-8") + } catch (e: UnsupportedEncodingException) { + str + } + } + + fun parameterToString(param: Any?) = + when (param) { + null -> "" + is OffsetDateTime -> formatDateTime(param) + is Collection<*> -> { + val b = StringBuilder() + for (o in param) { + if (b.isNotEmpty()) { + b.append(",") + } + b.append(o.toString()) + } + b.toString() + } + else -> param.toString() + } + } + + + fun build( + method: Int, + url : String, + body: Any?, + headers: Map?, + queryParams: Map?, + formParams: Map?, + contentTypeForBody: String?, + type: Type, + responseListener: Response.Listener, + errorListener: Response.ErrorListener): Request +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/request/RequestFactory.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/request/RequestFactory.kt new file mode 100644 index 000000000000..2bcf9d2d9c6c --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/request/RequestFactory.kt @@ -0,0 +1,87 @@ +// Knowing the details of an operation it will produce a call to a Volley Request constructor +package org.openapitools.client.request + + +import com.android.volley.Request +import com.android.volley.Response +import android.util.Base64 +import org.openapitools.client.request.IRequestFactory.Companion.escapeString +import java.lang.reflect.Type +import java.util.Locale +import java.util.UUID + +class RequestFactory(private val headerFactories : List<() -> Map> = listOf(), private val postProcessors :List <(Request<*>) -> Unit> = listOf(), private val gsonAdapters: Map = mapOf()): IRequestFactory { + + companion object Authentication { + // Where a header factory requires parameters a client will need to bind these + // TODO Generate appropriate header factories based on settings + // Api Key auth supports query header and cookie. + // Query is supported in the path generation only with a hardcoded value. + // TODO: Not sure about cookie auth form + // If implementing api key in query parameter use the ^isKeyInHeader property + + val apiKeyAuthHeaderFactoryBuilder = { + paramName: String, apiKeyPrefix: String?, apiKey: String? -> { + mapOf(paramName to + if (apiKeyPrefix != null) { + "$apiKeyPrefix $apiKey" + } else { + apiKey!! + } + ) + } + } + + // TODO: Oauth not implemented yet - comment out below as OAuth does not exist + } + + + /** + * {@inheritDoc} + */ + @Suppress("UNCHECKED_CAST") + override fun build( + method: Int, + url: String, + body: Any?, + headers: Map?, + queryParams: Map?, + formParams: Map?, + contentTypeForBody: String?, + type: Type, + responseListener: Response.Listener, + errorListener: Response.ErrorListener + ): Request { + val afterMarketHeaders = (headers?.toMutableMap() ?: mutableMapOf()) + // Factory built and aftermarket + // Merge the after market headers on top of the base ones in case we are overriding per call auth + val allHeaders = headerFactories.fold(afterMarketHeaders) { acc, factory -> (acc + factory.invoke()).toMutableMap() } + + // If we decide to support auth parameters in the url, then you will reference them by supplying a url string + // with known variable name refernces in the string. We will then apply + val updatedUrl = if (!queryParams.isNullOrEmpty()) { + queryParams.asSequence().fold("$url?") {acc, param -> + "$acc${escapeString(param.key)}=${escapeString(param.value)}&" + }.trimEnd('&') + } else { + url + } + + val request = GsonRequest( + method, + updatedUrl, + body, + allHeaders, + formParams?.toMutableMap(), + contentTypeForBody, + null, + gsonAdapters, + type, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + return request + } +} From 1757c4d2ea8a2570bd616609ab7348e7183bd333 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 20 Dec 2021 17:44:18 +0800 Subject: [PATCH 109/117] Test kotlin volley sample in the CI (#11156) * test kotlin volley sample in the ci * update samples * Revert "update samples" This reverts commit 9a0da130760a4a597e4ceef59d1538594893f724. --- .github/workflows/samples-kotlin.yaml | 1 + README.md | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/samples-kotlin.yaml b/.github/workflows/samples-kotlin.yaml index d1d812cbadbe..83d748e9f06e 100644 --- a/.github/workflows/samples-kotlin.yaml +++ b/.github/workflows/samples-kotlin.yaml @@ -29,6 +29,7 @@ jobs: # needs Android configured #- samples/client/petstore/kotlin-json-request-string - samples/client/petstore/kotlin-jvm-okhttp4-coroutines + - samples/client/petstore/kotlin-jvm-volley - samples/client/petstore/kotlin-moshi-codegen - samples/client/petstore/kotlin-multiplatform - samples/client/petstore/kotlin-nonpublic diff --git a/README.md b/README.md index 804104dd9627..899548113675 100644 --- a/README.md +++ b/README.md @@ -917,6 +917,7 @@ Here is a list of template creators: * JMeter: @davidkiss * Kotlin: @jimschubert [:heart:](https://www.patreon.com/jimschubert) * Kotlin (MultiPlatform): @andrewemery + * Kotlin (Volley): @alisters * Lua: @daurnimator * Nim: @hokamoto * OCaml: @cgensoul From c305c71715652fc2075122534fa049a28f750ff3 Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@users.noreply.github.com> Date: Tue, 21 Dec 2021 07:40:13 +0000 Subject: [PATCH 110/117] [DefaultCodegen] generate unknown default case (#11078) * [DefaultCodegen] generate unknown default case * [DefaultCodegen] replace Swift custom implementation with the DefaultCodegen implementation * [DefaultCodegen] generate unknown default case * [DefaultCodegen] generate unknown default case * [DefaultCodegen] generate unknown default case * [DefaultCodegen] generate unknown default case * [DefaultCodegen] generate unknown default case * [DefaultCodegen] generate unknown default case * [DefaultCodegen] generate unknown default case * [DefaultCodegen] generate unknown default case * [DefaultCodegen] update docs * [DefaultCodegen] fix Swift enum case name * [DefaultCodegen] generate unknown default case * [DefaultCodegen] generate unknown default case --- bin/configs/kotlin-enum-default-value.yaml | 1 + bin/configs/kotlin-jvm-okhttp3-okhttp3.yaml | 1 + bin/configs/swift5-frozenEnums.yaml | 2 +- docs/generators/ada-server.md | 1 + docs/generators/ada.md | 1 + docs/generators/android.md | 1 + docs/generators/apache2.md | 1 + docs/generators/apex.md | 1 + docs/generators/asciidoc.md | 1 + docs/generators/avro-schema.md | 1 + docs/generators/bash.md | 1 + docs/generators/c.md | 1 + docs/generators/clojure.md | 1 + docs/generators/cpp-qt-client.md | 1 + docs/generators/cpp-qt-qhttpengine-server.md | 1 + docs/generators/cpp-tiny.md | 1 + docs/generators/cpp-tizen.md | 1 + docs/generators/cpp-ue4.md | 1 + docs/generators/crystal.md | 1 + docs/generators/cwiki.md | 1 + docs/generators/dart-dio-next.md | 1 + docs/generators/dart-dio.md | 1 + docs/generators/dart-jaguar.md | 1 + docs/generators/dart.md | 1 + docs/generators/dynamic-html.md | 1 + docs/generators/elixir.md | 1 + docs/generators/fsharp-functions.md | 1 + docs/generators/groovy.md | 1 + docs/generators/haskell-http-client.md | 1 + docs/generators/haskell-yesod.md | 1 + docs/generators/haskell.md | 1 + docs/generators/html.md | 1 + docs/generators/html2.md | 1 + docs/generators/java-inflector.md | 1 + docs/generators/java-micronaut-client.md | 1 + docs/generators/java-msf4j.md | 1 + docs/generators/java-pkmst.md | 1 + docs/generators/java-play-framework.md | 1 + docs/generators/java-undertow-server.md | 1 + docs/generators/java-vertx-web.md | 1 + docs/generators/java-vertx.md | 1 + docs/generators/java.md | 1 + docs/generators/javascript-apollo.md | 1 + docs/generators/javascript-closure-angular.md | 1 + docs/generators/javascript-flowtyped.md | 1 + docs/generators/javascript.md | 1 + docs/generators/jaxrs-cxf-cdi.md | 1 + docs/generators/jaxrs-cxf-client.md | 1 + docs/generators/jaxrs-cxf-extended.md | 1 + docs/generators/jaxrs-cxf.md | 1 + docs/generators/jaxrs-jersey.md | 1 + docs/generators/jaxrs-resteasy-eap.md | 1 + docs/generators/jaxrs-resteasy.md | 1 + docs/generators/jaxrs-spec.md | 1 + docs/generators/jmeter.md | 1 + docs/generators/k6.md | 1 + docs/generators/markdown.md | 1 + docs/generators/nim.md | 1 + docs/generators/nodejs-express-server.md | 1 + docs/generators/ocaml.md | 1 + docs/generators/openapi-yaml.md | 1 + docs/generators/openapi.md | 1 + docs/generators/php-dt.md | 1 + docs/generators/php-laravel.md | 1 + docs/generators/php-lumen.md | 1 + docs/generators/php-mezzio-ph.md | 1 + docs/generators/php-silex-deprecated.md | 1 + docs/generators/php-slim-deprecated.md | 1 + docs/generators/php-slim4.md | 1 + docs/generators/php-symfony.md | 1 + docs/generators/php.md | 1 + docs/generators/plantuml.md | 1 + docs/generators/python-aiohttp.md | 1 + docs/generators/python-blueplanet.md | 1 + docs/generators/python-fastapi.md | 1 + docs/generators/python-flask.md | 1 + docs/generators/ruby.md | 1 + docs/generators/scala-akka-http-server.md | 1 + docs/generators/scala-akka.md | 1 + docs/generators/scala-gatling.md | 1 + .../generators/scala-httpclient-deprecated.md | 1 + docs/generators/scala-lagom-server.md | 1 + docs/generators/scala-play-server.md | 1 + docs/generators/scala-sttp.md | 1 + docs/generators/scalatra.md | 1 + docs/generators/scalaz.md | 1 + docs/generators/spring.md | 1 + docs/generators/swift4-deprecated.md | 1 + docs/generators/swift5.md | 2 +- docs/generators/typescript-angular.md | 1 + .../typescript-angularjs-deprecated.md | 1 + docs/generators/typescript-aurelia.md | 1 + docs/generators/typescript-axios.md | 1 + docs/generators/typescript-fetch.md | 1 + docs/generators/typescript-inversify.md | 1 + docs/generators/typescript-jquery.md | 1 + docs/generators/typescript-nestjs.md | 1 + docs/generators/typescript-node.md | 1 + docs/generators/typescript-redux-query.md | 1 + docs/generators/typescript-rxjs.md | 1 + docs/generators/typescript.md | 1 + docs/generators/wsdl-schema.md | 1 + .../codegen/CodegenConstants.java | 6 + .../openapitools/codegen/DefaultCodegen.java | 55 +++++++ .../languages/KotlinClientCodegen.java | 3 + .../languages/Swift5ClientCodegen.java | 22 +-- .../infrastructure/Serializer.kt.mustache | 6 + .../SerializerHelper.kt.mustache | 50 ++++++ .../libraries/jvm-okhttp/api.mustache | 86 +++++++++- .../src/main/resources/swift5/api.mustache | 11 ++ .../main/resources/swift5/modelEnum.mustache | 27 +--- .../modelInlineEnumDeclaration.mustache | 30 +--- .../codegen/bash/BashClientOptionsTest.java | 1 + .../codegen/dart/DartClientOptionsTest.java | 1 + .../dart/dio/DartDioClientOptionsTest.java | 1 + .../dio/DartDioNextClientOptionsTest.java | 1 + .../elixir/ElixirClientOptionsTest.java | 1 + .../HaskellServantOptionsTest.java | 1 + .../HaskellYesodServerOptionsTest.java | 1 + .../lumen/PhpLumenServerOptionsTest.java | 1 + .../options/BashClientOptionsProvider.java | 2 + .../options/DartClientOptionsProvider.java | 2 + .../options/DartDioClientOptionsProvider.java | 2 + .../DartDioNextClientOptionsProvider.java | 2 + .../options/ElixirClientOptionsProvider.java | 2 + .../HaskellServantOptionsProvider.java | 2 + .../HaskellYesodServerOptionsProvider.java | 2 + .../options/PhpClientOptionsProvider.java | 2 + .../PhpLumenServerOptionsProvider.java | 2 + .../PhpSilexServerOptionsProvider.java | 2 + .../PhpSlim4ServerOptionsProvider.java | 2 + .../options/PhpSlimServerOptionsProvider.java | 2 + .../options/RubyClientOptionsProvider.java | 2 + .../ScalaAkkaClientOptionsProvider.java | 2 + .../ScalaHttpClientOptionsProvider.java | 2 + .../options/Swift4OptionsProvider.java | 93 ----------- .../options/Swift5OptionsProvider.java | 4 +- ...ypeScriptAngularClientOptionsProvider.java | 2 + ...eScriptAngularJsClientOptionsProvider.java | 2 + ...ypeScriptAureliaClientOptionsProvider.java | 2 + .../TypeScriptFetchClientOptionsProvider.java | 2 + ...TypeScriptNestjsClientOptionsProvider.java | 2 + .../TypeScriptNodeClientOptionsProvider.java | 2 + .../codegen/php/PhpClientOptionsTest.java | 1 + .../codegen/ruby/RubyClientOptionsTest.java | 1 + .../scalaakka/ScalaAkkaClientOptionsTest.java | 1 + .../ScalaHttpClientOptionsTest.java | 1 + .../silex/PhpSilexServerOptionsTest.java | 1 + .../slim/PhpSlimServerOptionsTest.java | 1 + .../slim4/PhpSlim4ServerOptionsTest.java | 1 + .../codegen/swift4/Swift4CodegenTest.java | 147 ------------------ .../codegen/swift4/Swift4ModelEnumTest.java | 133 ---------------- .../codegen/swift4/Swift4ModelTest.java | 125 --------------- .../codegen/swift4/Swift4OptionsTest.java | 52 ------- .../codegen/swift5/Swift5OptionsTest.java | 2 +- .../TypeScriptAureliaClientOptionsTest.java | 1 + .../TypeScriptFetchClientOptionsTest.java | 1 + .../TypeScriptAngularClientOptionsTest.java | 1 + .../TypeScriptAngularJsClientOptionsTest.java | 1 + .../TypeScriptNestjsClientOptionsTest.java | 1 + .../TypeScriptNodeClientOptionsTest.java | 1 + .../.openapi-generator/FILES | 1 + .../openapitools/client/apis/DefaultApi.kt | 2 + .../client/infrastructure/Serializer.kt | 2 + .../client/infrastructure/SerializerHelper.kt | 12 ++ .../ModelWithEnumPropertyHavingDefault.kt | 5 +- .../org/openapitools/client/apis/PetApi.kt | 22 ++- .../org/openapitools/client/apis/StoreApi.kt | 2 + .../org/openapitools/client/apis/UserApi.kt | 4 +- .../org/openapitools/client/apis/PetApi.kt | 22 ++- .../org/openapitools/client/apis/StoreApi.kt | 2 + .../org/openapitools/client/apis/UserApi.kt | 4 +- .../org/openapitools/client/apis/PetApi.kt | 6 +- .../org/openapitools/client/apis/StoreApi.kt | 2 + .../org/openapitools/client/apis/UserApi.kt | 4 +- .../org/openapitools/client/apis/PetApi.kt | 22 ++- .../org/openapitools/client/apis/StoreApi.kt | 2 + .../org/openapitools/client/apis/UserApi.kt | 4 +- .../org/openapitools/client/apis/PetApi.kt | 22 ++- .../org/openapitools/client/apis/StoreApi.kt | 2 + .../org/openapitools/client/apis/UserApi.kt | 4 +- .../org/openapitools/client/apis/PetApi.kt | 22 ++- .../org/openapitools/client/apis/StoreApi.kt | 2 + .../org/openapitools/client/apis/UserApi.kt | 4 +- .../org/openapitools/client/apis/PetApi.kt | 22 ++- .../org/openapitools/client/apis/StoreApi.kt | 2 + .../org/openapitools/client/apis/UserApi.kt | 4 +- .../kotlin-okhttp3/.openapi-generator/FILES | 1 + .../org/openapitools/client/apis/PetApi.kt | 22 ++- .../org/openapitools/client/apis/StoreApi.kt | 2 + .../org/openapitools/client/apis/UserApi.kt | 4 +- .../client/infrastructure/Serializer.kt | 2 + .../client/infrastructure/SerializerHelper.kt | 14 ++ .../org/openapitools/client/models/Order.kt | 5 +- .../org/openapitools/client/models/Pet.kt | 5 +- .../org/openapitools/client/apis/PetApi.kt | 22 ++- .../org/openapitools/client/apis/StoreApi.kt | 2 + .../org/openapitools/client/apis/UserApi.kt | 4 +- .../org/openapitools/client/apis/PetApi.kt | 22 ++- .../org/openapitools/client/apis/StoreApi.kt | 2 + .../org/openapitools/client/apis/UserApi.kt | 4 +- .../org/openapitools/client/apis/EnumApi.kt | 2 + .../org/openapitools/client/apis/PetApi.kt | 22 ++- .../org/openapitools/client/apis/StoreApi.kt | 2 + .../org/openapitools/client/apis/UserApi.kt | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 12 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 6 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 34 +--- .../Classes/OpenAPIs/Models/MapTest.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 6 +- .../Classes/OpenAPIs/Models/Pet.swift | 6 +- 212 files changed, 674 insertions(+), 764 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/SerializerHelper.kt.mustache delete mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift4OptionsProvider.java delete mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4CodegenTest.java delete mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4ModelEnumTest.java delete mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4ModelTest.java delete mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4OptionsTest.java create mode 100644 samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/SerializerHelper.kt create mode 100644 samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/SerializerHelper.kt diff --git a/bin/configs/kotlin-enum-default-value.yaml b/bin/configs/kotlin-enum-default-value.yaml index 3d8c9f57a8be..ddb00c552830 100644 --- a/bin/configs/kotlin-enum-default-value.yaml +++ b/bin/configs/kotlin-enum-default-value.yaml @@ -6,3 +6,4 @@ additionalProperties: artifactId: kotlin-enum-default-value serializableModel: "true" dateLibrary: java8 + enumUnknownDefaultCase: true diff --git a/bin/configs/kotlin-jvm-okhttp3-okhttp3.yaml b/bin/configs/kotlin-jvm-okhttp3-okhttp3.yaml index f8be34a2f0ac..13baa85c9a64 100644 --- a/bin/configs/kotlin-jvm-okhttp3-okhttp3.yaml +++ b/bin/configs/kotlin-jvm-okhttp3-okhttp3.yaml @@ -5,3 +5,4 @@ inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-client additionalProperties: artifactId: kotlin-petstore-okhttp3 + enumUnknownDefaultCase: true diff --git a/bin/configs/swift5-frozenEnums.yaml b/bin/configs/swift5-frozenEnums.yaml index 64dc04a4f81b..38ca413f3505 100644 --- a/bin/configs/swift5-frozenEnums.yaml +++ b/bin/configs/swift5-frozenEnums.yaml @@ -7,6 +7,6 @@ additionalProperties: podAuthors: "" podSummary: PetstoreClient sortParamsByRequiredFlag: false - generateFrozenEnums: false + enumUnknownDefaultCase: true projectName: PetstoreClient podHomepage: https://github.com/openapitools/openapi-generator diff --git a/docs/generators/ada-server.md b/docs/generators/ada-server.md index 237bb29682bd..f88751432cb6 100644 --- a/docs/generators/ada-server.md +++ b/docs/generators/ada-server.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|

            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |projectName|GNAT project name| |defaultProject| diff --git a/docs/generators/ada.md b/docs/generators/ada.md index 06e405243158..3c08371fe24c 100644 --- a/docs/generators/ada.md +++ b/docs/generators/ada.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |projectName|GNAT project name| |defaultProject| diff --git a/docs/generators/android.md b/docs/generators/android.md index f2c6442c6e90..12e99f75cf31 100644 --- a/docs/generators/android.md +++ b/docs/generators/android.md @@ -16,6 +16,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version for use in the generated build.gradle and pom.xml| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |groupId|groupId for use in the generated build.gradle and pom.xml| |null| |invokerPackage|root package for generated code| |null| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| diff --git a/docs/generators/apache2.md b/docs/generators/apache2.md index 8e02718be28b..0db25b032cde 100644 --- a/docs/generators/apache2.md +++ b/docs/generators/apache2.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| diff --git a/docs/generators/apex.md b/docs/generators/apex.md index f5179a9d7e9d..89dfd44654d7 100644 --- a/docs/generators/apex.md +++ b/docs/generators/apex.md @@ -13,6 +13,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |classPrefix|Prefix for generated classes. Set this to avoid overwriting existing classes in your org.| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |namedCredential|The named credential name for the HTTP callouts| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/asciidoc.md b/docs/generators/asciidoc.md index 0e309aa541d1..80f949644c80 100644 --- a/docs/generators/asciidoc.md +++ b/docs/generators/asciidoc.md @@ -14,6 +14,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |groupId|groupId in generated pom.xml| |null| |headerAttributes|generation of asciidoc header meta data attributes (set to false to suppress, default: true)| |true| |infoEmail|an email address to contact for inquiries about the application| |null| diff --git a/docs/generators/avro-schema.md b/docs/generators/avro-schema.md index 2637a9227433..cbb7dd6e3f07 100644 --- a/docs/generators/avro-schema.md +++ b/docs/generators/avro-schema.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |packageName|package for generated classes (where supported)| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/bash.md b/docs/generators/bash.md index a8d3fe169377..590f535c54f5 100644 --- a/docs/generators/bash.md +++ b/docs/generators/bash.md @@ -13,6 +13,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |curlOptions|Default cURL options| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |generateBashCompletion|Whether to generate the Bash completion script| |false| |generateZshCompletion|Whether to generate the Zsh completion script| |false| |hostEnvironmentVariable|Name of environment variable where host can be defined (e.g. PETSTORE_HOST='http://api.openapitools.org:8080')| |null| diff --git a/docs/generators/c.md b/docs/generators/c.md index 98f84c458762..c6e5c35372f1 100644 --- a/docs/generators/c.md +++ b/docs/generators/c.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/clojure.md b/docs/generators/clojure.md index f5fce29a05bf..cf7b0c3bc03c 100644 --- a/docs/generators/clojure.md +++ b/docs/generators/clojure.md @@ -11,6 +11,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |baseNamespace|the base/top namespace (Default: generated from projectName)| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |projectDescription|description of the project (Default: using info.description or "Client library of <projectName>")| |null| diff --git a/docs/generators/cpp-qt-client.md b/docs/generators/cpp-qt-client.md index 96be28abb0af..4bb53da53f33 100644 --- a/docs/generators/cpp-qt-client.md +++ b/docs/generators/cpp-qt-client.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |cppNamespace|C++ namespace (convention: name::space::for::api).| |OpenAPI| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |modelNamePrefix|Prefix that will be prepended to all model names.| |OAI| |optionalProjectFile|Generate client.pri.| |true| diff --git a/docs/generators/cpp-qt-qhttpengine-server.md b/docs/generators/cpp-qt-qhttpengine-server.md index efd57d28d7ad..6126b80c2542 100644 --- a/docs/generators/cpp-qt-qhttpengine-server.md +++ b/docs/generators/cpp-qt-qhttpengine-server.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |cppNamespace|C++ namespace (convention: name::space::for::api).| |OpenAPI| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |modelNamePrefix|Prefix that will be prepended to all model names.| |OAI| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/cpp-tiny.md b/docs/generators/cpp-tiny.md index 1c90b5cbe8e0..4da8351e58a6 100644 --- a/docs/generators/cpp-tiny.md +++ b/docs/generators/cpp-tiny.md @@ -11,6 +11,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |controller|name of microcontroller (e.g esp32 or esp8266)| |esp32| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |reservedWordPrefix|Prefix to prepend to reserved words in order to avoid conflicts| |r_| diff --git a/docs/generators/cpp-tizen.md b/docs/generators/cpp-tizen.md index c38ec6f5e5c5..7f5b106c048a 100644 --- a/docs/generators/cpp-tizen.md +++ b/docs/generators/cpp-tizen.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |reservedWordPrefix|Prefix to prepend to reserved words in order to avoid conflicts| |r_| diff --git a/docs/generators/cpp-ue4.md b/docs/generators/cpp-ue4.md index b41a208e0e20..be06301a99d8 100644 --- a/docs/generators/cpp-ue4.md +++ b/docs/generators/cpp-ue4.md @@ -11,6 +11,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |cppNamespace|C++ namespace (convention: name::space::for::api).| |OpenAPI| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |optionalProjectFile|Generate Build.cs| |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/crystal.md b/docs/generators/crystal.md index 93a893215ca4..b79135246bb9 100644 --- a/docs/generators/crystal.md +++ b/docs/generators/crystal.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/cwiki.md b/docs/generators/cwiki.md index 0c09a332932b..d10f1d303efc 100644 --- a/docs/generators/cwiki.md +++ b/docs/generators/cwiki.md @@ -14,6 +14,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |groupId|groupId in generated pom.xml| |null| |infoEmail|an email address to contact for inquiries about the application| |null| |infoUrl|a URL where users can get more information about the application| |null| diff --git a/docs/generators/dart-dio-next.md b/docs/generators/dart-dio-next.md index d644e35b04a9..869645f7da8f 100644 --- a/docs/generators/dart-dio-next.md +++ b/docs/generators/dart-dio-next.md @@ -11,6 +11,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |dateLibrary|Specify Date library|
            **core**
            [DEFAULT] Dart core library (DateTime)
            **timemachine**
            Time Machine is date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing.
            |core| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |pubAuthor|Author name in generated pubspec| |null| diff --git a/docs/generators/dart-dio.md b/docs/generators/dart-dio.md index 9368dc7e7fc5..e3b6ac956394 100644 --- a/docs/generators/dart-dio.md +++ b/docs/generators/dart-dio.md @@ -11,6 +11,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |dateLibrary|Option. Date library to use|
            **core**
            Dart core library (DateTime)
            **timemachine**
            Time Machine is date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing.
            |core| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |nullableFields|Make all fields nullable in the JSON payload| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/dart-jaguar.md b/docs/generators/dart-jaguar.md index 068b5728f02e..769fa166dab3 100644 --- a/docs/generators/dart-jaguar.md +++ b/docs/generators/dart-jaguar.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |nullableFields|Is the null fields should be in the JSON payload| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/dart.md b/docs/generators/dart.md index cb783be68109..73f113808b46 100644 --- a/docs/generators/dart.md +++ b/docs/generators/dart.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |pubAuthor|Author name in generated pubspec| |null| diff --git a/docs/generators/dynamic-html.md b/docs/generators/dynamic-html.md index 6c0076fc7fa9..771cecc8b158 100644 --- a/docs/generators/dynamic-html.md +++ b/docs/generators/dynamic-html.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |groupId|groupId in generated pom.xml| |null| |invokerPackage|root package for generated code| |null| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| diff --git a/docs/generators/elixir.md b/docs/generators/elixir.md index cb8bd35d33a3..543f116ddb25 100644 --- a/docs/generators/elixir.md +++ b/docs/generators/elixir.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |invokerPackage|The main namespace to use for all classes. e.g. Yay.Pets| |null| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |licenseHeader|The license header to prepend to the top of all source files.| |null| diff --git a/docs/generators/fsharp-functions.md b/docs/generators/fsharp-functions.md index bb16f39fa776..de363c1ca6bb 100644 --- a/docs/generators/fsharp-functions.md +++ b/docs/generators/fsharp-functions.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |licenseName|The name of the license| |NoLicense| |licenseUrl|The URL of the license| |http://localhost| diff --git a/docs/generators/groovy.md b/docs/generators/groovy.md index 858464a52e1e..96df596870d7 100644 --- a/docs/generators/groovy.md +++ b/docs/generators/groovy.md @@ -24,6 +24,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| diff --git a/docs/generators/haskell-http-client.md b/docs/generators/haskell-http-client.md index 0e8a66744635..f287982ab71a 100644 --- a/docs/generators/haskell-http-client.md +++ b/docs/generators/haskell-http-client.md @@ -21,6 +21,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |dateTimeParseFormat|overrides the format string used to parse a datetime| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |generateEnums|Generate specific datatypes for OpenAPI enums| |true| |generateFormUrlEncodedInstances|Generate FromForm/ToForm instances for models that are used by operations that produce or consume application/x-www-form-urlencoded| |true| |generateLenses|Generate Lens optics for Models| |true| diff --git a/docs/generators/haskell-yesod.md b/docs/generators/haskell-yesod.md index 415a6f006233..e4f8bd5a3626 100644 --- a/docs/generators/haskell-yesod.md +++ b/docs/generators/haskell-yesod.md @@ -11,6 +11,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |apiModuleName|name of the API module (Default: generated from info.title or "API")| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |projectName|name of the project (Default: generated from info.title or "openapi-haskell-yesod-server")| |null| diff --git a/docs/generators/haskell.md b/docs/generators/haskell.md index 5ce44c462af1..75dfe15ca508 100644 --- a/docs/generators/haskell.md +++ b/docs/generators/haskell.md @@ -11,6 +11,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |apiPackage|package for generated api classes| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |modelPackage|package for generated models| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/html.md b/docs/generators/html.md index 225daac75448..0ece134692ac 100644 --- a/docs/generators/html.md +++ b/docs/generators/html.md @@ -14,6 +14,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |groupId|groupId in generated pom.xml| |null| |infoEmail|an email address to contact for inquiries about the application| |null| |infoUrl|a URL where users can get more information about the application| |null| diff --git a/docs/generators/html2.md b/docs/generators/html2.md index e69d26edf61f..40dc30a42e42 100644 --- a/docs/generators/html2.md +++ b/docs/generators/html2.md @@ -14,6 +14,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |groupId|groupId in generated pom.xml| |null| |infoEmail|an email address to contact for inquiries about the application| |null| |infoUrl|a URL where users can get more information about the application| |null| diff --git a/docs/generators/java-inflector.md b/docs/generators/java-inflector.md index bb4d9dbb2365..309bc1a3dbb9 100644 --- a/docs/generators/java-inflector.md +++ b/docs/generators/java-inflector.md @@ -26,6 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| diff --git a/docs/generators/java-micronaut-client.md b/docs/generators/java-micronaut-client.md index 95e4cf76c367..98ce5396a978 100644 --- a/docs/generators/java-micronaut-client.md +++ b/docs/generators/java-micronaut-client.md @@ -28,6 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| diff --git a/docs/generators/java-msf4j.md b/docs/generators/java-msf4j.md index cddf3dde0b7d..d3a7aa4bd218 100644 --- a/docs/generators/java-msf4j.md +++ b/docs/generators/java-msf4j.md @@ -26,6 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| diff --git a/docs/generators/java-pkmst.md b/docs/generators/java-pkmst.md index 073b381962c9..1f7b1f7e2627 100644 --- a/docs/generators/java-pkmst.md +++ b/docs/generators/java-pkmst.md @@ -27,6 +27,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |eurekaUri|Eureka URI| |null| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |groupId|groupId in generated pom.xml| |com.prokarma| diff --git a/docs/generators/java-play-framework.md b/docs/generators/java-play-framework.md index f7bf3373c7f7..851e0c567a15 100644 --- a/docs/generators/java-play-framework.md +++ b/docs/generators/java-play-framework.md @@ -29,6 +29,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |handleExceptions|Add a 'throw exception' to each controller function. Add also a custom error handler where you can put your custom logic| |true| diff --git a/docs/generators/java-undertow-server.md b/docs/generators/java-undertow-server.md index 77d069151bdc..f240e9490900 100644 --- a/docs/generators/java-undertow-server.md +++ b/docs/generators/java-undertow-server.md @@ -26,6 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| diff --git a/docs/generators/java-vertx-web.md b/docs/generators/java-vertx-web.md index 1c14df7a90f9..011359877603 100644 --- a/docs/generators/java-vertx-web.md +++ b/docs/generators/java-vertx-web.md @@ -26,6 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| diff --git a/docs/generators/java-vertx.md b/docs/generators/java-vertx.md index 78b0508c01d4..435c1a122663 100644 --- a/docs/generators/java-vertx.md +++ b/docs/generators/java-vertx.md @@ -26,6 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| diff --git a/docs/generators/java.md b/docs/generators/java.md index 4d086325a06f..9f432edc97f3 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -30,6 +30,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |dynamicOperations|Generate operations dynamically at runtime from an OAS| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |errorObjectType|Error Object type. (This option is for okhttp-gson-next-gen only)| |null| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |gradleProperties|Append additional Gradle proeprties to the gradle.properties file| |null| diff --git a/docs/generators/javascript-apollo.md b/docs/generators/javascript-apollo.md index 44a7ccac561a..260fc9809450 100644 --- a/docs/generators/javascript-apollo.md +++ b/docs/generators/javascript-apollo.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |emitJSDoc|generate JSDoc comments| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |invokerPackage|root package for generated code| |null| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| diff --git a/docs/generators/javascript-closure-angular.md b/docs/generators/javascript-closure-angular.md index 8d9c3b14a14c..891b35cb9331 100644 --- a/docs/generators/javascript-closure-angular.md +++ b/docs/generators/javascript-closure-angular.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/javascript-flowtyped.md b/docs/generators/javascript-flowtyped.md index 51ac05927d3e..a6fcea0533c7 100644 --- a/docs/generators/javascript-flowtyped.md +++ b/docs/generators/javascript-flowtyped.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| diff --git a/docs/generators/javascript.md b/docs/generators/javascript.md index a0bb2d24c952..962b9ffc40ee 100644 --- a/docs/generators/javascript.md +++ b/docs/generators/javascript.md @@ -13,6 +13,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |emitJSDoc|generate JSDoc comments| |true| |emitModelMethods|generate getters and setters for model properties| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |invokerPackage|root package for generated code| |null| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| diff --git a/docs/generators/jaxrs-cxf-cdi.md b/docs/generators/jaxrs-cxf-cdi.md index b604285fdbf3..621f0dc3a735 100644 --- a/docs/generators/jaxrs-cxf-cdi.md +++ b/docs/generators/jaxrs-cxf-cdi.md @@ -26,6 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |generateBuilders|Whether to generate builders for models.| |false| |generatePom|Whether to generate pom.xml if the file does not already exist.| |true| diff --git a/docs/generators/jaxrs-cxf-client.md b/docs/generators/jaxrs-cxf-client.md index 36393f588aae..ad1c60900364 100644 --- a/docs/generators/jaxrs-cxf-client.md +++ b/docs/generators/jaxrs-cxf-client.md @@ -26,6 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| diff --git a/docs/generators/jaxrs-cxf-extended.md b/docs/generators/jaxrs-cxf-extended.md index b8e1da73614d..0eef8cacd4e8 100644 --- a/docs/generators/jaxrs-cxf-extended.md +++ b/docs/generators/jaxrs-cxf-extended.md @@ -27,6 +27,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |false| |generateNonSpringApplication|Generate non-Spring application| |false| diff --git a/docs/generators/jaxrs-cxf.md b/docs/generators/jaxrs-cxf.md index 5958bcdd2eca..80b178858a31 100644 --- a/docs/generators/jaxrs-cxf.md +++ b/docs/generators/jaxrs-cxf.md @@ -27,6 +27,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |false| |generateNonSpringApplication|Generate non-Spring application| |false| diff --git a/docs/generators/jaxrs-jersey.md b/docs/generators/jaxrs-jersey.md index 076d72881e30..15584410d1f8 100644 --- a/docs/generators/jaxrs-jersey.md +++ b/docs/generators/jaxrs-jersey.md @@ -26,6 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| diff --git a/docs/generators/jaxrs-resteasy-eap.md b/docs/generators/jaxrs-resteasy-eap.md index ed99a6037ef7..247353cbb327 100644 --- a/docs/generators/jaxrs-resteasy-eap.md +++ b/docs/generators/jaxrs-resteasy-eap.md @@ -26,6 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |true| |groupId|groupId in generated pom.xml| |org.openapitools| diff --git a/docs/generators/jaxrs-resteasy.md b/docs/generators/jaxrs-resteasy.md index e7e1a5fd228a..ff9fab072fdc 100644 --- a/docs/generators/jaxrs-resteasy.md +++ b/docs/generators/jaxrs-resteasy.md @@ -26,6 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |false| |groupId|groupId in generated pom.xml| |org.openapitools| diff --git a/docs/generators/jaxrs-spec.md b/docs/generators/jaxrs-spec.md index 3f7e3c6de57c..621122f6eaa8 100644 --- a/docs/generators/jaxrs-spec.md +++ b/docs/generators/jaxrs-spec.md @@ -26,6 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |generateBuilders|Whether to generate builders for models.| |false| |generatePom|Whether to generate pom.xml if the file does not already exist.| |true| diff --git a/docs/generators/jmeter.md b/docs/generators/jmeter.md index 1618e2c1ad3b..71584a1e793a 100644 --- a/docs/generators/jmeter.md +++ b/docs/generators/jmeter.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| diff --git a/docs/generators/k6.md b/docs/generators/k6.md index 4c0e735816df..529527a890c4 100644 --- a/docs/generators/k6.md +++ b/docs/generators/k6.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| diff --git a/docs/generators/markdown.md b/docs/generators/markdown.md index 8d7cb9983821..4d87a35f9640 100644 --- a/docs/generators/markdown.md +++ b/docs/generators/markdown.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| diff --git a/docs/generators/nim.md b/docs/generators/nim.md index 23957ff2d5bf..3d90efad1598 100644 --- a/docs/generators/nim.md +++ b/docs/generators/nim.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| diff --git a/docs/generators/nodejs-express-server.md b/docs/generators/nodejs-express-server.md index a96fa3ec24b7..9fffa3c28b79 100644 --- a/docs/generators/nodejs-express-server.md +++ b/docs/generators/nodejs-express-server.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |serverPort|TCP port to listen on.| |null| diff --git a/docs/generators/ocaml.md b/docs/generators/ocaml.md index f9f922feee3b..597f07b84112 100644 --- a/docs/generators/ocaml.md +++ b/docs/generators/ocaml.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| diff --git a/docs/generators/openapi-yaml.md b/docs/generators/openapi-yaml.md index d305a85f0db6..4476c7900003 100644 --- a/docs/generators/openapi-yaml.md +++ b/docs/generators/openapi-yaml.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |outputFile|Output filename| |openapi/openapi.yaml| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/openapi.md b/docs/generators/openapi.md index caf9e4c9e6bb..53ea3bf812c3 100644 --- a/docs/generators/openapi.md +++ b/docs/generators/openapi.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |outputFileName|Output file name| |openapi.json| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/php-dt.md b/docs/generators/php-dt.md index 6f9dae638045..a4a6eac2b732 100644 --- a/docs/generators/php-dt.md +++ b/docs/generators/php-dt.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |modelPackage|package for generated models| |null| diff --git a/docs/generators/php-laravel.md b/docs/generators/php-laravel.md index fa6717217adf..09e61d56c132 100644 --- a/docs/generators/php-laravel.md +++ b/docs/generators/php-laravel.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |modelPackage|package for generated models| |null| diff --git a/docs/generators/php-lumen.md b/docs/generators/php-lumen.md index 1c39477ad47b..562b26a589da 100644 --- a/docs/generators/php-lumen.md +++ b/docs/generators/php-lumen.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |modelPackage|package for generated models| |null| diff --git a/docs/generators/php-mezzio-ph.md b/docs/generators/php-mezzio-ph.md index 35bedda05f9f..7abb3408bca7 100644 --- a/docs/generators/php-mezzio-ph.md +++ b/docs/generators/php-mezzio-ph.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |modelPackage|package for generated models| |null| diff --git a/docs/generators/php-silex-deprecated.md b/docs/generators/php-silex-deprecated.md index 9df926cce14e..9b4d5b39b635 100644 --- a/docs/generators/php-silex-deprecated.md +++ b/docs/generators/php-silex-deprecated.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| diff --git a/docs/generators/php-slim-deprecated.md b/docs/generators/php-slim-deprecated.md index d6f8b35c7f21..15c4d36ba80f 100644 --- a/docs/generators/php-slim-deprecated.md +++ b/docs/generators/php-slim-deprecated.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |modelPackage|package for generated models| |null| diff --git a/docs/generators/php-slim4.md b/docs/generators/php-slim4.md index ae6cc1cb6569..ca1bd3b6a101 100644 --- a/docs/generators/php-slim4.md +++ b/docs/generators/php-slim4.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |modelPackage|package for generated models| |null| diff --git a/docs/generators/php-symfony.md b/docs/generators/php-symfony.md index 4d268ab389ee..0a231dbd2e49 100644 --- a/docs/generators/php-symfony.md +++ b/docs/generators/php-symfony.md @@ -16,6 +16,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |composerVendorName|The vendor name used in the composer package name. The template uses {{composerVendorName}}/{{composerProjectName}} for the composer package name. e.g. yaypets| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| diff --git a/docs/generators/php.md b/docs/generators/php.md index dcee69588f4b..c84e12c36f66 100644 --- a/docs/generators/php.md +++ b/docs/generators/php.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |hideGenerationTimestamp|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |true| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| diff --git a/docs/generators/plantuml.md b/docs/generators/plantuml.md index 2413b540ef09..7a37ad0d187f 100644 --- a/docs/generators/plantuml.md +++ b/docs/generators/plantuml.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| diff --git a/docs/generators/python-aiohttp.md b/docs/generators/python-aiohttp.md index e986c14fd901..14ffd174221f 100644 --- a/docs/generators/python-aiohttp.md +++ b/docs/generators/python-aiohttp.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |defaultController|default controller| |default_controller| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |featureCORS|use flask-cors for handling CORS requests| |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |packageName|python package name (convention: snake_case).| |openapi_server| diff --git a/docs/generators/python-blueplanet.md b/docs/generators/python-blueplanet.md index 020c239e3081..049e3424ebbf 100644 --- a/docs/generators/python-blueplanet.md +++ b/docs/generators/python-blueplanet.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |defaultController|default controller| |default_controller| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |featureCORS|use flask-cors for handling CORS requests| |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |packageName|python package name (convention: snake_case).| |openapi_server| diff --git a/docs/generators/python-fastapi.md b/docs/generators/python-fastapi.md index 2143321f2d7d..4e321ff9e59e 100644 --- a/docs/generators/python-fastapi.md +++ b/docs/generators/python-fastapi.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |packageName|python package name (convention: snake_case).| |openapi_server| |packageVersion|python package version.| |1.0.0| diff --git a/docs/generators/python-flask.md b/docs/generators/python-flask.md index f65ec823a837..a0a5f44b20a3 100644 --- a/docs/generators/python-flask.md +++ b/docs/generators/python-flask.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |defaultController|default controller| |default_controller| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |featureCORS|use flask-cors for handling CORS requests| |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |packageName|python package name (convention: snake_case).| |openapi_server| diff --git a/docs/generators/ruby.md b/docs/generators/ruby.md index 5cd52c8c27af..6937905b9e3d 100644 --- a/docs/generators/ruby.md +++ b/docs/generators/ruby.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |gemAuthor|gem author (only one is supported).| |OpenAPI-Generator| |gemAuthorEmail|gem author email (only one is supported).| |null| |gemDescription|gem description. | |This gem maps to a REST API| diff --git a/docs/generators/scala-akka-http-server.md b/docs/generators/scala-akka-http-server.md index 3727fc6fdf60..3d27821c2315 100644 --- a/docs/generators/scala-akka-http-server.md +++ b/docs/generators/scala-akka-http-server.md @@ -16,6 +16,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |dateLibrary|Option. Date library to use|
            **joda**
            Joda (for legacy app)
            **java8**
            Java 8 native JSR310 (preferred for JDK 1.8+)
            |java8| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |groupId|groupId in generated pom.xml| |org.openapitools| |invokerPackage|root package for generated code| |org.openapitools.server| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| diff --git a/docs/generators/scala-akka.md b/docs/generators/scala-akka.md index f2c9cecdab97..1cc19c6216da 100644 --- a/docs/generators/scala-akka.md +++ b/docs/generators/scala-akka.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |dateLibrary|Option. Date library to use|
            **joda**
            Joda (for legacy app)
            **java8**
            Java 8 native JSR310 (preferred for JDK 1.8+)
            |java8| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |mainPackage|Top-level package name, which defines 'apiPackage', 'modelPackage', 'invokerPackage'| |org.openapitools.client| |modelPackage|package for generated models| |null| diff --git a/docs/generators/scala-gatling.md b/docs/generators/scala-gatling.md index 2477cb6848e2..6daaef5d657e 100644 --- a/docs/generators/scala-gatling.md +++ b/docs/generators/scala-gatling.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |dateLibrary|Option. Date library to use|
            **joda**
            Joda (for legacy app)
            **java8**
            Java 8 native JSR310 (preferred for JDK 1.8+)
            |java8| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |modelPackage|package for generated models| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| diff --git a/docs/generators/scala-httpclient-deprecated.md b/docs/generators/scala-httpclient-deprecated.md index adf4649ffcc4..4bd12dca9552 100644 --- a/docs/generators/scala-httpclient-deprecated.md +++ b/docs/generators/scala-httpclient-deprecated.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |dateLibrary|Option. Date library to use|
            **joda**
            Joda (for legacy app)
            **java8**
            Java 8 native JSR310 (preferred for JDK 1.8+)
            |java8| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |modelPackage|package for generated models| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| diff --git a/docs/generators/scala-lagom-server.md b/docs/generators/scala-lagom-server.md index 8c583afcaac0..ed197a23e5eb 100644 --- a/docs/generators/scala-lagom-server.md +++ b/docs/generators/scala-lagom-server.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |dateLibrary|Option. Date library to use|
            **joda**
            Joda (for legacy app)
            **java8**
            Java 8 native JSR310 (preferred for JDK 1.8+)
            |java8| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |modelPackage|package for generated models| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| diff --git a/docs/generators/scala-play-server.md b/docs/generators/scala-play-server.md index 7be64e0f108e..aeab7fd2538c 100644 --- a/docs/generators/scala-play-server.md +++ b/docs/generators/scala-play-server.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |basePackage|Base package in which supporting classes are generated.| |org.openapitools| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |generateCustomExceptions|If set, generates custom exception types.| |true| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |modelPackage|package for generated models| |null| diff --git a/docs/generators/scala-sttp.md b/docs/generators/scala-sttp.md index 0e12f7695d40..9425f8f5c973 100644 --- a/docs/generators/scala-sttp.md +++ b/docs/generators/scala-sttp.md @@ -13,6 +13,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |dateLibrary|Option. Date library to use|
            **joda**
            Joda (for legacy app)
            **java8**
            Java 8 native JSR310 (preferred for JDK 1.8+)
            |java8| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |jodaTimeVersion|The version of joda-time library| |2.10.10| |json4sVersion|The version of json4s library| |3.6.11| |jsonLibrary|Json library to use. Possible values are: json4s and circe.| |json4s| diff --git a/docs/generators/scalatra.md b/docs/generators/scalatra.md index aab1bd98c224..9159c798f233 100644 --- a/docs/generators/scalatra.md +++ b/docs/generators/scalatra.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |dateLibrary|Option. Date library to use|
            **joda**
            Joda (for legacy app)
            **java8**
            Java 8 native JSR310 (preferred for JDK 1.8+)
            |java8| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |modelPackage|package for generated models| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| diff --git a/docs/generators/scalaz.md b/docs/generators/scalaz.md index 87dc8b0e5e48..18520f5e3b3f 100644 --- a/docs/generators/scalaz.md +++ b/docs/generators/scalaz.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |dateLibrary|Option. Date library to use|
            **joda**
            Joda (for legacy app)
            **java8**
            Java 8 native JSR310 (preferred for JDK 1.8+)
            |java8| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |modelPackage|package for generated models| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| diff --git a/docs/generators/spring.md b/docs/generators/spring.md index 8f834fdf27dd..34e4a6a266cb 100644 --- a/docs/generators/spring.md +++ b/docs/generators/spring.md @@ -31,6 +31,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hateoas|Use Spring HATEOAS library to allow adding HATEOAS links| |false| diff --git a/docs/generators/swift4-deprecated.md b/docs/generators/swift4-deprecated.md index ef9fed5d5a8f..cf1e1f65df40 100644 --- a/docs/generators/swift4-deprecated.md +++ b/docs/generators/swift4-deprecated.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |lenientTypeCast|Accept and cast values for simple types (string->bool, string->int, int->string)| |false| diff --git a/docs/generators/swift5.md b/docs/generators/swift5.md index 9404a2fd458d..95f50fca7fc1 100644 --- a/docs/generators/swift5.md +++ b/docs/generators/swift5.md @@ -11,7 +11,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |apiNamePrefix|Prefix that will be appended to all API names ('tags'). Default: empty string. e.g. Pet => Pet.| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| -|generateFrozenEnums|Generate frozen enums (default: true)| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |generateModelAdditionalProperties|Generate model additional properties (default: true)| |true| |hashableModels|Make hashable models (default: true)| |true| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| diff --git a/docs/generators/typescript-angular.md b/docs/generators/typescript-angular.md index 2083b09cadf4..9421c54646ed 100644 --- a/docs/generators/typescript-angular.md +++ b/docs/generators/typescript-angular.md @@ -14,6 +14,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |fileNaming|Naming convention for the output files: 'camelCase', 'kebab-case'.| |camelCase| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |modelFileSuffix|The suffix of the file of the generated model (model<suffix>.ts).| |null| diff --git a/docs/generators/typescript-angularjs-deprecated.md b/docs/generators/typescript-angularjs-deprecated.md index 9363a6958da7..c094849a0781 100644 --- a/docs/generators/typescript-angularjs-deprecated.md +++ b/docs/generators/typescript-angularjs-deprecated.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original| |nullSafeAdditionalProps|Set to make additional properties types declare that their indexer may return undefined| |false| diff --git a/docs/generators/typescript-aurelia.md b/docs/generators/typescript-aurelia.md index aaad28dd75bc..23b71ae41a38 100644 --- a/docs/generators/typescript-aurelia.md +++ b/docs/generators/typescript-aurelia.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| diff --git a/docs/generators/typescript-axios.md b/docs/generators/typescript-axios.md index 8dfc77b52df8..3cfeda785802 100644 --- a/docs/generators/typescript-axios.md +++ b/docs/generators/typescript-axios.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| |npmRepository|Use this property to set an url of your private npmRepo in the package.json| |null| diff --git a/docs/generators/typescript-fetch.md b/docs/generators/typescript-fetch.md index f8e9cd2328ad..3fe83380da4a 100644 --- a/docs/generators/typescript-fetch.md +++ b/docs/generators/typescript-fetch.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| diff --git a/docs/generators/typescript-inversify.md b/docs/generators/typescript-inversify.md index 38077cb2b40a..21e44eac43f7 100644 --- a/docs/generators/typescript-inversify.md +++ b/docs/generators/typescript-inversify.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| diff --git a/docs/generators/typescript-jquery.md b/docs/generators/typescript-jquery.md index fcff7abe194b..030fdd2e572c 100644 --- a/docs/generators/typescript-jquery.md +++ b/docs/generators/typescript-jquery.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |jqueryAlreadyImported|When using this in legacy app using mix of typescript and javascript, this will only declare jquery and not import it| |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original| diff --git a/docs/generators/typescript-nestjs.md b/docs/generators/typescript-nestjs.md index 50e9acb16754..a3f0b52a05da 100644 --- a/docs/generators/typescript-nestjs.md +++ b/docs/generators/typescript-nestjs.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |fileNaming|Naming convention for the output files: 'camelCase', 'kebab-case'.| |camelCase| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |modelFileSuffix|The suffix of the file of the generated model (model<suffix>.ts).| |null| diff --git a/docs/generators/typescript-node.md b/docs/generators/typescript-node.md index 388dfd551bde..5de270453127 100644 --- a/docs/generators/typescript-node.md +++ b/docs/generators/typescript-node.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| diff --git a/docs/generators/typescript-redux-query.md b/docs/generators/typescript-redux-query.md index dd79fa1a433d..f2266c09703c 100644 --- a/docs/generators/typescript-redux-query.md +++ b/docs/generators/typescript-redux-query.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| diff --git a/docs/generators/typescript-rxjs.md b/docs/generators/typescript-rxjs.md index 509991799854..40921ae7f58a 100644 --- a/docs/generators/typescript-rxjs.md +++ b/docs/generators/typescript-rxjs.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| diff --git a/docs/generators/typescript.md b/docs/generators/typescript.md index bff28b73905b..9c6eea23c032 100644 --- a/docs/generators/typescript.md +++ b/docs/generators/typescript.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |fileContentDataType|Specifies the type to use for the content of a file - i.e. Blob (Browser, Deno) / Buffer (node)| |Buffer| |framework|Specify the framework which should be used in the client code.|
            **fetch-api**
            fetch-api
            **jquery**
            jquery
            |fetch-api| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| diff --git a/docs/generators/wsdl-schema.md b/docs/generators/wsdl-schema.md index 7842f8567492..a2af11398624 100644 --- a/docs/generators/wsdl-schema.md +++ b/docs/generators/wsdl-schema.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
            **false**
            The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
            **true**
            Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
            |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
            **false**
            No changes to the enum's are made, this is the default option.
            **true**
            With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
            |false| |hostname|the hostname of the service| |null| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java index bb7aa069fe7a..ffbd0c5e0a4b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java @@ -386,6 +386,12 @@ public static enum ENUM_PROPERTY_NAMING_TYPE {camelCase, PascalCase, snake_case, public static final String DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC = "If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. " + "If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default."; + + public static final String ENUM_UNKNOWN_DEFAULT_CASE = "enumUnknownDefaultCase"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_DESC = + "If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response." + + "With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case."; + public static final String USE_ONEOF_DISCRIMINATOR_LOOKUP = "useOneOfDiscriminatorLookup"; public static final String USE_ONEOF_DISCRIMINATOR_LOOKUP_DESC = "Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and only one match in oneOf's schemas) will be skipped."; } 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 a9780140f4c9..e28f4a03c33e 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 @@ -253,6 +253,11 @@ apiTemplateFiles are for API outputs only (controllers/handlers). // See CodegenConstants.java for more details. protected boolean disallowAdditionalPropertiesIfNotPresent = true; + // If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response. + // With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case. + protected boolean enumUnknownDefaultCase = false; + protected String enumUnknownDefaultCaseName = "unknown_default_open_api"; + // make openapi available to all methods protected OpenAPI openAPI; @@ -376,6 +381,10 @@ public void processOpts() { this.setDisallowAdditionalPropertiesIfNotPresent(Boolean.parseBoolean(additionalProperties .get(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT).toString())); } + if (additionalProperties.containsKey(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE)) { + this.setEnumUnknownDefaultCase(Boolean.parseBoolean(additionalProperties + .get(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE).toString())); + } } /*** @@ -1302,6 +1311,14 @@ public void setDisallowAdditionalPropertiesIfNotPresent(boolean val) { this.disallowAdditionalPropertiesIfNotPresent = val; } + public Boolean getEnumUnknownDefaultCase() { + return enumUnknownDefaultCase; + } + + public void setEnumUnknownDefaultCase(boolean val) { + this.enumUnknownDefaultCase = val; + } + public Boolean getAllowUnicodeIdentifiers() { return allowUnicodeIdentifiers; } @@ -1639,6 +1656,18 @@ public DefaultCodegen() { cliOptions.add(disallowAdditionalPropertiesIfNotPresentOpt); this.setDisallowAdditionalPropertiesIfNotPresent(true); + CliOption enumUnknownDefaultCaseOpt = CliOption.newBoolean( + CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, + CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE_DESC).defaultValue(Boolean.FALSE.toString()); + Map enumUnknownDefaultCaseOpts = new HashMap<>(); + enumUnknownDefaultCaseOpts.put("false", + "No changes to the enum's are made, this is the default option."); + enumUnknownDefaultCaseOpts.put("true", + "With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case."); + enumUnknownDefaultCaseOpt.setEnum(enumUnknownDefaultCaseOpts); + cliOptions.add(enumUnknownDefaultCaseOpt); + this.setEnumUnknownDefaultCase(false); + // initialize special character mapping initializeSpecialCharacterMapping(); @@ -5888,6 +5917,32 @@ protected List> buildEnumVars(List values, String da enumVar.put("isString", isDataTypeString(dataType)); enumVars.add(enumVar); } + + if (enumUnknownDefaultCase) { + // If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response. + // With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case. + Map enumVar = new HashMap<>(); + String enumName = enumUnknownDefaultCaseName; + + String enumValue; + if (isDataTypeString(dataType)) { + enumValue = enumUnknownDefaultCaseName; + } else { + // This is a dummy value that attempts to avoid collisions with previously specified cases. + // Int.max / 192 + // The number 192 that is used to calculate this random value, is the Swift Evolution proposal for frozen/non-frozen enums. + // [SE-0192](https://github.com/apple/swift-evolution/blob/master/proposals/0192-non-exhaustive-enums.md) + // Since this functionality was born in the Swift 5 generator and latter on broth to all generatorss + // https://github.com/OpenAPITools/openapi-generator/pull/11013 + enumValue = String.valueOf(11184809); + } + + enumVar.put("name", toEnumVarName(enumName, dataType)); + enumVar.put("value", toEnumValue(enumValue, dataType)); + enumVar.put("isString", isDataTypeString(dataType)); + enumVars.add(enumVar); + } + return enumVars; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java index b0d272d075b4..9ebab55c3f33 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java @@ -582,6 +582,9 @@ private void addSupportingSerializerAdapters(final String infrastructureFolder) switch (getSerializationLibrary()) { case moshi: + if (enumUnknownDefaultCase) { + supportingFiles.add(new SupportingFile("jvm-common/infrastructure/SerializerHelper.kt.mustache", infrastructureFolder, "SerializerHelper.kt")); + } supportingFiles.add(new SupportingFile("jvm-common/infrastructure/UUIDAdapter.kt.mustache", infrastructureFolder, "UUIDAdapter.kt")); supportingFiles.add(new SupportingFile("jvm-common/infrastructure/LocalDateAdapter.kt.mustache", infrastructureFolder, "LocalDateAdapter.kt")); supportingFiles.add(new SupportingFile("jvm-common/infrastructure/LocalDateTimeAdapter.kt.mustache", infrastructureFolder, "LocalDateTimeAdapter.kt")); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java index 4610b7ded05f..21e7a03c8817 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java @@ -66,7 +66,6 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig public static final String SWIFT_PACKAGE_PATH = "swiftPackagePath"; public static final String USE_CLASSES = "useClasses"; public static final String USE_BACKTICK_ESCAPES = "useBacktickEscapes"; - public static final String GENERATE_FROZEN_ENUMS = "generateFrozenEnums"; public static final String GENERATE_MODEL_ADDITIONAL_PROPERTIES = "generateModelAdditionalProperties"; public static final String HASHABLE_MODELS = "hashableModels"; public static final String MAP_FILE_BINARY_TO_DATA = "mapFileBinaryToData"; @@ -91,7 +90,6 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig protected boolean useClasses = false; protected boolean useBacktickEscapes = false; protected boolean generateModelAdditionalProperties = true; - protected boolean generateFrozenEnums = true; protected boolean hashableModels = true; protected boolean mapFileBinaryToData = false; protected String[] responseAs = new String[0]; @@ -283,9 +281,6 @@ public Swift5ClientCodegen() { cliOptions.add(new CliOption(USE_BACKTICK_ESCAPES, "Escape reserved words using backticks (default: false)") .defaultValue(Boolean.FALSE.toString())); - cliOptions.add(new CliOption(GENERATE_FROZEN_ENUMS, - "Generate frozen enums (default: true)") - .defaultValue(Boolean.TRUE.toString())); cliOptions.add(new CliOption(GENERATE_MODEL_ADDITIONAL_PROPERTIES, "Generate model additional properties (default: true)") .defaultValue(Boolean.TRUE.toString())); @@ -490,13 +485,6 @@ public void processOpts() { setUseBacktickEscapes(convertPropertyToBooleanAndWriteBack(USE_BACKTICK_ESCAPES)); } - // Setup generateFrozenEnums option. If true, enums will strictly include - // cases matching the spec. If false, enums will also include an extra catch-all case. - if (additionalProperties.containsKey(GENERATE_FROZEN_ENUMS)) { - setGenerateFrozenEnums(convertPropertyToBooleanAndWriteBack(GENERATE_FROZEN_ENUMS)); - } - additionalProperties.put(GENERATE_FROZEN_ENUMS, generateFrozenEnums); - if (additionalProperties.containsKey(GENERATE_MODEL_ADDITIONAL_PROPERTIES)) { setGenerateModelAdditionalProperties(convertPropertyToBooleanAndWriteBack(GENERATE_MODEL_ADDITIONAL_PROPERTIES)); } @@ -955,10 +943,6 @@ public void setUseBacktickEscapes(boolean useBacktickEscapes) { this.useBacktickEscapes = useBacktickEscapes; } - public void setGenerateFrozenEnums(boolean generateFrozenEnums) { - this.generateFrozenEnums = generateFrozenEnums; - } - public void setGenerateModelAdditionalProperties(boolean generateModelAdditionalProperties) { this.generateModelAdditionalProperties = generateModelAdditionalProperties; } @@ -988,6 +972,12 @@ public String toEnumVarName(String name, String datatype) { return "empty"; } + if (enumUnknownDefaultCase) { + if (name.equals(enumUnknownDefaultCaseName)) { + return camelize(name, true); + } + } + // Reserved Name String nameLowercase = StringUtils.lowerCase(name); if (isReservedWord(nameLowercase)) { diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/Serializer.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/Serializer.kt.mustache index e3e570e7a0ca..884e16846b14 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/Serializer.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/Serializer.kt.mustache @@ -2,6 +2,9 @@ package {{packageName}}.infrastructure {{#moshi}} import com.squareup.moshi.Moshi +{{#enumUnknownDefaultCase}} +import com.squareup.moshi.adapters.EnumJsonAdapter +{{/enumUnknownDefaultCase}} {{^moshiCodeGen}} import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory {{/moshiCodeGen}} @@ -68,6 +71,9 @@ import java.util.concurrent.atomic.AtomicLong @JvmStatic val moshi: Moshi by lazy { +{{#enumUnknownDefaultCase}} + SerializerHelper.addEnumUnknownDefaultCase(moshiBuilder) +{{/enumUnknownDefaultCase}} moshiBuilder.build() } {{/moshi}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/SerializerHelper.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/SerializerHelper.kt.mustache new file mode 100644 index 000000000000..fbf67a75dde9 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/SerializerHelper.kt.mustache @@ -0,0 +1,50 @@ +package {{packageName}}.infrastructure + +{{#moshi}} +import com.squareup.moshi.Moshi +{{#enumUnknownDefaultCase}} +import com.squareup.moshi.adapters.EnumJsonAdapter +{{/enumUnknownDefaultCase}} +{{/moshi}} + +{{#nonPublicApi}}internal {{/nonPublicApi}}object SerializerHelper { +{{#moshi}} + fun addEnumUnknownDefaultCase(moshiBuilder: Moshi.Builder): Moshi.Builder { + return moshiBuilder +{{#enumUnknownDefaultCase}} +{{#models}} +{{#model}} +{{#isEnum}} +{{#allowableValues}} +{{#enumVars}} +{{#-last}} + .add({{modelPackage}}.{{classname}}::class.java, EnumJsonAdapter.create({{modelPackage}}.{{classname}}::class.java) + .withUnknownFallback({{modelPackage}}.{{classname}}.{{&name}})) +{{/-last}} +{{/enumVars}} +{{/allowableValues}} +{{/isEnum}} +{{^isEnum}} +{{^isAlias}} +{{#hasEnums}} +{{#vars}} +{{#isEnum}} +{{#allowableValues}} +{{#enumVars}} +{{#-last}} + .add({{modelPackage}}.{{classname}}.{{{nameInCamelCase}}}::class.java, EnumJsonAdapter.create({{modelPackage}}.{{classname}}.{{{nameInCamelCase}}}::class.java) + .withUnknownFallback({{modelPackage}}.{{classname}}.{{{nameInCamelCase}}}.{{&name}})) +{{/-last}} +{{/enumVars}} +{{/allowableValues}} +{{/isEnum}} +{{/vars}} +{{/hasEnums}} +{{/isAlias}} +{{/isEnum}} +{{/model}} +{{/models}} +{{/enumUnknownDefaultCase}} + } +{{/moshi}} +} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache index f7a01d9dfbb9..7817289fa11a 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache @@ -6,6 +6,25 @@ import java.io.IOException {{#imports}}import {{import}} {{/imports}} +{{^multiplatform}} +{{#gson}} +import com.google.gson.annotations.SerializedName +{{/gson}} +{{#moshi}} +import com.squareup.moshi.Json +{{/moshi}} +{{#jackson}} +import com.fasterxml.jackson.annotation.JsonProperty +{{/jackson}} +{{#kotlinx_serialization}} +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +{{/kotlinx_serialization}} +{{/multiplatform}} +{{#multiplatform}} +import kotlinx.serialization.* +{{/multiplatform}} + {{^doNotUseRxAndCoroutines}} {{#useCoroutines}} import kotlinx.coroutines.Dispatchers @@ -35,6 +54,65 @@ import {{packageName}}.infrastructure.toMultiValue } {{#operation}} + {{#allParams}} + {{#isEnum}} + /** + * enum for parameter {{paramName}} + */ + {{#nonPublicApi}}internal {{/nonPublicApi}}enum class {{enumName}}_{{operationId}}(val value: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}kotlin.String{{/isContainer}}) { + {{^enumUnknownDefaultCase}} + {{#allowableValues}} + {{#enumVars}} + {{^multiplatform}} + {{#moshi}} + @Json(name = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}), + {{/moshi}} + {{#gson}} + @SerializedName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}), + {{/gson}} + {{#jackson}} + @JsonProperty(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}), + {{/jackson}} + {{#kotlinx_serialization}} + @SerialName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}), + {{/kotlinx_serialization}} + {{/multiplatform}} + {{#multiplatform}} + @SerialName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}), + {{/multiplatform}} + {{/enumVars}} + {{/allowableValues}} + {{/enumUnknownDefaultCase}} + {{#enumUnknownDefaultCase}} + {{#allowableValues}} + {{#enumVars}} + {{^-last}} + {{^multiplatform}} + {{#moshi}} + @Json(name = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}), + {{/moshi}} + {{#gson}} + @SerializedName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}), + {{/gson}} + {{#jackson}} + @JsonProperty(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}), + {{/jackson}} + {{#kotlinx_serialization}} + @SerialName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}), + {{/kotlinx_serialization}} + {{/multiplatform}} + {{#multiplatform}} + @SerialName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}), + {{/multiplatform}} + {{/-last}} + {{/enumVars}} + {{/allowableValues}} + {{/enumUnknownDefaultCase}} + ; + } + + {{/isEnum}} + {{/allParams}} /** * {{summary}} * {{notes}} @@ -51,7 +129,7 @@ import {{packageName}}.infrastructure.toMultiValue {{#isDeprecated}} @Deprecated(message = "This operation is deprecated.") {{/isDeprecated}} - {{^doNotUseRxAndCoroutines}}{{#useCoroutines}}suspend {{/useCoroutines}}{{/doNotUseRxAndCoroutines}}fun {{operationId}}({{#allParams}}{{{paramName}}}: {{{dataType}}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : {{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}{{^doNotUseRxAndCoroutines}}{{#useCoroutines}} = withContext(Dispatchers.IO){{/useCoroutines}}{{/doNotUseRxAndCoroutines}} { + {{^doNotUseRxAndCoroutines}}{{#useCoroutines}}suspend {{/useCoroutines}}{{/doNotUseRxAndCoroutines}}fun {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}_{{operationId}}>{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : {{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}{{^doNotUseRxAndCoroutines}}{{#useCoroutines}} = withContext(Dispatchers.IO){{/useCoroutines}}{{/doNotUseRxAndCoroutines}} { {{#isDeprecated}} @Suppress("DEPRECATION") {{/isDeprecated}} @@ -85,7 +163,7 @@ import {{packageName}}.infrastructure.toMultiValue {{#isDeprecated}} @Deprecated(message = "This operation is deprecated.") {{/isDeprecated}} - {{^doNotUseRxAndCoroutines}}{{#useCoroutines}}suspend {{/useCoroutines}}{{/doNotUseRxAndCoroutines}}fun {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}: {{{dataType}}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : ApiResponse<{{#returnType}}{{{returnType}}}?{{/returnType}}{{^returnType}}Unit?{{/returnType}}>{{^doNotUseRxAndCoroutines}}{{#useCoroutines}} = withContext(Dispatchers.IO){{/useCoroutines}}{{/doNotUseRxAndCoroutines}} { + {{^doNotUseRxAndCoroutines}}{{#useCoroutines}}suspend {{/useCoroutines}}{{/doNotUseRxAndCoroutines}}fun {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}_{{operationId}}>{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : ApiResponse<{{#returnType}}{{{returnType}}}?{{/returnType}}{{^returnType}}Unit?{{/returnType}}>{{^doNotUseRxAndCoroutines}}{{#useCoroutines}} = withContext(Dispatchers.IO){{/useCoroutines}}{{/doNotUseRxAndCoroutines}} { {{#isDeprecated}} @Suppress("DEPRECATION") {{/isDeprecated}} @@ -105,10 +183,10 @@ import {{packageName}}.infrastructure.toMultiValue {{#isDeprecated}} @Deprecated(message = "This operation is deprecated.") {{/isDeprecated}} - fun {{operationId}}RequestConfig({{#allParams}}{{{paramName}}}: {{{dataType}}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : RequestConfig<{{#hasBodyParam}}{{#bodyParams}}{{{dataType}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}Unit{{/hasFormParams}}{{#hasFormParams}}Map{{/hasFormParams}}{{/hasBodyParam}}> { + fun {{operationId}}RequestConfig({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}_{{operationId}}>{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : RequestConfig<{{#hasBodyParam}}{{#bodyParams}}{{{dataType}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}Unit{{/hasFormParams}}{{#hasFormParams}}Map{{/hasFormParams}}{{/hasBodyParam}}> { val localVariableBody = {{#hasBodyParam}}{{#bodyParams}}{{{paramName}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}null{{/hasFormParams}}{{#hasFormParams}}mapOf({{#formParams}}"{{{baseName}}}" to {{{paramName}}}{{^-last}}, {{/-last}}{{/formParams}}){{/hasFormParams}}{{/hasBodyParam}} val localVariableQuery: MultiValueMap = {{^hasQueryParams}}mutableMapOf() -{{/hasQueryParams}}{{#hasQueryParams}}mutableMapOf>() +{{/hasQueryParams}}{{#hasQueryParams}}mutableMapOf>() .apply { {{#queryParams}} {{^required}} diff --git a/modules/openapi-generator/src/main/resources/swift5/api.mustache b/modules/openapi-generator/src/main/resources/swift5/api.mustache index e5cd7ea4490d..9cf516b0c26e 100644 --- a/modules/openapi-generator/src/main/resources/swift5/api.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/api.mustache @@ -30,11 +30,22 @@ extension {{projectName}}API { * enum for parameter {{paramName}} */ {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{enumName}}_{{operationId}}: {{^isContainer}}{{{dataType}}}{{/isContainer}}{{#isContainer}}String{{/isContainer}}, CaseIterable{{#useVapor}}, Content{{/useVapor}} { + {{^enumUnknownDefaultCase}} {{#allowableValues}} {{#enumVars}} case {{name}} = {{{value}}} {{/enumVars}} {{/allowableValues}} + {{/enumUnknownDefaultCase}} + {{#enumUnknownDefaultCase}} + {{#allowableValues}} + {{#enumVars}} + {{^-last}} + case {{name}} = {{{value}}} + {{/-last}} + {{/enumVars}} + {{/allowableValues}} + {{/enumUnknownDefaultCase}} } {{/isEnum}} {{/allParams}} diff --git a/modules/openapi-generator/src/main/resources/swift5/modelEnum.mustache b/modules/openapi-generator/src/main/resources/swift5/modelEnum.mustache index 08f7bf9ee40d..2b28d7c00810 100644 --- a/modules/openapi-generator/src/main/resources/swift5/modelEnum.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/modelEnum.mustache @@ -1,32 +1,7 @@ -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{classname}}: {{dataType}}, {{#useVapor}}Content, Hashable{{/useVapor}}{{^useVapor}}Codable{{/useVapor}}, CaseIterable{{^generateFrozenEnums}}{{#isInteger}}, CaseIterableDefaultsLast{{/isInteger}}{{#isFloat}}, CaseIterableDefaultsLast{{/isFloat}}{{#isDouble}}, CaseIterableDefaultsLast{{/isDouble}}{{#isString}}, CaseIterableDefaultsLast{{/isString}}{{/generateFrozenEnums}} { +{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{classname}}: {{dataType}}, {{#useVapor}}Content, Hashable{{/useVapor}}{{^useVapor}}Codable{{/useVapor}}, CaseIterable{{#enumUnknownDefaultCase}}{{#isInteger}}, CaseIterableDefaultsLast{{/isInteger}}{{#isFloat}}, CaseIterableDefaultsLast{{/isFloat}}{{#isDouble}}, CaseIterableDefaultsLast{{/isDouble}}{{#isString}}, CaseIterableDefaultsLast{{/isString}}{{/enumUnknownDefaultCase}} { {{#allowableValues}} {{#enumVars}} case {{{name}}} = {{{value}}} {{/enumVars}} {{/allowableValues}} -{{^generateFrozenEnums}} - // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". - // If new enum cases are added that are unknown to the spec/client, they are safely - // decoded to this case. The raw value of this case is a dummy value that attempts - // to avoids collisions with previously specified cases. -{{#isString}} - case unknownDefaultOpenAPI = "unknown_default_open_api" -{{/isString}} -{{#isNumeric}} - // - // 192, used to calculate the raw value, was the Swift Evolution proposal for - // frozen/non-frozen enums. - // [SE-0192](https://github.com/apple/swift-evolution/blob/master/proposals/0192-non-exhaustive-enums.md) - // -{{/isNumeric}} -{{#isInteger}} - case unknownDefaultOpenAPI = -11184809 // Int.min / 192 -{{/isInteger}} -{{#isDouble}} - case unknownDefaultOpenAPI = -11184809 // Int.min / 192 -{{/isDouble}} -{{#isFloat}} - case unknownDefaultOpenAPI = -11184809 // Int.min / 192 -{{/isFloat}} -{{/generateFrozenEnums}} } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/swift5/modelInlineEnumDeclaration.mustache b/modules/openapi-generator/src/main/resources/swift5/modelInlineEnumDeclaration.mustache index 1dd9c55b16fd..445f56873884 100644 --- a/modules/openapi-generator/src/main/resources/swift5/modelInlineEnumDeclaration.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/modelInlineEnumDeclaration.mustache @@ -1,35 +1,7 @@ - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{enumName}}: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}String{{/isContainer}}, {{#useVapor}}Content, Hashable{{/useVapor}}{{^useVapor}}Codable{{/useVapor}}, CaseIterable{{^generateFrozenEnums}}{{#isInteger}}, CaseIterableDefaultsLast{{/isInteger}}{{#isFloat}}, CaseIterableDefaultsLast{{/isFloat}}{{#isDouble}}, CaseIterableDefaultsLast{{/isDouble}}{{#isString}}, CaseIterableDefaultsLast{{/isString}}{{#isContainer}}, CaseIterableDefaultsLast{{/isContainer}}{{/generateFrozenEnums}} { + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{enumName}}: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}String{{/isContainer}}, {{#useVapor}}Content, Hashable{{/useVapor}}{{^useVapor}}Codable{{/useVapor}}, CaseIterable{{#enumUnknownDefaultCase}}{{#isInteger}}, CaseIterableDefaultsLast{{/isInteger}}{{#isFloat}}, CaseIterableDefaultsLast{{/isFloat}}{{#isDouble}}, CaseIterableDefaultsLast{{/isDouble}}{{#isString}}, CaseIterableDefaultsLast{{/isString}}{{#isContainer}}, CaseIterableDefaultsLast{{/isContainer}}{{/enumUnknownDefaultCase}} { {{#allowableValues}} {{#enumVars}} case {{{name}}} = {{{value}}} {{/enumVars}} {{/allowableValues}} - {{^generateFrozenEnums}} - // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". - // If new enum cases are added that are unknown to the spec/client, they are safely - // decoded to this case. The raw value of this case is a dummy value that attempts - // to avoids collisions with previously specified cases. - {{#isString}} - case unknownDefaultOpenAPI = "unknown_default_open_api" - {{/isString}} - {{#isContainer}} - case unknownDefaultOpenAPI = "unknown_default_open_api" - {{/isContainer}} - {{#isNumeric}} - // - // 192, used to calculate the raw value, was the Swift Evolution proposal for - // frozen/non-frozen enums. - // [SE-0192](https://github.com/apple/swift-evolution/blob/master/proposals/0192-non-exhaustive-enums.md) - // - {{/isNumeric}} - {{#isInteger}} - case unknownDefaultOpenAPI = -11184809 // Int.min / 192 - {{/isInteger}} - {{#isDouble}} - case unknownDefaultOpenAPI = -11184809 // Int.min / 192 - {{/isDouble}} - {{#isFloat}} - case unknownDefaultOpenAPI = -11184809 // Int.min / 192 - {{/isFloat}} - {{/generateFrozenEnums}} } \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/bash/BashClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/bash/BashClientOptionsTest.java index 1d08eab2bede..11b557d2ae46 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/bash/BashClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/bash/BashClientOptionsTest.java @@ -58,6 +58,7 @@ protected void verifyOptions() { verify(clientCodegen).setApiKeyAuthEnvironmentVariable( BashClientOptionsProvider.APIKEY_AUTH_ENVIRONMENT_VARIABLE_NAME); verify(clientCodegen).setAllowUnicodeIdentifiers(Boolean.valueOf(BashClientOptionsProvider.ALLOW_UNICODE_IDENTIFIERS_VALUE)); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(BashClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientOptionsTest.java index 62693bf85447..1b268561e52a 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientOptionsTest.java @@ -50,5 +50,6 @@ protected void verifyOptions() { verify(clientCodegen).setPubHomepage(DartClientOptionsProvider.PUB_HOMEPAGE_VALUE); verify(clientCodegen).setSourceFolder(DartClientOptionsProvider.SOURCE_FOLDER_VALUE); verify(clientCodegen).setUseEnumExtension(Boolean.parseBoolean(DartClientOptionsProvider.USE_ENUM_EXTENSION)); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(DartClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientOptionsTest.java index 478d243580e4..9008b713bb00 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientOptionsTest.java @@ -52,5 +52,6 @@ protected void verifyOptions() { verify(clientCodegen).setUseEnumExtension(Boolean.parseBoolean(DartDioClientOptionsProvider.USE_ENUM_EXTENSION)); verify(clientCodegen).setDateLibrary(DartDioClientOptionsProvider.DATE_LIBRARY); verify(clientCodegen).setNullableFields(Boolean.parseBoolean(DartDioClientOptionsProvider.NULLABLE_FIELDS)); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(DartDioClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioNextClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioNextClientOptionsTest.java index f2237e4fbaaa..61c386b274a5 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioNextClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioNextClientOptionsTest.java @@ -51,5 +51,6 @@ protected void verifyOptions() { verify(clientCodegen).setUseEnumExtension(Boolean.parseBoolean(DartDioNextClientOptionsProvider.USE_ENUM_EXTENSION)); verify(clientCodegen).setDateLibrary(DartDioNextClientCodegen.DATE_LIBRARY_DEFAULT); verify(clientCodegen).setLibrary(DartDioNextClientCodegen.SERIALIZATION_LIBRARY_DEFAULT); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(DartDioNextClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/elixir/ElixirClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/elixir/ElixirClientOptionsTest.java index 41fe7cbbbbf5..a969cc174103 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/elixir/ElixirClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/elixir/ElixirClientOptionsTest.java @@ -42,5 +42,6 @@ protected CodegenConfig getCodegenConfig() { @Override protected void verifyOptions() { verify(clientCodegen).setModuleName(ElixirClientOptionsProvider.INVOKER_PACKAGE_VALUE); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(ElixirClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/haskellservant/HaskellServantOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/haskellservant/HaskellServantOptionsTest.java index 769dcbedbd60..40d4cbba4329 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/haskellservant/HaskellServantOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/haskellservant/HaskellServantOptionsTest.java @@ -43,5 +43,6 @@ protected void verifyOptions() { verify(clientCodegen).setModelPackage(HaskellServantOptionsProvider.MODEL_PACKAGE_VALUE); verify(clientCodegen).setApiPackage(HaskellServantOptionsProvider.API_PACKAGE_VALUE); verify(clientCodegen).setSortParamsByRequiredFlag(Boolean.valueOf(HaskellServantOptionsProvider.SORT_PARAMS_VALUE)); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(HaskellServantOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/haskellyesod/HaskellYesodServerOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/haskellyesod/HaskellYesodServerOptionsTest.java index 07d317b23daa..128b10a086c5 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/haskellyesod/HaskellYesodServerOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/haskellyesod/HaskellYesodServerOptionsTest.java @@ -25,5 +25,6 @@ protected CodegenConfig getCodegenConfig() { protected void verifyOptions() { verify(clientCodegen).setProjectName(HaskellYesodServerOptionsProvider.PROJECT_NAME_VALUE); verify(clientCodegen).setApiModuleName(HaskellYesodServerOptionsProvider.API_MODULE_NAME_VALUE); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(HaskellYesodServerOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/lumen/PhpLumenServerOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/lumen/PhpLumenServerOptionsTest.java index 4a79464569b5..73af635bb02a 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/lumen/PhpLumenServerOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/lumen/PhpLumenServerOptionsTest.java @@ -48,5 +48,6 @@ protected void verifyOptions() { verify(clientCodegen).setPackageName(PhpLumenServerOptionsProvider.PACKAGE_NAME_VALUE); verify(clientCodegen).setSrcBasePath(PhpLumenServerOptionsProvider.SRC_BASE_PATH_VALUE); verify(clientCodegen).setArtifactVersion(PhpLumenServerOptionsProvider.ARTIFACT_VERSION_VALUE); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(PhpLumenServerOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/BashClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/BashClientOptionsProvider.java index b2c8415fdca0..338a9e5ea13a 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/BashClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/BashClientOptionsProvider.java @@ -39,6 +39,7 @@ public class BashClientOptionsProvider implements OptionsProvider { public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -72,6 +73,7 @@ public Map createOptions() { .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartClientOptionsProvider.java index 464560449f01..5e468090bed6 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartClientOptionsProvider.java @@ -39,6 +39,7 @@ public class DartClientOptionsProvider implements OptionsProvider { public static final String USE_ENUM_EXTENSION = "true"; public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -65,6 +66,7 @@ public Map createOptions() { .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") .put("serializationLibrary", "custom") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioClientOptionsProvider.java index fa6bb3eeadb1..e974ddd8494c 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioClientOptionsProvider.java @@ -41,6 +41,7 @@ public class DartDioClientOptionsProvider implements OptionsProvider { public static final String PUB_AUTHOR_VALUE = "Author"; public static final String PUB_AUTHOR_EMAIL_VALUE = "author@homepage"; public static final String PUB_HOMEPAGE_VALUE = "Homepage"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -68,6 +69,7 @@ public Map createOptions() { .put(DartDioClientCodegen.NULLABLE_FIELDS, NULLABLE_FIELDS) .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioNextClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioNextClientOptionsProvider.java index b03f2a972142..cda6e36cfc6c 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioNextClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioNextClientOptionsProvider.java @@ -37,6 +37,7 @@ public class DartDioNextClientOptionsProvider implements OptionsProvider { public static final String PUB_AUTHOR_VALUE = "Author"; public static final String PUB_AUTHOR_EMAIL_VALUE = "author@homepage"; public static final String PUB_HOMEPAGE_VALUE = "Homepage"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -64,6 +65,7 @@ public Map createOptions() { .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ElixirClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ElixirClientOptionsProvider.java index bd39161584fd..32b7b3d34151 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ElixirClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ElixirClientOptionsProvider.java @@ -25,6 +25,7 @@ public class ElixirClientOptionsProvider implements OptionsProvider { public static final String INVOKER_PACKAGE_VALUE = "Yay.Pets"; public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -45,6 +46,7 @@ public Map createOptions() { .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/HaskellServantOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/HaskellServantOptionsProvider.java index 728b44ef38fe..892a753ce90f 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/HaskellServantOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/HaskellServantOptionsProvider.java @@ -31,6 +31,7 @@ public class HaskellServantOptionsProvider implements OptionsProvider { public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true"; public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -50,6 +51,7 @@ public Map createOptions() { .put(HaskellServantCodegen.PROP_SERVE_STATIC, HaskellServantCodegen.PROP_SERVE_STATIC_DEFAULT.toString()) .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/HaskellYesodServerOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/HaskellYesodServerOptionsProvider.java index 230c2243a803..66fd08f19aaa 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/HaskellYesodServerOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/HaskellYesodServerOptionsProvider.java @@ -14,6 +14,7 @@ public class HaskellYesodServerOptionsProvider implements OptionsProvider { public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; public static final String PROJECT_NAME_VALUE = "openapi-haskell-yesod-server"; public static final String API_MODULE_NAME_VALUE = "API"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -32,6 +33,7 @@ public Map createOptions() { .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") .put(HaskellYesodServerCodegen.PROJECT_NAME, PROJECT_NAME_VALUE) .put(HaskellYesodServerCodegen.API_MODULE_NAME, API_MODULE_NAME_VALUE) + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpClientOptionsProvider.java index b2a987d924ea..21ce7e748c84 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpClientOptionsProvider.java @@ -36,6 +36,7 @@ public class PhpClientOptionsProvider implements OptionsProvider { public static final String ARTIFACT_VERSION_VALUE = "1.0.0-SNAPSHOT"; public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -60,6 +61,7 @@ public Map createOptions() { .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpLumenServerOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpLumenServerOptionsProvider.java index 25d34b16d80a..3c0779cf5f87 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpLumenServerOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpLumenServerOptionsProvider.java @@ -36,6 +36,7 @@ public class PhpLumenServerOptionsProvider implements OptionsProvider { public static final String ARTIFACT_VERSION_VALUE = "1.0.0-SNAPSHOT"; public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -59,6 +60,7 @@ public Map createOptions() { .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSilexServerOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSilexServerOptionsProvider.java index b6c55c7a27b2..900aab03c7bf 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSilexServerOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSilexServerOptionsProvider.java @@ -28,6 +28,7 @@ public class PhpSilexServerOptionsProvider implements OptionsProvider { public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true"; public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -44,6 +45,7 @@ public Map createOptions() { .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSlim4ServerOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSlim4ServerOptionsProvider.java index 3295ed951011..2e6a8f6ee665 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSlim4ServerOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSlim4ServerOptionsProvider.java @@ -38,6 +38,7 @@ public class PhpSlim4ServerOptionsProvider implements OptionsProvider { public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; public static final String PSR7_IMPLEMENTATION_VALUE = "zend-diactoros"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -62,6 +63,7 @@ public Map createOptions() { .put(PhpSlim4ServerCodegen.PSR7_IMPLEMENTATION, PSR7_IMPLEMENTATION_VALUE) .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSlimServerOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSlimServerOptionsProvider.java index 4a40588c0ebb..be1d495713f7 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSlimServerOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSlimServerOptionsProvider.java @@ -36,6 +36,7 @@ public class PhpSlimServerOptionsProvider implements OptionsProvider { public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true"; public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -59,6 +60,7 @@ public Map createOptions() { .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/RubyClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/RubyClientOptionsProvider.java index 9d5c63f9d2da..807c0035bda7 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/RubyClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/RubyClientOptionsProvider.java @@ -40,6 +40,7 @@ public class RubyClientOptionsProvider implements OptionsProvider { public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; public static final String LIBRARY = "typhoeus"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -68,6 +69,7 @@ public Map createOptions() { .put(CodegenConstants.LIBRARY, LIBRARY) .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ScalaAkkaClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ScalaAkkaClientOptionsProvider.java index 62909fb5b3f2..7c4e5d4a1b92 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ScalaAkkaClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ScalaAkkaClientOptionsProvider.java @@ -34,6 +34,7 @@ public class ScalaAkkaClientOptionsProvider implements OptionsProvider { public static final String MAIN_PACKAGE_VALUE = "net.test"; public static final String MODEL_PROPERTY_NAMING = "camelCase"; public static final String DATE_LIBRARY = "joda"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override @@ -57,6 +58,7 @@ public Map createOptions() { .put("dateLibrary", DATE_LIBRARY) .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ScalaHttpClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ScalaHttpClientOptionsProvider.java index ac3c7f713c55..c8c56053cf0c 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ScalaHttpClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ScalaHttpClientOptionsProvider.java @@ -33,6 +33,7 @@ public class ScalaHttpClientOptionsProvider implements OptionsProvider { public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; public static final String DATE_LIBRARY = "joda"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -54,6 +55,7 @@ public Map createOptions() { .put("dateLibrary", DATE_LIBRARY) .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift4OptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift4OptionsProvider.java deleted file mode 100644 index 038c40121d62..000000000000 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift4OptionsProvider.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.options; - -import com.google.common.collect.ImmutableMap; -import org.openapitools.codegen.CodegenConstants; -import org.openapitools.codegen.languages.Swift4Codegen; - -import java.util.Map; - -public class Swift4OptionsProvider implements OptionsProvider { - public static final String SORT_PARAMS_VALUE = "false"; - public static final String SORT_MODEL_PROPERTIES_VALUE = "false"; - public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true"; - public static final String PROJECT_NAME_VALUE = "Swagger"; - public static final String RESPONSE_AS_VALUE = "test"; - public static final String NON_PUBLIC_API_REQUIRED_VALUE = "false"; - public static final String UNWRAP_REQUIRED_VALUE = "true"; - public static final String OBJC_COMPATIBLE_VALUE = "false"; - public static final String LENIENT_TYPE_CAST_VALUE = "false"; - public static final String POD_SOURCE_VALUE = "{ :git => 'git@github.com:swagger-api/swagger-mustache.git'," + - " :tag => 'v1.0.0-SNAPSHOT' }"; - public static final String POD_VERSION_VALUE = "v1.0.0-SNAPSHOT"; - public static final String POD_AUTHORS_VALUE = "podAuthors"; - public static final String POD_SOCIAL_MEDIA_URL_VALUE = "podSocialMediaURL"; - public static final String POD_DOCSET_URL_VALUE = "podDocsetURL"; - public static final String POD_LICENSE_VALUE = "'Apache License, Version 2.0'"; - public static final String POD_HOMEPAGE_VALUE = "podHomepage"; - public static final String POD_SUMMARY_VALUE = "podSummary"; - public static final String POD_DESCRIPTION_VALUE = "podDescription"; - public static final String POD_SCREENSHOTS_VALUE = "podScreenshots"; - public static final String POD_DOCUMENTATION_URL_VALUE = "podDocumentationURL"; - public static final String SWIFT_USE_API_NAMESPACE_VALUE = "swiftUseApiNamespace"; - public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; - public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; - - @Override - public String getLanguage() { - return "swift4"; - } - - @Override - public Map createOptions() { - ImmutableMap.Builder builder = new ImmutableMap.Builder(); - return builder.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE) - .put(CodegenConstants.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG, SORT_MODEL_PROPERTIES_VALUE) - .put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE) - .put(Swift4Codegen.PROJECT_NAME, PROJECT_NAME_VALUE) - .put(Swift4Codegen.RESPONSE_AS, RESPONSE_AS_VALUE) - .put(CodegenConstants.NON_PUBLIC_API, NON_PUBLIC_API_REQUIRED_VALUE) - .put(Swift4Codegen.UNWRAP_REQUIRED, UNWRAP_REQUIRED_VALUE) - .put(Swift4Codegen.OBJC_COMPATIBLE, OBJC_COMPATIBLE_VALUE) - .put(Swift4Codegen.LENIENT_TYPE_CAST, LENIENT_TYPE_CAST_VALUE) - .put(Swift4Codegen.POD_SOURCE, POD_SOURCE_VALUE) - .put(CodegenConstants.POD_VERSION, POD_VERSION_VALUE) - .put(Swift4Codegen.POD_AUTHORS, POD_AUTHORS_VALUE) - .put(Swift4Codegen.POD_SOCIAL_MEDIA_URL, POD_SOCIAL_MEDIA_URL_VALUE) - .put(Swift4Codegen.POD_DOCSET_URL, POD_DOCSET_URL_VALUE) - .put(Swift4Codegen.POD_LICENSE, POD_LICENSE_VALUE) - .put(Swift4Codegen.POD_HOMEPAGE, POD_HOMEPAGE_VALUE) - .put(Swift4Codegen.POD_SUMMARY, POD_SUMMARY_VALUE) - .put(Swift4Codegen.POD_DESCRIPTION, POD_DESCRIPTION_VALUE) - .put(Swift4Codegen.POD_SCREENSHOTS, POD_SCREENSHOTS_VALUE) - .put(Swift4Codegen.POD_DOCUMENTATION_URL, POD_DOCUMENTATION_URL_VALUE) - .put(Swift4Codegen.SWIFT_USE_API_NAMESPACE, SWIFT_USE_API_NAMESPACE_VALUE) - .put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "true") - .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) - .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) - .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") - .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") - .build(); - } - - @Override - public boolean isServer() { - return false; - } -} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift5OptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift5OptionsProvider.java index 4df5b89d5ba7..003e5b4b5b7d 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift5OptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift5OptionsProvider.java @@ -48,7 +48,6 @@ public class Swift5OptionsProvider implements OptionsProvider { public static final String REMOVE_MIGRATION_PROJECT_NAME_CLASS_VALUE = "false"; public static final String SWIFT_USE_API_NAMESPACE_VALUE = "swiftUseApiNamespace"; public static final String USE_BACKTICKS_ESCAPES_VALUE = "false"; - public static final String GENERATE_FROZEN_ENUMS_VALUE = "true"; public static final String GENERATE_MODEL_ADDITIONAL_PROPERTIES_VALUE = "true"; public static final String HASHABLE_MODELS_VALUE = "true"; public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; @@ -56,6 +55,7 @@ public class Swift5OptionsProvider implements OptionsProvider { public static final String LIBRARY_VALUE = "alamofire"; public static final String USE_SPM_FILE_STRUCTURE_VALUE = "false"; public static final String SWIFT_PACKAGE_PATH_VALUE = ""; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -96,11 +96,11 @@ public Map createOptions() { .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") .put(Swift5ClientCodegen.USE_SPM_FILE_STRUCTURE, USE_SPM_FILE_STRUCTURE_VALUE) .put(Swift5ClientCodegen.SWIFT_PACKAGE_PATH, SWIFT_PACKAGE_PATH_VALUE) - .put(Swift5ClientCodegen.GENERATE_FROZEN_ENUMS, GENERATE_FROZEN_ENUMS_VALUE) .put(Swift5ClientCodegen.GENERATE_MODEL_ADDITIONAL_PROPERTIES, GENERATE_MODEL_ADDITIONAL_PROPERTIES_VALUE) .put(Swift5ClientCodegen.HASHABLE_MODELS, HASHABLE_MODELS_VALUE) .put(Swift5ClientCodegen.MAP_FILE_BINARY_TO_DATA, "false") .put(Swift5ClientCodegen.USE_CLASSES, "false") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java index aa67286b9786..b3d82668ecbf 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java @@ -50,6 +50,7 @@ public class TypeScriptAngularClientOptionsProvider implements OptionsProvider { public static String SERVICE_FILE_SUFFIX = ".service"; public static String MODEL_SUFFIX = ""; public static String MODEL_FILE_SUFFIX = ""; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -91,6 +92,7 @@ public Map createOptions() { .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") .put(TypeScriptAngularClientCodegen.QUERY_PARAM_OBJECT_FORMAT, QUERY_PARAM_OBJECT_FORMAT_VALUE) + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularJsClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularJsClientOptionsProvider.java index 1b9c8a58e174..fd62de4e03b8 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularJsClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularJsClientOptionsProvider.java @@ -35,6 +35,7 @@ public class TypeScriptAngularJsClientOptionsProvider implements OptionsProvider public static final String ENUM_PROPERTY_NAMING_VALUE = "PascalCase"; public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -57,6 +58,7 @@ public Map createOptions() { .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAureliaClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAureliaClientOptionsProvider.java index 939a0fad979b..7cc5631fecbe 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAureliaClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAureliaClientOptionsProvider.java @@ -38,6 +38,7 @@ public class TypeScriptAureliaClientOptionsProvider implements OptionsProvider { private static final String NPM_VERSION = "1.0.0"; public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -63,6 +64,7 @@ public Map createOptions() { .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptFetchClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptFetchClientOptionsProvider.java index f33f1c437d64..5c2fb91f7255 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptFetchClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptFetchClientOptionsProvider.java @@ -42,6 +42,7 @@ public class TypeScriptFetchClientOptionsProvider implements OptionsProvider { public static final String TYPESCRIPT_THREE_PLUS = "true"; public static final String WITHOUT_RUNTIME_CHECKS = "true"; public static final String SAGAS_AND_RECORDS = "false"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -74,6 +75,7 @@ public Map createOptions() { .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptNestjsClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptNestjsClientOptionsProvider.java index d86f586e15c3..d7143efcfc30 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptNestjsClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptNestjsClientOptionsProvider.java @@ -46,6 +46,7 @@ public class TypeScriptNestjsClientOptionsProvider implements OptionsProvider { public static String SERVICE_FILE_SUFFIX = ".service"; public static String MODEL_SUFFIX = ""; public static String MODEL_FILE_SUFFIX = ""; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -84,6 +85,7 @@ public Map createOptions() { .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") .put(TypeScriptNestjsClientCodegen.FILE_NAMING, FILE_NAMING_VALUE) + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptNodeClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptNodeClientOptionsProvider.java index fb2b6a741dc5..a82306a54201 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptNodeClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptNodeClientOptionsProvider.java @@ -41,6 +41,7 @@ public class TypeScriptNodeClientOptionsProvider implements OptionsProvider { public static final String API_SUFFIX = "Api"; public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -67,6 +68,7 @@ public Map createOptions() { .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/PhpClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/PhpClientOptionsTest.java index 8479c3441a42..0432dec115e8 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/PhpClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/PhpClientOptionsTest.java @@ -48,5 +48,6 @@ protected void verifyOptions() { verify(clientCodegen).setPackageName(PhpClientOptionsProvider.PACKAGE_NAME_VALUE); verify(clientCodegen).setSrcBasePath(PhpClientOptionsProvider.SRC_BASE_PATH_VALUE); verify(clientCodegen).setArtifactVersion(PhpClientOptionsProvider.ARTIFACT_VERSION_VALUE); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(PhpClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/ruby/RubyClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/ruby/RubyClientOptionsTest.java index 6c338ad66b5f..c44d3d9b1a94 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/ruby/RubyClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/ruby/RubyClientOptionsTest.java @@ -50,5 +50,6 @@ protected void verifyOptions() { verify(clientCodegen).setGemSummary(RubyClientOptionsProvider.GEM_SUMMARY_VALUE); verify(clientCodegen).setGemAuthor(RubyClientOptionsProvider.GEM_AUTHOR_VALUE); verify(clientCodegen).setGemAuthorEmail(RubyClientOptionsProvider.GEM_AUTHOR_EMAIL_VALUE); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(RubyClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalaakka/ScalaAkkaClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalaakka/ScalaAkkaClientOptionsTest.java index fbb919e9fa54..fbcece61d96d 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalaakka/ScalaAkkaClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalaakka/ScalaAkkaClientOptionsTest.java @@ -47,5 +47,6 @@ protected void verifyOptions() { verify(clientCodegen).setPrependFormOrBodyParameters(Boolean.valueOf(ScalaAkkaClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); verify(clientCodegen).setMainPackage(ScalaAkkaClientOptionsProvider.MAIN_PACKAGE_VALUE); verify(clientCodegen).setModelPropertyNaming(ScalaAkkaClientOptionsProvider.MODEL_PROPERTY_NAMING); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(ScalaAkkaClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalahttpclient/ScalaHttpClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalahttpclient/ScalaHttpClientOptionsTest.java index a70da4206bc3..33692fab6009 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalahttpclient/ScalaHttpClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalahttpclient/ScalaHttpClientOptionsTest.java @@ -48,5 +48,6 @@ protected void verifyOptions() { verify(clientCodegen).setSourceFolder(ScalaHttpClientOptionsProvider.SOURCE_FOLDER_VALUE); verify(clientCodegen).setPrependFormOrBodyParameters(Boolean.valueOf(ScalaHttpClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); verify(clientCodegen).setDateLibrary(ScalaHttpClientOptionsProvider.DATE_LIBRARY,false); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(ScalaHttpClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/silex/PhpSilexServerOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/silex/PhpSilexServerOptionsTest.java index d7dcc1a28014..9ea6f43e43a1 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/silex/PhpSilexServerOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/silex/PhpSilexServerOptionsTest.java @@ -41,5 +41,6 @@ protected CodegenConfig getCodegenConfig() { @Override protected void verifyOptions() { verify(clientCodegen).setSortParamsByRequiredFlag(Boolean.valueOf(PhpSilexServerOptionsProvider.SORT_PARAMS_VALUE)); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(PhpSilexServerOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/slim/PhpSlimServerOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/slim/PhpSlimServerOptionsTest.java index ad6fb48b273d..e436efed1a33 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/slim/PhpSlimServerOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/slim/PhpSlimServerOptionsTest.java @@ -48,5 +48,6 @@ protected void verifyOptions() { verify(clientCodegen).setSrcBasePath(PhpSlimServerOptionsProvider.SRC_BASE_PATH_VALUE); verify(clientCodegen).setArtifactVersion(PhpSlimServerOptionsProvider.ARTIFACT_VERSION_VALUE); verify(clientCodegen).setSortParamsByRequiredFlag(Boolean.valueOf(PhpSlimServerOptionsProvider.SORT_PARAMS_VALUE)); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(PhpSlimServerOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/slim4/PhpSlim4ServerOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/slim4/PhpSlim4ServerOptionsTest.java index 499e6bec639c..b9c76e6b6414 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/slim4/PhpSlim4ServerOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/slim4/PhpSlim4ServerOptionsTest.java @@ -49,6 +49,7 @@ protected void verifyOptions() { verify(clientCodegen).setArtifactVersion(PhpSlim4ServerOptionsProvider.ARTIFACT_VERSION_VALUE); verify(clientCodegen).setSortParamsByRequiredFlag(Boolean.valueOf(PhpSlim4ServerOptionsProvider.SORT_PARAMS_VALUE)); verify(clientCodegen).setPsr7Implementation(PhpSlim4ServerOptionsProvider.PSR7_IMPLEMENTATION_VALUE); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(PhpSlim4ServerOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4CodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4CodegenTest.java deleted file mode 100644 index aeef2b73edbc..000000000000 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4CodegenTest.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.swift4; - -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.Operation; -import org.openapitools.codegen.CodegenOperation; -import org.openapitools.codegen.DefaultCodegen; -import org.openapitools.codegen.TestUtils; -import org.openapitools.codegen.languages.Swift4Codegen; -import org.testng.Assert; -import org.testng.annotations.Test; - - -public class Swift4CodegenTest { - - Swift4Codegen swiftCodegen = new Swift4Codegen(); - - @Test(enabled = true) - public void testCapitalizedReservedWord() throws Exception { - Assert.assertEquals(swiftCodegen.toEnumVarName("AS", null), "_as"); - } - - @Test(enabled = true) - public void testReservedWord() throws Exception { - Assert.assertEquals(swiftCodegen.toEnumVarName("Public", null), "_public"); - } - - @Test(enabled = true) - public void shouldNotBreakNonReservedWord() throws Exception { - Assert.assertEquals(swiftCodegen.toEnumVarName("Error", null), "error"); - } - - @Test(enabled = true) - public void shouldNotBreakCorrectName() throws Exception { - Assert.assertEquals(swiftCodegen.toEnumVarName("EntryName", null), "entryName"); - } - - @Test(enabled = true) - public void testSingleWordAllCaps() throws Exception { - Assert.assertEquals(swiftCodegen.toEnumVarName("VALUE", null), "value"); - } - - @Test(enabled = true) - public void testSingleWordLowercase() throws Exception { - Assert.assertEquals(swiftCodegen.toEnumVarName("value", null), "value"); - } - - @Test(enabled = true) - public void testCapitalsWithUnderscore() throws Exception { - Assert.assertEquals(swiftCodegen.toEnumVarName("ENTRY_NAME", null), "entryName"); - } - - @Test(enabled = true) - public void testCapitalsWithDash() throws Exception { - Assert.assertEquals(swiftCodegen.toEnumVarName("ENTRY-NAME", null), "entryName"); - } - - @Test(enabled = true) - public void testCapitalsWithSpace() throws Exception { - Assert.assertEquals(swiftCodegen.toEnumVarName("ENTRY NAME", null), "entryName"); - } - - @Test(enabled = true) - public void testLowercaseWithUnderscore() throws Exception { - Assert.assertEquals(swiftCodegen.toEnumVarName("entry_name", null), "entryName"); - } - - @Test(enabled = true) - public void testStartingWithNumber() throws Exception { - Assert.assertEquals(swiftCodegen.toEnumVarName("123EntryName", null), "_123entryName"); - Assert.assertEquals(swiftCodegen.toEnumVarName("123Entry_name", null), "_123entryName"); - Assert.assertEquals(swiftCodegen.toEnumVarName("123EntryName123", null), "_123entryName123"); - } - - @Test(description = "returns Data when response format is binary", enabled = true) - public void binaryDataTest() { - // TODO update json file - - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/binaryDataTest.json"); - final DefaultCodegen codegen = new Swift4Codegen(); - codegen.setOpenAPI(openAPI); - final String path = "/tests/binaryResponse"; - final Operation p = openAPI.getPaths().get(path).getPost(); - final CodegenOperation op = codegen.fromOperation(path, "post", p, null); - - Assert.assertEquals(op.returnType, "URL"); - Assert.assertEquals(op.bodyParam.dataType, "URL"); - Assert.assertTrue(op.bodyParam.isBinary); - Assert.assertTrue(op.responses.get(0).isBinary); - } - - @Test(description = "returns Date when response format is date", enabled = true) - public void dateTest() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/datePropertyTest.json"); - final DefaultCodegen codegen = new Swift4Codegen(); - codegen.setOpenAPI(openAPI); - final String path = "/tests/dateResponse"; - final Operation p = openAPI.getPaths().get(path).getPost(); - final CodegenOperation op = codegen.fromOperation(path, "post", p, null); - - Assert.assertEquals(op.returnType, "Date"); - Assert.assertEquals(op.bodyParam.dataType, "Date"); - } - - @Test(enabled = true) - public void testDefaultPodAuthors() throws Exception { - // Given - - // When - swiftCodegen.processOpts(); - - // Then - final String podAuthors = (String) swiftCodegen.additionalProperties().get(Swift4Codegen.POD_AUTHORS); - Assert.assertEquals(podAuthors, Swift4Codegen.DEFAULT_POD_AUTHORS); - } - - @Test(enabled = true) - public void testPodAuthors() throws Exception { - // Given - final String openAPIDevs = "OpenAPI Devs"; - swiftCodegen.additionalProperties().put(Swift4Codegen.POD_AUTHORS, openAPIDevs); - - // When - swiftCodegen.processOpts(); - - // Then - final String podAuthors = (String) swiftCodegen.additionalProperties().get(Swift4Codegen.POD_AUTHORS); - Assert.assertEquals(podAuthors, openAPIDevs); - } - -} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4ModelEnumTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4ModelEnumTest.java deleted file mode 100644 index 2b7696ba532f..000000000000 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4ModelEnumTest.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.swift4; - -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.media.IntegerSchema; -import io.swagger.v3.oas.models.media.NumberSchema; -import io.swagger.v3.oas.models.media.Schema; -import io.swagger.v3.oas.models.media.StringSchema; -import org.openapitools.codegen.CodegenModel; -import org.openapitools.codegen.CodegenProperty; -import org.openapitools.codegen.DefaultCodegen; -import org.openapitools.codegen.TestUtils; -import org.openapitools.codegen.languages.Swift4Codegen; -import org.testng.Assert; -import org.testng.annotations.Test; - -import java.math.BigDecimal; -import java.util.Arrays; - -@SuppressWarnings("static-method") -public class Swift4ModelEnumTest { - @Test(description = "convert a java model with an string enum and a default value") - public void convertStringDefaultValueTest() { - final StringSchema enumSchema = new StringSchema(); - enumSchema.setEnum(Arrays.asList("VALUE1", "VALUE2", "VALUE3")); - enumSchema.setDefault("VALUE2"); - final Schema model = new Schema().type("object").addProperties("name", enumSchema); - - final DefaultCodegen codegen = new Swift4Codegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", model); - - Assert.assertEquals(cm.vars.size(), 1); - - final CodegenProperty enumVar = cm.vars.get(0); - Assert.assertEquals(enumVar.baseName, "name"); - Assert.assertEquals(enumVar.dataType, "String"); - Assert.assertEquals(enumVar.datatypeWithEnum, "Name"); - Assert.assertEquals(enumVar.name, "name"); - Assert.assertEquals(enumVar.defaultValue, ".value2"); - Assert.assertEquals(enumVar.baseType, "String"); - Assert.assertTrue(enumVar.isEnum); - } - - @Test(description = "convert a java model with an reserved word string enum and a default value") - public void convertReservedWordStringDefaultValueTest() { - final StringSchema enumSchema = new StringSchema(); - enumSchema.setEnum(Arrays.asList("1st", "2nd", "3rd")); - enumSchema.setDefault("2nd"); - final Schema model = new Schema().type("object").addProperties("name", enumSchema); - - final DefaultCodegen codegen = new Swift4Codegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", model); - - Assert.assertEquals(cm.vars.size(), 1); - - final CodegenProperty enumVar = cm.vars.get(0); - Assert.assertEquals(enumVar.baseName, "name"); - Assert.assertEquals(enumVar.dataType, "String"); - Assert.assertEquals(enumVar.datatypeWithEnum, "Name"); - Assert.assertEquals(enumVar.name, "name"); - Assert.assertEquals(enumVar.defaultValue, "._2nd"); - Assert.assertEquals(enumVar.baseType, "String"); - Assert.assertTrue(enumVar.isEnum); - } - - @Test(description = "convert a java model with an integer enum and a default value") - public void convertIntegerDefaultValueTest() { - final IntegerSchema enumSchema = new IntegerSchema(); - enumSchema.setEnum(Arrays.asList(1, 2, 3)); - enumSchema.setDefault(2); - final Schema model = new Schema().type("object").addProperties("name", enumSchema); - - final DefaultCodegen codegen = new Swift4Codegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", model); - - Assert.assertEquals(cm.vars.size(), 1); - - final CodegenProperty enumVar = cm.vars.get(0); - Assert.assertEquals(enumVar.baseName, "name"); - Assert.assertEquals(enumVar.dataType, "Int"); - Assert.assertEquals(enumVar.datatypeWithEnum, "Name"); - Assert.assertEquals(enumVar.name, "name"); - Assert.assertEquals(enumVar.defaultValue, "._2"); - Assert.assertEquals(enumVar.baseType, "Int"); - Assert.assertTrue(enumVar.isEnum); - } - - @Test(description = "convert a java model with an number enum and a default value") - public void convertNumberDefaultValueTest() { - final NumberSchema enumSchema = new NumberSchema(); - enumSchema.setEnum(Arrays.asList(new BigDecimal(10), new BigDecimal(100), new BigDecimal(1000))); - enumSchema.setDefault(new BigDecimal((100))); - final Schema model = new Schema().type("object").addProperties("name", enumSchema); - - final DefaultCodegen codegen = new Swift4Codegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", model); - - Assert.assertEquals(cm.vars.size(), 1); - - final CodegenProperty enumVar = cm.vars.get(0); - Assert.assertEquals(enumVar.baseName, "name"); - Assert.assertEquals(enumVar.dataType, "Double"); - Assert.assertEquals(enumVar.datatypeWithEnum, "Name"); - Assert.assertEquals(enumVar.name, "name"); - Assert.assertEquals(enumVar.defaultValue, "._100"); - Assert.assertEquals(enumVar.baseType, "Double"); - Assert.assertTrue(enumVar.isEnum); - } -} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4ModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4ModelTest.java deleted file mode 100644 index f87ad8573836..000000000000 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4ModelTest.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.swift4; - -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.media.*; -import io.swagger.v3.parser.util.SchemaTypeUtil; -import org.openapitools.codegen.CodegenModel; -import org.openapitools.codegen.CodegenProperty; -import org.openapitools.codegen.DefaultCodegen; -import org.openapitools.codegen.TestUtils; -import org.openapitools.codegen.languages.Swift4Codegen; -import org.testng.Assert; -import org.testng.annotations.Test; - -@SuppressWarnings("static-method") -public class Swift4ModelTest { - - @Test(description = "convert a simple java model", enabled = true) - public void simpleModelTest() { - final Schema schema = new Schema() - .description("a sample model") - .addProperties("id", new IntegerSchema().format(SchemaTypeUtil.INTEGER64_FORMAT)) - .addProperties("name", new StringSchema()) - .addProperties("createdAt", new DateTimeSchema()) - .addProperties("binary", new BinarySchema()) - .addProperties("byte", new ByteArraySchema()) - .addProperties("uuid", new UUIDSchema()) - .addProperties("dateOfBirth", new DateSchema()) - .addRequiredItem("id") - .addRequiredItem("name") - .discriminator(new Discriminator().propertyName("test")); - final DefaultCodegen codegen = new Swift4Codegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", schema); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "a sample model"); - Assert.assertEquals(cm.vars.size(), 7); - Assert.assertEquals(cm.getDiscriminatorName(),"test"); - - final CodegenProperty property1 = cm.vars.get(0); - Assert.assertEquals(property1.baseName, "id"); - Assert.assertEquals(property1.dataType, "Int64"); - Assert.assertEquals(property1.name, "id"); - Assert.assertNull(property1.defaultValue); - Assert.assertEquals(property1.baseType, "Int64"); - Assert.assertTrue(property1.required); - Assert.assertTrue(property1.isPrimitiveType); - Assert.assertFalse(property1.isContainer); - - final CodegenProperty property2 = cm.vars.get(1); - Assert.assertEquals(property2.baseName, "name"); - Assert.assertEquals(property2.dataType, "String"); - Assert.assertEquals(property2.name, "name"); - Assert.assertNull(property2.defaultValue); - Assert.assertEquals(property2.baseType, "String"); - Assert.assertTrue(property2.required); - Assert.assertTrue(property2.isPrimitiveType); - Assert.assertFalse(property2.isContainer); - - final CodegenProperty property3 = cm.vars.get(2); - Assert.assertEquals(property3.baseName, "createdAt"); - Assert.assertEquals(property3.dataType, "Date"); - Assert.assertEquals(property3.name, "createdAt"); - Assert.assertNull(property3.defaultValue); - Assert.assertEquals(property3.baseType, "Date"); - Assert.assertFalse(property3.required); - Assert.assertFalse(property3.isContainer); - - final CodegenProperty property4 = cm.vars.get(3); - Assert.assertEquals(property4.baseName, "binary"); - Assert.assertEquals(property4.dataType, "URL"); - Assert.assertEquals(property4.name, "binary"); - Assert.assertNull(property4.defaultValue); - Assert.assertEquals(property4.baseType, "URL"); - Assert.assertFalse(property4.required); - Assert.assertFalse(property4.isContainer); - - final CodegenProperty property5 = cm.vars.get(4); - Assert.assertEquals(property5.baseName, "byte"); - Assert.assertEquals(property5.dataType, "Data"); - Assert.assertEquals(property5.name, "byte"); - Assert.assertNull(property5.defaultValue); - Assert.assertEquals(property5.baseType, "Data"); - Assert.assertFalse(property5.required); - Assert.assertFalse(property5.isContainer); - - final CodegenProperty property6 = cm.vars.get(5); - Assert.assertEquals(property6.baseName, "uuid"); - Assert.assertEquals(property6.dataType, "UUID"); - Assert.assertEquals(property6.name, "uuid"); - Assert.assertNull(property6.defaultValue); - Assert.assertEquals(property6.baseType, "UUID"); - Assert.assertFalse(property6.required); - Assert.assertFalse(property6.isContainer); - - final CodegenProperty property7 = cm.vars.get(6); - Assert.assertEquals(property7.baseName, "dateOfBirth"); - Assert.assertEquals(property7.dataType, "Date"); - Assert.assertEquals(property7.name, "dateOfBirth"); - Assert.assertNull(property7.defaultValue); - Assert.assertEquals(property7.baseType, "Date"); - Assert.assertFalse(property7.required); - Assert.assertFalse(property7.isContainer); - } - -} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4OptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4OptionsTest.java deleted file mode 100644 index dc4aa7d0943f..000000000000 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4OptionsTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.swift4; - -import org.openapitools.codegen.AbstractOptionsTest; -import org.openapitools.codegen.CodegenConfig; -import org.openapitools.codegen.languages.Swift4Codegen; -import org.openapitools.codegen.options.Swift4OptionsProvider; - -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; - -public class Swift4OptionsTest extends AbstractOptionsTest { - private Swift4Codegen clientCodegen = mock(Swift4Codegen.class, mockSettings); - - public Swift4OptionsTest() { - super(new Swift4OptionsProvider()); - } - - @Override - protected CodegenConfig getCodegenConfig() { - return clientCodegen; - } - - @SuppressWarnings("unused") - @Override - protected void verifyOptions() { - verify(clientCodegen).setSortParamsByRequiredFlag(Boolean.valueOf(Swift4OptionsProvider.SORT_PARAMS_VALUE)); - verify(clientCodegen).setProjectName(Swift4OptionsProvider.PROJECT_NAME_VALUE); - verify(clientCodegen).setResponseAs(Swift4OptionsProvider.RESPONSE_AS_VALUE.split(",")); - verify(clientCodegen).setNonPublicApi(Boolean.parseBoolean(Swift4OptionsProvider.NON_PUBLIC_API_REQUIRED_VALUE)); - verify(clientCodegen).setUnwrapRequired(Boolean.parseBoolean(Swift4OptionsProvider.UNWRAP_REQUIRED_VALUE)); - verify(clientCodegen).setObjcCompatible(Boolean.parseBoolean(Swift4OptionsProvider.OBJC_COMPATIBLE_VALUE)); - verify(clientCodegen).setLenientTypeCast(Boolean.parseBoolean(Swift4OptionsProvider.LENIENT_TYPE_CAST_VALUE)); - verify(clientCodegen).setPrependFormOrBodyParameters(Boolean.valueOf(Swift4OptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); - } -} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5OptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5OptionsTest.java index 0550f03de295..20f6c3f46a66 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5OptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5OptionsTest.java @@ -49,8 +49,8 @@ protected void verifyOptions() { verify(clientCodegen).setPrependFormOrBodyParameters(Boolean.valueOf(Swift5OptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); verify(clientCodegen).setReadonlyProperties(Boolean.parseBoolean(Swift5OptionsProvider.READONLY_PROPERTIES_VALUE)); verify(clientCodegen).setRemoveMigrationProjectNameClass(Boolean.parseBoolean(Swift5OptionsProvider.REMOVE_MIGRATION_PROJECT_NAME_CLASS_VALUE)); - verify(clientCodegen).setGenerateFrozenEnums(Boolean.parseBoolean(Swift5OptionsProvider.GENERATE_FROZEN_ENUMS_VALUE)); verify(clientCodegen).setGenerateModelAdditionalProperties(Boolean.parseBoolean(Swift5OptionsProvider.GENERATE_MODEL_ADDITIONAL_PROPERTIES_VALUE)); verify(clientCodegen).setHashableModels(Boolean.parseBoolean(Swift5OptionsProvider.HASHABLE_MODELS_VALUE)); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(Swift5OptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/aurelia/TypeScriptAureliaClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/aurelia/TypeScriptAureliaClientOptionsTest.java index cd247de1190c..be1801e6401b 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/aurelia/TypeScriptAureliaClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/aurelia/TypeScriptAureliaClientOptionsTest.java @@ -45,5 +45,6 @@ protected void verifyOptions() { verify(clientCodegen).setParamNaming(TypeScriptAureliaClientOptionsProvider.PARAM_NAMING_VALUE); verify(clientCodegen).setSupportsES6(TypeScriptAureliaClientOptionsProvider.SUPPORTS_ES6_VALUE); verify(clientCodegen).setPrependFormOrBodyParameters(Boolean.valueOf(TypeScriptAureliaClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(TypeScriptAureliaClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientOptionsTest.java index 7b29653b31a4..afd91bd47253 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientOptionsTest.java @@ -48,5 +48,6 @@ protected void verifyOptions() { verify(clientCodegen).setTypescriptThreePlus(Boolean.valueOf(TypeScriptFetchClientOptionsProvider.TYPESCRIPT_THREE_PLUS)); verify(clientCodegen).setWithoutRuntimeChecks(Boolean.valueOf(TypeScriptFetchClientOptionsProvider.WITHOUT_RUNTIME_CHECKS)); verify(clientCodegen).setSagasAndRecords(Boolean.valueOf(TypeScriptFetchClientOptionsProvider.SAGAS_AND_RECORDS)); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(TypeScriptFetchClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientOptionsTest.java index 5359b81e6a52..38b1f0ee4d01 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientOptionsTest.java @@ -47,5 +47,6 @@ protected void verifyOptions() { verify(clientCodegen).setPrependFormOrBodyParameters(Boolean.valueOf(TypeScriptAngularClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); verify(clientCodegen).setQueryParamObjectFormat(TypeScriptAngularClientOptionsProvider.QUERY_PARAM_OBJECT_FORMAT_VALUE); verify(clientCodegen).setParamNaming(TypeScriptAngularClientOptionsProvider.PARAM_NAMING_VALUE); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(TypeScriptAngularClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangularjs/TypeScriptAngularJsClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangularjs/TypeScriptAngularJsClientOptionsTest.java index 54710992d911..b2c9c066b819 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangularjs/TypeScriptAngularJsClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangularjs/TypeScriptAngularJsClientOptionsTest.java @@ -45,5 +45,6 @@ protected void verifyOptions() { verify(clientCodegen).setParamNaming(TypeScriptAngularJsClientOptionsProvider.PARAM_NAMING_VALUE); verify(clientCodegen).setSupportsES6(Boolean.valueOf(TypeScriptAngularJsClientOptionsProvider.SUPPORTS_ES6_VALUE)); verify(clientCodegen).setPrependFormOrBodyParameters(Boolean.valueOf(TypeScriptAngularJsClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(TypeScriptAngularJsClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnestjs/TypeScriptNestjsClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnestjs/TypeScriptNestjsClientOptionsTest.java index 5f2138a66c29..ba042c8471f2 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnestjs/TypeScriptNestjsClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnestjs/TypeScriptNestjsClientOptionsTest.java @@ -46,5 +46,6 @@ protected void verifyOptions() { verify(clientCodegen).setSupportsES6(Boolean.valueOf(TypeScriptNestjsClientOptionsProvider.SUPPORTS_ES6_VALUE)); verify(clientCodegen).setStringEnums(Boolean.parseBoolean(TypeScriptNestjsClientOptionsProvider.STRING_ENUMS_VALUE)); verify(clientCodegen).setPrependFormOrBodyParameters(Boolean.valueOf(TypeScriptNestjsClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(TypeScriptNestjsClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnode/TypeScriptNodeClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnode/TypeScriptNodeClientOptionsTest.java index 414c63dd279a..680759c870c9 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnode/TypeScriptNodeClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnode/TypeScriptNodeClientOptionsTest.java @@ -45,5 +45,6 @@ protected void verifyOptions() { verify(clientCodegen).setParamNaming(TypeScriptNodeClientOptionsProvider.PARAM_NAMING_VALUE); verify(clientCodegen).setSupportsES6(Boolean.valueOf(TypeScriptNodeClientOptionsProvider.SUPPORTS_ES6_VALUE)); verify(clientCodegen).setPrependFormOrBodyParameters(Boolean.valueOf(TypeScriptNodeClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(TypeScriptNodeClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/samples/client/petstore/kotlin-enum-default-value/.openapi-generator/FILES b/samples/client/petstore/kotlin-enum-default-value/.openapi-generator/FILES index 66329670bf9d..edff1ccea7b5 100644 --- a/samples/client/petstore/kotlin-enum-default-value/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-enum-default-value/.openapi-generator/FILES @@ -22,6 +22,7 @@ src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +src/main/kotlin/org/openapitools/client/infrastructure/SerializerHelper.kt src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt src/main/kotlin/org/openapitools/client/models/ModelWithEnumPropertyHavingDefault.kt diff --git a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt index ef0c18333845..3925a4181e8a 100644 --- a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt +++ b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.ModelWithEnumPropertyHavingDefault +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException diff --git a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt index e22592e47d74..755f8240ed47 100644 --- a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +++ b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -1,6 +1,7 @@ package org.openapitools.client.infrastructure import com.squareup.moshi.Moshi +import com.squareup.moshi.adapters.EnumJsonAdapter import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory object Serializer { @@ -18,6 +19,7 @@ object Serializer { @JvmStatic val moshi: Moshi by lazy { + SerializerHelper.addEnumUnknownDefaultCase(moshiBuilder) moshiBuilder.build() } } diff --git a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/SerializerHelper.kt b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/SerializerHelper.kt new file mode 100644 index 000000000000..d3789e4823bd --- /dev/null +++ b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/SerializerHelper.kt @@ -0,0 +1,12 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.Moshi +import com.squareup.moshi.adapters.EnumJsonAdapter + +object SerializerHelper { + fun addEnumUnknownDefaultCase(moshiBuilder: Moshi.Builder): Moshi.Builder { + return moshiBuilder + .add(org.openapitools.client.models.ModelWithEnumPropertyHavingDefault.PropertyName::class.java, EnumJsonAdapter.create(org.openapitools.client.models.ModelWithEnumPropertyHavingDefault.PropertyName::class.java) + .withUnknownFallback(org.openapitools.client.models.ModelWithEnumPropertyHavingDefault.PropertyName.unknownDefaultOpenApi)) + } +} diff --git a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/models/ModelWithEnumPropertyHavingDefault.kt b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/models/ModelWithEnumPropertyHavingDefault.kt index 80f0176dc0ca..16982beb8891 100644 --- a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/models/ModelWithEnumPropertyHavingDefault.kt +++ b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/models/ModelWithEnumPropertyHavingDefault.kt @@ -43,10 +43,11 @@ data class ModelWithEnumPropertyHavingDefault ( /** * * - * Values: vALUE + * Values: vALUE,unknownDefaultOpenApi */ enum class PropertyName(val value: kotlin.String) { - @Json(name = "VALUE") vALUE("VALUE"); + @Json(name = "VALUE") vALUE("VALUE"), + @Json(name = "unknown_default_open_api") unknownDefaultOpenApi("unknown_default_open_api"); } } diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index b774e10e7b81..54b52a811860 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -25,6 +25,8 @@ import java.io.IOException import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet +import com.google.gson.annotations.SerializedName + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -185,6 +187,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { ) } + /** + * enum for parameter status + */ + enum class Status_findPetsByStatus(val value: kotlin.String) { + @SerializedName(value = "available") available("available"), + @SerializedName(value = "pending") pending("pending"), + @SerializedName(value = "sold") sold("sold"), + ; + } + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -198,7 +210,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { + fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) return when (localVarResponse.responseType) { @@ -226,7 +238,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -240,9 +252,9 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param status Status values that need to be considered for filter * @return RequestConfig */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { + fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("status", toMultiValue(status.toList(), "csv")) } @@ -320,7 +332,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("tags", toMultiValue(tags.toList(), "csv")) } diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index d9cc68f0042f..5dff82cca137 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.Order +import com.google.gson.annotations.SerializedName + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index efbff7928151..3cd3a17289b9 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.User +import com.google.gson.annotations.SerializedName + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -443,7 +445,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("username", listOf(username.toString())) put("password", listOf(password.toString())) diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index b774e10e7b81..b07f6fb114f3 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -25,6 +25,8 @@ import java.io.IOException import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet +import com.fasterxml.jackson.annotation.JsonProperty + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -185,6 +187,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { ) } + /** + * enum for parameter status + */ + enum class Status_findPetsByStatus(val value: kotlin.String) { + @JsonProperty(value = "available") AVAILABLE("available"), + @JsonProperty(value = "pending") PENDING("pending"), + @JsonProperty(value = "sold") SOLD("sold"), + ; + } + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -198,7 +210,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { + fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) return when (localVarResponse.responseType) { @@ -226,7 +238,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -240,9 +252,9 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param status Status values that need to be considered for filter * @return RequestConfig */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { + fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("status", toMultiValue(status.toList(), "csv")) } @@ -320,7 +332,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("tags", toMultiValue(tags.toList(), "csv")) } diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index d9cc68f0042f..5f5f7ecffe81 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.Order +import com.fasterxml.jackson.annotation.JsonProperty + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index efbff7928151..332503b18953 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.User +import com.fasterxml.jackson.annotation.JsonProperty + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -443,7 +445,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("username", listOf(username.toString())) put("password", listOf(password.toString())) diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index dcb8d97586b5..5c62ed5b98f7 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -25,6 +25,8 @@ import java.io.IOException import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -247,7 +249,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("tags", toMultiValue(tags.toList(), "csv")) } @@ -320,7 +322,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ fun getAllPetsRequestConfig(lastUpdated: java.time.OffsetDateTime?) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { if (lastUpdated != null) { put("lastUpdated", listOf(parseDateToQueryString(lastUpdated))) diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index d9cc68f0042f..916a865f7acc 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.Order +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index efbff7928151..1c294b5e2215 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.User +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -443,7 +445,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("username", listOf(username.toString())) put("password", listOf(password.toString())) diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 1cd9901c0f91..6b26a13e51ae 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -25,6 +25,8 @@ import java.io.IOException import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet +import com.google.gson.annotations.SerializedName + import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.openapitools.client.infrastructure.ApiClient @@ -187,6 +189,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { ) } + /** + * enum for parameter status + */ + enum class Status_findPetsByStatus(val value: kotlin.String) { + @SerializedName(value = "available") available("available"), + @SerializedName(value = "pending") pending("pending"), + @SerializedName(value = "sold") sold("sold"), + ; + } + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -200,7 +212,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List = withContext(Dispatchers.IO) { + suspend fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List = withContext(Dispatchers.IO) { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) return@withContext when (localVarResponse.responseType) { @@ -228,7 +240,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - suspend fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> = withContext(Dispatchers.IO) { + suspend fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> = withContext(Dispatchers.IO) { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return@withContext request>( @@ -242,9 +254,9 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param status Status values that need to be considered for filter * @return RequestConfig */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { + fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("status", toMultiValue(status.toList(), "csv")) } @@ -322,7 +334,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("tags", toMultiValue(tags.toList(), "csv")) } diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 430d9449c484..ffa098db6ca1 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.Order +import com.google.gson.annotations.SerializedName + import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.openapitools.client.infrastructure.ApiClient diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index d318fa7477df..724e2d6fd2e8 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.User +import com.google.gson.annotations.SerializedName + import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.openapitools.client.infrastructure.ApiClient @@ -445,7 +447,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("username", listOf(username.toString())) put("password", listOf(password.toString())) diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index b774e10e7b81..601ca6b01f88 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -25,6 +25,8 @@ import java.io.IOException import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -185,6 +187,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { ) } + /** + * enum for parameter status + */ + enum class Status_findPetsByStatus(val value: kotlin.String) { + @Json(name = "available") available("available"), + @Json(name = "pending") pending("pending"), + @Json(name = "sold") sold("sold"), + ; + } + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -198,7 +210,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { + fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) return when (localVarResponse.responseType) { @@ -226,7 +238,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -240,9 +252,9 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param status Status values that need to be considered for filter * @return RequestConfig */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { + fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("status", toMultiValue(status.toList(), "csv")) } @@ -320,7 +332,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("tags", toMultiValue(tags.toList(), "csv")) } diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index d9cc68f0042f..916a865f7acc 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.Order +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index efbff7928151..1c294b5e2215 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.User +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -443,7 +445,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("username", listOf(username.toString())) put("password", listOf(password.toString())) diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 33d1e110f122..4eefd44019f8 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -25,6 +25,8 @@ import java.io.IOException import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -185,6 +187,16 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas ) } + /** + * enum for parameter status + */ + internal enum class Status_findPetsByStatus(val value: kotlin.String) { + @Json(name = "available") available("available"), + @Json(name = "pending") pending("pending"), + @Json(name = "sold") sold("sold"), + ; + } + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -198,7 +210,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { + fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) return when (localVarResponse.responseType) { @@ -226,7 +238,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -240,9 +252,9 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * @param status Status values that need to be considered for filter * @return RequestConfig */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { + fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("status", toMultiValue(status.toList(), "csv")) } @@ -320,7 +332,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("tags", toMultiValue(tags.toList(), "csv")) } diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 02201f04d42b..e5d64330d94d 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.Order +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 3475e9c4695e..363f3924a001 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.User +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -443,7 +445,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba */ fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("username", listOf(username.toString())) put("password", listOf(password.toString())) diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 8f8335f8b75b..9e40a8d6be31 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -25,6 +25,8 @@ import java.io.IOException import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -185,6 +187,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { ) } + /** + * enum for parameter status + */ + enum class Status_findPetsByStatus(val value: kotlin.String) { + @Json(name = "available") available("available"), + @Json(name = "pending") pending("pending"), + @Json(name = "sold") sold("sold"), + ; + } + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -198,7 +210,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List? { + fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List? { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) return when (localVarResponse.responseType) { @@ -226,7 +238,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -240,9 +252,9 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param status Status values that need to be considered for filter * @return RequestConfig */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { + fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("status", toMultiValue(status.toList(), "csv")) } @@ -320,7 +332,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("tags", toMultiValue(tags.toList(), "csv")) } diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index b35fda447217..a305a6661a0c 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.Order +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 87ad7db8960f..bc8b00bc288a 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.User +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -443,7 +445,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("username", listOf(username.toString())) put("password", listOf(password.toString())) diff --git a/samples/client/petstore/kotlin-okhttp3/.openapi-generator/FILES b/samples/client/petstore/kotlin-okhttp3/.openapi-generator/FILES index c7a409ac169e..2710ee42441f 100644 --- a/samples/client/petstore/kotlin-okhttp3/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-okhttp3/.openapi-generator/FILES @@ -31,6 +31,7 @@ src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +src/main/kotlin/org/openapitools/client/infrastructure/SerializerHelper.kt src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt src/main/kotlin/org/openapitools/client/models/Category.kt diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index b774e10e7b81..601ca6b01f88 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -25,6 +25,8 @@ import java.io.IOException import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -185,6 +187,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { ) } + /** + * enum for parameter status + */ + enum class Status_findPetsByStatus(val value: kotlin.String) { + @Json(name = "available") available("available"), + @Json(name = "pending") pending("pending"), + @Json(name = "sold") sold("sold"), + ; + } + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -198,7 +210,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { + fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) return when (localVarResponse.responseType) { @@ -226,7 +238,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -240,9 +252,9 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param status Status values that need to be considered for filter * @return RequestConfig */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { + fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("status", toMultiValue(status.toList(), "csv")) } @@ -320,7 +332,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("tags", toMultiValue(tags.toList(), "csv")) } diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index d9cc68f0042f..916a865f7acc 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.Order +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index efbff7928151..1c294b5e2215 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.User +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -443,7 +445,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("username", listOf(username.toString())) put("password", listOf(password.toString())) diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt index e22592e47d74..755f8240ed47 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -1,6 +1,7 @@ package org.openapitools.client.infrastructure import com.squareup.moshi.Moshi +import com.squareup.moshi.adapters.EnumJsonAdapter import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory object Serializer { @@ -18,6 +19,7 @@ object Serializer { @JvmStatic val moshi: Moshi by lazy { + SerializerHelper.addEnumUnknownDefaultCase(moshiBuilder) moshiBuilder.build() } } diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/SerializerHelper.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/SerializerHelper.kt new file mode 100644 index 000000000000..e00c195ee2c0 --- /dev/null +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/SerializerHelper.kt @@ -0,0 +1,14 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.Moshi +import com.squareup.moshi.adapters.EnumJsonAdapter + +object SerializerHelper { + fun addEnumUnknownDefaultCase(moshiBuilder: Moshi.Builder): Moshi.Builder { + return moshiBuilder + .add(org.openapitools.client.models.Order.Status::class.java, EnumJsonAdapter.create(org.openapitools.client.models.Order.Status::class.java) + .withUnknownFallback(org.openapitools.client.models.Order.Status.unknownDefaultOpenApi)) + .add(org.openapitools.client.models.Pet.Status::class.java, EnumJsonAdapter.create(org.openapitools.client.models.Pet.Status::class.java) + .withUnknownFallback(org.openapitools.client.models.Pet.Status.unknownDefaultOpenApi)) + } +} diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Order.kt index 1c87feb6972d..7195f3366927 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -60,12 +60,13 @@ data class Order ( /** * Order Status * - * Values: placed,approved,delivered + * Values: placed,approved,delivered,unknownDefaultOpenApi */ enum class Status(val value: kotlin.String) { @Json(name = "placed") placed("placed"), @Json(name = "approved") approved("approved"), - @Json(name = "delivered") delivered("delivered"); + @Json(name = "delivered") delivered("delivered"), + @Json(name = "unknown_default_open_api") unknownDefaultOpenApi("unknown_default_open_api"); } } diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Pet.kt index fb28ee922256..801bd2a82221 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -62,12 +62,13 @@ data class Pet ( /** * pet status in the store * - * Values: available,pending,sold + * Values: available,pending,sold,unknownDefaultOpenApi */ enum class Status(val value: kotlin.String) { @Json(name = "available") available("available"), @Json(name = "pending") pending("pending"), - @Json(name = "sold") sold("sold"); + @Json(name = "sold") sold("sold"), + @Json(name = "unknown_default_open_api") unknownDefaultOpenApi("unknown_default_open_api"); } } diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 40c875dcdc7e..870811a2c93a 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -25,6 +25,8 @@ import java.io.IOException import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -185,6 +187,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { ) } + /** + * enum for parameter status + */ + enum class Status_findPetsByStatus(val value: kotlin.String) { + @Json(name = "available") available("available"), + @Json(name = "pending") pending("pending"), + @Json(name = "sold") sold("sold"), + ; + } + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -198,7 +210,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { + fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) return when (localVarResponse.responseType) { @@ -226,7 +238,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -240,9 +252,9 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param status Status values that need to be considered for filter * @return RequestConfig */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { + fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("status", toMultiValue(status.toList(), "csv")) } @@ -320,7 +332,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("tags", toMultiValue(tags.toList(), "csv")) } diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index d9cc68f0042f..916a865f7acc 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.Order +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index efbff7928151..1c294b5e2215 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.User +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -443,7 +445,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("username", listOf(username.toString())) put("password", listOf(password.toString())) diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index b774e10e7b81..601ca6b01f88 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -25,6 +25,8 @@ import java.io.IOException import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -185,6 +187,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { ) } + /** + * enum for parameter status + */ + enum class Status_findPetsByStatus(val value: kotlin.String) { + @Json(name = "available") available("available"), + @Json(name = "pending") pending("pending"), + @Json(name = "sold") sold("sold"), + ; + } + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -198,7 +210,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { + fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) return when (localVarResponse.responseType) { @@ -226,7 +238,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -240,9 +252,9 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param status Status values that need to be considered for filter * @return RequestConfig */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { + fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("status", toMultiValue(status.toList(), "csv")) } @@ -320,7 +332,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("tags", toMultiValue(tags.toList(), "csv")) } diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index d9cc68f0042f..916a865f7acc 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.Order +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index efbff7928151..1c294b5e2215 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.User +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -443,7 +445,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("username", listOf(username.toString())) put("password", listOf(password.toString())) 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 9e39ffb9d00d..325c66305b88 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 @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.PetEnum +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index b774e10e7b81..601ca6b01f88 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -25,6 +25,8 @@ import java.io.IOException import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -185,6 +187,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { ) } + /** + * enum for parameter status + */ + enum class Status_findPetsByStatus(val value: kotlin.String) { + @Json(name = "available") available("available"), + @Json(name = "pending") pending("pending"), + @Json(name = "sold") sold("sold"), + ; + } + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -198,7 +210,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { + fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) return when (localVarResponse.responseType) { @@ -226,7 +238,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -240,9 +252,9 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param status Status values that need to be considered for filter * @return RequestConfig */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { + fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("status", toMultiValue(status.toList(), "csv")) } @@ -320,7 +332,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("tags", toMultiValue(tags.toList(), "csv")) } diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index d9cc68f0042f..916a865f7acc 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.Order +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index efbff7928151..1c294b5e2215 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.User +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -443,7 +445,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("username", listOf(username.toString())) put("password", listOf(password.toString())) diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 321066b9f4ed..e41babad70f4 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -15,20 +15,12 @@ public struct EnumArrays: Codable, Hashable { public enum JustSymbol: String, Codable, CaseIterable, CaseIterableDefaultsLast { case greaterThanOrEqualTo = ">=" case dollar = "$" - // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". - // If new enum cases are added that are unknown to the spec/client, they are safely - // decoded to this case. The raw value of this case is a dummy value that attempts - // to avoids collisions with previously specified cases. - case unknownDefaultOpenAPI = "unknown_default_open_api" + case unknownDefaultOpenApi = "unknown_default_open_api" } public enum ArrayEnum: String, Codable, CaseIterable, CaseIterableDefaultsLast { case fish = "fish" case crab = "crab" - // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". - // If new enum cases are added that are unknown to the spec/client, they are safely - // decoded to this case. The raw value of this case is a dummy value that attempts - // to avoids collisions with previously specified cases. - case unknownDefaultOpenAPI = "unknown_default_open_api" + case unknownDefaultOpenApi = "unknown_default_open_api" } public var justSymbol: JustSymbol? public var arrayEnum: [ArrayEnum]? diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index eef3045b2915..232f04f3ddd3 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -14,9 +14,5 @@ public enum EnumClass: String, Codable, CaseIterable, CaseIterableDefaultsLast { case abc = "_abc" case efg = "-efg" case xyz = "(xyz)" - // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". - // If new enum cases are added that are unknown to the spec/client, they are safely - // decoded to this case. The raw value of this case is a dummy value that attempts - // to avoids collisions with previously specified cases. - case unknownDefaultOpenAPI = "unknown_default_open_api" + case unknownDefaultOpenApi = "unknown_default_open_api" } diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index d6a96c72d97e..72eaac6069a6 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -16,49 +16,23 @@ public struct EnumTest: Codable, Hashable { case upper = "UPPER" case lower = "lower" case empty = "" - // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". - // If new enum cases are added that are unknown to the spec/client, they are safely - // decoded to this case. The raw value of this case is a dummy value that attempts - // to avoids collisions with previously specified cases. - case unknownDefaultOpenAPI = "unknown_default_open_api" + case unknownDefaultOpenApi = "unknown_default_open_api" } public enum EnumStringRequired: String, Codable, CaseIterable, CaseIterableDefaultsLast { case upper = "UPPER" case lower = "lower" case empty = "" - // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". - // If new enum cases are added that are unknown to the spec/client, they are safely - // decoded to this case. The raw value of this case is a dummy value that attempts - // to avoids collisions with previously specified cases. - case unknownDefaultOpenAPI = "unknown_default_open_api" + case unknownDefaultOpenApi = "unknown_default_open_api" } public enum EnumInteger: Int, Codable, CaseIterable, CaseIterableDefaultsLast { case _1 = 1 case number1 = -1 - // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". - // If new enum cases are added that are unknown to the spec/client, they are safely - // decoded to this case. The raw value of this case is a dummy value that attempts - // to avoids collisions with previously specified cases. - // - // 192, used to calculate the raw value, was the Swift Evolution proposal for - // frozen/non-frozen enums. - // [SE-0192](https://github.com/apple/swift-evolution/blob/master/proposals/0192-non-exhaustive-enums.md) - // - case unknownDefaultOpenAPI = -11184809 // Int.min / 192 + case unknownDefaultOpenApi = 11184809 } public enum EnumNumber: Double, Codable, CaseIterable, CaseIterableDefaultsLast { case _11 = 1.1 case number12 = -1.2 - // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". - // If new enum cases are added that are unknown to the spec/client, they are safely - // decoded to this case. The raw value of this case is a dummy value that attempts - // to avoids collisions with previously specified cases. - // - // 192, used to calculate the raw value, was the Swift Evolution proposal for - // frozen/non-frozen enums. - // [SE-0192](https://github.com/apple/swift-evolution/blob/master/proposals/0192-non-exhaustive-enums.md) - // - case unknownDefaultOpenAPI = -11184809 // Int.min / 192 + case unknownDefaultOpenApi = 11184809 } public var enumString: EnumString? public var enumStringRequired: EnumStringRequired diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index c0b5a369451d..fcae4e7e9372 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -15,11 +15,7 @@ public struct MapTest: Codable, Hashable { public enum MapOfEnumString: String, Codable, CaseIterable, CaseIterableDefaultsLast { case upper = "UPPER" case lower = "lower" - // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". - // If new enum cases are added that are unknown to the spec/client, they are safely - // decoded to this case. The raw value of this case is a dummy value that attempts - // to avoids collisions with previously specified cases. - case unknownDefaultOpenAPI = "unknown_default_open_api" + case unknownDefaultOpenApi = "unknown_default_open_api" } public var mapMapOfString: [String: [String: String]]? public var mapOfEnumString: [String: String]? diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 5615d10ff4c5..57c1c4f866e5 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -16,11 +16,7 @@ public struct Order: Codable, Hashable { case placed = "placed" case approved = "approved" case delivered = "delivered" - // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". - // If new enum cases are added that are unknown to the spec/client, they are safely - // decoded to this case. The raw value of this case is a dummy value that attempts - // to avoids collisions with previously specified cases. - case unknownDefaultOpenAPI = "unknown_default_open_api" + case unknownDefaultOpenApi = "unknown_default_open_api" } public var id: Int64? public var petId: Int64? diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index e418b2c445bb..4c1af47007e5 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -14,9 +14,5 @@ public enum OuterEnum: String, Codable, CaseIterable, CaseIterableDefaultsLast { case placed = "placed" case approved = "approved" case delivered = "delivered" - // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". - // If new enum cases are added that are unknown to the spec/client, they are safely - // decoded to this case. The raw value of this case is a dummy value that attempts - // to avoids collisions with previously specified cases. - case unknownDefaultOpenAPI = "unknown_default_open_api" + case unknownDefaultOpenApi = "unknown_default_open_api" } diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index 81afbc4b2a16..45b4cff8e1e5 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -16,11 +16,7 @@ public struct Pet: Codable, Hashable { case available = "available" case pending = "pending" case sold = "sold" - // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". - // If new enum cases are added that are unknown to the spec/client, they are safely - // decoded to this case. The raw value of this case is a dummy value that attempts - // to avoids collisions with previously specified cases. - case unknownDefaultOpenAPI = "unknown_default_open_api" + case unknownDefaultOpenApi = "unknown_default_open_api" } public var id: Int64? public var category: Category? From e3788ce44ed8c61843ae0a8b8adab032982439a4 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 21 Dec 2021 15:48:47 +0800 Subject: [PATCH 111/117] update doc for okhttp-gson-nextgen --- docs/generators/java.md | 2 +- .../org/openapitools/codegen/languages/JavaClientCodegen.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/generators/java.md b/docs/generators/java.md index 9f432edc97f3..cdab88d701e2 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -40,7 +40,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |invokerPackage|root package for generated code| |org.openapitools.client| |java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
            **true**
            Use Java 8 classes such as Base64
            **false**
            Various third party libraries as needed
            |true| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
            **true**
            The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
            **false**
            The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
            |true| -|library|library template (sub-template) to use|
            **jersey1**
            HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libraries instead.
            **jersey2**
            HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x
            **feign**
            HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x.
            **okhttp-gson**
            [DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.
            **okhttp-gson-nextgen**
            HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x.'. Better support for oneOf/anyOf with breaking changes. Will replace `okhttp-gson` in the 6.0.0 release.
            **retrofit2**
            HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2/3]=true'. (RxJava 1.x or 2.x or 3.x)
            **resttemplate**
            HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x
            **webclient**
            HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x
            **resteasy**
            HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x
            **vertx**
            HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x
            **google-api-client**
            HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x
            **rest-assured**
            HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.10.x. Only for Java 8
            **native**
            HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+
            **microprofile**
            HTTP client: Microprofile client 1.x. JSON processing: JSON-B
            **apache-httpclient**
            HTTP client: Apache httpclient 4.x
            |okhttp-gson| +|library|library template (sub-template) to use|
            **jersey1**
            HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libraries instead.
            **jersey2**
            HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x
            **feign**
            HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x.
            **okhttp-gson**
            [DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.
            **okhttp-gson-nextgen**
            HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x.'. Better support for oneOf/anyOf with breaking changes. Will replace `okhttp-gson` in the 6.0.0 release. IMPORTANT: this may subject to breaking changes without further notice.
            **retrofit2**
            HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2/3]=true'. (RxJava 1.x or 2.x or 3.x)
            **resttemplate**
            HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x
            **webclient**
            HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x
            **resteasy**
            HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x
            **vertx**
            HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x
            **google-api-client**
            HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x
            **rest-assured**
            HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.10.x. Only for Java 8
            **native**
            HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+
            **microprofile**
            HTTP client: Microprofile client 1.x. JSON processing: JSON-B
            **apache-httpclient**
            HTTP client: Apache httpclient 4.x
            |okhttp-gson| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |microprofileFramework|Framework for microprofile. Possible values "kumuluzee"| |null| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java index f675c9a9c3f1..2d4a3214b038 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java @@ -174,7 +174,7 @@ public JavaClientCodegen() { supportedLibraries.put(JERSEY2, "HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x"); supportedLibraries.put(FEIGN, "HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x."); supportedLibraries.put(OKHTTP_GSON, "[DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'."); - supportedLibraries.put(OKHTTP_GSON_NEXTGEN, "HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x.'. Better support for oneOf/anyOf with breaking changes. Will replace `okhttp-gson` in the 6.0.0 release."); + supportedLibraries.put(OKHTTP_GSON_NEXTGEN, "HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x.'. Better support for oneOf/anyOf with breaking changes. Will replace `okhttp-gson` in the 6.0.0 release. IMPORTANT: this may subject to breaking changes without further notice."); supportedLibraries.put(RETROFIT_2, "HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2/3]=true'. (RxJava 1.x or 2.x or 3.x)"); supportedLibraries.put(RESTTEMPLATE, "HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x"); supportedLibraries.put(WEBCLIENT, "HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x"); From 6269a9810c427422f99d9eb63e4831e70de17c6f Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 21 Dec 2021 18:20:13 +0800 Subject: [PATCH 112/117] Prepare 5.3.1 release (#11161) * prepare v5.3.1 release * update samples --- modules/openapi-generator-cli/pom.xml | 2 +- modules/openapi-generator-core/pom.xml | 2 +- modules/openapi-generator-gradle-plugin/gradle.properties | 2 +- modules/openapi-generator-gradle-plugin/pom.xml | 2 +- .../samples/local-spec/gradle.properties | 2 +- modules/openapi-generator-maven-plugin/examples/java-client.xml | 2 +- modules/openapi-generator-maven-plugin/examples/kotlin.xml | 2 +- .../examples/multi-module/java-client/pom.xml | 2 +- .../examples/non-java-invalid-spec.xml | 2 +- modules/openapi-generator-maven-plugin/examples/non-java.xml | 2 +- modules/openapi-generator-maven-plugin/examples/spring.xml | 2 +- modules/openapi-generator-maven-plugin/pom.xml | 2 +- modules/openapi-generator-online/pom.xml | 2 +- modules/openapi-generator/pom.xml | 2 +- pom.xml | 2 +- .../csharp-netcore-complex-files/.openapi-generator/VERSION | 2 +- .../java/okhttp-gson-streaming/.openapi-generator/VERSION | 2 +- samples/client/petstore/R/.openapi-generator/VERSION | 2 +- samples/client/petstore/apex/.openapi-generator/VERSION | 2 +- samples/client/petstore/bash/.openapi-generator/VERSION | 2 +- samples/client/petstore/c/.openapi-generator/VERSION | 2 +- samples/client/petstore/cpp-qt/.openapi-generator/VERSION | 2 +- .../petstore/cpp-restsdk/client/.openapi-generator/VERSION | 2 +- samples/client/petstore/cpp-restsdk/client/ApiClient.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/ApiClient.h | 2 +- samples/client/petstore/cpp-restsdk/client/ApiConfiguration.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/ApiConfiguration.h | 2 +- samples/client/petstore/cpp-restsdk/client/ApiException.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/ApiException.h | 2 +- samples/client/petstore/cpp-restsdk/client/HttpContent.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/HttpContent.h | 2 +- samples/client/petstore/cpp-restsdk/client/IHttpBody.h | 2 +- samples/client/petstore/cpp-restsdk/client/JsonBody.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/JsonBody.h | 2 +- samples/client/petstore/cpp-restsdk/client/ModelBase.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/ModelBase.h | 2 +- .../client/petstore/cpp-restsdk/client/MultipartFormData.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/MultipartFormData.h | 2 +- samples/client/petstore/cpp-restsdk/client/Object.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/Object.h | 2 +- samples/client/petstore/cpp-restsdk/client/api/PetApi.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/api/PetApi.h | 2 +- samples/client/petstore/cpp-restsdk/client/api/StoreApi.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/api/StoreApi.h | 2 +- samples/client/petstore/cpp-restsdk/client/api/UserApi.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/api/UserApi.h | 2 +- .../client/petstore/cpp-restsdk/client/model/ApiResponse.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/model/ApiResponse.h | 2 +- samples/client/petstore/cpp-restsdk/client/model/Category.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/model/Category.h | 2 +- samples/client/petstore/cpp-restsdk/client/model/Order.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/model/Order.h | 2 +- samples/client/petstore/cpp-restsdk/client/model/Pet.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/model/Pet.h | 2 +- samples/client/petstore/cpp-restsdk/client/model/Tag.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/model/Tag.h | 2 +- samples/client/petstore/cpp-restsdk/client/model/User.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/model/User.h | 2 +- samples/client/petstore/cpp-tiny/.openapi-generator/VERSION | 2 +- samples/client/petstore/cpp-ue4/.openapi-generator/VERSION | 2 +- samples/client/petstore/crystal/.openapi-generator/VERSION | 2 +- samples/client/petstore/crystal/.travis.yml | 2 +- samples/client/petstore/crystal/spec/spec_helper.cr | 2 +- samples/client/petstore/crystal/src/petstore.cr | 2 +- samples/client/petstore/crystal/src/petstore/api/pet_api.cr | 2 +- samples/client/petstore/crystal/src/petstore/api/store_api.cr | 2 +- samples/client/petstore/crystal/src/petstore/api/user_api.cr | 2 +- samples/client/petstore/crystal/src/petstore/api_client.cr | 2 +- samples/client/petstore/crystal/src/petstore/api_error.cr | 2 +- samples/client/petstore/crystal/src/petstore/configuration.cr | 2 +- .../client/petstore/crystal/src/petstore/models/api_response.cr | 2 +- samples/client/petstore/crystal/src/petstore/models/category.cr | 2 +- samples/client/petstore/crystal/src/petstore/models/order.cr | 2 +- samples/client/petstore/crystal/src/petstore/models/pet.cr | 2 +- samples/client/petstore/crystal/src/petstore/models/tag.cr | 2 +- samples/client/petstore/crystal/src/petstore/models/user.cr | 2 +- .../.openapi-generator/VERSION | 2 +- .../OpenAPIClient-httpclient/.openapi-generator/VERSION | 2 +- .../OpenAPIClient-net47/.openapi-generator/VERSION | 2 +- .../OpenAPIClient-net5.0/.openapi-generator/VERSION | 2 +- .../csharp-netcore/OpenAPIClient/.openapi-generator/VERSION | 2 +- .../csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION | 2 +- .../OpenAPIClientCoreAndNet47/.openapi-generator/VERSION | 2 +- .../petstore/csharp/OpenAPIClient/.openapi-generator/VERSION | 2 +- samples/client/petstore/elixir/.openapi-generator/VERSION | 2 +- .../client/petstore/go/go-petstore/.openapi-generator/VERSION | 2 +- samples/client/petstore/groovy/.openapi-generator/VERSION | 2 +- .../petstore/haskell-http-client/.openapi-generator/VERSION | 2 +- .../petstore/java-micronaut-client/.openapi-generator/VERSION | 2 +- .../petstore/java/apache-httpclient/.openapi-generator/VERSION | 2 +- .../petstore/java/feign-no-nullable/.openapi-generator/VERSION | 2 +- samples/client/petstore/java/feign/.openapi-generator/VERSION | 2 +- .../petstore/java/google-api-client/.openapi-generator/VERSION | 2 +- samples/client/petstore/java/jersey1/.openapi-generator/VERSION | 2 +- .../java/jersey2-java8-localdatetime/.openapi-generator/VERSION | 2 +- .../petstore/java/jersey2-java8/.openapi-generator/VERSION | 2 +- .../java/microprofile-rest-client/.openapi-generator/VERSION | 2 +- .../petstore/java/native-async/.openapi-generator/VERSION | 2 +- samples/client/petstore/java/native/.openapi-generator/VERSION | 2 +- .../okhttp-gson-dynamicOperations/.openapi-generator/VERSION | 2 +- .../java/okhttp-gson-nextgen/.openapi-generator/VERSION | 2 +- .../java/okhttp-gson-parcelableModel/.openapi-generator/VERSION | 2 +- .../client/petstore/java/okhttp-gson/.openapi-generator/VERSION | 2 +- .../java/rest-assured-jackson/.openapi-generator/VERSION | 2 +- .../petstore/java/rest-assured/.openapi-generator/VERSION | 2 +- .../client/petstore/java/resteasy/.openapi-generator/VERSION | 2 +- .../java/resttemplate-withXml/.openapi-generator/VERSION | 2 +- .../petstore/java/resttemplate/.openapi-generator/VERSION | 2 +- .../petstore/java/retrofit2-play26/.openapi-generator/VERSION | 2 +- .../client/petstore/java/retrofit2/.openapi-generator/VERSION | 2 +- .../petstore/java/retrofit2rx2/.openapi-generator/VERSION | 2 +- .../petstore/java/retrofit2rx3/.openapi-generator/VERSION | 2 +- .../petstore/java/vertx-no-nullable/.openapi-generator/VERSION | 2 +- samples/client/petstore/java/vertx/.openapi-generator/VERSION | 2 +- .../java/webclient-nulable-arrays/.openapi-generator/VERSION | 2 +- .../client/petstore/java/webclient/.openapi-generator/VERSION | 2 +- .../client/petstore/javascript-es6/.openapi-generator/VERSION | 2 +- .../petstore/javascript-promise-es6/.openapi-generator/VERSION | 2 +- samples/client/petstore/k6/.openapi-generator/VERSION | 2 +- samples/client/petstore/k6/script.js | 2 +- .../kotlin-enum-default-value/.openapi-generator/VERSION | 2 +- samples/client/petstore/kotlin-gson/.openapi-generator/VERSION | 2 +- .../client/petstore/kotlin-jackson/.openapi-generator/VERSION | 2 +- .../kotlin-json-request-string/.openapi-generator/VERSION | 2 +- .../kotlin-jvm-okhttp4-coroutines/.openapi-generator/VERSION | 2 +- .../petstore/kotlin-jvm-volley/.openapi-generator/VERSION | 2 +- .../petstore/kotlin-moshi-codegen/.openapi-generator/VERSION | 2 +- .../petstore/kotlin-multiplatform/.openapi-generator/VERSION | 2 +- .../client/petstore/kotlin-nonpublic/.openapi-generator/VERSION | 2 +- .../client/petstore/kotlin-nullable/.openapi-generator/VERSION | 2 +- .../client/petstore/kotlin-okhttp3/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../petstore/kotlin-retrofit2-rx3/.openapi-generator/VERSION | 2 +- .../client/petstore/kotlin-retrofit2/.openapi-generator/VERSION | 2 +- .../client/petstore/kotlin-string/.openapi-generator/VERSION | 2 +- .../petstore/kotlin-threetenbp/.openapi-generator/VERSION | 2 +- .../petstore/kotlin-uppercase-enum/.openapi-generator/VERSION | 2 +- samples/client/petstore/kotlin/.openapi-generator/VERSION | 2 +- samples/client/petstore/lua/.openapi-generator/VERSION | 2 +- samples/client/petstore/nim/.openapi-generator/VERSION | 2 +- .../client/petstore/objc/core-data/.openapi-generator/VERSION | 2 +- samples/client/petstore/objc/default/.openapi-generator/VERSION | 2 +- samples/client/petstore/perl/.openapi-generator/VERSION | 2 +- .../client/petstore/php-dt-modern/.openapi-generator/VERSION | 2 +- samples/client/petstore/php-dt/.openapi-generator/VERSION | 2 +- .../petstore/php/OpenAPIClient-php/.openapi-generator/VERSION | 2 +- .../petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php | 2 +- .../php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/ApiException.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Configuration.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/HeaderSelector.php | 2 +- .../OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php | 2 +- .../OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php | 2 +- .../php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php | 2 +- samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Category.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Client.php | 2 +- .../php/OpenAPIClient-php/lib/Model/DeprecatedObject.php | 2 +- samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/File.php | 2 +- .../php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php | 2 +- samples/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php | 2 +- .../php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php | 2 +- .../php/OpenAPIClient-php/lib/Model/HealthCheckResult.php | 2 +- .../php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php | 2 +- .../lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php | 2 +- .../php/OpenAPIClient-php/lib/Model/Model200Response.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ModelList.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Name.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php | 2 +- .../OpenAPIClient-php/lib/Model/ObjectWithDeprecatedFields.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Order.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php | 2 +- .../php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php | 2 +- .../php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php | 2 +- .../lib/Model/OuterEnumIntegerDefaultValue.php | 2 +- .../OpenAPIClient-php/lib/Model/OuterObjectWithEnumProperty.php | 2 +- samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php | 2 +- .../php/OpenAPIClient-php/lib/Model/SpecialModelName.php | 2 +- samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/User.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php | 2 +- samples/client/petstore/powershell/.openapi-generator/VERSION | 2 +- .../client/petstore/python-asyncio/.openapi-generator/VERSION | 2 +- .../client/petstore/python-legacy/.openapi-generator/VERSION | 2 +- .../client/petstore/python-tornado/.openapi-generator/VERSION | 2 +- samples/client/petstore/python/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- samples/client/petstore/ruby-faraday/.openapi-generator/VERSION | 2 +- samples/client/petstore/ruby-faraday/lib/petstore.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/api/default_api.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb | 2 +- .../ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/api/store_api.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/api/user_api.rb | 2 +- samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb | 2 +- samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/configuration.rb | 2 +- .../lib/petstore/models/additional_properties_class.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/animal.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/api_response.rb | 2 +- .../lib/petstore/models/array_of_array_of_number_only.rb | 2 +- .../ruby-faraday/lib/petstore/models/array_of_number_only.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/array_test.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/capitalization.rb | 2 +- samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/category.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/class_model.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/client.rb | 2 +- .../ruby-faraday/lib/petstore/models/deprecated_object.rb | 2 +- samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/enum_class.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/enum_test.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/file.rb | 2 +- .../ruby-faraday/lib/petstore/models/file_schema_test_class.rb | 2 +- samples/client/petstore/ruby-faraday/lib/petstore/models/foo.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/format_test.rb | 2 +- .../ruby-faraday/lib/petstore/models/has_only_read_only.rb | 2 +- .../ruby-faraday/lib/petstore/models/health_check_result.rb | 2 +- .../ruby-faraday/lib/petstore/models/inline_response_default.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/list.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/map_test.rb | 2 +- .../models/mixed_properties_and_additional_properties_class.rb | 2 +- .../ruby-faraday/lib/petstore/models/model200_response.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/model_return.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/name.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/nullable_class.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/number_only.rb | 2 +- .../lib/petstore/models/object_with_deprecated_fields.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/order.rb | 2 +- .../ruby-faraday/lib/petstore/models/outer_composite.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/outer_enum.rb | 2 +- .../lib/petstore/models/outer_enum_default_value.rb | 2 +- .../ruby-faraday/lib/petstore/models/outer_enum_integer.rb | 2 +- .../lib/petstore/models/outer_enum_integer_default_value.rb | 2 +- .../lib/petstore/models/outer_object_with_enum_property.rb | 2 +- samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb | 2 +- .../ruby-faraday/lib/petstore/models/read_only_first.rb | 2 +- .../ruby-faraday/lib/petstore/models/special_model_name.rb | 2 +- samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/user.rb | 2 +- samples/client/petstore/ruby-faraday/lib/petstore/version.rb | 2 +- samples/client/petstore/ruby-faraday/petstore.gemspec | 2 +- samples/client/petstore/ruby-faraday/spec/api_client_spec.rb | 2 +- samples/client/petstore/ruby-faraday/spec/configuration_spec.rb | 2 +- samples/client/petstore/ruby-faraday/spec/spec_helper.rb | 2 +- samples/client/petstore/ruby/.openapi-generator/VERSION | 2 +- samples/client/petstore/ruby/lib/petstore.rb | 2 +- .../client/petstore/ruby/lib/petstore/api/another_fake_api.rb | 2 +- samples/client/petstore/ruby/lib/petstore/api/default_api.rb | 2 +- samples/client/petstore/ruby/lib/petstore/api/fake_api.rb | 2 +- .../ruby/lib/petstore/api/fake_classname_tags123_api.rb | 2 +- samples/client/petstore/ruby/lib/petstore/api/pet_api.rb | 2 +- samples/client/petstore/ruby/lib/petstore/api/store_api.rb | 2 +- samples/client/petstore/ruby/lib/petstore/api/user_api.rb | 2 +- samples/client/petstore/ruby/lib/petstore/api_client.rb | 2 +- samples/client/petstore/ruby/lib/petstore/api_error.rb | 2 +- samples/client/petstore/ruby/lib/petstore/configuration.rb | 2 +- .../ruby/lib/petstore/models/additional_properties_class.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/animal.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/api_response.rb | 2 +- .../ruby/lib/petstore/models/array_of_array_of_number_only.rb | 2 +- .../petstore/ruby/lib/petstore/models/array_of_number_only.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/array_test.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/capitalization.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/cat.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/category.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/class_model.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/client.rb | 2 +- .../petstore/ruby/lib/petstore/models/deprecated_object.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/dog.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/enum_class.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/enum_test.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/file.rb | 2 +- .../petstore/ruby/lib/petstore/models/file_schema_test_class.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/foo.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/format_test.rb | 2 +- .../petstore/ruby/lib/petstore/models/has_only_read_only.rb | 2 +- .../petstore/ruby/lib/petstore/models/health_check_result.rb | 2 +- .../ruby/lib/petstore/models/inline_response_default.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/list.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/map_test.rb | 2 +- .../models/mixed_properties_and_additional_properties_class.rb | 2 +- .../petstore/ruby/lib/petstore/models/model200_response.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/model_return.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/name.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/nullable_class.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/number_only.rb | 2 +- .../ruby/lib/petstore/models/object_with_deprecated_fields.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/order.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/outer_composite.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb | 2 +- .../ruby/lib/petstore/models/outer_enum_default_value.rb | 2 +- .../petstore/ruby/lib/petstore/models/outer_enum_integer.rb | 2 +- .../lib/petstore/models/outer_enum_integer_default_value.rb | 2 +- .../ruby/lib/petstore/models/outer_object_with_enum_property.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/pet.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/read_only_first.rb | 2 +- .../petstore/ruby/lib/petstore/models/special_model_name.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/tag.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/user.rb | 2 +- samples/client/petstore/ruby/lib/petstore/version.rb | 2 +- samples/client/petstore/ruby/petstore.gemspec | 2 +- samples/client/petstore/ruby/spec/api_client_spec.rb | 2 +- samples/client/petstore/ruby/spec/configuration_spec.rb | 2 +- samples/client/petstore/ruby/spec/spec_helper.rb | 2 +- .../petstore/rust/hyper/petstore/.openapi-generator/VERSION | 2 +- .../rust/reqwest/petstore-async/.openapi-generator/VERSION | 2 +- .../petstore/rust/reqwest/petstore/.openapi-generator/VERSION | 2 +- samples/client/petstore/scala-akka/.openapi-generator/VERSION | 2 +- .../scala-httpclient-deprecated/.openapi-generator/VERSION | 2 +- samples/client/petstore/scala-sttp/.openapi-generator/VERSION | 2 +- .../petstore/spring-cloud-async/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../spring-cloud-spring-pageable/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- samples/client/petstore/spring-cloud/.openapi-generator/VERSION | 2 +- .../spring-cloud/src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- samples/client/petstore/spring-stubs/.openapi-generator/VERSION | 2 +- .../spring-stubs/src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/swift5/alamofireLibrary/.openapi-generator/VERSION | 2 +- .../swift5/asyncAwaitLibrary/.openapi-generator/VERSION | 2 +- .../petstore/swift5/combineLibrary/.openapi-generator/VERSION | 2 +- .../client/petstore/swift5/default/.openapi-generator/VERSION | 2 +- .../petstore/swift5/deprecated/.openapi-generator/VERSION | 2 +- .../petstore/swift5/frozenEnums/.openapi-generator/VERSION | 2 +- .../petstore/swift5/nonPublicApi/.openapi-generator/VERSION | 2 +- .../petstore/swift5/objcCompatible/.openapi-generator/VERSION | 2 +- samples/client/petstore/swift5/oneOf/.openapi-generator/VERSION | 2 +- .../swift5/promisekitLibrary/.openapi-generator/VERSION | 2 +- .../swift5/readonlyProperties/.openapi-generator/VERSION | 2 +- .../petstore/swift5/resultLibrary/.openapi-generator/VERSION | 2 +- .../petstore/swift5/rxswiftLibrary/.openapi-generator/VERSION | 2 +- .../swift5/urlsessionLibrary/.openapi-generator/VERSION | 2 +- .../petstore/swift5/vaporLibrary/.openapi-generator/VERSION | 2 +- .../petstore/swift5/x-swift-hashable/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/single-request-parameter/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/with-prefixed-module-name/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../typescript-aurelia/default/.openapi-generator/VERSION | 2 +- .../builds/composed-schemas/.openapi-generator/VERSION | 2 +- .../typescript-axios/builds/default/.openapi-generator/VERSION | 2 +- .../builds/es6-target/.openapi-generator/VERSION | 2 +- .../builds/test-petstore/.openapi-generator/VERSION | 2 +- .../builds/with-complex-headers/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../builds/with-interfaces/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../builds/with-npm-version/.openapi-generator/VERSION | 2 +- .../with-single-request-parameters/.openapi-generator/VERSION | 2 +- .../builds/default-v3.0/.openapi-generator/VERSION | 2 +- .../typescript-fetch/builds/default/.openapi-generator/VERSION | 2 +- .../typescript-fetch/builds/enum/.openapi-generator/VERSION | 2 +- .../builds/es6-target/.openapi-generator/VERSION | 2 +- .../builds/multiple-parameters/.openapi-generator/VERSION | 2 +- .../prefix-parameter-interfaces/.openapi-generator/VERSION | 2 +- .../builds/sagas-and-records/.openapi-generator/VERSION | 2 +- .../builds/typescript-three-plus/.openapi-generator/VERSION | 2 +- .../builds/with-interfaces/.openapi-generator/VERSION | 2 +- .../builds/with-npm-version/.openapi-generator/VERSION | 2 +- .../builds/without-runtime-checks/.openapi-generator/VERSION | 2 +- .../petstore/typescript-inversify/.openapi-generator/VERSION | 2 +- .../typescript-jquery/default/.openapi-generator/VERSION | 2 +- .../petstore/typescript-jquery/npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../petstore/typescript-node/default/.openapi-generator/VERSION | 2 +- .../petstore/typescript-node/npm/.openapi-generator/VERSION | 2 +- .../builds/with-npm-version/.openapi-generator/VERSION | 2 +- .../typescript-rxjs/builds/default/.openapi-generator/VERSION | 2 +- .../builds/es6-target/.openapi-generator/VERSION | 2 +- .../builds/with-npm-version/.openapi-generator/VERSION | 2 +- .../builds/with-progress-subscriber/.openapi-generator/VERSION | 2 +- .../config/petstore/protobuf-schema/.openapi-generator/VERSION | 2 +- samples/meta-codegen/lib/pom.xml | 2 +- samples/meta-codegen/usage/.openapi-generator/VERSION | 2 +- samples/openapi3/client/elm/.openapi-generator/VERSION | 2 +- .../x-auth-id-alias/go-experimental/.openapi-generator/VERSION | 2 +- .../java/jersey2-java8/.openapi-generator/VERSION | 2 +- .../x-auth-id-alias/python/.openapi-generator/VERSION | 2 +- .../x-auth-id-alias/ruby-client/.openapi-generator/VERSION | 2 +- .../x-auth-id-alias/ruby-client/lib/x_auth_id_alias.rb | 2 +- .../ruby-client/lib/x_auth_id_alias/api/usage_api.rb | 2 +- .../ruby-client/lib/x_auth_id_alias/api_client.rb | 2 +- .../ruby-client/lib/x_auth_id_alias/api_error.rb | 2 +- .../ruby-client/lib/x_auth_id_alias/configuration.rb | 2 +- .../x-auth-id-alias/ruby-client/lib/x_auth_id_alias/version.rb | 2 +- .../x-auth-id-alias/ruby-client/spec/api_client_spec.rb | 2 +- .../x-auth-id-alias/ruby-client/spec/configuration_spec.rb | 2 +- .../extensions/x-auth-id-alias/ruby-client/spec/spec_helper.rb | 2 +- .../x-auth-id-alias/ruby-client/x_auth_id_alias.gemspec | 2 +- .../features/dynamic-servers/python/.openapi-generator/VERSION | 2 +- .../features/dynamic-servers/ruby/.openapi-generator/VERSION | 2 +- .../features/dynamic-servers/ruby/dynamic_servers.gemspec | 2 +- .../client/features/dynamic-servers/ruby/lib/dynamic_servers.rb | 2 +- .../dynamic-servers/ruby/lib/dynamic_servers/api/usage_api.rb | 2 +- .../dynamic-servers/ruby/lib/dynamic_servers/api_client.rb | 2 +- .../dynamic-servers/ruby/lib/dynamic_servers/api_error.rb | 2 +- .../dynamic-servers/ruby/lib/dynamic_servers/configuration.rb | 2 +- .../dynamic-servers/ruby/lib/dynamic_servers/version.rb | 2 +- .../features/dynamic-servers/ruby/spec/api_client_spec.rb | 2 +- .../features/dynamic-servers/ruby/spec/configuration_spec.rb | 2 +- .../client/features/dynamic-servers/ruby/spec/spec_helper.rb | 2 +- .../ruby-client/.openapi-generator/VERSION | 2 +- .../generate-alias-as-model/ruby-client/lib/petstore.rb | 2 +- .../ruby-client/lib/petstore/api/usage_api.rb | 2 +- .../ruby-client/lib/petstore/api_client.rb | 2 +- .../ruby-client/lib/petstore/api_error.rb | 2 +- .../ruby-client/lib/petstore/configuration.rb | 2 +- .../ruby-client/lib/petstore/models/array_alias.rb | 2 +- .../ruby-client/lib/petstore/models/map_alias.rb | 2 +- .../generate-alias-as-model/ruby-client/lib/petstore/version.rb | 2 +- .../generate-alias-as-model/ruby-client/petstore.gemspec | 2 +- .../generate-alias-as-model/ruby-client/spec/api_client_spec.rb | 2 +- .../ruby-client/spec/configuration_spec.rb | 2 +- .../generate-alias-as-model/ruby-client/spec/spec_helper.rb | 2 +- .../petstore_client_lib_fake/.openapi-generator/VERSION | 2 +- .../dart-dio/petstore_client_lib/.openapi-generator/VERSION | 2 +- .../petstore_client_lib_fake/.openapi-generator/VERSION | 2 +- .../dart2/petstore_client_lib/.openapi-generator/VERSION | 2 +- .../dart2/petstore_client_lib_fake/.openapi-generator/VERSION | 2 +- .../client/petstore/go/go-petstore/.openapi-generator/VERSION | 2 +- .../jersey2-java8-special-characters/.openapi-generator/VERSION | 2 +- .../petstore/java/jersey2-java8/.openapi-generator/VERSION | 2 +- .../client/petstore/python-legacy/.openapi-generator/VERSION | 2 +- .../openapi3/client/petstore/python/.openapi-generator/VERSION | 2 +- .../builds/composed-schemas/.openapi-generator/VERSION | 2 +- .../typescript/builds/default/.openapi-generator/VERSION | 2 +- .../petstore/typescript/builds/deno/.openapi-generator/VERSION | 2 +- .../typescript/builds/inversify/.openapi-generator/VERSION | 2 +- .../typescript/builds/jquery/.openapi-generator/VERSION | 2 +- .../typescript/builds/object_params/.openapi-generator/VERSION | 2 +- samples/schema/petstore/ktorm/.openapi-generator/VERSION | 2 +- samples/schema/petstore/mysql/.openapi-generator/VERSION | 2 +- samples/schema/petstore/wsdl-schema/.openapi-generator/VERSION | 2 +- .../server/petstore/aspnetcore-3.0/.openapi-generator/VERSION | 2 +- .../server/petstore/aspnetcore-3.1/.openapi-generator/VERSION | 2 +- .../server/petstore/aspnetcore-5.0/.openapi-generator/VERSION | 2 +- samples/server/petstore/aspnetcore/.openapi-generator/VERSION | 2 +- samples/server/petstore/cpp-pistache/.openapi-generator/VERSION | 2 +- .../cpp-qt-qhttpengine-server/.openapi-generator/VERSION | 2 +- .../server/petstore/erlang-server/.openapi-generator/VERSION | 2 +- .../server/petstore/go-api-server/.openapi-generator/VERSION | 2 +- .../server/petstore/go-chi-server/.openapi-generator/VERSION | 2 +- .../server/petstore/go-echo-server/.openapi-generator/VERSION | 2 +- .../petstore/go-gin-api-server/.openapi-generator/VERSION | 2 +- .../petstore/go-server-required/.openapi-generator/VERSION | 2 +- .../server/petstore/haskell-servant/.openapi-generator/VERSION | 2 +- .../server/petstore/haskell-yesod/.openapi-generator/VERSION | 2 +- samples/server/petstore/java-msf4j/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../java-play-framework-async/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../java-play-framework-no-interface/.openapi-generator/VERSION | 2 +- .../java-play-framework-no-nullable/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../petstore/java-play-framework/.openapi-generator/VERSION | 2 +- .../server/petstore/java-undertow/.openapi-generator/VERSION | 2 +- .../server/petstore/java-vertx-web/.openapi-generator/VERSION | 2 +- .../jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION | 2 +- .../jaxrs-cxf-cdi-default-value/.openapi-generator/VERSION | 2 +- .../server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION | 2 +- .../jaxrs-cxf-non-spring-app/.openapi-generator/VERSION | 2 +- samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION | 2 +- .../server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION | 2 +- samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION | 2 +- .../jaxrs-resteasy/default-value/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-resteasy/default/.openapi-generator/VERSION | 2 +- .../jaxrs-resteasy/eap-java8/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-resteasy/java8/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-spec-interface/.openapi-generator/VERSION | 2 +- samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION | 2 +- .../server/petstore/jaxrs/jersey1/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION | 2 +- .../server/petstore/jaxrs/jersey2/.openapi-generator/VERSION | 2 +- .../petstore/kotlin-server/ktor/.openapi-generator/VERSION | 2 +- samples/server/petstore/kotlin-server/ktor/README.md | 2 +- .../kotlin-springboot-delegate/.openapi-generator/VERSION | 2 +- .../src/main/kotlin/org/openapitools/api/PetApi.kt | 2 +- .../src/main/kotlin/org/openapitools/api/StoreApi.kt | 2 +- .../src/main/kotlin/org/openapitools/api/UserApi.kt | 2 +- .../kotlin-springboot-modelMutable/.openapi-generator/VERSION | 2 +- .../kotlin-springboot-reactive/.openapi-generator/VERSION | 2 +- .../petstore/kotlin-springboot/.openapi-generator/VERSION | 2 +- samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION | 2 +- samples/server/petstore/php-laravel/.openapi-generator/VERSION | 2 +- samples/server/petstore/php-lumen/.openapi-generator/VERSION | 2 +- .../petstore/php-mezzio-ph-modern/.openapi-generator/VERSION | 2 +- .../server/petstore/php-mezzio-ph/.openapi-generator/VERSION | 2 +- samples/server/petstore/php-slim4/.openapi-generator/VERSION | 2 +- .../php-symfony/SymfonyBundle-php/.openapi-generator/VERSION | 2 +- .../python-aiohttp-srclayout/.openapi-generator/VERSION | 2 +- .../server/petstore/python-aiohttp/.openapi-generator/VERSION | 2 +- .../petstore/python-blueplanet/.openapi-generator/VERSION | 2 +- .../server/petstore/python-fastapi/.openapi-generator/VERSION | 2 +- samples/server/petstore/python-flask/.openapi-generator/VERSION | 2 +- .../rust-server/output/multipart-v3/.openapi-generator/VERSION | 2 +- .../rust-server/output/no-example-v3/.openapi-generator/VERSION | 2 +- .../rust-server/output/openapi-v3/.openapi-generator/VERSION | 2 +- .../rust-server/output/ops-v3/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../output/ping-bearer-auth/.openapi-generator/VERSION | 2 +- .../output/rust-server-test/.openapi-generator/VERSION | 2 +- .../spring-mvc-default-value/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/TestHeadersApi.java | 2 +- .../src/main/java/org/openapitools/api/TestQueryParamsApi.java | 2 +- .../petstore/spring-mvc-j8-async/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../spring-mvc-j8-localdatetime/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/spring-mvc-no-nullable/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../spring-mvc-spring-pageable/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- samples/server/petstore/spring-mvc/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../spring-mvc/src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../spring-mvc/src/main/java/org/openapitools/api/PetApi.java | 2 +- .../spring-mvc/src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../spring-mvc/src/main/java/org/openapitools/api/UserApi.java | 2 +- .../.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../springboot-beanvalidation/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/springboot-delegate-j8/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/springboot-delegate/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../springboot-implicitHeaders/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/springboot-reactive/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../springboot-spring-pageable/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/springboot-useoptional/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/springboot-virtualan/.openapi-generator/VERSION | 2 +- .../java/org/openapitools/virtualan/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/virtualan/api/FakeApi.java | 2 +- .../org/openapitools/virtualan/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/virtualan/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/virtualan/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/virtualan/api/UserApi.java | 2 +- samples/server/petstore/springboot/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../springboot/src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../springboot/src/main/java/org/openapitools/api/PetApi.java | 2 +- .../springboot/src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../springboot/src/main/java/org/openapitools/api/UserApi.java | 2 +- 697 files changed, 697 insertions(+), 697 deletions(-) diff --git a/modules/openapi-generator-cli/pom.xml b/modules/openapi-generator-cli/pom.xml index 6a7fbbda1b2f..3c12f8f79183 100644 --- a/modules/openapi-generator-cli/pom.xml +++ b/modules/openapi-generator-cli/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 5.3.1-SNAPSHOT + 5.3.1 ../.. diff --git a/modules/openapi-generator-core/pom.xml b/modules/openapi-generator-core/pom.xml index 166ba14131b1..911c03c85733 100644 --- a/modules/openapi-generator-core/pom.xml +++ b/modules/openapi-generator-core/pom.xml @@ -6,7 +6,7 @@ openapi-generator-project org.openapitools - 5.3.1-SNAPSHOT + 5.3.1 ../.. diff --git a/modules/openapi-generator-gradle-plugin/gradle.properties b/modules/openapi-generator-gradle-plugin/gradle.properties index e623391d60c1..c8fbf0f82a92 100644 --- a/modules/openapi-generator-gradle-plugin/gradle.properties +++ b/modules/openapi-generator-gradle-plugin/gradle.properties @@ -1,5 +1,5 @@ # RELEASE_VERSION -openApiGeneratorVersion=5.3.1-SNAPSHOT +openApiGeneratorVersion=5.3.1 # /RELEASE_VERSION # BEGIN placeholders diff --git a/modules/openapi-generator-gradle-plugin/pom.xml b/modules/openapi-generator-gradle-plugin/pom.xml index c1b8953d831b..6c6b9696d248 100644 --- a/modules/openapi-generator-gradle-plugin/pom.xml +++ b/modules/openapi-generator-gradle-plugin/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 5.3.1-SNAPSHOT + 5.3.1 ../.. diff --git a/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties b/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties index 0d00f845a966..08301dcb0b06 100644 --- a/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties +++ b/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties @@ -1,3 +1,3 @@ # RELEASE_VERSION -openApiGeneratorVersion=5.3.1-SNAPSHOT +openApiGeneratorVersion=5.3.1 # /RELEASE_VERSION diff --git a/modules/openapi-generator-maven-plugin/examples/java-client.xml b/modules/openapi-generator-maven-plugin/examples/java-client.xml index f37560b68628..b82befe82680 100644 --- a/modules/openapi-generator-maven-plugin/examples/java-client.xml +++ b/modules/openapi-generator-maven-plugin/examples/java-client.xml @@ -13,7 +13,7 @@ org.openapitools openapi-generator-maven-plugin - 5.3.1-SNAPSHOT + 5.3.1 diff --git a/modules/openapi-generator-maven-plugin/examples/kotlin.xml b/modules/openapi-generator-maven-plugin/examples/kotlin.xml index e7ebc5a12458..4960964cef4f 100644 --- a/modules/openapi-generator-maven-plugin/examples/kotlin.xml +++ b/modules/openapi-generator-maven-plugin/examples/kotlin.xml @@ -15,7 +15,7 @@ org.openapitools openapi-generator-maven-plugin - 5.3.1-SNAPSHOT + 5.3.1 diff --git a/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml b/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml index be8c5cb67b4a..f632bfc88261 100644 --- a/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml +++ b/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml @@ -19,7 +19,7 @@ org.openapitools openapi-generator-maven-plugin - 5.3.1-SNAPSHOT + 5.3.1 diff --git a/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml b/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml index cf242a94bad7..4fc8acf72861 100644 --- a/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml +++ b/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml @@ -13,7 +13,7 @@ org.openapitools openapi-generator-maven-plugin - 5.3.1-SNAPSHOT + 5.3.1 diff --git a/modules/openapi-generator-maven-plugin/examples/non-java.xml b/modules/openapi-generator-maven-plugin/examples/non-java.xml index 60018a26e646..1ccbb790eae7 100644 --- a/modules/openapi-generator-maven-plugin/examples/non-java.xml +++ b/modules/openapi-generator-maven-plugin/examples/non-java.xml @@ -13,7 +13,7 @@ org.openapitools openapi-generator-maven-plugin - 5.3.1-SNAPSHOT + 5.3.1 diff --git a/modules/openapi-generator-maven-plugin/examples/spring.xml b/modules/openapi-generator-maven-plugin/examples/spring.xml index 967d49a16551..3bb8d3a51baa 100644 --- a/modules/openapi-generator-maven-plugin/examples/spring.xml +++ b/modules/openapi-generator-maven-plugin/examples/spring.xml @@ -20,7 +20,7 @@ org.openapitools openapi-generator-maven-plugin - 5.3.1-SNAPSHOT + 5.3.1 diff --git a/modules/openapi-generator-maven-plugin/pom.xml b/modules/openapi-generator-maven-plugin/pom.xml index 1726f2e9e813..908c44da292a 100644 --- a/modules/openapi-generator-maven-plugin/pom.xml +++ b/modules/openapi-generator-maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.openapitools openapi-generator-project - 5.3.1-SNAPSHOT + 5.3.1 ../.. diff --git a/modules/openapi-generator-online/pom.xml b/modules/openapi-generator-online/pom.xml index 031cadea6c22..c8e77f5df369 100644 --- a/modules/openapi-generator-online/pom.xml +++ b/modules/openapi-generator-online/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 5.3.1-SNAPSHOT + 5.3.1 ../.. diff --git a/modules/openapi-generator/pom.xml b/modules/openapi-generator/pom.xml index 7fbb9f96c3ab..15e0de2c6020 100644 --- a/modules/openapi-generator/pom.xml +++ b/modules/openapi-generator/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 5.3.1-SNAPSHOT + 5.3.1 ../.. diff --git a/pom.xml b/pom.xml index 6dd63afc4b4a..3b27eb856d1f 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ pom openapi-generator-project - 5.3.1-SNAPSHOT + 5.3.1 https://github.com/openapitools/openapi-generator diff --git a/samples/client/others/csharp-netcore-complex-files/.openapi-generator/VERSION b/samples/client/others/csharp-netcore-complex-files/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/others/csharp-netcore-complex-files/.openapi-generator/VERSION +++ b/samples/client/others/csharp-netcore-complex-files/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/others/java/okhttp-gson-streaming/.openapi-generator/VERSION b/samples/client/others/java/okhttp-gson-streaming/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/others/java/okhttp-gson-streaming/.openapi-generator/VERSION +++ b/samples/client/others/java/okhttp-gson-streaming/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/R/.openapi-generator/VERSION b/samples/client/petstore/R/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/R/.openapi-generator/VERSION +++ b/samples/client/petstore/R/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/apex/.openapi-generator/VERSION b/samples/client/petstore/apex/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/apex/.openapi-generator/VERSION +++ b/samples/client/petstore/apex/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/bash/.openapi-generator/VERSION b/samples/client/petstore/bash/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/bash/.openapi-generator/VERSION +++ b/samples/client/petstore/bash/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/c/.openapi-generator/VERSION b/samples/client/petstore/c/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/c/.openapi-generator/VERSION +++ b/samples/client/petstore/c/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/cpp-qt/.openapi-generator/VERSION b/samples/client/petstore/cpp-qt/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/cpp-qt/.openapi-generator/VERSION +++ b/samples/client/petstore/cpp-qt/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/cpp-restsdk/client/.openapi-generator/VERSION b/samples/client/petstore/cpp-restsdk/client/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/cpp-restsdk/client/.openapi-generator/VERSION +++ b/samples/client/petstore/cpp-restsdk/client/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/cpp-restsdk/client/ApiClient.cpp b/samples/client/petstore/cpp-restsdk/client/ApiClient.cpp index 5d0f4a6475e7..885c229bfe76 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiClient.cpp +++ b/samples/client/petstore/cpp-restsdk/client/ApiClient.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiClient.h b/samples/client/petstore/cpp-restsdk/client/ApiClient.h index 0e05b25a7727..c2db5dc08c49 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiClient.h +++ b/samples/client/petstore/cpp-restsdk/client/ApiClient.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.cpp b/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.cpp index e691c52743d9..bd0cb8c0e9e2 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.cpp +++ b/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.h b/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.h index 9a254ad71ee6..d65ddb6b2ff9 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.h +++ b/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiException.cpp b/samples/client/petstore/cpp-restsdk/client/ApiException.cpp index 82fc4f3c1193..928bf8e0413b 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiException.cpp +++ b/samples/client/petstore/cpp-restsdk/client/ApiException.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiException.h b/samples/client/petstore/cpp-restsdk/client/ApiException.h index 9916a29e2c51..bced883bee7d 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiException.h +++ b/samples/client/petstore/cpp-restsdk/client/ApiException.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/HttpContent.cpp b/samples/client/petstore/cpp-restsdk/client/HttpContent.cpp index 22dabc4beff3..eac0d66ff3ae 100644 --- a/samples/client/petstore/cpp-restsdk/client/HttpContent.cpp +++ b/samples/client/petstore/cpp-restsdk/client/HttpContent.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/HttpContent.h b/samples/client/petstore/cpp-restsdk/client/HttpContent.h index 991e7a9f22d7..bfa0d19bbf18 100644 --- a/samples/client/petstore/cpp-restsdk/client/HttpContent.h +++ b/samples/client/petstore/cpp-restsdk/client/HttpContent.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/IHttpBody.h b/samples/client/petstore/cpp-restsdk/client/IHttpBody.h index 6655271d919d..a5adf55cf84d 100644 --- a/samples/client/petstore/cpp-restsdk/client/IHttpBody.h +++ b/samples/client/petstore/cpp-restsdk/client/IHttpBody.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/JsonBody.cpp b/samples/client/petstore/cpp-restsdk/client/JsonBody.cpp index 780f48f91ea2..b47bc2c5bd72 100644 --- a/samples/client/petstore/cpp-restsdk/client/JsonBody.cpp +++ b/samples/client/petstore/cpp-restsdk/client/JsonBody.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/JsonBody.h b/samples/client/petstore/cpp-restsdk/client/JsonBody.h index 5774baebae21..c50267c56ecd 100644 --- a/samples/client/petstore/cpp-restsdk/client/JsonBody.h +++ b/samples/client/petstore/cpp-restsdk/client/JsonBody.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ModelBase.cpp b/samples/client/petstore/cpp-restsdk/client/ModelBase.cpp index 4d75c83b3e13..75d1bb01cfb2 100644 --- a/samples/client/petstore/cpp-restsdk/client/ModelBase.cpp +++ b/samples/client/petstore/cpp-restsdk/client/ModelBase.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ModelBase.h b/samples/client/petstore/cpp-restsdk/client/ModelBase.h index 0e94211a66f6..831ffa9f4e8d 100644 --- a/samples/client/petstore/cpp-restsdk/client/ModelBase.h +++ b/samples/client/petstore/cpp-restsdk/client/ModelBase.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/MultipartFormData.cpp b/samples/client/petstore/cpp-restsdk/client/MultipartFormData.cpp index d3085c0a7ec2..d8f3ee4340f5 100644 --- a/samples/client/petstore/cpp-restsdk/client/MultipartFormData.cpp +++ b/samples/client/petstore/cpp-restsdk/client/MultipartFormData.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/MultipartFormData.h b/samples/client/petstore/cpp-restsdk/client/MultipartFormData.h index 0d48bd7aa06d..d260399229ad 100644 --- a/samples/client/petstore/cpp-restsdk/client/MultipartFormData.h +++ b/samples/client/petstore/cpp-restsdk/client/MultipartFormData.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/Object.cpp b/samples/client/petstore/cpp-restsdk/client/Object.cpp index a0ac8abe4f92..968df9a4877f 100644 --- a/samples/client/petstore/cpp-restsdk/client/Object.cpp +++ b/samples/client/petstore/cpp-restsdk/client/Object.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/Object.h b/samples/client/petstore/cpp-restsdk/client/Object.h index 16b430c404d3..6bcec36c0285 100644 --- a/samples/client/petstore/cpp-restsdk/client/Object.h +++ b/samples/client/petstore/cpp-restsdk/client/Object.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/PetApi.cpp b/samples/client/petstore/cpp-restsdk/client/api/PetApi.cpp index 08ff5e5772d4..2c2236f7d273 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/PetApi.cpp +++ b/samples/client/petstore/cpp-restsdk/client/api/PetApi.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/PetApi.h b/samples/client/petstore/cpp-restsdk/client/api/PetApi.h index bfe7bc38c825..a6bf7fcbcc49 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/PetApi.h +++ b/samples/client/petstore/cpp-restsdk/client/api/PetApi.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/StoreApi.cpp b/samples/client/petstore/cpp-restsdk/client/api/StoreApi.cpp index 11f4d22ff5d6..7171938cadfc 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/StoreApi.cpp +++ b/samples/client/petstore/cpp-restsdk/client/api/StoreApi.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/StoreApi.h b/samples/client/petstore/cpp-restsdk/client/api/StoreApi.h index ded6008b515e..5d35de7fc3bf 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/StoreApi.h +++ b/samples/client/petstore/cpp-restsdk/client/api/StoreApi.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/UserApi.cpp b/samples/client/petstore/cpp-restsdk/client/api/UserApi.cpp index 0cc08823dc53..bc13700dfd50 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/UserApi.cpp +++ b/samples/client/petstore/cpp-restsdk/client/api/UserApi.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/UserApi.h b/samples/client/petstore/cpp-restsdk/client/api/UserApi.h index a4a8f2e94e01..0b2a6144332e 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/UserApi.h +++ b/samples/client/petstore/cpp-restsdk/client/api/UserApi.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.cpp b/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.cpp index 5473fd47040c..214e69dcbeb3 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.h b/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.h index 3a1587556fcb..86a703fae9c2 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.h +++ b/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Category.cpp b/samples/client/petstore/cpp-restsdk/client/model/Category.cpp index 56ec361b78aa..3250fef9ca9c 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Category.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/Category.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Category.h b/samples/client/petstore/cpp-restsdk/client/model/Category.h index 81233b6cb5ba..7ecefb549299 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Category.h +++ b/samples/client/petstore/cpp-restsdk/client/model/Category.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Order.cpp b/samples/client/petstore/cpp-restsdk/client/model/Order.cpp index 41a9930e468a..4fc8ad8b5cf1 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Order.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/Order.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Order.h b/samples/client/petstore/cpp-restsdk/client/model/Order.h index 6f3a452e0d37..a10e8c34f4de 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Order.h +++ b/samples/client/petstore/cpp-restsdk/client/model/Order.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Pet.cpp b/samples/client/petstore/cpp-restsdk/client/model/Pet.cpp index f43a844f892f..76867745ecb2 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Pet.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/Pet.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Pet.h b/samples/client/petstore/cpp-restsdk/client/model/Pet.h index a319e72ada81..b5f8b346b314 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Pet.h +++ b/samples/client/petstore/cpp-restsdk/client/model/Pet.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Tag.cpp b/samples/client/petstore/cpp-restsdk/client/model/Tag.cpp index 90e3aab5d6e1..eafb5845d527 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Tag.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/Tag.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Tag.h b/samples/client/petstore/cpp-restsdk/client/model/Tag.h index ccccea9a607b..a6f8d6932545 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Tag.h +++ b/samples/client/petstore/cpp-restsdk/client/model/Tag.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/User.cpp b/samples/client/petstore/cpp-restsdk/client/model/User.cpp index 2002040f1444..074b337eda84 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/User.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/User.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/User.h b/samples/client/petstore/cpp-restsdk/client/model/User.h index 181736a5a98e..588445311bc8 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/User.h +++ b/samples/client/petstore/cpp-restsdk/client/model/User.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-tiny/.openapi-generator/VERSION b/samples/client/petstore/cpp-tiny/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/cpp-tiny/.openapi-generator/VERSION +++ b/samples/client/petstore/cpp-tiny/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/cpp-ue4/.openapi-generator/VERSION b/samples/client/petstore/cpp-ue4/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/cpp-ue4/.openapi-generator/VERSION +++ b/samples/client/petstore/cpp-ue4/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/crystal/.openapi-generator/VERSION b/samples/client/petstore/crystal/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/crystal/.openapi-generator/VERSION +++ b/samples/client/petstore/crystal/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/crystal/.travis.yml b/samples/client/petstore/crystal/.travis.yml index b0d669b09f6d..6bc76c06134e 100644 --- a/samples/client/petstore/crystal/.travis.yml +++ b/samples/client/petstore/crystal/.travis.yml @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.3.1 # language: crystal diff --git a/samples/client/petstore/crystal/spec/spec_helper.cr b/samples/client/petstore/crystal/spec/spec_helper.cr index 6df055fdea53..901c22954921 100644 --- a/samples/client/petstore/crystal/spec/spec_helper.cr +++ b/samples/client/petstore/crystal/spec/spec_helper.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.3.1 # # load modules diff --git a/samples/client/petstore/crystal/src/petstore.cr b/samples/client/petstore/crystal/src/petstore.cr index 585ca028c1ca..95c15e099648 100644 --- a/samples/client/petstore/crystal/src/petstore.cr +++ b/samples/client/petstore/crystal/src/petstore.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.3.1 # # Dependencies diff --git a/samples/client/petstore/crystal/src/petstore/api/pet_api.cr b/samples/client/petstore/crystal/src/petstore/api/pet_api.cr index 813ae328c65b..e2c81b3a3bb3 100644 --- a/samples/client/petstore/crystal/src/petstore/api/pet_api.cr +++ b/samples/client/petstore/crystal/src/petstore/api/pet_api.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.3.1 # require "uri" diff --git a/samples/client/petstore/crystal/src/petstore/api/store_api.cr b/samples/client/petstore/crystal/src/petstore/api/store_api.cr index 4d05bcef67e1..f080f1a29a9a 100644 --- a/samples/client/petstore/crystal/src/petstore/api/store_api.cr +++ b/samples/client/petstore/crystal/src/petstore/api/store_api.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.3.1 # require "uri" diff --git a/samples/client/petstore/crystal/src/petstore/api/user_api.cr b/samples/client/petstore/crystal/src/petstore/api/user_api.cr index c052abaa87c4..f936051d44d6 100644 --- a/samples/client/petstore/crystal/src/petstore/api/user_api.cr +++ b/samples/client/petstore/crystal/src/petstore/api/user_api.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.3.1 # require "uri" diff --git a/samples/client/petstore/crystal/src/petstore/api_client.cr b/samples/client/petstore/crystal/src/petstore/api_client.cr index a04d3b56a49b..e8377faa33b5 100644 --- a/samples/client/petstore/crystal/src/petstore/api_client.cr +++ b/samples/client/petstore/crystal/src/petstore/api_client.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.3.1 # require "json" diff --git a/samples/client/petstore/crystal/src/petstore/api_error.cr b/samples/client/petstore/crystal/src/petstore/api_error.cr index a01117fbd536..482fcb96160c 100644 --- a/samples/client/petstore/crystal/src/petstore/api_error.cr +++ b/samples/client/petstore/crystal/src/petstore/api_error.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.3.1 # module Petstore diff --git a/samples/client/petstore/crystal/src/petstore/configuration.cr b/samples/client/petstore/crystal/src/petstore/configuration.cr index dcf7bc0c9b70..d87702fb8a2e 100644 --- a/samples/client/petstore/crystal/src/petstore/configuration.cr +++ b/samples/client/petstore/crystal/src/petstore/configuration.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.3.1 # require "log" diff --git a/samples/client/petstore/crystal/src/petstore/models/api_response.cr b/samples/client/petstore/crystal/src/petstore/models/api_response.cr index b9f3034a1e72..0c0aa1fd1c2c 100644 --- a/samples/client/petstore/crystal/src/petstore/models/api_response.cr +++ b/samples/client/petstore/crystal/src/petstore/models/api_response.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.3.1 # require "json" diff --git a/samples/client/petstore/crystal/src/petstore/models/category.cr b/samples/client/petstore/crystal/src/petstore/models/category.cr index 5e24f73d289e..11dcb87bad73 100644 --- a/samples/client/petstore/crystal/src/petstore/models/category.cr +++ b/samples/client/petstore/crystal/src/petstore/models/category.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.3.1 # require "json" diff --git a/samples/client/petstore/crystal/src/petstore/models/order.cr b/samples/client/petstore/crystal/src/petstore/models/order.cr index 9f93b6ef453c..4d03556ff819 100644 --- a/samples/client/petstore/crystal/src/petstore/models/order.cr +++ b/samples/client/petstore/crystal/src/petstore/models/order.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.3.1 # require "json" diff --git a/samples/client/petstore/crystal/src/petstore/models/pet.cr b/samples/client/petstore/crystal/src/petstore/models/pet.cr index 39ef758adc09..7fb8cc4521fd 100644 --- a/samples/client/petstore/crystal/src/petstore/models/pet.cr +++ b/samples/client/petstore/crystal/src/petstore/models/pet.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.3.1 # require "json" diff --git a/samples/client/petstore/crystal/src/petstore/models/tag.cr b/samples/client/petstore/crystal/src/petstore/models/tag.cr index 76c99c2e07d9..9b95af047b12 100644 --- a/samples/client/petstore/crystal/src/petstore/models/tag.cr +++ b/samples/client/petstore/crystal/src/petstore/models/tag.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.3.1 # require "json" diff --git a/samples/client/petstore/crystal/src/petstore/models/user.cr b/samples/client/petstore/crystal/src/petstore/models/user.cr index bb541138fb39..7b647aaee100 100644 --- a/samples/client/petstore/crystal/src/petstore/models/user.cr +++ b/samples/client/petstore/crystal/src/petstore/models/user.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.3.1 # require "json" diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/elixir/.openapi-generator/VERSION b/samples/client/petstore/elixir/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/elixir/.openapi-generator/VERSION +++ b/samples/client/petstore/elixir/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION b/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION +++ b/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/groovy/.openapi-generator/VERSION b/samples/client/petstore/groovy/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/groovy/.openapi-generator/VERSION +++ b/samples/client/petstore/groovy/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/.openapi-generator/VERSION b/samples/client/petstore/haskell-http-client/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/haskell-http-client/.openapi-generator/VERSION +++ b/samples/client/petstore/haskell-http-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java-micronaut-client/.openapi-generator/VERSION b/samples/client/petstore/java-micronaut-client/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/java-micronaut-client/.openapi-generator/VERSION +++ b/samples/client/petstore/java-micronaut-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/apache-httpclient/.openapi-generator/VERSION b/samples/client/petstore/java/apache-httpclient/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/java/apache-httpclient/.openapi-generator/VERSION +++ b/samples/client/petstore/java/apache-httpclient/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/feign-no-nullable/.openapi-generator/VERSION b/samples/client/petstore/java/feign-no-nullable/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/java/feign-no-nullable/.openapi-generator/VERSION +++ b/samples/client/petstore/java/feign-no-nullable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/feign/.openapi-generator/VERSION b/samples/client/petstore/java/feign/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/java/feign/.openapi-generator/VERSION +++ b/samples/client/petstore/java/feign/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION b/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION +++ b/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/jersey1/.openapi-generator/VERSION b/samples/client/petstore/java/jersey1/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/java/jersey1/.openapi-generator/VERSION +++ b/samples/client/petstore/java/jersey1/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/.openapi-generator/VERSION b/samples/client/petstore/java/jersey2-java8-localdatetime/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/.openapi-generator/VERSION +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION b/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION +++ b/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/microprofile-rest-client/.openapi-generator/VERSION b/samples/client/petstore/java/microprofile-rest-client/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/java/microprofile-rest-client/.openapi-generator/VERSION +++ b/samples/client/petstore/java/microprofile-rest-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/native-async/.openapi-generator/VERSION b/samples/client/petstore/java/native-async/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/java/native-async/.openapi-generator/VERSION +++ b/samples/client/petstore/java/native-async/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/native/.openapi-generator/VERSION b/samples/client/petstore/java/native/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/java/native/.openapi-generator/VERSION +++ b/samples/client/petstore/java/native/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator/VERSION b/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator/VERSION +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/VERSION b/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/VERSION +++ b/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION b/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION b/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION +++ b/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/rest-assured-jackson/.openapi-generator/VERSION b/samples/client/petstore/java/rest-assured-jackson/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/java/rest-assured-jackson/.openapi-generator/VERSION +++ b/samples/client/petstore/java/rest-assured-jackson/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION b/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION +++ b/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/resteasy/.openapi-generator/VERSION b/samples/client/petstore/java/resteasy/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/java/resteasy/.openapi-generator/VERSION +++ b/samples/client/petstore/java/resteasy/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION b/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION +++ b/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION b/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION +++ b/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2-play26/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2-play26/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/java/retrofit2-play26/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2-play26/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2rx3/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2rx3/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/java/retrofit2rx3/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2rx3/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/vertx-no-nullable/.openapi-generator/VERSION b/samples/client/petstore/java/vertx-no-nullable/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/java/vertx-no-nullable/.openapi-generator/VERSION +++ b/samples/client/petstore/java/vertx-no-nullable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/vertx/.openapi-generator/VERSION b/samples/client/petstore/java/vertx/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/java/vertx/.openapi-generator/VERSION +++ b/samples/client/petstore/java/vertx/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/webclient-nulable-arrays/.openapi-generator/VERSION b/samples/client/petstore/java/webclient-nulable-arrays/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/java/webclient-nulable-arrays/.openapi-generator/VERSION +++ b/samples/client/petstore/java/webclient-nulable-arrays/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/webclient/.openapi-generator/VERSION b/samples/client/petstore/java/webclient/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/java/webclient/.openapi-generator/VERSION +++ b/samples/client/petstore/java/webclient/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/javascript-es6/.openapi-generator/VERSION b/samples/client/petstore/javascript-es6/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/javascript-es6/.openapi-generator/VERSION +++ b/samples/client/petstore/javascript-es6/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION b/samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION +++ b/samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/k6/.openapi-generator/VERSION b/samples/client/petstore/k6/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/k6/.openapi-generator/VERSION +++ b/samples/client/petstore/k6/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/k6/script.js b/samples/client/petstore/k6/script.js index 7ae1bf14532b..da7d50e96536 100644 --- a/samples/client/petstore/k6/script.js +++ b/samples/client/petstore/k6/script.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator. * https://github.com/OpenAPITools/openapi-generator * - * OpenAPI generator version: 5.3.1-SNAPSHOT + * OpenAPI generator version: 5.3.1 */ diff --git a/samples/client/petstore/kotlin-enum-default-value/.openapi-generator/VERSION b/samples/client/petstore/kotlin-enum-default-value/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/kotlin-enum-default-value/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-enum-default-value/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-gson/.openapi-generator/VERSION b/samples/client/petstore/kotlin-gson/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/kotlin-gson/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-gson/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jackson/.openapi-generator/VERSION b/samples/client/petstore/kotlin-jackson/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/kotlin-jackson/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-jackson/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-json-request-string/.openapi-generator/VERSION b/samples/client/petstore/kotlin-json-request-string/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/kotlin-json-request-string/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-json-request-string/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/VERSION b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-volley/.openapi-generator/VERSION b/samples/client/petstore/kotlin-jvm-volley/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/kotlin-jvm-volley/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-jvm-volley/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/VERSION b/samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION b/samples/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nonpublic/.openapi-generator/VERSION b/samples/client/petstore/kotlin-nonpublic/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/kotlin-nonpublic/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-nonpublic/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nullable/.openapi-generator/VERSION b/samples/client/petstore/kotlin-nullable/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/kotlin-nullable/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-nullable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-okhttp3/.openapi-generator/VERSION b/samples/client/petstore/kotlin-okhttp3/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/kotlin-okhttp3/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-okhttp3/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/VERSION b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/.openapi-generator/VERSION b/samples/client/petstore/kotlin-retrofit2-rx3/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-retrofit2-rx3/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-retrofit2/.openapi-generator/VERSION b/samples/client/petstore/kotlin-retrofit2/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/kotlin-retrofit2/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-retrofit2/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-string/.openapi-generator/VERSION b/samples/client/petstore/kotlin-string/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/kotlin-string/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-string/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION b/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ 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 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/kotlin/.openapi-generator/VERSION b/samples/client/petstore/kotlin/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/kotlin/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/lua/.openapi-generator/VERSION b/samples/client/petstore/lua/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/lua/.openapi-generator/VERSION +++ b/samples/client/petstore/lua/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/nim/.openapi-generator/VERSION b/samples/client/petstore/nim/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/nim/.openapi-generator/VERSION +++ b/samples/client/petstore/nim/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/objc/core-data/.openapi-generator/VERSION b/samples/client/petstore/objc/core-data/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/objc/core-data/.openapi-generator/VERSION +++ b/samples/client/petstore/objc/core-data/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/objc/default/.openapi-generator/VERSION b/samples/client/petstore/objc/default/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/objc/default/.openapi-generator/VERSION +++ b/samples/client/petstore/objc/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/perl/.openapi-generator/VERSION b/samples/client/petstore/perl/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/perl/.openapi-generator/VERSION +++ b/samples/client/petstore/perl/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/php-dt-modern/.openapi-generator/VERSION b/samples/client/petstore/php-dt-modern/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/php-dt-modern/.openapi-generator/VERSION +++ b/samples/client/petstore/php-dt-modern/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/php-dt/.openapi-generator/VERSION b/samples/client/petstore/php-dt/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/php-dt/.openapi-generator/VERSION +++ b/samples/client/petstore/php-dt/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION b/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION +++ b/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php index 1848ea60872b..ef0239cf3c6f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php index 98450dfdce6e..c46d14ceacba 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php index b284bfc1da2f..18321834a0c7 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php index 5b01b4788695..2de6960003e1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php index 0ce7655f68f6..affa3d61c5e2 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php index b4084ea0f811..8af7471eba24 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php index f4137f4061ea..941de5bc5584 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php index 9793625ce059..2011d70101b7 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php index 15c87c883382..8bd9fbe0f277 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php b/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php index 65c30b801462..08598d5d89d3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php index cf51246752f6..34faf425f954 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php index 4730a780c9ef..281c00ce1def 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php index 94cd6c008106..0e98f27fd82a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php index 9ac0724679fc..1699097ee941 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php index b6a77632ddd2..484d6d85db97 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php index 98656789cc6e..b273d72aadf4 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php index 80457e8befd8..b27ff3277a2d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php index 1ab9ae895219..7ec56fb28fc4 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php index 1f5442b74647..86c145ba23e2 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php index 675ec09537f5..77cf9d7491b3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php index 061c4bbf2dce..a10395aeb5af 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php index 5a12e03f5370..9003d71c55d2 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DeprecatedObject.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DeprecatedObject.php index ce4a50797b07..709840cf55ac 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DeprecatedObject.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DeprecatedObject.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php index a8913e4d4667..7019bc247b9b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php index 31c569fbffc9..340c9b62d46a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php index b075f037ce29..7087c06f4b9d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php index ca5795be26e4..95e659d81c77 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php index bd4ba37593dd..a9b77449fb42 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php index 18598a117d26..dab541a365c1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php index 84ac5deed603..182bba9d0f4b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php index cc6eec6f37fe..0350c9b702c0 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php index 229691e3f9c1..ad12cf397cb5 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php index de6d9b2a1b72..63d53152ed29 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php index 91effaad0c5c..1584ce6e4c9f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php index d9c20bad20c8..6c2cddeab137 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php index d74dbb7187e4..aab4ab77d620 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php index 2c74ff0afd0d..12d73135f2e3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php index b5d6024b0ddd..95c238707cd6 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php index 50af9985b46e..9cc0c37d2394 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php index c0148a3c9508..c6f2fa418f7b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php index f70e22035767..136db271d338 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php index 2c6dd888ee42..e99ec229be3e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php index ef6e0c99af1e..536d505ead35 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php index 4038d4bdd8d7..d178264a41a9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ObjectWithDeprecatedFields.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ObjectWithDeprecatedFields.php index a9ee861174a8..7fecb8280381 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ObjectWithDeprecatedFields.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ObjectWithDeprecatedFields.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php index 8e0bfd035fa4..8ce7262cbab3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php index 0161dcb53591..fe187afea216 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php index 848fe8c710f9..507b3082ef56 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php index 38cc912fa773..b6dd12bb8b9f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php index acdb884a648e..f250dc8a6aa6 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php index bec3672715ec..955c64ce9aac 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterObjectWithEnumProperty.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterObjectWithEnumProperty.php index 1f18ed694a5c..dd50c70fc3d8 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterObjectWithEnumProperty.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterObjectWithEnumProperty.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php index 5ed7cf384834..6b9279481c05 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php index 0b9f551c97ef..c5a4506ed4a8 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php index 027cefe7b336..f024c4ed581f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php index 0d66323a9b96..1e28a4712f6b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php index ae5d4c147c42..ca9f08769f17 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php index cf8277464437..b91eafd90796 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/powershell/.openapi-generator/VERSION b/samples/client/petstore/powershell/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/powershell/.openapi-generator/VERSION +++ b/samples/client/petstore/powershell/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/python-asyncio/.openapi-generator/VERSION b/samples/client/petstore/python-asyncio/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/python-asyncio/.openapi-generator/VERSION +++ b/samples/client/petstore/python-asyncio/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/python-legacy/.openapi-generator/VERSION b/samples/client/petstore/python-legacy/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/python-legacy/.openapi-generator/VERSION +++ b/samples/client/petstore/python-legacy/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/python-tornado/.openapi-generator/VERSION b/samples/client/petstore/python-tornado/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/python-tornado/.openapi-generator/VERSION +++ b/samples/client/petstore/python-tornado/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/python/.openapi-generator/VERSION b/samples/client/petstore/python/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/python/.openapi-generator/VERSION +++ b/samples/client/petstore/python/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/VERSION b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/VERSION +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION b/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION +++ b/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/ruby-faraday/lib/petstore.rb b/samples/client/petstore/ruby-faraday/lib/petstore.rb index 52888e58a27c..2995b750e7aa 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb index 4bf4193b4eae..df802567c94c 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb index e3a7cd310337..6d11d8773a60 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end 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 ee52929a2479..20d12b5c1fed 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 @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb index 65485cff858b..d00a18a1bf67 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb index e0793d51f0fe..08f18cd4f107 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb index deac217effc7..7c9e0fde7aac 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb index e78912f6ec6f..9687de3f3838 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb index f6ad5e2c7a31..568dd909fdd4 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb index becfa19ff983..a200afcf0a05 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb index d7b5555cf838..b528aef09d7e 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb index 7531ca63698c..01f6b001eaf3 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb index aa12eb3d75d7..1025187c82be 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb index 696db1a23df2..1049822b7fcc 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb index 638f600b4184..57c603716d6b 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb index b317724cf128..6668a18e9323 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb index 882a63aba31f..95cfe89d1692 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb index 438e60cb08dc..db3fd786857e 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb index 23ffc61d744b..61114303c8ab 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb index 6edbd10d0d59..33cb299c2935 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb index 74b270bb2fb8..447b1573bf86 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb index f86d40e3a30c..d5c9fef37be3 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb index 6ec58e16cee5..3314bca5ed1d 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/deprecated_object.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/deprecated_object.rb index a03e3768569f..b72cd21b9352 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/deprecated_object.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/deprecated_object.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb index f0e5b085052a..40987f214ef5 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb index 4c6bf35e7f75..e5c68f798346 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb index 5ef024fa4a2e..96dfcb24d71b 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb index 597f28b713ad..f722acfc1d8e 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb index abbbd53eb472..aedf6b2c7ee1 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb index 87a2e68dac9d..f5ae1fed192e 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb index 7a8b6dbbac33..542d991d5a44 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/foo.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/foo.rb index 4b78a1a4e0b5..ac18fe7beea2 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/foo.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/foo.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb index 150c9c5fd4ea..4410e00a4795 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb index b45c4c559f93..9f51cfada96e 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb index f571546880ae..07be52509fcb 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb index 81cd539687c0..5fc7450bdf47 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb index 7f7b06af8107..a81fe7e5fde8 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb index 81d45842d317..24e2b85e7204 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb index f4f82d05a24f..73e2781755c0 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb index 250270b108d0..91ccd158a13c 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb index c6415f59a10e..d71c1f1bd93c 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb index f30bc7d491d4..86b93dd8b216 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb index ceaba02c50f4..a41b1ddc084e 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb index 90ec47bc8d7e..ecd5e5b84192 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/object_with_deprecated_fields.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/object_with_deprecated_fields.rb index 685e67faf247..25e3b018e287 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/object_with_deprecated_fields.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/object_with_deprecated_fields.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb index 3302c7a6ae74..e2cdc7dce110 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb index 7fbf354561e1..0b9b36ea64e5 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb index 22fb7e25e290..b2b647d26d5d 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb index 7c6e440a2a4d..55244dcbcfc1 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb index ac32309217e1..59419e67fd02 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb index 88edbfe29494..6807c7de36fd 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_object_with_enum_property.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_object_with_enum_property.rb index e4c1bf4cace4..4b467b3de03f 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_object_with_enum_property.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_object_with_enum_property.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb index 35d3a97a5306..410fa168bff7 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb index 8c67c2007cbb..6f4a5fbd5d2d 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb index f839bdefc132..bad3c1d542cc 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb index 70f887236d1f..166611902eb1 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb index 6d96a7f032a6..30e9406bf76b 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/version.rb b/samples/client/petstore/ruby-faraday/lib/petstore/version.rb index 536c6915652e..6126a809aaaf 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/version.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/petstore.gemspec b/samples/client/petstore/ruby-faraday/petstore.gemspec index 6afb0812dbba..b64d60e74118 100644 --- a/samples/client/petstore/ruby-faraday/petstore.gemspec +++ b/samples/client/petstore/ruby-faraday/petstore.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/spec/api_client_spec.rb b/samples/client/petstore/ruby-faraday/spec/api_client_spec.rb index ab6921a450cf..99b44ba5730a 100644 --- a/samples/client/petstore/ruby-faraday/spec/api_client_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/api_client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/spec/configuration_spec.rb b/samples/client/petstore/ruby-faraday/spec/configuration_spec.rb index 449c41414396..9a36ef93379f 100644 --- a/samples/client/petstore/ruby-faraday/spec/configuration_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/spec/spec_helper.rb b/samples/client/petstore/ruby-faraday/spec/spec_helper.rb index 223647452af5..389cc910f06f 100644 --- a/samples/client/petstore/ruby-faraday/spec/spec_helper.rb +++ b/samples/client/petstore/ruby-faraday/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/.openapi-generator/VERSION b/samples/client/petstore/ruby/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/ruby/.openapi-generator/VERSION +++ b/samples/client/petstore/ruby/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/ruby/lib/petstore.rb b/samples/client/petstore/ruby/lib/petstore.rb index 52888e58a27c..2995b750e7aa 100644 --- a/samples/client/petstore/ruby/lib/petstore.rb +++ b/samples/client/petstore/ruby/lib/petstore.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb b/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb index 4bf4193b4eae..df802567c94c 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/default_api.rb b/samples/client/petstore/ruby/lib/petstore/api/default_api.rb index e3a7cd310337..6d11d8773a60 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/default_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/default_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end 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 ee52929a2479..20d12b5c1fed 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb b/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb index 65485cff858b..d00a18a1bf67 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb index 0fd7e3cf7f93..9d828b5f6d9e 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb index 74b571373fd3..50be6c0e1503 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/user_api.rb b/samples/client/petstore/ruby/lib/petstore/api/user_api.rb index b2acdb131860..fd7106e35983 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/user_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/user_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/api_client.rb b/samples/client/petstore/ruby/lib/petstore/api_client.rb index 7e6dff7d6b9c..8ab8f8520ca6 100644 --- a/samples/client/petstore/ruby/lib/petstore/api_client.rb +++ b/samples/client/petstore/ruby/lib/petstore/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/api_error.rb b/samples/client/petstore/ruby/lib/petstore/api_error.rb index becfa19ff983..a200afcf0a05 100644 --- a/samples/client/petstore/ruby/lib/petstore/api_error.rb +++ b/samples/client/petstore/ruby/lib/petstore/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/configuration.rb b/samples/client/petstore/ruby/lib/petstore/configuration.rb index a0453d029264..4ee7fe94f349 100644 --- a/samples/client/petstore/ruby/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby/lib/petstore/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb index 7531ca63698c..01f6b001eaf3 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/animal.rb b/samples/client/petstore/ruby/lib/petstore/models/animal.rb index aa12eb3d75d7..1025187c82be 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/animal.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/animal.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/api_response.rb b/samples/client/petstore/ruby/lib/petstore/models/api_response.rb index 696db1a23df2..1049822b7fcc 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/api_response.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/api_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb index 638f600b4184..57c603716d6b 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb index b317724cf128..6668a18e9323 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_test.rb b/samples/client/petstore/ruby/lib/petstore/models/array_test.rb index 882a63aba31f..95cfe89d1692 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb b/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb index 438e60cb08dc..db3fd786857e 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/cat.rb b/samples/client/petstore/ruby/lib/petstore/models/cat.rb index 23ffc61d744b..61114303c8ab 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/cat.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/cat.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb b/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb index 6edbd10d0d59..33cb299c2935 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/category.rb b/samples/client/petstore/ruby/lib/petstore/models/category.rb index 74b270bb2fb8..447b1573bf86 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/category.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/category.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/class_model.rb b/samples/client/petstore/ruby/lib/petstore/models/class_model.rb index f86d40e3a30c..d5c9fef37be3 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/class_model.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/class_model.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/client.rb b/samples/client/petstore/ruby/lib/petstore/models/client.rb index 6ec58e16cee5..3314bca5ed1d 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/client.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/deprecated_object.rb b/samples/client/petstore/ruby/lib/petstore/models/deprecated_object.rb index a03e3768569f..b72cd21b9352 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/deprecated_object.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/deprecated_object.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/dog.rb b/samples/client/petstore/ruby/lib/petstore/models/dog.rb index f0e5b085052a..40987f214ef5 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/dog.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/dog.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb b/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb index 4c6bf35e7f75..e5c68f798346 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb index 5ef024fa4a2e..96dfcb24d71b 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb index 597f28b713ad..f722acfc1d8e 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb index abbbd53eb472..aedf6b2c7ee1 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/file.rb b/samples/client/petstore/ruby/lib/petstore/models/file.rb index 87a2e68dac9d..f5ae1fed192e 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/file.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/file.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb b/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb index 7a8b6dbbac33..542d991d5a44 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/foo.rb b/samples/client/petstore/ruby/lib/petstore/models/foo.rb index 4b78a1a4e0b5..ac18fe7beea2 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/foo.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/foo.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb index 150c9c5fd4ea..4410e00a4795 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb b/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb index b45c4c559f93..9f51cfada96e 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/health_check_result.rb b/samples/client/petstore/ruby/lib/petstore/models/health_check_result.rb index f571546880ae..07be52509fcb 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/health_check_result.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/health_check_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/inline_response_default.rb b/samples/client/petstore/ruby/lib/petstore/models/inline_response_default.rb index 81cd539687c0..5fc7450bdf47 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/inline_response_default.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/inline_response_default.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/list.rb b/samples/client/petstore/ruby/lib/petstore/models/list.rb index 7f7b06af8107..a81fe7e5fde8 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/list.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/map_test.rb b/samples/client/petstore/ruby/lib/petstore/models/map_test.rb index 81d45842d317..24e2b85e7204 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/map_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/map_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb index f4f82d05a24f..73e2781755c0 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb b/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb index 250270b108d0..91ccd158a13c 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/model_return.rb b/samples/client/petstore/ruby/lib/petstore/models/model_return.rb index c6415f59a10e..d71c1f1bd93c 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/model_return.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/model_return.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/name.rb b/samples/client/petstore/ruby/lib/petstore/models/name.rb index f30bc7d491d4..86b93dd8b216 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/name.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/name.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/nullable_class.rb b/samples/client/petstore/ruby/lib/petstore/models/nullable_class.rb index ceaba02c50f4..a41b1ddc084e 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/nullable_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/nullable_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/number_only.rb index 90ec47bc8d7e..ecd5e5b84192 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/object_with_deprecated_fields.rb b/samples/client/petstore/ruby/lib/petstore/models/object_with_deprecated_fields.rb index 685e67faf247..25e3b018e287 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/object_with_deprecated_fields.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/object_with_deprecated_fields.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/order.rb b/samples/client/petstore/ruby/lib/petstore/models/order.rb index 3302c7a6ae74..e2cdc7dce110 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/order.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/order.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb index 7fbf354561e1..0b9b36ea64e5 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb index 22fb7e25e290..b2b647d26d5d 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb index 7c6e440a2a4d..55244dcbcfc1 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb index ac32309217e1..59419e67fd02 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb index 88edbfe29494..6807c7de36fd 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_object_with_enum_property.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_object_with_enum_property.rb index e4c1bf4cace4..4b467b3de03f 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_object_with_enum_property.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_object_with_enum_property.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/pet.rb b/samples/client/petstore/ruby/lib/petstore/models/pet.rb index 35d3a97a5306..410fa168bff7 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/pet.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/pet.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb b/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb index 8c67c2007cbb..6f4a5fbd5d2d 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb b/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb index f839bdefc132..bad3c1d542cc 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/tag.rb b/samples/client/petstore/ruby/lib/petstore/models/tag.rb index 70f887236d1f..166611902eb1 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/tag.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/tag.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/user.rb b/samples/client/petstore/ruby/lib/petstore/models/user.rb index 6d96a7f032a6..30e9406bf76b 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/user.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/user.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/version.rb b/samples/client/petstore/ruby/lib/petstore/version.rb index 536c6915652e..6126a809aaaf 100644 --- a/samples/client/petstore/ruby/lib/petstore/version.rb +++ b/samples/client/petstore/ruby/lib/petstore/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/petstore.gemspec b/samples/client/petstore/ruby/petstore.gemspec index fb9853b2f605..846cb3e9f93f 100644 --- a/samples/client/petstore/ruby/petstore.gemspec +++ b/samples/client/petstore/ruby/petstore.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/spec/api_client_spec.rb b/samples/client/petstore/ruby/spec/api_client_spec.rb index 8f608b72b491..04d9cc79cd48 100644 --- a/samples/client/petstore/ruby/spec/api_client_spec.rb +++ b/samples/client/petstore/ruby/spec/api_client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/spec/configuration_spec.rb b/samples/client/petstore/ruby/spec/configuration_spec.rb index 449c41414396..9a36ef93379f 100644 --- a/samples/client/petstore/ruby/spec/configuration_spec.rb +++ b/samples/client/petstore/ruby/spec/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/spec/spec_helper.rb b/samples/client/petstore/ruby/spec/spec_helper.rb index 223647452af5..389cc910f06f 100644 --- a/samples/client/petstore/ruby/spec/spec_helper.rb +++ b/samples/client/petstore/ruby/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/rust/hyper/petstore/.openapi-generator/VERSION b/samples/client/petstore/rust/hyper/petstore/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/rust/hyper/petstore/.openapi-generator/VERSION +++ b/samples/client/petstore/rust/hyper/petstore/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/VERSION b/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/VERSION +++ b/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ 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 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/VERSION +++ b/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/scala-akka/.openapi-generator/VERSION b/samples/client/petstore/scala-akka/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/scala-akka/.openapi-generator/VERSION +++ b/samples/client/petstore/scala-akka/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/scala-httpclient-deprecated/.openapi-generator/VERSION b/samples/client/petstore/scala-httpclient-deprecated/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/scala-httpclient-deprecated/.openapi-generator/VERSION +++ b/samples/client/petstore/scala-httpclient-deprecated/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/scala-sttp/.openapi-generator/VERSION b/samples/client/petstore/scala-sttp/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/scala-sttp/.openapi-generator/VERSION +++ b/samples/client/petstore/scala-sttp/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION b/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java index 60fe14bc55c0..b87ed4065e34 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java index 0fb9fb455de2..e6e78df20524 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java index f02a6902a51c..efcfdfa6bd97 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud-spring-pageable/.openapi-generator/VERSION b/samples/client/petstore/spring-cloud-spring-pageable/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-cloud-spring-pageable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java index 909fe7073e9a..785314b56f91 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java index 6a61280117f1..28845958d64a 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index ec264eb0d0b7..9105efb7a327 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud/.openapi-generator/VERSION b/samples/client/petstore/spring-cloud/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/spring-cloud/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-cloud/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java index d98b4e1441f9..0719fcf872b5 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java index a09c72d480b3..51d842c795c9 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java index 5fa9e20f90dd..44d9bbf440e9 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-stubs/.openapi-generator/VERSION b/samples/client/petstore/spring-stubs/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/spring-stubs/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-stubs/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java index 9da30d1e34f4..551fccda4f31 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java index d7a7d1303b1a..31712e7b2c17 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java index 006c4fd5ef43..8b76ca575368 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/swift5/alamofireLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/alamofireLibrary/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/alamofireLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/asyncAwaitLibrary/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/swift5/combineLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/combineLibrary/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/swift5/combineLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/combineLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/swift5/default/.openapi-generator/VERSION b/samples/client/petstore/swift5/default/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/swift5/default/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/swift5/deprecated/.openapi-generator/VERSION b/samples/client/petstore/swift5/deprecated/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/swift5/deprecated/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/deprecated/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/swift5/frozenEnums/.openapi-generator/VERSION b/samples/client/petstore/swift5/frozenEnums/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/swift5/frozenEnums/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/frozenEnums/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/swift5/nonPublicApi/.openapi-generator/VERSION b/samples/client/petstore/swift5/nonPublicApi/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/swift5/nonPublicApi/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/nonPublicApi/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/swift5/objcCompatible/.openapi-generator/VERSION b/samples/client/petstore/swift5/objcCompatible/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/swift5/objcCompatible/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/objcCompatible/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/swift5/oneOf/.openapi-generator/VERSION b/samples/client/petstore/swift5/oneOf/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/swift5/oneOf/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/oneOf/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/swift5/promisekitLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/promisekitLibrary/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/promisekitLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/swift5/readonlyProperties/.openapi-generator/VERSION b/samples/client/petstore/swift5/readonlyProperties/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/swift5/readonlyProperties/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/readonlyProperties/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/swift5/resultLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/resultLibrary/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/swift5/resultLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/resultLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/swift5/rxswiftLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/rxswiftLibrary/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/rxswiftLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/swift5/urlsessionLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/urlsessionLibrary/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/urlsessionLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/swift5/vaporLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/vaporLibrary/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/swift5/vaporLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/vaporLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/swift5/x-swift-hashable/.openapi-generator/VERSION b/samples/client/petstore/swift5/x-swift-hashable/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/x-swift-hashable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/composed-schemas/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/composed-schemas/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-axios/builds/composed-schemas/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/composed-schemas/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/test-petstore/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/test-petstore/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-axios/builds/test-petstore/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/test-petstore/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/enum/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/enum/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-fetch/builds/enum/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/enum/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION b/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-node/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-node/default/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-node/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-node/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-node/npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-node/npm/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-node/npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-node/npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-redux-query/builds/with-npm-version/.openapi-generator/VERSION b/samples/client/petstore/typescript-redux-query/builds/with-npm-version/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-redux-query/builds/with-npm-version/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-redux-query/builds/with-npm-version/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/VERSION b/samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/VERSION b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/.openapi-generator/VERSION b/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION b/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION +++ b/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/meta-codegen/lib/pom.xml b/samples/meta-codegen/lib/pom.xml index b58e80a5b28f..9587ea668d32 100644 --- a/samples/meta-codegen/lib/pom.xml +++ b/samples/meta-codegen/lib/pom.xml @@ -121,7 +121,7 @@ UTF-8 - 5.3.1-SNAPSHOT + 5.3.1 1.0.0 4.13.2 diff --git a/samples/meta-codegen/usage/.openapi-generator/VERSION b/samples/meta-codegen/usage/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/meta-codegen/usage/.openapi-generator/VERSION +++ b/samples/meta-codegen/usage/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/elm/.openapi-generator/VERSION b/samples/openapi3/client/elm/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/openapi3/client/elm/.openapi-generator/VERSION +++ b/samples/openapi3/client/elm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/.openapi-generator/VERSION b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/.openapi-generator/VERSION +++ b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.openapi-generator/VERSION b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.openapi-generator/VERSION +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/.openapi-generator/VERSION b/samples/openapi3/client/extensions/x-auth-id-alias/python/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python/.openapi-generator/VERSION +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/.openapi-generator/VERSION b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/.openapi-generator/VERSION +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias.rb index 38bf40026771..b0324ac0bf92 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api/usage_api.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api/usage_api.rb index 84e3bdc6885f..fa2549ca25f1 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api/usage_api.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api/usage_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_client.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_client.rb index f7fda51a469f..acd170f6b6e9 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_client.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_error.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_error.rb index 43558c0a8d1b..1d9d6b85c51a 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_error.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/configuration.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/configuration.rb index dbf8adc10ef7..2c2d6ed5e187 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/configuration.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/version.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/version.rb index be49fe115f5d..92236c87116d 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/version.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/api_client_spec.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/api_client_spec.rb index 97f9b2e8329d..d4b35523b206 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/api_client_spec.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/api_client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/configuration_spec.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/configuration_spec.rb index 2f9a61462725..39ae82521650 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/configuration_spec.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/spec_helper.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/spec_helper.rb index 8704daa39c3d..0a68b8922b00 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/spec_helper.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/x_auth_id_alias.gemspec b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/x_auth_id_alias.gemspec index 429b960dcfb9..29085fa88f1a 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/x_auth_id_alias.gemspec +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/x_auth_id_alias.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/dynamic-servers/python/.openapi-generator/VERSION b/samples/openapi3/client/features/dynamic-servers/python/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/.openapi-generator/VERSION +++ b/samples/openapi3/client/features/dynamic-servers/python/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/.openapi-generator/VERSION b/samples/openapi3/client/features/dynamic-servers/ruby/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/.openapi-generator/VERSION +++ b/samples/openapi3/client/features/dynamic-servers/ruby/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/dynamic_servers.gemspec b/samples/openapi3/client/features/dynamic-servers/ruby/dynamic_servers.gemspec index ec29bbb2de3b..c5fb037a7f6e 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/dynamic_servers.gemspec +++ b/samples/openapi3/client/features/dynamic-servers/ruby/dynamic_servers.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers.rb b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers.rb index dd38bdd94123..a70acea01140 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api/usage_api.rb b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api/usage_api.rb index 000b259b380e..d4efa7f35130 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api/usage_api.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api/usage_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_client.rb b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_client.rb index 6b94cfc24e18..fc7597e64fe9 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_client.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_error.rb b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_error.rb index ed00fd5969b0..9d73ce3ffaad 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_error.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/configuration.rb b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/configuration.rb index e90670e8320f..f5b389637ff1 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/configuration.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/version.rb b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/version.rb index 654718614808..1e07b74b1fdf 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/version.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/spec/api_client_spec.rb b/samples/openapi3/client/features/dynamic-servers/ruby/spec/api_client_spec.rb index 77a88330a2a0..8bc1b5c8867b 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/spec/api_client_spec.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/spec/api_client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/spec/configuration_spec.rb b/samples/openapi3/client/features/dynamic-servers/ruby/spec/configuration_spec.rb index 549db52d5c74..84a6ac09401c 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/spec/configuration_spec.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/spec/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/spec/spec_helper.rb b/samples/openapi3/client/features/dynamic-servers/ruby/spec/spec_helper.rb index f8ebbcdb98da..f16601469053 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/spec/spec_helper.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/.openapi-generator/VERSION b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/.openapi-generator/VERSION +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore.rb index 40a130506ad5..ac8f867d98d0 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api/usage_api.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api/usage_api.rb index a126916ccbb0..f5a2172c5758 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api/usage_api.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api/usage_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_client.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_client.rb index 92fe897c6968..c09f3588044e 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_client.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_error.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_error.rb index 7e837120aaa4..110ca5de7bfc 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_error.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/configuration.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/configuration.rb index 5090bcfcb924..69251a11d237 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/configuration.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/array_alias.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/array_alias.rb index 580b8c5bd2ab..2550c985ef78 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/array_alias.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/array_alias.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/map_alias.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/map_alias.rb index 446dd162dde3..45f5b3532a7d 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/map_alias.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/map_alias.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/version.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/version.rb index f570789af128..c803b873a033 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/version.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/petstore.gemspec b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/petstore.gemspec index 93f6b8bcd434..09ab2855fb4c 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/petstore.gemspec +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/petstore.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/api_client_spec.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/api_client_spec.rb index f03fbe5455e3..45a8bfe213fa 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/api_client_spec.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/api_client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/configuration_spec.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/configuration_spec.rb index a56c37c158ee..dcc206c5189e 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/configuration_spec.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/spec_helper.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/spec_helper.rb index 2af20efde2f0..64a0a2bc8b0e 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/spec_helper.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart2/petstore_client_lib/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/VERSION b/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator/VERSION b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/VERSION b/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-legacy/.openapi-generator/VERSION b/samples/openapi3/client/petstore/python-legacy/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100755 --- a/samples/openapi3/client/petstore/python-legacy/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/python-legacy/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/.openapi-generator/VERSION b/samples/openapi3/client/petstore/python/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/openapi3/client/petstore/python/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/python/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/.openapi-generator/VERSION b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/petstore/typescript/builds/default/.openapi-generator/VERSION b/samples/openapi3/client/petstore/typescript/builds/default/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/typescript/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/.openapi-generator/VERSION b/samples/openapi3/client/petstore/typescript/builds/deno/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/typescript/builds/deno/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/.openapi-generator/VERSION b/samples/openapi3/client/petstore/typescript/builds/inversify/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/.openapi-generator/VERSION b/samples/openapi3/client/petstore/typescript/builds/jquery/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/.openapi-generator/VERSION b/samples/openapi3/client/petstore/typescript/builds/object_params/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/schema/petstore/ktorm/.openapi-generator/VERSION b/samples/schema/petstore/ktorm/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/schema/petstore/ktorm/.openapi-generator/VERSION +++ b/samples/schema/petstore/ktorm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/schema/petstore/mysql/.openapi-generator/VERSION b/samples/schema/petstore/mysql/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/schema/petstore/mysql/.openapi-generator/VERSION +++ b/samples/schema/petstore/mysql/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/schema/petstore/wsdl-schema/.openapi-generator/VERSION b/samples/schema/petstore/wsdl-schema/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/schema/petstore/wsdl-schema/.openapi-generator/VERSION +++ b/samples/schema/petstore/wsdl-schema/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-3.0/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore-3.0/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/aspnetcore-3.0/.openapi-generator/VERSION +++ b/samples/server/petstore/aspnetcore-3.0/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-3.1/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore-3.1/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/aspnetcore-3.1/.openapi-generator/VERSION +++ b/samples/server/petstore/aspnetcore-3.1/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-5.0/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore-5.0/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/aspnetcore-5.0/.openapi-generator/VERSION +++ b/samples/server/petstore/aspnetcore-5.0/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/aspnetcore/.openapi-generator/VERSION +++ b/samples/server/petstore/aspnetcore/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION b/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION +++ b/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/cpp-qt-qhttpengine-server/.openapi-generator/VERSION b/samples/server/petstore/cpp-qt-qhttpengine-server/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/cpp-qt-qhttpengine-server/.openapi-generator/VERSION +++ b/samples/server/petstore/cpp-qt-qhttpengine-server/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/erlang-server/.openapi-generator/VERSION b/samples/server/petstore/erlang-server/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/erlang-server/.openapi-generator/VERSION +++ b/samples/server/petstore/erlang-server/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/go-api-server/.openapi-generator/VERSION b/samples/server/petstore/go-api-server/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/go-api-server/.openapi-generator/VERSION +++ b/samples/server/petstore/go-api-server/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/go-chi-server/.openapi-generator/VERSION b/samples/server/petstore/go-chi-server/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/go-chi-server/.openapi-generator/VERSION +++ b/samples/server/petstore/go-chi-server/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/go-echo-server/.openapi-generator/VERSION b/samples/server/petstore/go-echo-server/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/go-echo-server/.openapi-generator/VERSION +++ b/samples/server/petstore/go-echo-server/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/go-gin-api-server/.openapi-generator/VERSION b/samples/server/petstore/go-gin-api-server/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/go-gin-api-server/.openapi-generator/VERSION +++ b/samples/server/petstore/go-gin-api-server/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/go-server-required/.openapi-generator/VERSION b/samples/server/petstore/go-server-required/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/go-server-required/.openapi-generator/VERSION +++ b/samples/server/petstore/go-server-required/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ 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 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/haskell-servant/.openapi-generator/VERSION +++ b/samples/server/petstore/haskell-servant/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/haskell-yesod/.openapi-generator/VERSION b/samples/server/petstore/haskell-yesod/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/haskell-yesod/.openapi-generator/VERSION +++ b/samples/server/petstore/haskell-yesod/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/java-msf4j/.openapi-generator/VERSION b/samples/server/petstore/java-msf4j/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/java-msf4j/.openapi-generator/VERSION +++ b/samples/server/petstore/java-msf4j/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-nullable/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-nullable/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/java-play-framework-no-nullable/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-nullable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/java-play-framework/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/java-undertow/.openapi-generator/VERSION b/samples/server/petstore/java-undertow/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/java-undertow/.openapi-generator/VERSION +++ b/samples/server/petstore/java-undertow/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/java-vertx-web/.openapi-generator/VERSION b/samples/server/petstore/java-vertx-web/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/java-vertx-web/.openapi-generator/VERSION +++ b/samples/server/petstore/java-vertx-web/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-cdi-default-value/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-cdi-default-value/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi-default-value/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-cdi-default-value/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/default-value/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/default-value/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/jaxrs-resteasy/default-value/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/default-value/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/java8/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/java8/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/jaxrs-resteasy/java8/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/java8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION b/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/kotlin-server/ktor/README.md b/samples/server/petstore/kotlin-server/ktor/README.md index 6ec361da3cd4..e47cdeb550ce 100644 --- a/samples/server/petstore/kotlin-server/ktor/README.md +++ b/samples/server/petstore/kotlin-server/ktor/README.md @@ -2,7 +2,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -Generated by OpenAPI Generator 5.3.1-SNAPSHOT. +Generated by OpenAPI Generator 5.3.1. ## Requires diff --git a/samples/server/petstore/kotlin-springboot-delegate/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot-delegate/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-springboot-delegate/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt index fd4f3edbda71..bedd82ad84e9 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt index 238dc18931b2..8ce2645e4d61 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt index 54a68054495e..bb608e5c66d8 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/kotlin-springboot/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/kotlin-springboot/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-springboot/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION b/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/php-laravel/.openapi-generator/VERSION b/samples/server/petstore/php-laravel/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/php-laravel/.openapi-generator/VERSION +++ b/samples/server/petstore/php-laravel/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/php-lumen/.openapi-generator/VERSION b/samples/server/petstore/php-lumen/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/php-lumen/.openapi-generator/VERSION +++ b/samples/server/petstore/php-lumen/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/php-mezzio-ph-modern/.openapi-generator/VERSION b/samples/server/petstore/php-mezzio-ph-modern/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/php-mezzio-ph-modern/.openapi-generator/VERSION +++ b/samples/server/petstore/php-mezzio-ph-modern/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/php-mezzio-ph/.openapi-generator/VERSION b/samples/server/petstore/php-mezzio-ph/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/php-mezzio-ph/.openapi-generator/VERSION +++ b/samples/server/petstore/php-mezzio-ph/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/php-slim4/.openapi-generator/VERSION b/samples/server/petstore/php-slim4/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/php-slim4/.openapi-generator/VERSION +++ b/samples/server/petstore/php-slim4/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION b/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/python-aiohttp-srclayout/.openapi-generator/VERSION b/samples/server/petstore/python-aiohttp-srclayout/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/python-aiohttp-srclayout/.openapi-generator/VERSION +++ b/samples/server/petstore/python-aiohttp-srclayout/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/python-aiohttp/.openapi-generator/VERSION b/samples/server/petstore/python-aiohttp/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/python-aiohttp/.openapi-generator/VERSION +++ b/samples/server/petstore/python-aiohttp/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/python-blueplanet/.openapi-generator/VERSION b/samples/server/petstore/python-blueplanet/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/python-blueplanet/.openapi-generator/VERSION +++ b/samples/server/petstore/python-blueplanet/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/python-fastapi/.openapi-generator/VERSION b/samples/server/petstore/python-fastapi/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/python-fastapi/.openapi-generator/VERSION +++ b/samples/server/petstore/python-fastapi/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/python-flask/.openapi-generator/VERSION b/samples/server/petstore/python-flask/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/python-flask/.openapi-generator/VERSION +++ b/samples/server/petstore/python-flask/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/no-example-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/no-example-v3/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/rust-server/output/no-example-v3/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/no-example-v3/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/ping-bearer-auth/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/ping-bearer-auth/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/rust-server/output/ping-bearer-auth/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/ping-bearer-auth/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-default-value/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-default-value/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/spring-mvc-default-value/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc-default-value/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java index 032377d53cc2..11418534677f 100644 --- a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java +++ b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApi.java b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApi.java index 780e8818072e..81423f590bde 100644 --- a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApi.java +++ b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java index 204d18334cce..9013faa9cb7a 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java index 8bbb762545f3..1d0035e021dd 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index a899c1e2ac7c..557a43e1d436 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java index b4e11c47fc26..161749430ff9 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java index 6fd0038424ab..d9c5e3c16e8e 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java index ce495a26f875..a2065f673a2f 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java index ba1b869f0363..57e6c1d10672 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java index 4fd628eb9a27..ba64ef318812 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 71ce0007da65..8b45339424f3 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java index b0e4e2c2dc2e..693ce02c51e9 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java index 22b5b7670284..d3a44c4e9c67 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java index 0a1551959741..598ae5ad88c3 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-no-nullable/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc-no-nullable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java index ba1b869f0363..57e6c1d10672 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java index c22b8c03f8fe..dfa1803e162d 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 71ce0007da65..8b45339424f3 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApi.java index b0e4e2c2dc2e..693ce02c51e9 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApi.java index 22b5b7670284..d3a44c4e9c67 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java index fabb81f5f1a8..743aa88a6d29 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java index ba1b869f0363..57e6c1d10672 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java index a56d13721e16..b494e974feba 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 71ce0007da65..8b45339424f3 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApi.java index f07fa4a7edff..d15f313c4c9e 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java index 22b5b7670284..d3a44c4e9c67 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index fabb81f5f1a8..743aa88a6d29 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/spring-mvc/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java index ba1b869f0363..57e6c1d10672 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java index c22b8c03f8fe..dfa1803e162d 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 71ce0007da65..8b45339424f3 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java index b0e4e2c2dc2e..693ce02c51e9 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java index 22b5b7670284..d3a44c4e9c67 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java index fabb81f5f1a8..743aa88a6d29 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/VERSION b/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java index e6d35a4c351e..151aa6dc81dd 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java index 8ba25d828cb5..0c19151a979c 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index f1102a0f069e..7f524d7af4ad 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java index 9033b9ba3087..21a559470bae 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java index 29a3d124c55c..25b01491b507 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java index 517f2743d2aa..4cbe795d92ad 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java index ba1b869f0363..57e6c1d10672 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java index c22b8c03f8fe..dfa1803e162d 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 71ce0007da65..8b45339424f3 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java index b0e4e2c2dc2e..693ce02c51e9 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java index 22b5b7670284..d3a44c4e9c67 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java index fabb81f5f1a8..743aa88a6d29 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index b41fa1a1b795..978eee460b58 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java index 70ea9673e92b..34e7ffdf2fe3 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 231633cb34e6..ba5b622efda7 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java index 8186ae2e5b32..4948412cbf91 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java index 01a5e332fc45..58cf7cd17c74 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java index 7fce7995a83d..b77c5fb5ce71 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION b/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java index b41fa1a1b795..978eee460b58 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java index 70ea9673e92b..34e7ffdf2fe3 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 231633cb34e6..ba5b622efda7 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java index 8186ae2e5b32..4948412cbf91 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java index 01a5e332fc45..58cf7cd17c74 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java index 7fce7995a83d..b77c5fb5ce71 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java index bf263c24b4cf..3aa0b58d6c21 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java index ab909726e8d8..d8109c85a034 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 6ee5686f74ad..a6c0dfd6f088 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java index 98a0f6aa2e73..040870852682 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java index 2591ae1d45fa..4534ce024da3 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java index 2e0fbbbffc94..80c294ca88d1 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION b/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java index bce3a8a84857..81cbd1690c9b 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java index 8bc50f63c879..722970792125 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 0badb75bc22a..2a9ad13847b7 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java index 101ef0e1acb0..85222405a9b7 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java index a8418c54ea17..3443339b8841 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java index 9487e29ee1a1..7eb94eb0b370 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/VERSION b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index e6d35a4c351e..151aa6dc81dd 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java index 94827ba4a000..3cc9777cabcf 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index f1102a0f069e..7f524d7af4ad 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java index f26f3c41e4bc..41b8fce914ab 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java index 29a3d124c55c..25b01491b507 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java index 517f2743d2aa..4cbe795d92ad 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/VERSION b/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java index b41fa1a1b795..978eee460b58 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java index 052aa11e934f..5e5c3fc8c98f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 231633cb34e6..ba5b622efda7 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java index fd2d40410eb3..ce9171bef3d0 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java index 01a5e332fc45..58cf7cd17c74 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java index 7fce7995a83d..b77c5fb5ce71 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/VERSION b/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index e6d35a4c351e..151aa6dc81dd 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java index 94827ba4a000..3cc9777cabcf 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index f1102a0f069e..7f524d7af4ad 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java index f26f3c41e4bc..41b8fce914ab 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java index 29a3d124c55c..25b01491b507 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java index 517f2743d2aa..4cbe795d92ad 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable/.openapi-generator/VERSION b/samples/server/petstore/springboot-spring-pageable/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/springboot-spring-pageable/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-spring-pageable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java index ba1b869f0363..57e6c1d10672 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java index a56d13721e16..b494e974feba 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 71ce0007da65..8b45339424f3 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java index f07fa4a7edff..d15f313c4c9e 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java index 22b5b7670284..d3a44c4e9c67 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index fabb81f5f1a8..743aa88a6d29 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION b/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java index ba1b869f0363..57e6c1d10672 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java index 3cc4f5442898..bcfd41bee165 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 71ce0007da65..8b45339424f3 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java index 6eb817a03f54..027746a2e5b1 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java index 22b5b7670284..d3a44c4e9c67 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java index fabb81f5f1a8..743aa88a6d29 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION b/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java index b71a163e8ef5..575fd8a2ae27 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java index c36496ec99d3..a85c742451af 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java index 4aa760d7a8e9..7b1b825d386b 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java index fbac4cf8c2af..28c60937d7a8 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java index 7edd493e6b11..d20e937d0326 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java index a3766015580e..c6f02bef5d1c 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/.openapi-generator/VERSION b/samples/server/petstore/springboot/.openapi-generator/VERSION index 4077803655c0..7d3cdbf0dd04 100644 --- a/samples/server/petstore/springboot/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java index ba1b869f0363..57e6c1d10672 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java index c22b8c03f8fe..dfa1803e162d 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 71ce0007da65..8b45339424f3 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java index b0e4e2c2dc2e..693ce02c51e9 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java index 22b5b7670284..d3a44c4e9c67 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java index fabb81f5f1a8..743aa88a6d29 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ From 82b77a099af27acdfbf41d47382a73226c266483 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 21 Dec 2021 19:13:29 +0800 Subject: [PATCH 113/117] update readme --- README.md | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 899548113675..f8b8df917ae8 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@
            -[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`5.3.1`): +[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`5.4.x`): [![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/master.svg?label=Integration%20Test)](https://travis-ci.com/OpenAPITools/openapi-generator) [![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator) [![Windows Test](https://ci.appveyor.com/api/projects/status/github/openapitools/openapi-generator?branch=master&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/openapi-generator) @@ -17,13 +17,6 @@ [![Bitrise](https://img.shields.io/bitrise/4a2b10a819d12b67/master?label=bitrise%3A%20Swift+4,5&token=859FMDR8QHwabCzwvZK6vQ)](https://app.bitrise.io/app/4a2b10a819d12b67) [![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/openapitools/openapi-generator/Check%20Supported%20Java%20Versions/master?label=Check%20Supported%20Java%20Versions&logo=github&logoColor=green)](https://github.com/OpenAPITools/openapi-generator/actions?query=workflow%3A%22Check+Supported+Java+Versions%22) -[5.4.x](https://github.com/OpenAPITools/openapi-generator/tree/5.4.x) (`5.4.x`): -[![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/5.4.x.svg?label=Integration%20Test)](https://travis-ci.com/OpenAPITools/openapi-generator) -[![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator/tree/5.4.x.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator) -[![Windows Test](https://ci.appveyor.com/api/projects/status/github/openapitools/openapi-generator?branch=5.4.x&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/openapi-generator) -[![JDK11 Build](https://cloud.drone.io/api/badges/OpenAPITools/openapi-generator/status.svg?ref=refs/heads/5.4.x)](https://cloud.drone.io/OpenAPITools/openapi-generator) -[![Bitrise](https://img.shields.io/bitrise/4a2b10a819d12b67/5.4.x?label=bitrise%3A%20Swift+4,5&token=859FMDR8QHwabCzwvZK6vQ)](https://app.bitrise.io/app/4a2b10a819d12b67) - [6.0.x](https://github.com/OpenAPITools/openapi-generator/tree/6.0.x) (`6.0.x`): [![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/6.0.x.svg?label=Integration%20Test)](https://travis-ci.com/OpenAPITools/openapi-generator) [![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator/tree/6.0.x.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator) @@ -119,8 +112,7 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20 | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------- | | 6.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/6.0.0-SNAPSHOT/) | Jan/Feb 2022 | Minor release with breaking changes (no fallback) | | 5.4.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/5.4.0-SNAPSHOT/) | Dec 2021 | Minor release with breaking changes (with fallback) | -| 5.3.1 (upcoming patch release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/5.3.1-SNAPSHOT/) | Nov/Dec 2021 | Patch release (enhancements, bug fixes, etc) | -| [5.3.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v5.3.0) (latest stable release) | 24.10.2021 | Minor release with breaking changes (with fallback) | +| [5.3.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v5.3.1) (latest stable release) | 21.12.2021 | Patch release (enhancements, bug fixes, etc) | | [4.3.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.3.1) | 06.05.2020 | Patch release (enhancements, bug fixes, etc) | OpenAPI Spec compatibility: 1.0, 1.1, 1.2, 2.0, 3.0 @@ -177,16 +169,16 @@ See the different versions of the [openapi-generator-cli](https://mvnrepository. If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 8 runtime at a minimum): -JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.3.0/openapi-generator-cli-5.3.0.jar` +JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.3.1/openapi-generator-cli-5.3.1.jar` For **Mac/Linux** users: ```sh -wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.3.0/openapi-generator-cli-5.3.0.jar -O openapi-generator-cli.jar +wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.3.1/openapi-generator-cli-5.3.1.jar -O openapi-generator-cli.jar ``` For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g. ``` -Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.3.0/openapi-generator-cli-5.3.0.jar +Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.3.1/openapi-generator-cli-5.3.1.jar ``` After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage. @@ -411,7 +403,7 @@ openapi-generator-cli version To use a specific version of "openapi-generator-cli" ```sh -openapi-generator-cli version-manager set 5.3.0 +openapi-generator-cli version-manager set 5.3.1 ``` Or install it as dev-dependency: @@ -435,7 +427,7 @@ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generat (if you're on Windows, replace the last command with `java -jar modules\openapi-generator-cli\target\openapi-generator-cli.jar generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g php -o c:\temp\php_api_client`) -You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.3.0/openapi-generator-cli-5.3.0.jar) +You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.3.1/openapi-generator-cli-5.3.1.jar) To get a list of **general** options available, please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help generate` From 588cd1532319faa9c3a937a76b402014981aeb04 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 22 Dec 2021 00:42:28 +0800 Subject: [PATCH 114/117] fix openapi-generator-cli version --- modules/openapi-generator-cli/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator-cli/pom.xml b/modules/openapi-generator-cli/pom.xml index 3c12f8f79183..88111767922f 100644 --- a/modules/openapi-generator-cli/pom.xml +++ b/modules/openapi-generator-cli/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 5.3.1 + 5.4.0-SNAPSHOT ../.. From 0bbd1e59e9cf7828c93b66c3f8b85b19ac25ff1a Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 24 Dec 2021 10:46:02 -0500 Subject: [PATCH 115/117] useSingleRequestParameter should mark parameter optional if all properties are optional (#11135) * useSingleRequestParameter should mark parameter optional if all properties are optional * update samples --- .../src/main/resources/typescript-fetch/apis.mustache | 2 +- .../builds/default-v3.0/apis/FakeApi.ts | 10 +++++----- .../typescript-fetch/builds/enum/apis/DefaultApi.ts | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache index 74c0c77d712a..bbdf2edf4a35 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache @@ -342,7 +342,7 @@ export class {{classname}} extends runtime.BaseAPI { } {{/useSingleRequestParameter}} {{#useSingleRequestParameter}} - async {{nickname}}({{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}Request, {{/allParams.0}}initOverrides?: RequestInit): Promise<{{{returnType}}}{{^returnType}}void{{/returnType}}> { + async {{nickname}}({{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}Request{{^hasRequiredParams}} = {}{{/hasRequiredParams}}, {{/allParams.0}}initOverrides?: RequestInit): Promise<{{{returnType}}}{{^returnType}}void{{/returnType}}> { {{#returnType}} const response = await this.{{nickname}}Raw({{#allParams.0}}requestParameters, {{/allParams.0}}initOverrides); return await response.value(); diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts index 19d5f89fce9c..b0a139e2f202 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts @@ -232,7 +232,7 @@ export class FakeApi extends runtime.BaseAPI { /** * Test serialization of outer boolean types */ - async fakeOuterBooleanSerialize(requestParameters: FakeOuterBooleanSerializeRequest, initOverrides?: RequestInit): Promise { + async fakeOuterBooleanSerialize(requestParameters: FakeOuterBooleanSerializeRequest = {}, initOverrides?: RequestInit): Promise { const response = await this.fakeOuterBooleanSerializeRaw(requestParameters, initOverrides); return await response.value(); } @@ -261,7 +261,7 @@ export class FakeApi extends runtime.BaseAPI { /** * Test serialization of object with outer number type */ - async fakeOuterCompositeSerialize(requestParameters: FakeOuterCompositeSerializeRequest, initOverrides?: RequestInit): Promise { + async fakeOuterCompositeSerialize(requestParameters: FakeOuterCompositeSerializeRequest = {}, initOverrides?: RequestInit): Promise { const response = await this.fakeOuterCompositeSerializeRaw(requestParameters, initOverrides); return await response.value(); } @@ -290,7 +290,7 @@ export class FakeApi extends runtime.BaseAPI { /** * Test serialization of outer number types */ - async fakeOuterNumberSerialize(requestParameters: FakeOuterNumberSerializeRequest, initOverrides?: RequestInit): Promise { + async fakeOuterNumberSerialize(requestParameters: FakeOuterNumberSerializeRequest = {}, initOverrides?: RequestInit): Promise { const response = await this.fakeOuterNumberSerializeRaw(requestParameters, initOverrides); return await response.value(); } @@ -319,7 +319,7 @@ export class FakeApi extends runtime.BaseAPI { /** * Test serialization of outer string types */ - async fakeOuterStringSerialize(requestParameters: FakeOuterStringSerializeRequest, initOverrides?: RequestInit): Promise { + async fakeOuterStringSerialize(requestParameters: FakeOuterStringSerializeRequest = {}, initOverrides?: RequestInit): Promise { const response = await this.fakeOuterStringSerializeRaw(requestParameters, initOverrides); return await response.value(); } @@ -683,7 +683,7 @@ export class FakeApi extends runtime.BaseAPI { * To test enum parameters * To test enum parameters */ - async testEnumParameters(requestParameters: TestEnumParametersRequest, initOverrides?: RequestInit): Promise { + async testEnumParameters(requestParameters: TestEnumParametersRequest = {}, initOverrides?: RequestInit): Promise { await this.testEnumParametersRaw(requestParameters, initOverrides); } diff --git a/samples/client/petstore/typescript-fetch/builds/enum/apis/DefaultApi.ts b/samples/client/petstore/typescript-fetch/builds/enum/apis/DefaultApi.ts index 844842111c7a..6706d55addc9 100644 --- a/samples/client/petstore/typescript-fetch/builds/enum/apis/DefaultApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/enum/apis/DefaultApi.ts @@ -94,7 +94,7 @@ export class DefaultApi extends runtime.BaseAPI { /** */ - async fakeEnumRequestGetInline(requestParameters: FakeEnumRequestGetInlineRequest, initOverrides?: RequestInit): Promise { + async fakeEnumRequestGetInline(requestParameters: FakeEnumRequestGetInlineRequest = {}, initOverrides?: RequestInit): Promise { const response = await this.fakeEnumRequestGetInlineRaw(requestParameters, initOverrides); return await response.value(); } @@ -134,7 +134,7 @@ export class DefaultApi extends runtime.BaseAPI { /** */ - async fakeEnumRequestGetRef(requestParameters: FakeEnumRequestGetRefRequest, initOverrides?: RequestInit): Promise { + async fakeEnumRequestGetRef(requestParameters: FakeEnumRequestGetRefRequest = {}, initOverrides?: RequestInit): Promise { const response = await this.fakeEnumRequestGetRefRaw(requestParameters, initOverrides); return await response.value(); } @@ -161,7 +161,7 @@ export class DefaultApi extends runtime.BaseAPI { /** */ - async fakeEnumRequestPostInline(requestParameters: FakeEnumRequestPostInlineRequest, initOverrides?: RequestInit): Promise { + async fakeEnumRequestPostInline(requestParameters: FakeEnumRequestPostInlineRequest = {}, initOverrides?: RequestInit): Promise { const response = await this.fakeEnumRequestPostInlineRaw(requestParameters, initOverrides); return await response.value(); } @@ -188,7 +188,7 @@ export class DefaultApi extends runtime.BaseAPI { /** */ - async fakeEnumRequestPostRef(requestParameters: FakeEnumRequestPostRefRequest, initOverrides?: RequestInit): Promise { + async fakeEnumRequestPostRef(requestParameters: FakeEnumRequestPostRefRequest = {}, initOverrides?: RequestInit): Promise { const response = await this.fakeEnumRequestPostRefRaw(requestParameters, initOverrides); return await response.value(); } From 7ffd0711c3c3e7e08110a3e8d63e324daa1773d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vesa=20Poikaj=C3=A4rvi?= Date: Fri, 24 Dec 2021 17:49:36 +0200 Subject: [PATCH 116/117] [typescript-axios] Add option to add NodeJS imports (#10990) * [typescript-axios] Add new option to generate imports from 'url' * Added new option `withImportUrl` to be used to generate the imports needed for NodeJS support without adding DOM to TypeScript libs * [typescript-axios] Add withImportUrl support to templates * Generate imports from 'url' if withImportUrl is set to true * [typescript-axios] Generate new samples using withImportUrl * [typescript-axios] Add withImportUrl to documentation * [typescript-axios] Regenerate docs, build was still ongoing and used old param name * [typescript-axios] Rename withImportUrl to withNodeImports * Rename the parameter to support other Node imports * Add imports for form-data too if using multipartFormData * Add fix for multipart headers when running in Node with form-data package --- .../typescript-axios-with-node-imports.yaml | 7 + docs/generators/typescript-axios.md | 1 + .../TypeScriptAxiosClientCodegen.java | 2 + .../resources/typescript-axios/api.mustache | 8 + .../typescript-axios/apiInner.mustache | 10 +- .../typescript-axios/common.mustache | 3 + .../builds/with-node-imports/.gitignore | 4 + .../builds/with-node-imports/.npmignore | 1 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 8 + .../.openapi-generator/VERSION | 1 + .../builds/with-node-imports/api.ts | 1818 +++++++++++++++++ .../builds/with-node-imports/base.ts | 71 + .../builds/with-node-imports/common.ts | 139 ++ .../builds/with-node-imports/configuration.ts | 101 + .../builds/with-node-imports/git_push.sh | 57 + .../builds/with-node-imports/index.ts | 18 + 17 files changed, 2271 insertions(+), 1 deletion(-) create mode 100644 bin/configs/typescript-axios-with-node-imports.yaml create mode 100644 samples/client/petstore/typescript-axios/builds/with-node-imports/.gitignore create mode 100644 samples/client/petstore/typescript-axios/builds/with-node-imports/.npmignore create mode 100644 samples/client/petstore/typescript-axios/builds/with-node-imports/.openapi-generator-ignore create mode 100644 samples/client/petstore/typescript-axios/builds/with-node-imports/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-axios/builds/with-node-imports/.openapi-generator/VERSION create mode 100644 samples/client/petstore/typescript-axios/builds/with-node-imports/api.ts create mode 100644 samples/client/petstore/typescript-axios/builds/with-node-imports/base.ts create mode 100644 samples/client/petstore/typescript-axios/builds/with-node-imports/common.ts create mode 100644 samples/client/petstore/typescript-axios/builds/with-node-imports/configuration.ts create mode 100644 samples/client/petstore/typescript-axios/builds/with-node-imports/git_push.sh create mode 100644 samples/client/petstore/typescript-axios/builds/with-node-imports/index.ts diff --git a/bin/configs/typescript-axios-with-node-imports.yaml b/bin/configs/typescript-axios-with-node-imports.yaml new file mode 100644 index 000000000000..1ed732421d20 --- /dev/null +++ b/bin/configs/typescript-axios-with-node-imports.yaml @@ -0,0 +1,7 @@ +generatorName: typescript-axios +outputDir: samples/client/petstore/typescript-axios/builds/with-node-imports +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-operations-without-required-params.yaml +templateDir: modules/openapi-generator/src/main/resources/typescript-axios +additionalProperties: + withNodeImports: "true" + multipartFormData: "true" diff --git a/docs/generators/typescript-axios.md b/docs/generators/typescript-axios.md index 3cfeda785802..d489756bacb7 100644 --- a/docs/generators/typescript-axios.md +++ b/docs/generators/typescript-axios.md @@ -26,6 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |supportsES6|Generate code that conforms to ES6.| |false| |useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.| |false| |withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false| +|withNodeImports|Setting this property to true adds imports for NodeJS| |false| |withSeparateModelsAndApi|Put the model and api in separate folders and in separate classes| |false| |withoutPrefixEnums|Don't prefix enum names with class names| |false| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java index 171b0e254e07..539313d513c5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java @@ -33,6 +33,7 @@ public class TypeScriptAxiosClientCodegen extends AbstractTypeScriptClientCodege public static final String SEPARATE_MODELS_AND_API = "withSeparateModelsAndApi"; public static final String WITHOUT_PREFIX_ENUMS = "withoutPrefixEnums"; public static final String USE_SINGLE_REQUEST_PARAMETER = "useSingleRequestParameter"; + public static final String WITH_NODE_IMPORTS = "withNodeImports"; protected String npmRepository = null; @@ -55,6 +56,7 @@ public TypeScriptAxiosClientCodegen() { this.cliOptions.add(new CliOption(SEPARATE_MODELS_AND_API, "Put the model and api in separate folders and in separate classes", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString())); this.cliOptions.add(new CliOption(WITHOUT_PREFIX_ENUMS, "Don't prefix enum names with class names", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString())); this.cliOptions.add(new CliOption(USE_SINGLE_REQUEST_PARAMETER, "Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString())); + this.cliOptions.add(new CliOption(WITH_NODE_IMPORTS, "Setting this property to true adds imports for NodeJS", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString())); // Templates have no mapping between formatted property names and original base names so use only "original" and remove this option removeOption(CodegenConstants.MODEL_PROPERTY_NAMING); } diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/api.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/api.mustache index 140801103b7b..707faf3a1b16 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/api.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/api.mustache @@ -5,6 +5,14 @@ {{^withSeparateModelsAndApi}} import { Configuration } from './configuration'; import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +{{#withNodeImports}} +// URLSearchParams not necessarily used +// @ts-ignore +import { URL, URLSearchParams } from 'url'; +{{#multipartFormData}} +import FormData from 'form-data' +{{/multipartFormData}} +{{/withNodeImports}} // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache index 14b4d67503a0..04812f66dde2 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache @@ -5,6 +5,14 @@ import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; import { Configuration } from '{{apiRelativeToRoot}}configuration'; +{{#withNodeImports}} +// URLSearchParams not necessarily used +// @ts-ignore +import { URL, URLSearchParams } from 'url'; +{{#multipartFormData}} +import FormData from 'form-data' +{{/multipartFormData}} +{{/withNodeImports}} // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '{{apiRelativeToRoot}}common'; @@ -184,7 +192,7 @@ export const {{classname}}AxiosParamCreator = function (configuration?: Configur {{/bodyParam}} setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions,{{#hasFormParams}}{{#multipartFormData}} ...(localVarFormParams as any).getHeaders?.(),{{/multipartFormData}}{{/hasFormParams}} ...options.headers}; {{#hasFormParams}} localVarRequestOptions.data = localVarFormParams{{#vendorExtensions}}{{^multipartFormData}}.toString(){{/multipartFormData}}{{/vendorExtensions}}; {{/hasFormParams}} diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/common.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/common.mustache index 7a057e3e443e..114bb3e92f2d 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/common.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/common.mustache @@ -5,6 +5,9 @@ import { Configuration } from "./configuration"; import { RequiredError, RequestArgs } from "./base"; import { AxiosInstance, AxiosResponse } from 'axios'; +{{#withNodeImports}} +import { URL, URLSearchParams } from 'url'; +{{/withNodeImports}} /** * diff --git a/samples/client/petstore/typescript-axios/builds/with-node-imports/.gitignore b/samples/client/petstore/typescript-axios/builds/with-node-imports/.gitignore new file mode 100644 index 000000000000..149b57654723 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-node-imports/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/samples/client/petstore/typescript-axios/builds/with-node-imports/.npmignore b/samples/client/petstore/typescript-axios/builds/with-node-imports/.npmignore new file mode 100644 index 000000000000..999d88df6939 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-node-imports/.npmignore @@ -0,0 +1 @@ +# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-node-imports/.openapi-generator-ignore b/samples/client/petstore/typescript-axios/builds/with-node-imports/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-node-imports/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/typescript-axios/builds/with-node-imports/.openapi-generator/FILES b/samples/client/petstore/typescript-axios/builds/with-node-imports/.openapi-generator/FILES new file mode 100644 index 000000000000..a80cd4f07b06 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-node-imports/.openapi-generator/FILES @@ -0,0 +1,8 @@ +.gitignore +.npmignore +api.ts +base.ts +common.ts +configuration.ts +git_push.sh +index.ts diff --git a/samples/client/petstore/typescript-axios/builds/with-node-imports/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-node-imports/.openapi-generator/VERSION new file mode 100644 index 000000000000..4077803655c0 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-node-imports/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-node-imports/api.ts b/samples/client/petstore/typescript-axios/builds/with-node-imports/api.ts new file mode 100644 index 000000000000..81a0a2962453 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-node-imports/api.ts @@ -0,0 +1,1818 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { Configuration } from './configuration'; +import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +// URLSearchParams not necessarily used +// @ts-ignore +import { URL, URLSearchParams } from 'url'; +import FormData from 'form-data' +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; + +/** + * Describes the result of uploading an image resource + * @export + * @interface ApiResponse + */ +export interface ApiResponse { + /** + * + * @type {number} + * @memberof ApiResponse + */ + 'code'?: number; + /** + * + * @type {string} + * @memberof ApiResponse + */ + 'type'?: string; + /** + * + * @type {string} + * @memberof ApiResponse + */ + 'message'?: string; +} +/** + * A category for a pet + * @export + * @interface Category + */ +export interface Category { + /** + * + * @type {number} + * @memberof Category + */ + 'id'?: number; + /** + * + * @type {string} + * @memberof Category + */ + 'name'?: string; +} +/** + * An order for a pets from the pet store + * @export + * @interface Order + */ +export interface Order { + /** + * + * @type {number} + * @memberof Order + */ + 'id'?: number; + /** + * + * @type {number} + * @memberof Order + */ + 'petId'?: number; + /** + * + * @type {number} + * @memberof Order + */ + 'quantity'?: number; + /** + * + * @type {string} + * @memberof Order + */ + 'shipDate'?: string; + /** + * Order Status + * @type {string} + * @memberof Order + */ + 'status'?: OrderStatusEnum; + /** + * + * @type {boolean} + * @memberof Order + */ + 'complete'?: boolean; +} + +/** + * @export + * @enum {string} + */ +export enum OrderStatusEnum { + Placed = 'placed', + Approved = 'approved', + Delivered = 'delivered' +} + +/** + * A pet for sale in the pet store + * @export + * @interface Pet + */ +export interface Pet { + /** + * + * @type {number} + * @memberof Pet + */ + 'id'?: number; + /** + * + * @type {Category} + * @memberof Pet + */ + 'category'?: Category; + /** + * + * @type {string} + * @memberof Pet + */ + 'name': string; + /** + * + * @type {Array} + * @memberof Pet + */ + 'photoUrls': Array; + /** + * + * @type {Array} + * @memberof Pet + */ + 'tags'?: Array; + /** + * pet status in the store + * @type {string} + * @memberof Pet + */ + 'status'?: PetStatusEnum; +} + +/** + * @export + * @enum {string} + */ +export enum PetStatusEnum { + Available = 'available', + Pending = 'pending', + Sold = 'sold' +} + +/** + * A tag for a pet + * @export + * @interface Tag + */ +export interface Tag { + /** + * + * @type {number} + * @memberof Tag + */ + 'id'?: number; + /** + * + * @type {string} + * @memberof Tag + */ + 'name'?: string; +} +/** + * A User who is purchasing from the pet store + * @export + * @interface User + */ +export interface User { + /** + * + * @type {number} + * @memberof User + */ + 'id'?: number; + /** + * + * @type {string} + * @memberof User + */ + 'username'?: string; + /** + * + * @type {string} + * @memberof User + */ + 'firstName'?: string; + /** + * + * @type {string} + * @memberof User + */ + 'lastName'?: string; + /** + * + * @type {string} + * @memberof User + */ + 'email'?: string; + /** + * + * @type {string} + * @memberof User + */ + 'password'?: string; + /** + * + * @type {string} + * @memberof User + */ + 'phone'?: string; + /** + * User Status + * @type {number} + * @memberof User + */ + 'userStatus'?: number; +} + +/** + * PetApi - axios parameter creator + * @export + */ +export const PetApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary Add a new pet to the store + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addPet: async (body: Pet, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'body' is not null or undefined + assertParamExists('addPet', 'body', body) + const localVarPath = `/pet`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication petstore_auth required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Deletes a pet + * @param {number} petId Pet id to delete + * @param {string} [apiKey] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePet: async (petId: number, apiKey?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'petId' is not null or undefined + assertParamExists('deletePet', 'petId', petId) + const localVarPath = `/pet/{petId}` + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication petstore_auth required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) + + if (apiKey !== undefined && apiKey !== null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Multiple status values can be provided with comma separated strings + * @summary Finds Pets by status + * @param {Array<'available' | 'pending' | 'sold'>} status Status values that need to be considered for filter + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + findPetsByStatus: async (status: Array<'available' | 'pending' | 'sold'>, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'status' is not null or undefined + assertParamExists('findPetsByStatus', 'status', status) + const localVarPath = `/pet/findByStatus`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication petstore_auth required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) + + if (status) { + localVarQueryParameter['status'] = status.join(COLLECTION_FORMATS.csv); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @summary Finds Pets by tags + * @param {Array} tags Tags to filter by + * @param {*} [options] Override http request option. + * @deprecated + * @throws {RequiredError} + */ + findPetsByTags: async (tags: Array, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'tags' is not null or undefined + assertParamExists('findPetsByTags', 'tags', tags) + const localVarPath = `/pet/findByTags`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication petstore_auth required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) + + if (tags) { + localVarQueryParameter['tags'] = tags.join(COLLECTION_FORMATS.csv); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns a single pet + * @summary Find pet by ID + * @param {number} petId ID of pet to return + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPetById: async (petId: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'petId' is not null or undefined + assertParamExists('getPetById', 'petId', petId) + const localVarPath = `/pet/{petId}` + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication api_key required + await setApiKeyToObject(localVarHeaderParameter, "api_key", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Update an existing pet + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePet: async (body: Pet, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'body' is not null or undefined + assertParamExists('updatePet', 'body', body) + const localVarPath = `/pet`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication petstore_auth required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Updates a pet in the store with form data + * @param {number} petId ID of pet that needs to be updated + * @param {string} [name] Updated name of the pet + * @param {string} [status] Updated status of the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePetWithForm: async (petId: number, name?: string, status?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'petId' is not null or undefined + assertParamExists('updatePetWithForm', 'petId', petId) + const localVarPath = `/pet/{petId}` + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)(); + + // authentication petstore_auth required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) + + + if (name !== undefined) { + localVarFormParams.append('name', name as any); + } + + if (status !== undefined) { + localVarFormParams.append('status', status as any); + } + + + localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...(localVarFormParams as any).getHeaders?.(), ...options.headers}; + localVarRequestOptions.data = localVarFormParams; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary uploads an image + * @param {number} petId ID of pet to update + * @param {string} [additionalMetadata] Additional data to pass to server + * @param {any} [file] file to upload + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + uploadFile: async (petId: number, additionalMetadata?: string, file?: any, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'petId' is not null or undefined + assertParamExists('uploadFile', 'petId', petId) + const localVarPath = `/pet/{petId}/uploadImage` + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)(); + + // authentication petstore_auth required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) + + + if (additionalMetadata !== undefined) { + localVarFormParams.append('additionalMetadata', additionalMetadata as any); + } + + if (file !== undefined) { + localVarFormParams.append('file', file as any); + } + + + localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...(localVarFormParams as any).getHeaders?.(), ...options.headers}; + localVarRequestOptions.data = localVarFormParams; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * PetApi - functional programming interface + * @export + */ +export const PetApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = PetApiAxiosParamCreator(configuration) + return { + /** + * + * @summary Add a new pet to the store + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async addPet(body: Pet, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addPet(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Deletes a pet + * @param {number} petId Pet id to delete + * @param {string} [apiKey] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deletePet(petId: number, apiKey?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deletePet(petId, apiKey, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Multiple status values can be provided with comma separated strings + * @summary Finds Pets by status + * @param {Array<'available' | 'pending' | 'sold'>} status Status values that need to be considered for filter + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.findPetsByStatus(status, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @summary Finds Pets by tags + * @param {Array} tags Tags to filter by + * @param {*} [options] Override http request option. + * @deprecated + * @throws {RequiredError} + */ + async findPetsByTags(tags: Array, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.findPetsByTags(tags, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Returns a single pet + * @summary Find pet by ID + * @param {number} petId ID of pet to return + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getPetById(petId: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPetById(petId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Update an existing pet + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updatePet(body: Pet, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updatePet(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Updates a pet in the store with form data + * @param {number} petId ID of pet that needs to be updated + * @param {string} [name] Updated name of the pet + * @param {string} [status] Updated status of the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updatePetWithForm(petId: number, name?: string, status?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updatePetWithForm(petId, name, status, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary uploads an image + * @param {number} petId ID of pet to update + * @param {string} [additionalMetadata] Additional data to pass to server + * @param {any} [file] file to upload + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.uploadFile(petId, additionalMetadata, file, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * PetApi - factory interface + * @export + */ +export const PetApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = PetApiFp(configuration) + return { + /** + * + * @summary Add a new pet to the store + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addPet(body: Pet, options?: any): AxiosPromise { + return localVarFp.addPet(body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Deletes a pet + * @param {number} petId Pet id to delete + * @param {string} [apiKey] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePet(petId: number, apiKey?: string, options?: any): AxiosPromise { + return localVarFp.deletePet(petId, apiKey, options).then((request) => request(axios, basePath)); + }, + /** + * Multiple status values can be provided with comma separated strings + * @summary Finds Pets by status + * @param {Array<'available' | 'pending' | 'sold'>} status Status values that need to be considered for filter + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any): AxiosPromise> { + return localVarFp.findPetsByStatus(status, options).then((request) => request(axios, basePath)); + }, + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @summary Finds Pets by tags + * @param {Array} tags Tags to filter by + * @param {*} [options] Override http request option. + * @deprecated + * @throws {RequiredError} + */ + findPetsByTags(tags: Array, options?: any): AxiosPromise> { + return localVarFp.findPetsByTags(tags, options).then((request) => request(axios, basePath)); + }, + /** + * Returns a single pet + * @summary Find pet by ID + * @param {number} petId ID of pet to return + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPetById(petId: number, options?: any): AxiosPromise { + return localVarFp.getPetById(petId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Update an existing pet + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePet(body: Pet, options?: any): AxiosPromise { + return localVarFp.updatePet(body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Updates a pet in the store with form data + * @param {number} petId ID of pet that needs to be updated + * @param {string} [name] Updated name of the pet + * @param {string} [status] Updated status of the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePetWithForm(petId: number, name?: string, status?: string, options?: any): AxiosPromise { + return localVarFp.updatePetWithForm(petId, name, status, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary uploads an image + * @param {number} petId ID of pet to update + * @param {string} [additionalMetadata] Additional data to pass to server + * @param {any} [file] file to upload + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): AxiosPromise { + return localVarFp.uploadFile(petId, additionalMetadata, file, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * PetApi - object-oriented interface + * @export + * @class PetApi + * @extends {BaseAPI} + */ +export class PetApi extends BaseAPI { + /** + * + * @summary Add a new pet to the store + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public addPet(body: Pet, options?: AxiosRequestConfig) { + return PetApiFp(this.configuration).addPet(body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Deletes a pet + * @param {number} petId Pet id to delete + * @param {string} [apiKey] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public deletePet(petId: number, apiKey?: string, options?: AxiosRequestConfig) { + return PetApiFp(this.configuration).deletePet(petId, apiKey, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Multiple status values can be provided with comma separated strings + * @summary Finds Pets by status + * @param {Array<'available' | 'pending' | 'sold'>} status Status values that need to be considered for filter + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: AxiosRequestConfig) { + return PetApiFp(this.configuration).findPetsByStatus(status, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @summary Finds Pets by tags + * @param {Array} tags Tags to filter by + * @param {*} [options] Override http request option. + * @deprecated + * @throws {RequiredError} + * @memberof PetApi + */ + public findPetsByTags(tags: Array, options?: AxiosRequestConfig) { + return PetApiFp(this.configuration).findPetsByTags(tags, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns a single pet + * @summary Find pet by ID + * @param {number} petId ID of pet to return + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public getPetById(petId: number, options?: AxiosRequestConfig) { + return PetApiFp(this.configuration).getPetById(petId, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Update an existing pet + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public updatePet(body: Pet, options?: AxiosRequestConfig) { + return PetApiFp(this.configuration).updatePet(body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Updates a pet in the store with form data + * @param {number} petId ID of pet that needs to be updated + * @param {string} [name] Updated name of the pet + * @param {string} [status] Updated status of the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public updatePetWithForm(petId: number, name?: string, status?: string, options?: AxiosRequestConfig) { + return PetApiFp(this.configuration).updatePetWithForm(petId, name, status, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary uploads an image + * @param {number} petId ID of pet to update + * @param {string} [additionalMetadata] Additional data to pass to server + * @param {any} [file] file to upload + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: AxiosRequestConfig) { + return PetApiFp(this.configuration).uploadFile(petId, additionalMetadata, file, options).then((request) => request(this.axios, this.basePath)); + } +} + + +/** + * StoreApi - axios parameter creator + * @export + */ +export const StoreApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @summary Delete purchase order by ID + * @param {string} orderId ID of the order that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteOrder: async (orderId: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'orderId' is not null or undefined + assertParamExists('deleteOrder', 'orderId', orderId) + const localVarPath = `/store/order/{orderId}` + .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns a map of status codes to quantities + * @summary Returns pet inventories by status + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInventory: async (options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/store/inventory`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication api_key required + await setApiKeyToObject(localVarHeaderParameter, "api_key", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @summary Find purchase order by ID + * @param {number} orderId ID of pet that needs to be fetched + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getOrderById: async (orderId: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'orderId' is not null or undefined + assertParamExists('getOrderById', 'orderId', orderId) + const localVarPath = `/store/order/{orderId}` + .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Place an order for a pet + * @param {Order} [body] order placed for purchasing the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + placeOrder: async (body?: Order, options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/store/order`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * StoreApi - functional programming interface + * @export + */ +export const StoreApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = StoreApiAxiosParamCreator(configuration) + return { + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @summary Delete purchase order by ID + * @param {string} orderId ID of the order that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteOrder(orderId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteOrder(orderId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Returns a map of status codes to quantities + * @summary Returns pet inventories by status + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getInventory(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{ [key: string]: number; }>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getInventory(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @summary Find purchase order by ID + * @param {number} orderId ID of pet that needs to be fetched + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getOrderById(orderId: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getOrderById(orderId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Place an order for a pet + * @param {Order} [body] order placed for purchasing the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async placeOrder(body?: Order, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.placeOrder(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * StoreApi - factory interface + * @export + */ +export const StoreApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = StoreApiFp(configuration) + return { + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @summary Delete purchase order by ID + * @param {string} orderId ID of the order that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteOrder(orderId: string, options?: any): AxiosPromise { + return localVarFp.deleteOrder(orderId, options).then((request) => request(axios, basePath)); + }, + /** + * Returns a map of status codes to quantities + * @summary Returns pet inventories by status + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInventory(options?: any): AxiosPromise<{ [key: string]: number; }> { + return localVarFp.getInventory(options).then((request) => request(axios, basePath)); + }, + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @summary Find purchase order by ID + * @param {number} orderId ID of pet that needs to be fetched + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getOrderById(orderId: number, options?: any): AxiosPromise { + return localVarFp.getOrderById(orderId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Place an order for a pet + * @param {Order} [body] order placed for purchasing the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + placeOrder(body?: Order, options?: any): AxiosPromise { + return localVarFp.placeOrder(body, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * StoreApi - object-oriented interface + * @export + * @class StoreApi + * @extends {BaseAPI} + */ +export class StoreApi extends BaseAPI { + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @summary Delete purchase order by ID + * @param {string} orderId ID of the order that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StoreApi + */ + public deleteOrder(orderId: string, options?: AxiosRequestConfig) { + return StoreApiFp(this.configuration).deleteOrder(orderId, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns a map of status codes to quantities + * @summary Returns pet inventories by status + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StoreApi + */ + public getInventory(options?: AxiosRequestConfig) { + return StoreApiFp(this.configuration).getInventory(options).then((request) => request(this.axios, this.basePath)); + } + + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @summary Find purchase order by ID + * @param {number} orderId ID of pet that needs to be fetched + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StoreApi + */ + public getOrderById(orderId: number, options?: AxiosRequestConfig) { + return StoreApiFp(this.configuration).getOrderById(orderId, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Place an order for a pet + * @param {Order} [body] order placed for purchasing the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StoreApi + */ + public placeOrder(body?: Order, options?: AxiosRequestConfig) { + return StoreApiFp(this.configuration).placeOrder(body, options).then((request) => request(this.axios, this.basePath)); + } +} + + +/** + * UserApi - axios parameter creator + * @export + */ +export const UserApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * This can only be done by the logged in user. + * @summary Create user + * @param {User} body Created user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUser: async (body: User, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'body' is not null or undefined + assertParamExists('createUser', 'body', body) + const localVarPath = `/user`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUsersWithArrayInput: async (body: Array, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'body' is not null or undefined + assertParamExists('createUsersWithArrayInput', 'body', body) + const localVarPath = `/user/createWithArray`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUsersWithListInput: async (body: Array, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'body' is not null or undefined + assertParamExists('createUsersWithListInput', 'body', body) + const localVarPath = `/user/createWithList`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * This can only be done by the logged in user. + * @summary Delete user + * @param {string} username The name that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteUser: async (username: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'username' is not null or undefined + assertParamExists('deleteUser', 'username', username) + const localVarPath = `/user/{username}` + .replace(`{${"username"}}`, encodeURIComponent(String(username))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Get user by user name + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getUserByName: async (username: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'username' is not null or undefined + assertParamExists('getUserByName', 'username', username) + const localVarPath = `/user/{username}` + .replace(`{${"username"}}`, encodeURIComponent(String(username))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Logs user into the system + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + loginUser: async (username: string, password: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'username' is not null or undefined + assertParamExists('loginUser', 'username', username) + // verify required parameter 'password' is not null or undefined + assertParamExists('loginUser', 'password', password) + const localVarPath = `/user/login`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (username !== undefined) { + localVarQueryParameter['username'] = username; + } + + if (password !== undefined) { + localVarQueryParameter['password'] = password; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Logs out current logged in user session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + logoutUser: async (options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/user/logout`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * This can only be done by the logged in user. + * @summary Updated user + * @param {string} username name that need to be deleted + * @param {User} body Updated user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateUser: async (username: string, body: User, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'username' is not null or undefined + assertParamExists('updateUser', 'username', username) + // verify required parameter 'body' is not null or undefined + assertParamExists('updateUser', 'body', body) + const localVarPath = `/user/{username}` + .replace(`{${"username"}}`, encodeURIComponent(String(username))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * UserApi - functional programming interface + * @export + */ +export const UserApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = UserApiAxiosParamCreator(configuration) + return { + /** + * This can only be done by the logged in user. + * @summary Create user + * @param {User} body Created user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createUser(body: User, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createUser(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createUsersWithArrayInput(body: Array, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createUsersWithArrayInput(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createUsersWithListInput(body: Array, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createUsersWithListInput(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * This can only be done by the logged in user. + * @summary Delete user + * @param {string} username The name that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteUser(username: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteUser(username, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Get user by user name + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getUserByName(username: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getUserByName(username, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Logs user into the system + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async loginUser(username: string, password: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.loginUser(username, password, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Logs out current logged in user session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async logoutUser(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.logoutUser(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * This can only be done by the logged in user. + * @summary Updated user + * @param {string} username name that need to be deleted + * @param {User} body Updated user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updateUser(username: string, body: User, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateUser(username, body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * UserApi - factory interface + * @export + */ +export const UserApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = UserApiFp(configuration) + return { + /** + * This can only be done by the logged in user. + * @summary Create user + * @param {User} body Created user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUser(body: User, options?: any): AxiosPromise { + return localVarFp.createUser(body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUsersWithArrayInput(body: Array, options?: any): AxiosPromise { + return localVarFp.createUsersWithArrayInput(body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUsersWithListInput(body: Array, options?: any): AxiosPromise { + return localVarFp.createUsersWithListInput(body, options).then((request) => request(axios, basePath)); + }, + /** + * This can only be done by the logged in user. + * @summary Delete user + * @param {string} username The name that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteUser(username: string, options?: any): AxiosPromise { + return localVarFp.deleteUser(username, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Get user by user name + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getUserByName(username: string, options?: any): AxiosPromise { + return localVarFp.getUserByName(username, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Logs user into the system + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + loginUser(username: string, password: string, options?: any): AxiosPromise { + return localVarFp.loginUser(username, password, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Logs out current logged in user session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + logoutUser(options?: any): AxiosPromise { + return localVarFp.logoutUser(options).then((request) => request(axios, basePath)); + }, + /** + * This can only be done by the logged in user. + * @summary Updated user + * @param {string} username name that need to be deleted + * @param {User} body Updated user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateUser(username: string, body: User, options?: any): AxiosPromise { + return localVarFp.updateUser(username, body, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * UserApi - object-oriented interface + * @export + * @class UserApi + * @extends {BaseAPI} + */ +export class UserApi extends BaseAPI { + /** + * This can only be done by the logged in user. + * @summary Create user + * @param {User} body Created user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public createUser(body: User, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).createUser(body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Creates list of users with given input array + * @param {Array} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public createUsersWithArrayInput(body: Array, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).createUsersWithArrayInput(body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Creates list of users with given input array + * @param {Array} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public createUsersWithListInput(body: Array, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).createUsersWithListInput(body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * This can only be done by the logged in user. + * @summary Delete user + * @param {string} username The name that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public deleteUser(username: string, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).deleteUser(username, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Get user by user name + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public getUserByName(username: string, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).getUserByName(username, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Logs user into the system + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public loginUser(username: string, password: string, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).loginUser(username, password, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Logs out current logged in user session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public logoutUser(options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).logoutUser(options).then((request) => request(this.axios, this.basePath)); + } + + /** + * This can only be done by the logged in user. + * @summary Updated user + * @param {string} username name that need to be deleted + * @param {User} body Updated user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public updateUser(username: string, body: User, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).updateUser(username, body, options).then((request) => request(this.axios, this.basePath)); + } +} + + diff --git a/samples/client/petstore/typescript-axios/builds/with-node-imports/base.ts b/samples/client/petstore/typescript-axios/builds/with-node-imports/base.ts new file mode 100644 index 000000000000..e23d972eeb04 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-node-imports/base.ts @@ -0,0 +1,71 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { Configuration } from "./configuration"; +// Some imports not used depending on template conditions +// @ts-ignore +import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; + +export const BASE_PATH = "http://petstore.swagger.io/v2".replace(/\/+$/, ""); + +/** + * + * @export + */ +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +/** + * + * @export + * @interface RequestArgs + */ +export interface RequestArgs { + url: string; + options: AxiosRequestConfig; +} + +/** + * + * @export + * @class BaseAPI + */ +export class BaseAPI { + protected configuration: Configuration | undefined; + + constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) { + if (configuration) { + this.configuration = configuration; + this.basePath = configuration.basePath || this.basePath; + } + } +}; + +/** + * + * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + name: "RequiredError" = "RequiredError"; + constructor(public field: string, msg?: string) { + super(msg); + } +} diff --git a/samples/client/petstore/typescript-axios/builds/with-node-imports/common.ts b/samples/client/petstore/typescript-axios/builds/with-node-imports/common.ts new file mode 100644 index 000000000000..56fdbc9e2512 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-node-imports/common.ts @@ -0,0 +1,139 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { Configuration } from "./configuration"; +import { RequiredError, RequestArgs } from "./base"; +import { AxiosInstance, AxiosResponse } from 'axios'; +import { URL, URLSearchParams } from 'url'; + +/** + * + * @export + */ +export const DUMMY_BASE_URL = 'https://example.com' + +/** + * + * @throws {RequiredError} + * @export + */ +export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) { + if (paramValue === null || paramValue === undefined) { + throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`); + } +} + +/** + * + * @export + */ +export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) { + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? await configuration.apiKey(keyParamName) + : await configuration.apiKey; + object[keyParamName] = localVarApiKeyValue; + } +} + +/** + * + * @export + */ +export const setBasicAuthToObject = function (object: any, configuration?: Configuration) { + if (configuration && (configuration.username || configuration.password)) { + object["auth"] = { username: configuration.username, password: configuration.password }; + } +} + +/** + * + * @export + */ +export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const accessToken = typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + object["Authorization"] = "Bearer " + accessToken; + } +} + +/** + * + * @export + */ +export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? await configuration.accessToken(name, scopes) + : await configuration.accessToken; + object["Authorization"] = "Bearer " + localVarAccessTokenValue; + } +} + +/** + * + * @export + */ +export const setSearchParams = function (url: URL, ...objects: any[]) { + const searchParams = new URLSearchParams(url.search); + for (const object of objects) { + for (const key in object) { + if (Array.isArray(object[key])) { + searchParams.delete(key); + for (const item of object[key]) { + searchParams.append(key, item); + } + } else { + searchParams.set(key, object[key]); + } + } + } + url.search = searchParams.toString(); +} + +/** + * + * @export + */ +export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) { + const nonString = typeof value !== 'string'; + const needsSerialization = nonString && configuration && configuration.isJsonMime + ? configuration.isJsonMime(requestOptions.headers['Content-Type']) + : nonString; + return needsSerialization + ? JSON.stringify(value !== undefined ? value : {}) + : (value || ""); +} + +/** + * + * @export + */ +export const toPathString = function (url: URL) { + return url.pathname + url.search + url.hash +} + +/** + * + * @export + */ +export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { + return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; + return axios.request(axiosRequestArgs); + }; +} diff --git a/samples/client/petstore/typescript-axios/builds/with-node-imports/configuration.ts b/samples/client/petstore/typescript-axios/builds/with-node-imports/configuration.ts new file mode 100644 index 000000000000..b8780457121d --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-node-imports/configuration.ts @@ -0,0 +1,101 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface ConfigurationParameters { + apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); + username?: string; + password?: string; + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); + basePath?: string; + baseOptions?: any; + formDataCtor?: new () => any; +} + +export class Configuration { + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username?: string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password?: string; + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath?: string; + /** + * base options for axios calls + * + * @type {any} + * @memberof Configuration + */ + baseOptions?: any; + /** + * The FormData constructor that will be used to create multipart form data + * requests. You can inject this here so that execution environments that + * do not support the FormData class can still run the generated client. + * + * @type {new () => FormData} + */ + formDataCtor?: new () => any; + + constructor(param: ConfigurationParameters = {}) { + this.apiKey = param.apiKey; + this.username = param.username; + this.password = param.password; + this.accessToken = param.accessToken; + this.basePath = param.basePath; + this.baseOptions = param.baseOptions; + this.formDataCtor = param.formDataCtor; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } +} diff --git a/samples/client/petstore/typescript-axios/builds/with-node-imports/git_push.sh b/samples/client/petstore/typescript-axios/builds/with-node-imports/git_push.sh new file mode 100644 index 000000000000..f53a75d4fabe --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-node-imports/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/typescript-axios/builds/with-node-imports/index.ts b/samples/client/petstore/typescript-axios/builds/with-node-imports/index.ts new file mode 100644 index 000000000000..ed3d348fdfec --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-node-imports/index.ts @@ -0,0 +1,18 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export * from "./api"; +export * from "./configuration"; + From 02a51579be7f52ada22d5a6517fbb6d505d50a42 Mon Sep 17 00:00:00 2001 From: Jason Kaiser <69987919+oaklandcorp-jkaiser@users.noreply.github.com> Date: Fri, 24 Dec 2021 09:51:31 -0600 Subject: [PATCH 117/117] [typescript-angular] Support blob response types (#11085) * Fixed issue 11021 by changing the responseType to blob for accept headers that don't match text or json. * Updated samples. * Updated inline json pattern matching with an existing utility method. * Updated samples. * Fixed isJsonMime call. * Updated samples. * Fixed default response type of json when accept header is not given. * Updated samples. --- .../typescript-angular/api.service.mustache | 12 ++- .../builds/default/api/pet.service.ts | 96 ++++++++++++++----- .../builds/default/api/store.service.ts | 48 +++++++--- .../builds/default/api/user.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/pet.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/store.service.ts | 48 +++++++--- .../builds/with-npm/api/user.service.ts | 96 ++++++++++++++----- .../builds/default/api/default.service.ts | 24 +++-- .../builds/default/api/pet.service.ts | 96 ++++++++++++++----- .../builds/default/api/store.service.ts | 48 +++++++--- .../builds/default/api/user.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/pet.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/store.service.ts | 48 +++++++--- .../builds/with-npm/api/user.service.ts | 96 ++++++++++++++----- .../builds/default/api/pet.service.ts | 96 ++++++++++++++----- .../builds/default/api/store.service.ts | 48 +++++++--- .../builds/default/api/user.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/pet.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/store.service.ts | 48 +++++++--- .../builds/with-npm/api/user.service.ts | 96 ++++++++++++++----- .../builds/default/api/pet.service.ts | 96 ++++++++++++++----- .../builds/default/api/store.service.ts | 48 +++++++--- .../builds/default/api/user.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/pet.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/store.service.ts | 48 +++++++--- .../builds/with-npm/api/user.service.ts | 96 ++++++++++++++----- .../builds/default/api/pet.service.ts | 96 ++++++++++++++----- .../builds/default/api/store.service.ts | 48 +++++++--- .../builds/default/api/user.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/pet.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/store.service.ts | 48 +++++++--- .../builds/with-npm/api/user.service.ts | 96 ++++++++++++++----- .../builds/default/api/pet.service.ts | 96 ++++++++++++++----- .../builds/default/api/store.service.ts | 48 +++++++--- .../builds/default/api/user.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/pet.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/store.service.ts | 48 +++++++--- .../builds/with-npm/api/user.service.ts | 96 ++++++++++++++----- .../builds/default/api/pet.service.ts | 96 ++++++++++++++----- .../builds/default/api/store.service.ts | 48 +++++++--- .../builds/default/api/user.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/pet.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/store.service.ts | 48 +++++++--- .../builds/with-npm/api/user.service.ts | 96 ++++++++++++++----- .../builds/default/api/pet.service.ts | 96 ++++++++++++++----- .../builds/default/api/store.service.ts | 48 +++++++--- .../builds/default/api/user.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/pet.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/store.service.ts | 48 +++++++--- .../builds/with-npm/api/user.service.ts | 96 ++++++++++++++----- .../api/pet.service.ts | 96 ++++++++++++++----- .../api/store.service.ts | 48 +++++++--- .../api/user.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/pet.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/store.service.ts | 48 +++++++--- .../builds/with-npm/api/user.service.ts | 96 ++++++++++++++----- .../api/pet.service.ts | 96 ++++++++++++++----- .../api/store.service.ts | 48 +++++++--- .../api/user.service.ts | 96 ++++++++++++++----- .../builds/default/api/pet.service.ts | 96 ++++++++++++++----- .../builds/default/api/store.service.ts | 48 +++++++--- .../builds/default/api/user.service.ts | 96 ++++++++++++++----- .../builds/default/api/pet.service.ts | 96 ++++++++++++++----- .../builds/default/api/store.service.ts | 48 +++++++--- .../builds/default/api/user.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/pet.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/store.service.ts | 48 +++++++--- .../builds/with-npm/api/user.service.ts | 96 ++++++++++++++----- 68 files changed, 3987 insertions(+), 1329 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache index b7dd7cbd94be..3f5bb626a411 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache @@ -349,9 +349,15 @@ export class {{classname}} { {{/hasFormParams}} {{^isResponseFile}} - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } {{/isResponseFile}} diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/pet.service.ts index 2a0f6ba3794f..955dc51f0508 100644 --- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/pet.service.ts @@ -148,9 +148,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -205,9 +211,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -266,9 +278,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -329,9 +347,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -385,9 +409,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -447,9 +477,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -524,9 +560,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -605,9 +647,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/store.service.ts index a90fbb92ab87..20480749e90e 100644 --- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/store.service.ts @@ -117,9 +117,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -167,9 +173,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -215,9 +227,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -270,9 +288,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/user.service.ts index f3565253c9c3..b90b53eb44ca 100644 --- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/user.service.ts @@ -125,9 +125,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -179,9 +185,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -233,9 +245,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -280,9 +298,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -327,9 +351,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -388,9 +418,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -430,9 +466,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -488,9 +530,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/pet.service.ts index 2a0f6ba3794f..955dc51f0508 100644 --- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/pet.service.ts @@ -148,9 +148,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -205,9 +211,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -266,9 +278,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -329,9 +347,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -385,9 +409,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -447,9 +477,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -524,9 +560,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -605,9 +647,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/store.service.ts index a90fbb92ab87..20480749e90e 100644 --- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/store.service.ts @@ -117,9 +117,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -167,9 +173,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -215,9 +227,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -270,9 +288,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/user.service.ts index f3565253c9c3..b90b53eb44ca 100644 --- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/user.service.ts @@ -125,9 +125,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -179,9 +185,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -233,9 +245,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -280,9 +298,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -327,9 +351,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -388,9 +418,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -430,9 +466,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -488,9 +530,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/api/default.service.ts b/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/api/default.service.ts index 7363f44f9462..71c70d99cc67 100644 --- a/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/api/default.service.ts +++ b/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/api/default.service.ts @@ -112,9 +112,15 @@ export class DefaultService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/`, @@ -162,9 +168,15 @@ export class DefaultService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/`, diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/pet.service.ts index 2a0f6ba3794f..955dc51f0508 100644 --- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/pet.service.ts @@ -148,9 +148,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -205,9 +211,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -266,9 +278,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -329,9 +347,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -385,9 +409,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -447,9 +477,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -524,9 +560,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -605,9 +647,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/store.service.ts index a90fbb92ab87..20480749e90e 100644 --- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/store.service.ts @@ -117,9 +117,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -167,9 +173,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -215,9 +227,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -270,9 +288,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/user.service.ts index f3565253c9c3..b90b53eb44ca 100644 --- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/user.service.ts @@ -125,9 +125,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -179,9 +185,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -233,9 +245,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -280,9 +298,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -327,9 +351,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -388,9 +418,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -430,9 +466,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -488,9 +530,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/pet.service.ts index 2a0f6ba3794f..955dc51f0508 100644 --- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/pet.service.ts @@ -148,9 +148,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -205,9 +211,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -266,9 +278,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -329,9 +347,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -385,9 +409,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -447,9 +477,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -524,9 +560,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -605,9 +647,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/store.service.ts index a90fbb92ab87..20480749e90e 100644 --- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/store.service.ts @@ -117,9 +117,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -167,9 +173,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -215,9 +227,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -270,9 +288,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/user.service.ts index f3565253c9c3..b90b53eb44ca 100644 --- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/user.service.ts @@ -125,9 +125,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -179,9 +185,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -233,9 +245,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -280,9 +298,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -327,9 +351,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -388,9 +418,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -430,9 +466,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -488,9 +530,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/pet.service.ts index 1b493ddec456..dcc8df3f3c82 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/pet.service.ts @@ -152,9 +152,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -214,9 +220,15 @@ export class PetService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -280,9 +292,15 @@ export class PetService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -348,9 +366,15 @@ export class PetService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -409,9 +433,15 @@ export class PetService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -476,9 +506,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -558,9 +594,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -644,9 +686,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/store.service.ts index d1f6b021e97b..06d4df352ea0 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/store.service.ts @@ -121,9 +121,15 @@ export class StoreService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -176,9 +182,15 @@ export class StoreService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -229,9 +241,15 @@ export class StoreService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -289,9 +307,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/user.service.ts index 74920d0f5600..a820ab296317 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/user.service.ts @@ -129,9 +129,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -188,9 +194,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -247,9 +259,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -299,9 +317,15 @@ export class UserService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -351,9 +375,15 @@ export class UserService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -417,9 +447,15 @@ export class UserService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -464,9 +500,15 @@ export class UserService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -527,9 +569,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/pet.service.ts index 1b493ddec456..dcc8df3f3c82 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/pet.service.ts @@ -152,9 +152,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -214,9 +220,15 @@ export class PetService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -280,9 +292,15 @@ export class PetService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -348,9 +366,15 @@ export class PetService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -409,9 +433,15 @@ export class PetService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -476,9 +506,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -558,9 +594,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -644,9 +686,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/store.service.ts index d1f6b021e97b..06d4df352ea0 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/store.service.ts @@ -121,9 +121,15 @@ export class StoreService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -176,9 +182,15 @@ export class StoreService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -229,9 +241,15 @@ export class StoreService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -289,9 +307,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/user.service.ts index 74920d0f5600..a820ab296317 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/user.service.ts @@ -129,9 +129,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -188,9 +194,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -247,9 +259,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -299,9 +317,15 @@ export class UserService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -351,9 +375,15 @@ export class UserService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -417,9 +447,15 @@ export class UserService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -464,9 +500,15 @@ export class UserService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -527,9 +569,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/pet.service.ts index 4e6194e7b10f..c68d5a82d524 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/pet.service.ts @@ -152,9 +152,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -214,9 +220,15 @@ export class PetService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -281,9 +293,15 @@ export class PetService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -349,9 +367,15 @@ export class PetService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -410,9 +434,15 @@ export class PetService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -477,9 +507,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -559,9 +595,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -645,9 +687,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/store.service.ts index 9d00e8b652cb..b63e9dbea89a 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/store.service.ts @@ -121,9 +121,15 @@ export class StoreService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -177,9 +183,15 @@ export class StoreService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -230,9 +242,15 @@ export class StoreService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -290,9 +308,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/user.service.ts index 7fc46dada8a2..a2e40fa8a185 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/user.service.ts @@ -129,9 +129,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -188,9 +194,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -247,9 +259,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -299,9 +317,15 @@ export class UserService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -352,9 +376,15 @@ export class UserService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -418,9 +448,15 @@ export class UserService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -465,9 +501,15 @@ export class UserService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -528,9 +570,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/pet.service.ts index 4e6194e7b10f..c68d5a82d524 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/pet.service.ts @@ -152,9 +152,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -214,9 +220,15 @@ export class PetService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -281,9 +293,15 @@ export class PetService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -349,9 +367,15 @@ export class PetService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -410,9 +434,15 @@ export class PetService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -477,9 +507,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -559,9 +595,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -645,9 +687,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/store.service.ts index 9d00e8b652cb..b63e9dbea89a 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/store.service.ts @@ -121,9 +121,15 @@ export class StoreService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -177,9 +183,15 @@ export class StoreService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -230,9 +242,15 @@ export class StoreService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -290,9 +308,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/user.service.ts index 7fc46dada8a2..a2e40fa8a185 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/user.service.ts @@ -129,9 +129,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -188,9 +194,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -247,9 +259,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -299,9 +317,15 @@ export class UserService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -352,9 +376,15 @@ export class UserService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -418,9 +448,15 @@ export class UserService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -465,9 +501,15 @@ export class UserService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -528,9 +570,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts index 5da186643ad8..e7c596ed3a0f 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts @@ -146,9 +146,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -203,9 +209,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -264,9 +276,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -327,9 +345,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -383,9 +407,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -445,9 +475,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -522,9 +558,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -603,9 +645,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts index 4de27ffefa19..9b77dbcef194 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts @@ -115,9 +115,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -165,9 +171,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -213,9 +225,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -268,9 +286,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts index 90ef87d8371d..63077165236f 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts @@ -123,9 +123,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -177,9 +183,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -231,9 +243,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -278,9 +296,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -325,9 +349,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -386,9 +416,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -428,9 +464,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -486,9 +528,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts index 5da186643ad8..e7c596ed3a0f 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts @@ -146,9 +146,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -203,9 +209,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -264,9 +276,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -327,9 +345,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -383,9 +407,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -445,9 +475,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -522,9 +558,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -603,9 +645,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts index 4de27ffefa19..9b77dbcef194 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts @@ -115,9 +115,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -165,9 +171,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -213,9 +225,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -268,9 +286,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts index 90ef87d8371d..63077165236f 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts @@ -123,9 +123,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -177,9 +183,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -231,9 +243,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -278,9 +296,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -325,9 +349,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -386,9 +416,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -428,9 +464,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -486,9 +528,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts index 2a0f6ba3794f..955dc51f0508 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts @@ -148,9 +148,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -205,9 +211,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -266,9 +278,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -329,9 +347,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -385,9 +409,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -447,9 +477,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -524,9 +560,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -605,9 +647,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts index a90fbb92ab87..20480749e90e 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts @@ -117,9 +117,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -167,9 +173,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -215,9 +227,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -270,9 +288,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts index f3565253c9c3..b90b53eb44ca 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts @@ -125,9 +125,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -179,9 +185,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -233,9 +245,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -280,9 +298,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -327,9 +351,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -388,9 +418,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -430,9 +466,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -488,9 +530,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts index 2a0f6ba3794f..955dc51f0508 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts @@ -148,9 +148,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -205,9 +211,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -266,9 +278,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -329,9 +347,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -385,9 +409,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -447,9 +477,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -524,9 +560,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -605,9 +647,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts index a90fbb92ab87..20480749e90e 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts @@ -117,9 +117,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -167,9 +173,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -215,9 +227,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -270,9 +288,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts index f3565253c9c3..b90b53eb44ca 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts @@ -125,9 +125,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -179,9 +185,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -233,9 +245,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -280,9 +298,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -327,9 +351,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -388,9 +418,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -430,9 +466,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -488,9 +530,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts index 5da186643ad8..e7c596ed3a0f 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts @@ -146,9 +146,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -203,9 +209,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -264,9 +276,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -327,9 +345,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -383,9 +407,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -445,9 +475,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -522,9 +558,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -603,9 +645,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts index 4de27ffefa19..9b77dbcef194 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts @@ -115,9 +115,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -165,9 +171,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -213,9 +225,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -268,9 +286,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts index 90ef87d8371d..63077165236f 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts @@ -123,9 +123,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -177,9 +183,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -231,9 +243,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -278,9 +296,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -325,9 +349,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -386,9 +416,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -428,9 +464,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -486,9 +528,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts index 5da186643ad8..e7c596ed3a0f 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts @@ -146,9 +146,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -203,9 +209,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -264,9 +276,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -327,9 +345,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -383,9 +407,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -445,9 +475,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -522,9 +558,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -603,9 +645,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts index 4de27ffefa19..9b77dbcef194 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts @@ -115,9 +115,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -165,9 +171,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -213,9 +225,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -268,9 +286,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts index 90ef87d8371d..63077165236f 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts @@ -123,9 +123,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -177,9 +183,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -231,9 +243,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -278,9 +296,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -325,9 +349,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -386,9 +416,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -428,9 +464,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -486,9 +528,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts index 2a0f6ba3794f..955dc51f0508 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts @@ -148,9 +148,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -205,9 +211,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -266,9 +278,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -329,9 +347,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -385,9 +409,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -447,9 +477,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -524,9 +560,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -605,9 +647,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts index a90fbb92ab87..20480749e90e 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts @@ -117,9 +117,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -167,9 +173,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -215,9 +227,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -270,9 +288,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts index f3565253c9c3..b90b53eb44ca 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts @@ -125,9 +125,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -179,9 +185,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -233,9 +245,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -280,9 +298,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -327,9 +351,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -388,9 +418,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -430,9 +466,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -488,9 +530,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts index 2a0f6ba3794f..955dc51f0508 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts @@ -148,9 +148,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -205,9 +211,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -266,9 +278,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -329,9 +347,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -385,9 +409,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -447,9 +477,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -524,9 +560,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -605,9 +647,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts index a90fbb92ab87..20480749e90e 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts @@ -117,9 +117,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -167,9 +173,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -215,9 +227,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -270,9 +288,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts index f3565253c9c3..b90b53eb44ca 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts @@ -125,9 +125,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -179,9 +185,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -233,9 +245,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -280,9 +298,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -327,9 +351,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -388,9 +418,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -430,9 +466,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -488,9 +530,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts index 011ad69411bd..65ef3821f1c9 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts @@ -198,9 +198,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -256,9 +262,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -318,9 +330,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -382,9 +400,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -439,9 +463,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -502,9 +532,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -580,9 +616,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -662,9 +704,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts index bad85023eeae..fda474ef8da9 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts @@ -133,9 +133,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -183,9 +189,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -232,9 +244,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -288,9 +306,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/user.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/user.service.ts index 0181b7c6889f..cd418a08eaa7 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/user.service.ts @@ -165,9 +165,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -220,9 +226,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -275,9 +287,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -323,9 +341,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -371,9 +395,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -433,9 +463,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -475,9 +511,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -534,9 +576,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts index 2a0f6ba3794f..955dc51f0508 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts @@ -148,9 +148,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -205,9 +211,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -266,9 +278,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -329,9 +347,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -385,9 +409,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -447,9 +477,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -524,9 +560,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -605,9 +647,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts index a90fbb92ab87..20480749e90e 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts @@ -117,9 +117,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -167,9 +173,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -215,9 +227,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -270,9 +288,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/user.service.ts index f3565253c9c3..b90b53eb44ca 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/user.service.ts @@ -125,9 +125,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -179,9 +185,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -233,9 +245,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -280,9 +298,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -327,9 +351,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -388,9 +418,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -430,9 +466,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -488,9 +530,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts index fe9e03703981..a1cdf35cb1b4 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts @@ -148,9 +148,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -205,9 +211,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -266,9 +278,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -329,9 +347,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -385,9 +409,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -447,9 +477,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -524,9 +560,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -605,9 +647,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts index d561fc8a01d4..5a0c0c2914b4 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts @@ -117,9 +117,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -167,9 +173,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -215,9 +227,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -270,9 +288,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/user.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/user.service.ts index 5635e4a0021e..7976ebfc80eb 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/user.service.ts @@ -125,9 +125,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -179,9 +185,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -233,9 +245,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -280,9 +298,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -327,9 +351,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -388,9 +418,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -430,9 +466,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -488,9 +530,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/pet.service.ts index 66ca7a9fbccf..8dad43c484ad 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/pet.service.ts @@ -148,9 +148,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -205,9 +211,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -266,9 +278,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -329,9 +347,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -385,9 +409,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -447,9 +477,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -524,9 +560,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -605,9 +647,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/store.service.ts index 4d3a302a7dfc..819801bdccdf 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/store.service.ts @@ -117,9 +117,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -167,9 +173,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -215,9 +227,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -270,9 +288,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/user.service.ts index 20a377573259..1ac75a68c0d1 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/user.service.ts @@ -125,9 +125,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -179,9 +185,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -233,9 +245,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -280,9 +298,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -327,9 +351,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -388,9 +418,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -430,9 +466,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -488,9 +530,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/pet.service.ts index 2a0f6ba3794f..955dc51f0508 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/pet.service.ts @@ -148,9 +148,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -205,9 +211,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -266,9 +278,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -329,9 +347,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -385,9 +409,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -447,9 +477,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -524,9 +560,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -605,9 +647,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/store.service.ts index a90fbb92ab87..20480749e90e 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/store.service.ts @@ -117,9 +117,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -167,9 +173,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -215,9 +227,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -270,9 +288,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/user.service.ts index f3565253c9c3..b90b53eb44ca 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/user.service.ts @@ -125,9 +125,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -179,9 +185,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -233,9 +245,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -280,9 +298,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -327,9 +351,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -388,9 +418,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -430,9 +466,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -488,9 +530,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/pet.service.ts index 2a0f6ba3794f..955dc51f0508 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/pet.service.ts @@ -148,9 +148,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -205,9 +211,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -266,9 +278,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -329,9 +347,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -385,9 +409,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -447,9 +477,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -524,9 +560,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -605,9 +647,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/store.service.ts index a90fbb92ab87..20480749e90e 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/store.service.ts @@ -117,9 +117,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -167,9 +173,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -215,9 +227,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -270,9 +288,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/user.service.ts index f3565253c9c3..b90b53eb44ca 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/user.service.ts @@ -125,9 +125,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -179,9 +185,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -233,9 +245,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -280,9 +298,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -327,9 +351,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -388,9 +418,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -430,9 +466,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -488,9 +530,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`,